:root {
  --bg: #0a0a0a;
  --text: #ffffff;
  --accent: #ff00ff;
  --max-width: 1100px;
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --active-index: 0;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* --- NAVIGATION BAR --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 20px;
  text-align: center;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.95) 0%,
    rgba(10, 10, 10, 0) 100%
  );
}

.top-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 32px;
}

.top-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.7;
  transition: opacity 0.3s var(--ease);
  cursor: pointer;
}

.top-nav a:hover,
.top-nav a.active {
  opacity: 1;
}

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  color: var(--accent);
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  animation: bounce 2s infinite;
  pointer-events: none;
}

.scroll-indicator.visible {
  opacity: 0.7;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* --- VIEWPORT & ROOMS --- */
.rooms-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.rooms {
  height: 100%;
  width: 100%;
  transition: transform 900ms var(--ease);
  transform: translateY(calc(var(--active-index, 0) * -100%));
}

.room {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px 20px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.room::-webkit-scrollbar {
  width: 6px;
}
.room::-webkit-scrollbar-track {
  background: transparent;
}
.room::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 255, 0.3);
  border-radius: 3px;
}
.room::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 0, 255, 0.6);
}

.room-inner {
  max-width: var(--max-width);
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  flex-shrink: 0;
}

.room.active .room-inner {
  opacity: 1;
  transform: none;
}

/* Grid Background */
.room::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: screen;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  animation: grid-move 18s linear infinite;
  z-index: -1;
}

@keyframes grid-move {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 240px 0, 0 240px;
  }
}

/* --- ELEMENT STYLES --- */
.hero .room-inner {
  gap: 15px;
}
.profile {
  width: 400px;
  height: 400px;
  max-width: 70vw;
  max-height: 70vw;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
}
.headline {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  letter-spacing: 4px;
  font-size: 56px;
  margin: 0;
  line-height: 1.1;
}
.tagline {
  margin: 0;
  color: var(--accent);
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 18px;
}
.tagline code {
  display: inline-block;
}

.mono {
  font-family: "Space Mono", monospace;
}
.accent {
  color: var(--accent);
}
.small {
  opacity: 0.9;
  font-size: 13px;
}
.lead {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 900px;
  margin: 15px auto;
}

/* Capacities & Projects */
.cap-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.cap-line {
  margin: 0;
  opacity: 0.95;
}
.project-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 30px;
  margin-bottom: 40px;
}
.project {
  max-width: 980px;
  margin: 0 auto;
  text-align: left;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 2px solid var(--accent);
}
.project strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 18px;
}
.accent-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  position: relative;
  transition: all 0.3s ease;
}
.accent-link:hover {
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.4);
}
.edu-item {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
pre {
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0;
  margin: 0;
  font-family: inherit;
}
a:focus {
  outline: 2px solid rgba(255, 0, 255, 0.5);
  outline-offset: 3px;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
  .room {
    /* Safe align for long content */
    justify-content: flex-start;
    padding-top: 100px;
  }

  .room-inner {
    /* CRITICAL FIX: If content is short, this pushes it to center */
    margin: auto 0;
    width: 100%;
  }

  .top-nav {
    padding: 15px 10px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
  }

  .top-nav ul {
    gap: 15px;
    flex-wrap: wrap;
  }

  .top-nav a {
    font-size: 11px;
  }

  .headline {
    font-size: 32px;
    letter-spacing: 2px;
  }
  .tagline {
    font-size: 13px;
    margin-top: 10px;
  }
  .profile {
    width: 200px;
    height: 200px;
  }

  .lead {
    font-size: 14px;
    text-align: left;
  }

  .cap-line {
    font-size: 11px;
    line-height: 1.5;
    text-align: left;
    border-left: 1px solid var(--accent);
    padding-left: 10px;
  }
}
