/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #0b0b10;
  --bg-2: #12121a;
  --surface: #16161f;
  --surface-2: #1d1d29;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecebf3;
  --muted: #8d8ca3;
  --accent: #8b7bff;
  --accent-2: #4fd1c5;
  --accent-3: #ff7ab6;
  --accent-ink: #0b0b10;
  --glow: rgba(139, 123, 255, 0.35);
  --particle: 236, 235, 243;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5f1;
    --bg-2: #efede7;
    --surface: #ffffff;
    --surface-2: #f2f0ea;
    --border: rgba(20, 20, 30, 0.09);
    --border-strong: rgba(20, 20, 30, 0.18);
    --text: #14131a;
    --muted: #6a6878;
    --accent: #5b47f5;
    --accent-2: #0f9488;
    --accent-3: #e0458c;
    --accent-ink: #ffffff;
    --glow: rgba(91, 71, 245, 0.2);
    --particle: 20, 19, 26;
    --shadow: 0 30px 70px -25px rgba(30, 25, 60, 0.25);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-2: #efede7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --border: rgba(20, 20, 30, 0.09);
  --border-strong: rgba(20, 20, 30, 0.18);
  --text: #14131a;
  --muted: #6a6878;
  --accent: #5b47f5;
  --accent-2: #0f9488;
  --accent-3: #e0458c;
  --accent-ink: #ffffff;
  --glow: rgba(91, 71, 245, 0.2);
  --particle: 20, 19, 26;
  --shadow: 0 30px 70px -25px rgba(30, 25, 60, 0.25);
  color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
body.is-loading { overflow: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; }
.muted { color: var(--muted); }

/* Subtle film grain over everything */
body::after {
  content: "";
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(3%, -6%); }
  60% { transform: translate(-7%, -2%); }
  80% { transform: translate(6%, 5%); }
}

