/* ==========================================================================
   Zaheen Kasim — Portfolio Design System
   Direction: Futuristic · Minimal · Premium · Technical · Editorial
   Accent: Electric Blue (#5B8CFF)
   ========================================================================== */

:root {
  --bg: #0A0B0D;
  --bg-elevated: #12141A;
  --bg-soft: #181B24;
  --bg-line: rgba(255, 255, 255, 0.08);
  --bg-line-strong: rgba(255, 255, 255, 0.14);

  --text: #F4F5F7;
  --text-muted: #8B919E;
  --text-dim: #5C6370;

  --accent: #5B8CFF;
  --accent-soft: rgba(91, 140, 255, 0.16);
  --accent-glow: rgba(91, 140, 255, 0.35);

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 5rem;
  --space-8: 8rem;

  --nav-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 2px;

  --container: min(1120px, calc(100% - 3rem));
  --container-wide: min(1280px, calc(100% - 3rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

html {
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: clip;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-loading {
  overflow: hidden;
}

body.has-touch,
body.reduced-motion {
  cursor: auto;
}

body.has-overlay {
  overflow: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: none;
}

body.has-touch button,
body.has-touch a {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-3);
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-3);
  cursor: pointer;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Noise / Atmosphere
   -------------------------------------------------------------------------- */

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 70% 10%, rgba(91, 140, 255, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(91, 140, 255, 0.04), transparent 50%),
    linear-gradient(180deg, #0A0B0D 0%, #0C0E12 50%, #0A0B0D 100%);
}

/* --------------------------------------------------------------------------
   Loader
   -------------------------------------------------------------------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  width: min(360px, 85vw);
}

.loader__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.loader__list {
  display: grid;
  gap: 0.55rem;
  margin-bottom: var(--space-5);
}

.loader__list li {
  font-size: 0.75rem;
  color: var(--text-dim);
  transform: translateY(8px);
  opacity: 0.3;
  transition: color 0.35s, opacity 0.35s, transform 0.35s var(--ease);
}

.loader__list li.is-active {
  color: var(--text);
  opacity: 1;
  transform: translateY(0);
}

.loader__bar {
  height: 1px;
  background: var(--bg-line);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.loader__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.loader__percent {
  font-size: 0.75rem;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Custom Cursor
   -------------------------------------------------------------------------- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9500;
  pointer-events: none;
  mix-blend-mode: difference;
}

body.has-touch .cursor,
body.reduced-motion .cursor {
  display: none;
}

.cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.cursor__ring {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease), background 0.35s, border-color 0.35s;
}

.cursor.is-hover .cursor__ring {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
}

.cursor.is-label .cursor__ring {
  width: 96px;
  height: 96px;
  background: rgba(91, 140, 255, 0.2);
  border-color: var(--accent);
  mix-blend-mode: normal;
}

.cursor__label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #fff;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}

.cursor.is-label .cursor__label {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* --------------------------------------------------------------------------
   Scroll Progress
   -------------------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}

.scroll-progress__track {
  width: 1px;
  height: 120px;
  background: var(--bg-line);
  position: relative;
  overflow: hidden;
}

.scroll-progress__fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
}

.scroll-progress__markers {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.6rem;
  color: var(--text-dim);
}

.scroll-progress__markers span.is-active {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.1rem 1.5rem;
  transition: padding 0.4s var(--ease), background 0.4s, backdrop-filter 0.4s;
}

.nav.is-compact {
  padding: 0.7rem 1.5rem;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-line);
}

.nav__bar {
  width: var(--container-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
}

.nav__logo-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--bg-line-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: border-color 0.3s, background 0.3s;
}

.nav__logo:hover .nav__logo-mark {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.nav__logo-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__links a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
  transform: scaleX(1);
}

.nav__menu-btn {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  position: relative;
  z-index: 2;
}

.nav__menu-btn span {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  height: 1px;
  background: var(--text);
  transition: transform 0.35s var(--ease), top 0.35s, opacity 0.25s;
}

.nav__menu-btn span:first-child { top: 1rem; }
.nav__menu-btn span:last-child { top: 1.4rem; }

.nav__menu-btn.is-open span:first-child {
  top: 1.2rem;
  transform: rotate(45deg);
}

.nav__menu-btn.is-open span:last-child {
  top: 1.2rem;
  transform: rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  gap: 3rem;
  background: rgba(10, 11, 13, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__nav {
  display: grid;
  gap: 1.25rem;
  text-align: center;
}

.mobile-menu__nav a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.mobile-menu__meta {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
  will-change: transform;
}

.btn--primary {
  background: var(--accent);
  color: #07080A;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: #7AA3FF;
  border-color: #7AA3FF;
}

.btn--ghost {
  border-color: var(--bg-line-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--lg {
  padding: 1.15rem 1.75rem;
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Sections shared
   -------------------------------------------------------------------------- */

.section {
  position: relative;
  padding: var(--space-8) 0;
  width: var(--container);
  margin: 0 auto;
}

.section__header {
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 720px;
}

.section__index {
  display: block;
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.section__sub {
  margin-top: 1.25rem;
  color: var(--text-muted);
  max-width: 42ch;
  font-size: 1.05rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 1.5rem) 0 3.25rem;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.95;
}

.hero__glow {
  position: absolute;
  top: 5%;
  right: -5%;
  width: min(62vw, 720px);
  height: min(62vw, 720px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(91, 140, 255, 0.32), transparent 42%),
    radial-gradient(circle, rgba(91, 140, 255, 0.14), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
  animation: glowPulse 8s ease-in-out infinite;
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(91, 140, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 140, 255, 0.12) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, #000 0%, #000 28%, transparent 58%);
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.hero__shell {
  position: relative;
  z-index: 2;
  width: var(--container-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: end;
}

.hero__rail {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.1rem 0.85rem 1.1rem 0;
  border-right: 1px solid var(--bg-line);
  min-height: 320px;
  color: var(--accent);
}

.hero__rail-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.hero__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hero__signal {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
}

.hero__signal span {
  width: 3px;
  background: var(--accent);
  opacity: 0.35;
  animation: signalBar 1.4s ease-in-out infinite;
}

.hero__signal span:nth-child(1) { height: 28%; animation-delay: 0s; }
.hero__signal span:nth-child(2) { height: 48%; animation-delay: 0.1s; }
.hero__signal span:nth-child(3) { height: 72%; animation-delay: 0.2s; }
.hero__signal span:nth-child(4) { height: 40%; animation-delay: 0.3s; }
.hero__signal span:nth-child(5) { height: 90%; animation-delay: 0.4s; }

@keyframes signalBar {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

.hero__circuit {
  width: 100%;
  max-width: 110px;
  color: rgba(91, 140, 255, 0.75);
}

.hero__chips {
  display: grid;
  gap: 0.45rem;
}

.hero__chips li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.hero__chips li span {
  color: var(--accent);
  opacity: 0.8;
}

.hero__rail-meta {
  margin-top: auto;
  display: grid;
  gap: 0.3rem;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 0;
}

.hero__eyebrow {
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6.2vw + 0.4rem, 5.4rem);
  letter-spacing: -0.045em;
  line-height: 0.96;
  margin-bottom: 1.25rem;
}

.hero__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.hero__word {
  padding-right: 0.02em;
}

.hero__line--accent {
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 245, 247, 0.85);
}

.hero__statement {
  max-width: 46ch;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__meta {
  position: absolute;
  right: max(1.5rem, calc((100% - min(1280px, 100% - 3rem)) / 2));
  bottom: 3.25rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: right;
}

.hero__scroll {
  position: absolute;
  left: max(1.5rem, calc((100% - min(1280px, 100% - 3rem)) / 2));
  bottom: 2rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.65rem;
  color: var(--text-dim);
}

.hero__scroll-line {
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleX(0.4); opacity: 0.4; transform-origin: left; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* Keep CTAs in the first viewport on shorter laptop screens */
@media (max-height: 900px) {
  .hero {
    justify-content: center;
    padding-top: calc(var(--nav-h) + 1rem);
    padding-bottom: 2.25rem;
  }

  .hero__rail {
    min-height: 240px;
    gap: 0.85rem;
  }

  .hero__circuit {
    max-width: 84px;
  }

  .hero__title {
    font-size: clamp(2.2rem, 5.8vh, 4.1rem);
    margin-bottom: 0.95rem;
  }

  .hero__eyebrow {
    margin-bottom: 0.75rem;
  }

  .hero__statement {
    margin-bottom: 1.15rem;
    font-size: 0.95rem;
    max-width: 42ch;
  }

  .hero__meta,
  .hero__scroll {
    display: none;
  }
}

@media (max-height: 740px) {
  .hero__title {
    font-size: clamp(1.9rem, 5.2vh, 3.2rem);
  }

  .hero__statement {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* --------------------------------------------------------------------------
   Statement
   -------------------------------------------------------------------------- */

.statement {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-8) 1.5rem;
}

.statement__inner {
  width: var(--container);
}

.statement__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
  color: var(--text-dim);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.statement__line--lg {
  font-size: clamp(3rem, 10vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--text);
  line-height: 0.95;
}

.statement__line--accent {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}

.statement__line.is-lit {
  color: var(--text);
}

.statement__line--accent.is-lit {
  color: var(--accent);
  -webkit-text-stroke: 0;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about__lead {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.55;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}

.about__body {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 52ch;
}

.about__focus-label {
  display: block;
  font-size: 0.68rem;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.about__focus p,
.about__edu p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.about__edu {
  margin-top: 2rem;
  display: grid;
  gap: 0.85rem;
}

.about__meta {
  border-left: 1px solid var(--bg-line);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  gap: 2rem;
}

.stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.25rem;
}

.stat__num,
.stat__suffix {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.stat__suffix {
  color: var(--accent);
}

.stat__label {
  width: 100%;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about__tags span {
  font-size: 0.65rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--bg-line);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Experience — pinned scrub on desktop, stacked on mobile
   -------------------------------------------------------------------------- */

.experience {
  position: relative;
  width: 100%;
}

.experience__pin {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(91, 140, 255, 0.06), transparent 55%),
    var(--bg);
}

.experience__inner {
  width: var(--container);
  margin: 0 auto;
  padding: 5.5rem 0 4rem;
}

.experience__hint {
  margin-top: 0.85rem;
  color: var(--text-dim);
  font-size: 0.68rem;
}

.experience__layout {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.experience__timeline {
  position: relative;
  height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.experience__track {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  background: var(--bg-line);
  transform: translateX(-50%);
}

.experience__progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  will-change: height, width;
}

.experience__dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  background: var(--bg);
  transition: transform 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.experience__dot.is-active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: scale(1.3);
}

.experience__panels {
  position: relative;
  min-height: 480px;
  height: 480px;
}

.exp-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
  pointer-events: none;
}

.exp-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.experience.is-stacked .experience__pin {
  min-height: 0;
  display: block;
  background: transparent;
}

.experience.is-stacked .experience__inner {
  padding: 4rem 0;
}

.experience.is-stacked .experience__hint {
  display: none;
}

.experience.is-stacked .experience__timeline {
  display: none;
}

.experience.is-stacked .experience__layout {
  grid-template-columns: 1fr;
}

.experience.is-stacked .experience__panels {
  height: auto;
  min-height: 0;
  display: grid;
  gap: 2.5rem;
}

.experience.is-stacked .exp-panel {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bg-line);
}

.experience.is-stacked .exp-panel:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.experience.is-stacked .exp-panel__tech span {
  opacity: 1;
  transform: none;
  animation: none;
}

.exp-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.exp-panel__role {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.exp-panel__company {
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0.4rem 0 1.25rem;
}

.exp-panel__desc {
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: 1.5rem;
}

.exp-panel__list {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
}

.exp-panel__list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.exp-panel__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

.exp-panel__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.exp-panel__tech span {
  font-size: 0.65rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--bg-line);
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(8px);
}

.exp-panel.is-active .exp-panel__tech span {
  animation: techIn 0.45s var(--ease) forwards;
}

.exp-panel.is-active .exp-panel__tech span:nth-child(1) { animation-delay: 0.05s; }
.exp-panel.is-active .exp-panel__tech span:nth-child(2) { animation-delay: 0.1s; }
.exp-panel.is-active .exp-panel__tech span:nth-child(3) { animation-delay: 0.15s; }
.exp-panel.is-active .exp-panel__tech span:nth-child(4) { animation-delay: 0.2s; }
.exp-panel.is-active .exp-panel__tech span:nth-child(5) { animation-delay: 0.25s; }
.exp-panel.is-active .exp-panel__tech span:nth-child(6) { animation-delay: 0.3s; }

@keyframes techIn {
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Work / Projects
   -------------------------------------------------------------------------- */

.work {
  width: var(--container-wide);
}

.work__list {
  display: grid;
  gap: 1px;
  background: var(--bg-line);
  border-top: 1px solid var(--bg-line);
  border-bottom: 1px solid var(--bg-line);
}

.project {
  background: var(--bg);
  transition: background 0.45s var(--ease);
}

.project:hover,
.project:focus-within {
  background: var(--bg-elevated);
}

.project__trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 80px 1.1fr 1.2fr;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  text-align: left;
  cursor: none;
}

.project__index {
  font-size: 0.75rem;
  color: var(--text-dim);
  align-self: start;
  padding-top: 0.35rem;
}

.project__visual {
  overflow: hidden;
  aspect-ratio: 16 / 11;
  border: 1px solid var(--bg-line);
  background: var(--bg-soft);
}

.project__visual-inner {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform 0.7s var(--ease);
  overflow: hidden;
}

.project:hover .project__visual-inner {
  transform: scale(1.04);
}

.project__tag {
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.45rem;
}

.project__visual-inner--courier {
  background:
    radial-gradient(circle at 25% 30%, rgba(91, 140, 255, 0.28), transparent 38%),
    linear-gradient(155deg, #121820, #0A0B0D 70%);
}

.project__route {
  position: absolute;
  inset: 18% 14%;
  border: 1px dashed rgba(91, 140, 255, 0.35);
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  animation: routePulse 10s ease-in-out infinite;
}

.project__route::before,
.project__route::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.project__route::before {
  top: 12%;
  left: 18%;
}

.project__route::after {
  bottom: 18%;
  right: 16%;
}

@keyframes routePulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.03); }
}

.project__visual-inner--a {
  background:
    radial-gradient(circle at 30% 40%, rgba(91, 140, 255, 0.25), transparent 40%),
    linear-gradient(145deg, #12151D, #0A0B0D);
}

.project__visual-inner--b {
  background:
    radial-gradient(circle at 70% 30%, rgba(91, 140, 255, 0.2), transparent 35%),
    linear-gradient(160deg, #10131A, #0A0B0D);
}

.project__visual-inner--c {
  background:
    radial-gradient(circle at 50% 60%, rgba(91, 140, 255, 0.18), transparent 40%),
    linear-gradient(180deg, #12141A, #0A0B0D);
}

.project__grid-lines {
  position: absolute;
  inset: 12%;
  background-image:
    linear-gradient(rgba(91, 140, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 140, 255, 0.2) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle, #000 20%, transparent 75%);
  animation: gridDrift 12s linear infinite;
}

@keyframes gridDrift {
  to { transform: translate(28px, 14px); }
}

.project__nodes {
  position: absolute;
  width: 55%;
  height: 55%;
  border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(91, 140, 255, 0.05);
}

.project__nodes::before,
.project__nodes::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.project__nodes::before { top: 10%; left: 60%; }
.project__nodes::after { bottom: 20%; left: 20%; box-shadow: 40px -20px 0 0 rgba(91, 140, 255, 0.5); }

.project__orbit {
  width: 46%;
  height: 46%;
  border: 1px dashed rgba(91, 140, 255, 0.4);
  border-radius: 50%;
  animation: spinSlow 18s linear infinite;
  position: relative;
}

.project__orbit::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

.project__visual-label {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  z-index: 1;
}

.project__name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  transition: transform 0.45s var(--ease), color 0.3s;
}

.project:hover .project__name {
  transform: translateX(8px);
  color: var(--accent);
}

.project__summary {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 42ch;
  font-size: 0.98rem;
}

.project__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.project__tech span {
  font-size: 0.62rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s, transform 0.35s var(--ease);
}

.project:hover .project__tech span {
  color: var(--text-muted);
  border-color: var(--bg-line-strong);
  transform: translateY(-2px);
}

.project__cta {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.7;
  transition: opacity 0.3s, letter-spacing 0.35s;
}

.project:hover .project__cta {
  opacity: 1;
  letter-spacing: 0.12em;
}

/* Project overlay */
.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s, visibility 0.4s;
}

.project-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.project-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(10px);
}

.project-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(86vh, 900px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-line-strong);
  padding: clamp(1.5rem, 4vw, 3rem);
  transform: translateY(28px) scale(0.98);
  transition: transform 0.45s var(--ease);
}

.project-overlay.is-open .project-overlay__panel {
  transform: translateY(0) scale(1);
}

.project-overlay__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  margin: -0.35rem -0.35rem 0.5rem 0;
  background: var(--bg-elevated);
}

.project-overlay__close span {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  top: 50%;
  height: 1px;
  background: var(--text);
}

.project-overlay__close span:first-child { transform: rotate(45deg); }
.project-overlay__close span:last-child { transform: rotate(-45deg); }

.project-detail__index {
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.project-detail__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.project-detail__meta {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.project-detail__grid {
  display: grid;
  gap: 1.5rem;
}

.project-detail__block h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.project-detail__block p,
.project-detail__block li {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.project-detail__block ul {
  display: grid;
  gap: 0.45rem;
}

.project-detail__block ul li {
  padding-left: 0.9rem;
  position: relative;
}

.project-detail__block ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-detail__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.project-detail__tech span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--bg-line);
  color: var(--text-muted);
}

.project-detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.project-detail__links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, color 0.25s;
}

.project-detail__links a:hover {
  border-color: var(--accent);
  color: #7AA3FF;
}

/* --------------------------------------------------------------------------
   Architecture
   -------------------------------------------------------------------------- */

.arch {
  border: 1px solid var(--bg-line);
  background:
    linear-gradient(180deg, rgba(91, 140, 255, 0.04), transparent 40%),
    var(--bg-elevated);
  padding: clamp(1rem, 3vw, 2rem);
}

.arch__svg {
  width: 100%;
  height: auto;
}

.arch__node rect {
  fill: rgba(18, 20, 26, 0.9);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  transition: stroke 0.35s, fill 0.35s;
}

.arch__node text {
  fill: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-anchor: middle;
  letter-spacing: 0.08em;
}

.arch__node.is-active rect {
  stroke: var(--accent);
  fill: rgba(91, 140, 255, 0.1);
}

.arch__node.is-active text {
  fill: var(--text);
}

.arch__path {
  stroke-dasharray: 6 8;
  opacity: 0.55;
}

.arch__packet {
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.arch__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.25rem;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Stack
   -------------------------------------------------------------------------- */

.stack__marquee {
  overflow: hidden;
  border-block: 1px solid var(--bg-line);
  margin: 0 0 3rem;
  width: 100%;
  padding: 1rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.stack__marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marquee 40s linear infinite;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-dim);
}

.stack__marquee-track span:nth-child(odd) {
  color: transparent;
  -webkit-text-stroke: 1px rgba(139, 145, 158, 0.7);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.stack__ecosystem {
  display: grid;
  gap: 2rem;
}

.stack__group-title {
  font-size: 0.68rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.stack__nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.stack-node {
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--bg-line);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.35s var(--ease);
}

.stack-node:hover,
.stack-node:focus-visible,
.stack-node.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.stack-node.is-related {
  border-color: rgba(91, 140, 255, 0.45);
  color: var(--text);
}

.stack-node.is-dim {
  opacity: 0.35;
}

.stack__detail {
  margin-top: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--bg-line);
  background: var(--bg-elevated);
  min-height: 88px;
}

.stack__detail-tech {
  display: block;
  color: var(--accent);
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}

.stack__detail-desc {
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Terminal
   -------------------------------------------------------------------------- */

.terminal {
  border: 1px solid var(--bg-line-strong);
  background: #0C0E12;
  overflow: hidden;
}

.terminal__chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--bg-line);
  background: var(--bg-elevated);
}

.terminal__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2A2F3A;
}

.terminal__dot:nth-child(1) { background: #FF5F57; }
.terminal__dot:nth-child(2) { background: #FEBC2E; }
.terminal__dot:nth-child(3) { background: #28C840; }

.terminal__title {
  margin-left: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.terminal__body {
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  padding: 1.25rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.terminal__body .t-cmd { color: var(--text); }
.terminal__body .t-accent { color: var(--accent); }
.terminal__body .t-dim { color: var(--text-dim); }

.terminal__form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--bg-line);
}

.terminal__prompt {
  color: var(--accent);
  font-family: var(--font-mono);
}

.terminal__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: text;
}

.terminal__hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.25rem 1.1rem;
}

.terminal__hints button {
  font-size: 0.65rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--bg-line);
  color: var(--text-dim);
  transition: color 0.25s, border-color 0.25s;
}

.terminal__hints button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  width: var(--container);
  padding-top: var(--space-8);
  padding-bottom: var(--space-7);
}

.contact__inner {
  max-width: 820px;
}

.contact__eyebrow {
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.contact__title span {
  display: block;
}

.contact__title-accent {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 245, 247, 0.85);
}

.contact__text {
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 2.25rem;
  font-size: 1.05rem;
}

.contact__links {
  margin-top: 3.5rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--bg-line);
}

.contact__links a {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--bg-line);
  transition: padding-left 0.35s var(--ease), color 0.3s;
}

.contact__links a span:first-child {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.contact__links a span:last-child {
  font-size: 1.05rem;
}

.contact__links a:hover {
  padding-left: 0.75rem;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  width: var(--container-wide);
  margin: 0 auto;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--bg-line);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.footer__role {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__top-btn {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  transition: color 0.3s;
}

.footer__top-btn:hover {
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero__glow,
  .hero__pulse,
  .hero__signal span,
  .project__grid-lines,
  .project__orbit,
  .project__route,
  .stack__marquee-track,
  .hero__scroll-line {
    animation: none !important;
  }
}
