/* =========================================================
   Swarnav Dey — portfolio
   Type:   Bricolage Grotesque (display) · Inter (body) · JetBrains Mono (labels)
   Colour: Royal Cobalt #2563EB primary, light + dark themes
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  --cobalt: #2563EB;          /* Royal Cobalt, primary */
  --cobalt-deep: #1D4ED8;
  --cobalt-ink: #1E40AF;      /* cobalt text on light backgrounds */
  --cobalt-sky: #7EA6FF;      /* cobalt text on dark backgrounds */
  --cobalt-night: #0B1B4D;

  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1240px;
  --radius: 20px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

[data-theme="light"] {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #ECF0FA;
  --ink: #0A0F1F;
  --ink-2: #3B4358;
  --muted: #687089;
  --line: rgba(10, 15, 31, .10);
  --line-strong: rgba(10, 15, 31, .22);
  --accent-text: var(--cobalt-ink);
  --accent-soft: rgba(37, 99, 235, .09);
  --blob-a: rgba(37, 99, 235, .30);
  --blob-b: rgba(99, 140, 255, .26);
  --blob-c: rgba(14, 165, 233, .18);
  --grid: rgba(37, 99, 235, .08);
  --shadow: 0 24px 60px -30px rgba(10, 15, 31, .28);
  --header-bg: rgba(255, 255, 255, .72);
  --grain-opacity: .035;
  --ghost: rgba(37, 99, 235, .16);   /* unfilled footer name */
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #060914;
  --surface: #0D1324;
  --surface-2: #131B33;
  --ink: #F1F4FF;
  --ink-2: #B4BDD6;
  --muted: #7F88A6;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .22);
  --accent-text: var(--cobalt-sky);
  --accent-soft: rgba(37, 99, 235, .18);
  --blob-a: rgba(37, 99, 235, .42);
  --blob-b: rgba(76, 110, 245, .30);
  --blob-c: rgba(14, 165, 233, .18);
  --grid: rgba(126, 166, 255, .07);
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .8);
  --header-bg: rgba(10, 14, 28, .66);
  --grain-opacity: .06;
  --ghost: rgba(126, 166, 255, .14);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
::selection { background: var(--cobalt); color: #fff; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; position: relative; }
.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.accent-word { color: var(--cobalt); }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--cobalt); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { top: 16px; }

/* Scroll progress + film grain */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--cobalt); transform-origin: left; transform: scaleX(var(--p, 0)); }
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: var(--grain-opacity);
  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='.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(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 26px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 15.5px/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: 0 12px 30px -12px rgba(37, 99, 235, .7); }
.btn-primary:hover { background: var(--cobalt-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--cobalt); color: var(--accent-text); }
.btn-sm { --h: 40px; padding: 0 18px; font-size: 14px; box-shadow: none; }
.btn-lg { --h: 58px; padding: 0 32px; font-size: 16.5px; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- Header ---------- */
.site-header { position: fixed; top: 16px; left: 0; right: 0; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
.nav {
  pointer-events: auto; position: relative; z-index: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .4s var(--ease);
}
/* The glass blur lives on a pseudo-element: backdrop-filter on .nav itself would
   trap the fixed-position mobile menu inside the pill. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.site-header.hide .nav { transform: translateY(-140%); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cobalt); color: #fff; font: 800 15px/1 var(--font-display); letter-spacing: .01em;
  -webkit-text-stroke: .7px #fff; /* same-colour stroke = heavier than the font's 800 weight */
}
.nav-links { display: flex; gap: 2px; margin: 0 8px; }
.nav-links a {
  display: block; padding: 9px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links a.active { color: #fff; background: var(--ink); }
[data-theme="dark"] .nav-links a.active { color: var(--bg); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.menu-only { display: none; }
@media (max-width: 900px) { .menu-only { display: block; } .menu-only a { color: var(--accent-text) !important; } }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--ink); cursor: pointer; display: grid; place-items: center; overflow: hidden; position: relative;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; position: absolute; transition: transform .5s var(--ease), opacity .3s; }
.theme-toggle:hover { border-color: var(--cobalt); color: var(--accent-text); }
[data-theme="light"] .i-moon { transform: translateY(150%) rotate(-90deg); opacity: 0; }
[data-theme="dark"] .i-sun { transform: translateY(-150%) rotate(90deg); opacity: 0; }

.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease); }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Animated backgrounds ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.b1 { width: 46vw; height: 46vw; max-width: 720px; max-height: 720px; background: var(--blob-a); top: -18%; right: -8%; animation: drift1 22s ease-in-out infinite alternate; }
.b2 { width: 34vw; height: 34vw; max-width: 520px; max-height: 520px; background: var(--blob-b); top: 30%; left: -10%; animation: drift2 26s ease-in-out infinite alternate; }
.b3 { width: 26vw; height: 26vw; max-width: 420px; max-height: 420px; background: var(--blob-c); bottom: -10%; right: 28%; animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-12vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(14vw, -8vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-8vw, -14vh) scale(1.2); } }