/* ==========================================================================
   Loader, progress, cursor, toast
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  padding: var(--gutter);
  transition: transform 0.9s var(--ease-in-out);
}
.loader.is-done { transform: translateY(-100%); }
.loader__count { font-family: var(--font-display); font-size: clamp(4rem, 14vw, 10rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.loader__bar { width: 100%; height: 2px; background: var(--border); margin-top: 1rem; overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); }

.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none;
  border-radius: 50%; opacity: 0;
  transition: opacity 0.3s, width 0.3s var(--ease), height 0.3s var(--ease), background-color 0.3s, border-color 0.3s;
}
.cursor { width: 36px; height: 36px; border: 1.5px solid var(--text); mix-blend-mode: difference; }
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.has-cursor .cursor, .has-cursor .cursor-dot { opacity: 1; }
.cursor.is-hover { width: 64px; height: 64px; background: rgba(255, 255, 255, 0.9); border-color: transparent; }
.cursor.is-view { width: 92px; height: 92px; background: var(--accent); border-color: transparent; mix-blend-mode: normal; }
.cursor.is-view::after {
  content: "View"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-ink);
}
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120;
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  background: var(--text); color: var(--bg);
  padding: 0.7rem 1.2rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.8rem;
  transition: transform 0.5s var(--ease), visibility 0s 0.5s;
}
.toast.is-visible { transform: translate(-50%, 0); visibility: visible; transition: transform 0.5s var(--ease); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 18px var(--gutter);
  transition: transform 0.5s var(--ease), background-color 0.4s, padding 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 12px;
  transition: background-color 0.3s, color 0.3s;
}
.nav__logo:hover { background: var(--text); color: var(--bg); }
.nav__links { display: flex; gap: 0.25rem; }
.nav__links a {
  position: relative; padding: 0.45rem 0.9rem; border-radius: 999px;
  font-size: 0.92rem; color: var(--muted);
  transition: color 0.3s;
}
.nav__links a::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--surface-2); transform: scale(0.6); opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s; z-index: -1;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::before, .nav__links a:hover::before { transform: scale(1); opacity: 1; }
.nav__actions { display: flex; gap: 0.5rem; align-items: center; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  transition: background-color 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.icon-btn:hover { background: var(--text); color: var(--bg); }
.icon-btn svg { transition: transform 0.6s var(--ease); }
#themeToggle:hover svg { transform: rotate(90deg); }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .icon-moon { display: block; }
}

.nav__burger { display: none; position: relative; }
.nav__burger span {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav__burger span:first-child { top: 16px; }
.nav__burger span:last-child { top: 24px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 0 var(--gutter); gap: 0.25rem;
    background: var(--bg);
    clip-path: circle(0% at calc(100% - 40px) 40px);
    transition: clip-path 0.7s var(--ease-in-out);
  }
  .nav__links.is-open { clip-path: circle(150% at calc(100% - 40px) 40px); }
  .nav__links a {
    font-family: var(--font-display); font-size: clamp(2.2rem, 11vw, 3.5rem); font-weight: 600;
    color: var(--text); padding: 0.2rem 0;
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }
  .nav__links a::before { display: none; }
  .nav__links.is-open a { opacity: 1; transform: none; }
  .nav__links.is-open a:nth-child(1) { transition-delay: 0.2s; }
  .nav__links.is-open a:nth-child(2) { transition-delay: 0.26s; }
  .nav__links.is-open a:nth-child(3) { transition-delay: 0.32s; }
  .nav__links.is-open a:nth-child(4) { transition-delay: 0.38s; }
  .nav.is-scrolled:has(.nav__links.is-open) { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.5rem; border-radius: 999px;
  font-weight: 500; font-size: 0.95rem;
  border: 1px solid var(--border-strong);
  transition: color 0.4s var(--ease), border-color 0.4s;
  will-change: transform;
}
.btn::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 100%; width: 140%; aspect-ratio: 1;
  border-radius: 50%; transform: translate(-50%, 0) scale(0);
  transition: transform 0.6s var(--ease);
}
.btn:hover::before { transform: translate(-50%, -50%) scale(1); }
.btn svg { transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--primary::before { background: var(--accent); }
.btn--primary:hover { color: var(--accent-ink); border-color: var(--accent); }
.btn--ghost::before { background: var(--text); }
.btn--ghost:hover { color: var(--bg); }
.btn--lg { font-size: clamp(1rem, 2.4vw, 1.25rem); padding: 1.15rem 2rem; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px 0 100px; overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__glow {
  position: absolute; width: 70vmax; height: 70vmax; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, var(--glow), transparent 70%),
    conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 40%, color-mix(in srgb, var(--accent-3) 14%, transparent), transparent 75%);
  filter: blur(60px); border-radius: 50%;
  animation: spin 30s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero__inner { position: relative; }

.hero__status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem; margin: 0 0 1.5rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 0.85rem; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  backdrop-filter: blur(8px);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3.2); opacity: 0; } }

.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.2rem, 13vw, 10.5rem);
  line-height: 0.9; letter-spacing: -0.045em;
  margin: 0 0 1.5rem;
}
.hero__title .word { display: inline-block; white-space: nowrap; }
.hero__title .char {
  display: inline-block;
  transform: translateY(110%) rotate(8deg); opacity: 0;
  transition: transform 1.1s var(--ease), opacity 1.1s var(--ease), color 0.3s;
  transition-delay: calc(var(--i) * 40ms + 0.1s);
}
.hero__title .char:hover { color: var(--accent); transition-delay: 0s; }
.hero__title .mask { display: inline-block; overflow: hidden; padding-bottom: 0.08em; vertical-align: top; }
.is-ready .hero__title .char { transform: none; opacity: 1; }
.hero__title .word:last-child .char {
  color: var(--accent);
  color: color-mix(in oklab, var(--accent-2) calc(var(--p, 0) * 100%), var(--accent));
}
.hero__title .word:last-child .char:hover { color: var(--text); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }

.hero__role {
  font-family: var(--font-display); font-size: clamp(1.4rem, 3.5vw, 2.2rem); font-weight: 500;
  margin: 0 0 1rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
}
.hero__role .mono { font-size: 0.9rem; }
.typed { color: var(--accent); }
.caret {
  display: inline-block; width: 3px; height: 1em; background: var(--accent);
  align-self: center; margin-left: -0.35rem;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__tagline { max-width: 560px; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); margin: 0 0 2.25rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero__fade { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.is-ready .hero__fade { opacity: 1; transform: none; }

.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; color: var(--muted);
}
.hero__scroll-line { width: 1px; height: 48px; background: var(--border-strong); position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%;
  background: var(--text); animation: drip 2s var(--ease-in-out) infinite;
}
@keyframes drip { to { top: 100%; } }

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 1.4rem 0; overflow: hidden; background: var(--bg-2);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: flex; align-items: center; gap: 2rem; padding-right: 2rem;
  font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 500; white-space: nowrap;
}
.marquee__item:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--muted); }
.marquee__star { color: var(--accent); font-size: 0.7em; -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(90px, 14vw, 160px) 0; position: relative; }
.section__head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section__head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.eyebrow { display: inline-block; color: var(--accent); margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; }
.section__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1; letter-spacing: -0.035em; margin: 0;
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* About */
.about__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); }
.about__text p { font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.55; margin: 0 0 1.4rem; color: var(--muted); }
.about__text p:first-child { color: var(--text); }
.about__text .w { display: inline; opacity: 0.18; transition: opacity 0.4s; }
.about__text .w.is-lit { opacity: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; }
.stat { background: var(--bg); padding: 1.4rem 1rem; text-align: center; }
.stat__value { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat__label { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }

.skills { display: grid; gap: 1.4rem; }
.skills__group h3 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 0.7rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.chip {
  padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 0.86rem;
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}
.chip:hover { transform: translateY(-3px); border-color: var(--accent); }

@media (max-width: 860px) { .about__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Projects
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; position: relative; }
.filter {
  padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.88rem;
  border: 1px solid var(--border-strong); color: var(--muted);
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter sup { font-family: var(--font-mono); font-size: 0.65rem; margin-left: 0.2rem; opacity: 0.7; }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.75rem); }
.project {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; cursor: pointer; text-align: left;
  transform-style: preserve-3d; transform: perspective(1000px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  transition: transform 0.6s var(--ease), border-color 0.4s, box-shadow 0.6s var(--ease), opacity 0.5s var(--ease);
}
.project:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.project.is-tilting { transition: transform 0.1s linear, border-color 0.4s, box-shadow 0.6s var(--ease); }
.project--featured { grid-column: span 2; flex-direction: row; }
.project--featured .project__media { flex: 1.3; aspect-ratio: auto; min-height: 340px; }
.project--featured .project__body { flex: 1; justify-content: center; padding: clamp(1.5rem, 3vw, 2.5rem); }
.project--featured .project__title { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }

.project::after { /* spotlight that follows the mouse */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%);
  opacity: 0; transition: opacity 0.4s;
}
.project:hover::after { opacity: 1; }

.project__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.project__media img, .project__media .cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s var(--ease);
}
.project:hover .project__media img, .project:hover .project__media .cover { transform: scale(1.06); }
.project__index { position: absolute; top: 1rem; left: 1rem; z-index: 1; padding: 0.3rem 0.6rem; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: #fff; backdrop-filter: blur(8px); }
.project__body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.4rem 1.5rem 1.6rem; flex: 1; }
.project__meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.project__title { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.project__arrow { display: inline-block; transition: transform 0.4s var(--ease); color: var(--accent); }
.project:hover .project__arrow { transform: translate(4px, -4px); }
.project__summary { color: var(--muted); margin: 0; font-size: 0.97rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.4rem 0 0; }
.tag { font-family: var(--font-mono); font-size: 0.72rem; padding: 0.25rem 0.6rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

.project.reveal { transform: perspective(1000px) translateY(40px); }
.project.reveal.is-in { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.project.is-hidden { display: none; }
.project.is-entering { animation: cardIn 0.7s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(0.97); } }

/* Generated cover art */
.cover { overflow: hidden; }
.cover__blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.9; animation: float 14s ease-in-out infinite alternate; }
.cover__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
}
.cover__label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #fff;
  font-size: clamp(2.5rem, 7vw, 5rem); letter-spacing: -0.05em; mix-blend-mode: overlay; opacity: 0.9;
}
@keyframes float { to { transform: translate(var(--fx, 20px), var(--fy, -20px)) scale(1.15); } }

@media (max-width: 860px) {
  .projects { grid-template-columns: 1fr; }
  .project--featured { grid-column: auto; flex-direction: column; }
  .project--featured .project__media { min-height: 0; aspect-ratio: 16 / 10; }
}

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline { list-style: none; padding: 0 0 0 2.5rem; margin: 0; position: relative; max-width: 860px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.timeline__line {
  position: absolute; left: 7px; top: 8px; width: 1px; height: calc(100% - 16px);
  background: linear-gradient(var(--accent), var(--accent-2));
  transform-origin: top; transform: scaleY(var(--p, 0));
}
.job { position: relative; padding: 0 0 3rem; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: calc(-2.5rem + 1px); top: 0.45rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border-strong);
  transition: background-color 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.job.is-in::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }
.job__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem; flex-wrap: wrap; }
.job__role { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.job__org { color: var(--accent); }
.job__desc { color: var(--muted); margin: 0.5rem 0 0; max-width: 620px; }

/* ==========================================================================
   Contact & footer
   ========================================================================== */
.contact { overflow: hidden; }
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: -40vmax; width: 90vmax; height: 60vmax;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  filter: blur(40px); pointer-events: none;
}
.contact__inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.8rem, 10vw, 7.5rem); line-height: 0.95; letter-spacing: -0.045em; margin: 0 0 1.5rem;
}
.contact__title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}
.contact__text { max-width: 460px; margin: 0 0 2.5rem; font-size: 1.1rem; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.contact__actions .btn--lg { max-width: 100%; }
.contact__actions .btn--lg span { overflow: hidden; text-overflow: ellipsis; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.75rem; list-style: none; padding: 0; margin: 3rem 0 0; }
.socials a { position: relative; color: var(--muted); padding: 0.25rem 0; transition: color 0.3s; }
.socials a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.socials a:hover { color: var(--text); }
.socials a:hover::after { transform: scaleX(1); transform-origin: left; }

.footer { border-top: 1px solid var(--border); padding: 1.75rem 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer__top { transition: color 0.3s; }
.footer__top:hover { color: var(--accent); }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--gutter); }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(5, 5, 10, 0.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.modal__panel {
  position: relative; width: min(860px, 100%); max-height: calc(100vh - 2 * var(--gutter)); overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(40px) scale(0.96);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal__close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.modal__media { position: relative; aspect-ratio: 16 / 8; background: var(--surface-2); }
.modal__media img, .modal__media .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.modal__body { padding: clamp(1.5rem, 4vw, 2.5rem); }
.modal__body > p { margin: 0 0 1rem; }
.modal__title { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0.25rem 0 1rem; }
.modal__links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.75rem; }
body.modal-open { overflow: hidden; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .reveal, .hero__fade, .hero__title .char { opacity: 1; transform: none; }
  .about__text .w { opacity: 1; }
}