.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 70% at 50% 35%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 35%, #000 30%, transparent 80%);
  animation: grid-pan 40s linear infinite;
}
@keyframes grid-pan { to { background-position: 64px 64px; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding: 140px 0 48px; overflow: hidden; }
.hero-inner { z-index: 1; width: min(100% - 48px, 1400px); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--ink-2); margin-bottom: 18px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; position: relative; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22C55E; animation: ping 2s var(--ease) infinite; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.hero-title { position: relative; will-change: transform, opacity; }
.hero-name {
  font-size: clamp(76px, 17.5vw, 268px); font-weight: 800; line-height: .84; letter-spacing: -0.05em;
  text-transform: uppercase; margin: 0 0 0 -0.04em;
  /* A stroke in the text's own colour thickens the glyphs past the font's heaviest weight */
  -webkit-text-stroke: .022em currentColor;
}
.hero-name .line { display: block; overflow: hidden; padding: 0 .03em .04em 0; }
.hero-name .line > span { display: inline-block; }

/* "15 years" stamp: sits apart from the name, at the right edge of the second line */
.hero-badge {
  position: absolute; right: 0; bottom: .5vw;
  width: clamp(96px, 12vw, 188px); aspect-ratio: 1; display: grid; place-items: center;
  animation: spin-in 1.2s .8s var(--ease) both;
}
.badge-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; rotate: var(--br, 0deg); }
.badge-ring text { font: 500 13.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; fill: var(--ink); }
.badge-ring { animation: spin 28s linear infinite; }
.badge-core {
  width: 60%; aspect-ratio: 1; border-radius: 50%; background: var(--cobalt); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 18px 40px -16px rgba(37, 99, 235, .9), inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.badge-core b { font: 800 clamp(28px, 3.3vw, 52px)/.9 var(--font-display); letter-spacing: -0.05em; }
.badge-core small { font: 500 clamp(9px, .75vw, 12px)/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; margin-top: 4px; opacity: .85; }
@keyframes spin-in { from { transform: scale(0) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.js .hero-name .line > span { transform: translateY(105%); animation: rise 1s var(--ease) forwards; }
.js .hero-name .line + .line > span { animation-delay: .12s; }
@keyframes rise { to { transform: translateY(0); } }
.js .hero-meta, .js .hero-bottom, .js .hero-stats { opacity: 0; animation: fade-up .9s var(--ease) forwards; }
.js .hero-meta { animation-delay: .05s; }
.js .hero-bottom { animation-delay: .35s; }
.js .hero-stats { animation-delay: .5s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; margin-top: 34px; }
.hero-lede { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; color: var(--ink); max-width: 640px; margin: 0; }
.rotator { display: inline-block; vertical-align: bottom; overflow: hidden; height: 1.5em; }
.rotator-word {
  display: inline-block; color: var(--accent-text); font-weight: 600;
  border-bottom: 2px solid currentColor; line-height: 1.35;
}
.rotator-word.out { animation: word-out .35s var(--ease) forwards; }
.rotator-word.in { animation: word-in .45s var(--ease) forwards; }
@keyframes word-out { to { transform: translateY(-110%); opacity: 0; } }
@keyframes word-in { from { transform: translateY(110%); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 56px 0 0;
  border-top: 1px solid var(--line-strong);
}
.hero-stats > div { padding: 20px 20px 0 0; }
.hero-stats > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.hero-stats dt { font-size: 13.5px; color: var(--muted); order: 2; }
.hero-stats dd { margin: 0 0 4px; font: 800 clamp(34px, 4vw, 54px)/1 var(--font-display); color: var(--ink); letter-spacing: -0.04em; }
.hero-stats > div { display: flex; flex-direction: column-reverse; }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 26px 0; background: var(--surface); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; flex: none; }
.marquee li {
  font: 700 clamp(22px, 2.6vw, 34px)/1 var(--font-display); color: var(--ink); letter-spacing: -0.02em;
  padding: 0 28px; display: flex; align-items: center; gap: 56px; white-space: nowrap;
}
.marquee li::after { content: "✦"; font-size: .55em; color: var(--cobalt); }
.marquee li:nth-child(even) { color: var(--muted); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 5vw, 76px) 0; position: relative; overflow-x: clip; }
.marquee + .section { padding-top: clamp(64px, 7vw, 110px); }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.sec-num { color: #fff; background: var(--cobalt); padding: 5px 10px; border-radius: 999px; }
.sec-label { font: 500 12.5px/1 var(--font-mono); color: var(--ink-2); letter-spacing: .12em; display: flex; align-items: center; gap: 14px; flex: 1; }
.sec-label::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.sec-title { font-size: clamp(38px, 5.6vw, 76px); font-weight: 800; letter-spacing: -0.045em; max-width: 14ch; margin-bottom: 40px; }

/* About */
.statement {
  font: 700 clamp(30px, 4.4vw, 60px)/1.12 var(--font-display); letter-spacing: -0.035em; color: var(--ink);
  max-width: 22ch; margin-bottom: 52px;
}
.js .statement .w { opacity: .16; transition: opacity .25s linear; }
.js .statement .w.on { opacity: 1; }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.about-body p { font-size: 18px; }
.about-body strong { color: var(--ink); }
.pipeline { position: relative; border-left: 1px solid var(--line-strong); }
.pipeline li { display: grid; grid-template-columns: 52px 1fr; column-gap: 8px; padding: 16px 0 16px 24px; position: relative; border-bottom: 1px solid var(--line); }
.pipeline li:last-child { border-bottom: 0; }
.pipeline li::before { content: ""; position: absolute; left: -5px; top: 24px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cobalt); transition: background-color .3s; }
.pipeline li:hover::before { background: var(--cobalt); }
.pipeline span { color: var(--accent-text); grid-row: span 2; padding-top: 4px; }
.pipeline strong { font: 700 21px/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.pipeline em { font-style: normal; color: var(--muted); font-size: 14.5px; }

/* Spotlight hover (cursor-following glow) */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
}
.spot:hover::before { opacity: 1; }

/* Expertise bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile {
  grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column;
  transition: border-color .3s, transform .4s var(--ease);
}
.tile:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.tile-kicker { color: var(--accent-text); margin-bottom: 22px; }
.tile-feature .tile-kicker { margin-bottom: auto; padding-bottom: 28px; }
.tile h4 { font-size: 26px; margin-bottom: 10px; }
.tile p:last-child { margin: 0; font-size: 15px; }
.tile-feature { grid-column: span 4; grid-row: span 2; background: var(--cobalt); color: #DCE6FF; border-color: transparent; overflow: hidden; }
.tile-feature .tile-kicker { color: #fff; }
.tile-feature .tile-big { font: 800 clamp(64px, 10vw, 150px)/.9 var(--font-display); color: #fff; letter-spacing: -0.06em; margin: 0 0 18px; }
.tile-feature p:last-child { font-size: 18px; max-width: 34ch; }
.tile-feature::after {
  content: ""; position: absolute; right: -14%; bottom: -40%; width: 70%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 0 0 40px rgba(255, 255, 255, .04), 0 0 0 80px rgba(255, 255, 255, .03);
  animation: pulse-ring 6s ease-in-out infinite alternate;
}
.tile-feature.spot::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .16), transparent 60%); }
@keyframes pulse-ring { to { transform: scale(1.12); } }
.tile-wide, .tile-half { grid-column: span 3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 500; color: var(--ink); transition: background-color .2s, color .2s, border-color .2s; }
.chips li:hover { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.chips.sm li { padding: 4px 10px; font-size: 12.5px; color: var(--ink-2); }

/* Experience */
.exp-grid { display: grid; grid-template-columns: 0.9fr 1.4fr; gap: clamp(40px, 6vw, 96px); }
.exp-sticky { position: sticky; top: 120px; }
.exp-total { font: 800 clamp(72px, 10vw, 148px)/.9 var(--font-display); letter-spacing: -0.06em; color: var(--ink); margin-bottom: 20px; }
.exp-total span { color: var(--cobalt); }
.exp-caption { font-size: 17px; max-width: 30ch; }
.split { margin-top: 36px; display: grid; gap: 18px; }
.split-label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; color: var(--ink); font-size: 14.5px; margin-bottom: 8px; }
.split-label .mono { color: var(--muted); }
.split-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.split-bar span { display: block; height: 100%; width: var(--to); background: var(--cobalt); border-radius: inherit; transform-origin: left; transition: transform 1.4s var(--ease); }
.split-bar.alt span { background: var(--ink); }
.js .split:not(.in) .split-bar span { transform: scaleX(0); }

/* Timeline: a track with a cobalt line that draws down as you scroll */
.timeline { display: grid; gap: 20px; position: relative; padding-left: 36px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; }
.timeline::before { background: var(--line-strong); }
.timeline::after { background: var(--cobalt); transform-origin: top; transform: scaleY(var(--tl, 1)); }
.js .timeline::after { transform: scaleY(var(--tl, 0)); }
.job { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); }
.job::before {
  content: ""; position: absolute; left: -36px; top: 34px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--cobalt); box-shadow: 0 0 0 5px var(--bg);
  transition: background-color .5s .3s;
}
.job.in::before, .no-js .job::before { background: var(--cobalt); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 8px; }
.job-head h3 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; }
.job-head .mono { color: var(--accent-text); }
.role { padding-top: 22px; margin-top: 22px; border-top: 1px dashed var(--line-strong); }
.job-head + .role { border-top: 0; margin-top: 0; padding-top: 14px; }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.role-head h4 { font-size: 20px; letter-spacing: -0.02em; }
.role-head .mono { color: var(--muted); }
.role ul { display: grid; gap: 8px; }
.role li { position: relative; padding-left: 22px; font-size: 15.5px; }
.role li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--cobalt); }
.role strong { color: var(--ink); }

/* Work */
.featured { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.proj {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .45s var(--ease), border-color .3s;
}
.proj:hover { transform: translateY(-6px); border-color: var(--cobalt); }
.proj-meta { display: flex; gap: 16px; color: var(--accent-text); margin-bottom: 40px; }
.proj-meta span + span { color: var(--muted); }
.proj h4 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; }
.proj-sub { font-weight: 600; color: var(--accent-text); margin: 4px 0 12px; }
.proj > p:not(.proj-sub) { font-size: 15.5px; }
.proj .chips { margin-top: auto; padding-top: 8px; }

.index-block { margin-top: 56px; }
.index-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 20px; }
.index-tabs button {
  border: 0; background: transparent; color: var(--ink-2); font: 600 14.5px/1 var(--font-body);
  padding: 11px 18px; border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s;
}
.index-tabs button[aria-selected="true"] { background: var(--cobalt); color: #fff; }
.index li {
  display: grid; grid-template-columns: 110px minmax(200px, 1fr) 2fr; gap: 8px 24px; align-items: baseline;
  padding: 22px 8px; border-top: 1px solid var(--line); transition: background-color .25s, padding .35s var(--ease);
}
.index li:last-child { border-bottom: 1px solid var(--line); }
.index li:hover { background: var(--accent-soft); padding-left: 20px; }
.index .mono { color: var(--muted); }
.index strong { font: 700 22px/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.index em { font-style: normal; font-size: 15px; }

/* Awards */
.awards { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); }
.awards li { padding: 28px 24px 8px 0; }
.awards li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.award-year {
  display: block; font: 800 clamp(56px, 7vw, 96px)/1 var(--font-display); letter-spacing: -0.06em;
  color: var(--accent-soft); margin-bottom: 18px; transition: color .4s;
}
.awards li:hover .award-year { color: var(--cobalt); }
.js .awards li.in .award-year { animation: year-flash 1.6s .3s var(--ease) backwards; }
@keyframes year-flash { 0% { color: var(--accent-soft); } 40% { color: var(--cobalt); } 100% { color: var(--accent-soft); } }
.awards h4 { font-size: 22px; margin-bottom: 8px; }
.awards p { font-size: 15px; margin: 0; }

/* Contact */
.contact { overflow: hidden; border-top: 1px solid var(--line); }
.aurora-contact .b1 { top: auto; bottom: -30%; right: -10%; }
.aurora-contact .b2 { top: -10%; left: -15%; }
.contact .wrap { z-index: 1; }
.contact-title { font: 800 clamp(48px, 8.4vw, 128px)/.92 var(--font-display); letter-spacing: -0.055em; color: var(--ink); max-width: 11ch; margin-bottom: 44px; }
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }

.form { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 3.4vw, 44px); box-shadow: var(--shadow); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 22px; }
.field label { display: block; font: 500 12.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.field .opt { text-transform: none; letter-spacing: 0; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: 500 16.5px/1.5 var(--font-body); color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px;
  transition: border-color .2s, box-shadow .2s, background-color .4s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 4px var(--accent-soft); }
.field.invalid input, .field.invalid textarea { border-color: #E5484D; }
.field .err { display: block; color: #E5484D; font-size: 13.5px; margin-top: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.form-status { margin: 0; font-size: 15px; font-weight: 500; }
.form-status.ok { color: #16A34A; }
.form-status.error { color: #E5484D; }
[data-theme="dark"] .form-status.ok { color: #4ADE80; }
[data-theme="dark"] .form-status.error { color: #FF7A7E; }

.direct { display: grid; }
.direct li { border-top: 1px solid var(--line-strong); }
.direct li:last-child { border-bottom: 1px solid var(--line-strong); }
.direct a { display: grid; gap: 6px; padding: 22px 0; transition: padding .35s var(--ease), color .2s; }
.direct a:hover { padding-left: 14px; color: var(--accent-text); }
.direct small { color: var(--muted); }
.direct span { font: 700 clamp(19px, 1.8vw, 24px)/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.02em; word-break: break-word; transition: color .2s; }
.direct a:hover span { color: var(--accent-text); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 28px; overflow: hidden; }
.footer-name {
  font: 800 clamp(56px, 15vw, 230px)/.85 var(--font-display); letter-spacing: -0.06em; text-transform: uppercase;
  color: transparent; margin: 0 0 28px; white-space: nowrap;
  background:
    linear-gradient(90deg, var(--cobalt), var(--cobalt)) no-repeat 0 0 / var(--fill, 0%) 100%,
    linear-gradient(var(--ghost), var(--ghost));
  -webkit-background-clip: text; background-clip: text;
}
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.footer-row p { margin: 0; }
.footer-row a:hover { color: var(--accent-text); }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease), border-color .3s; transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .tile.reveal.in:hover, .js .proj.reveal.in:hover { transition-delay: 0s; }
.js .tile.reveal.in:hover { transform: translateY(-4px); }
.js .proj.reveal.in:hover { transform: translateY(-6px); }

/* Section titles rise word by word from behind a mask */
.js .reveal.split-words { opacity: 1; transform: none; }
.split-words .wm { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .1em; margin-bottom: -.1em; }
.split-words .wm > span { display: inline-block; }
.js .split-words .wm > span { transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--wi, 0) * 60ms); }
.js .split-words.in .wm > span { transform: none; }

/* Section rule draws across */
.js .sec-head .sec-label::after { transform: scaleX(0); transform-origin: left; transition: transform 1.4s .2s var(--ease); }
.js .sec-head.in .sec-label::after { transform: scaleX(1); }
.js .sec-head .sec-num { transform: scale(0); transition: transform .6s var(--ease); }
.js .sec-head.in .sec-num { transform: scale(1); }

/* Featured tile wipes open */
/* A page-coloured curtain slides off the tile. (Clipping the tile itself would hide it
   from IntersectionObserver, so it would never be revealed.) */
.js .tile-feature.reveal { opacity: 1; transform: none; }
.curtain { display: none; }
.js .curtain {
  display: block; position: absolute; inset: -2px; z-index: 3; pointer-events: none;
  background: var(--bg); transform-origin: right center; transition: transform 1.3s var(--ease);
}
.js .tile-feature.in .curtain { transform: scaleX(0); }
.js .tile-feature .tile-big { display: inline-block; transform: translateX(-30px); opacity: 0; transition: transform 1s .5s var(--ease), opacity 1s .5s; }
.js .tile-feature.in .tile-big { transform: none; opacity: 1; }

/* Project cards tilt up into place */
.featured { perspective: 1400px; }
.js .proj.reveal { transform-origin: 50% 100%; }
.js .proj.reveal:not(.in) { transform: translateY(70px) rotateX(10deg) scale(.96); }

/* Index rows slide in from the left; pipeline steps from the right */
.js .index li.reveal:not(.in), .js .direct.reveal:not(.in) { transform: translateX(-40px); }
.js .pipeline li.reveal:not(.in) { transform: translateX(40px); }

/* Award years: rise and settle */
.js .awards li.reveal .award-year { transform: translateY(60%); transition: transform 1.1s .15s var(--ease); }
.js .awards li.reveal.in .award-year { transform: none; }

/* Marquee leans with scroll speed */
.marquee ul { transform: skewX(var(--skew, 0deg)); transition: transform .5s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile, .tile-wide, .tile-half { grid-column: span 1; }
  .tile-feature { grid-column: span 2; grid-row: auto; }
  .tile-wide { grid-column: span 2; }
  .awards { grid-template-columns: repeat(2, 1fr); }
  .awards li:nth-child(3) { padding-left: 0; border-left: 0; }
  .awards li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 4px;
    margin: 0; padding: 0 32px; background: var(--bg);
    opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links a { font: 800 clamp(40px, 11vw, 64px)/1.1 var(--font-display); letter-spacing: -0.04em; color: var(--ink); padding: 6px 0; background: none !important; }
  .nav-links a.active { color: var(--accent-text); }
  .nav-toggle { display: block; }
  .nav { gap: 6px; }
  .site-header { justify-content: center; }

  .about-grid, .exp-grid, .contact-grid { grid-template-columns: 1fr; }
  .exp-sticky { position: static; }
  .featured { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 8px; }
  .index li { grid-template-columns: 90px 1fr; }
  .index em { grid-column: 2; }
}
@media (max-width: 600px) {
  .wrap, .hero-inner { width: min(100% - 32px, var(--wrap)); }
  .nav-cta { display: none; }
  .bento { grid-template-columns: 1fr; }
  .tile, .tile-wide, .tile-half, .tile-feature { grid-column: span 1; }
  .field-row { grid-template-columns: 1fr; }
  .awards { grid-template-columns: 1fr; }
  .awards li, .awards li + li { padding-left: 0; border-left: 0; }
  .awards li + li { border-top: 1px solid var(--line); }
  .index li { grid-template-columns: 1fr; }
  .index em { grid-column: 1; }
  .proj { padding: 26px; }
  .proj-meta { margin-bottom: 36px; }
  .hero-badge { width: 74px; bottom: 0; right: 4px; }
  .badge-core b { font-size: 20px; }
  .badge-core small { font-size: 7px; margin-top: 2px; }
  .badge-ring text { font-size: 15px; }
  .timeline { padding-left: 24px; }
  .job::before { left: -31px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .hero-meta, .js .hero-bottom, .js .hero-stats { opacity: 1; transform: none; }
  .js .hero-name .line > span { transform: none; }
  .js .statement .w { opacity: 1; }
  .js .timeline::after { transform: none; }
  .curtain { display: none !important; }
  .js .reveal *, .js .sec-head * { transform: none !important; opacity: 1 !important; }
  .hero-title { transform: none !important; opacity: 1 !important; }
  .js .split:not(.in) .split-bar span { transform: none; }
  .marquee-track { flex-wrap: wrap; width: auto; }
  .marquee ul[aria-hidden] { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .aurora, .grid-bg, .grain, .progress, .hero-cta, .form, .marquee { display: none !important; }
  .js .reveal, .js .statement .w { opacity: 1 !important; transform: none !important; }
  .index[hidden] { display: block !important; }
}
