/* ══════════════════════════════════════════════════════════════════════
   Neelash Kannan — portfolio
   "Instrument": a dark precision-HMI aesthetic. Two accents carry meaning —
   signal orange for the mechanical/human layer, scan cyan for the data layer.
   ══════════════════════════════════════════════════════════════════════ */

/* ── tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:        #08090B;
  --bg-2:      #0C0E12;
  --surface:   #111419;
  --surface-2: #171B21;

  --ink:   #EDEBE6;
  --ink-2: #A5ABB4;
  --ink-3: #858C96;
  --ink-4: #737A85;

  --line:   rgba(237, 235, 230, 0.10);
  --line-2: rgba(237, 235, 230, 0.20);

  --signal: #FF4A15;
  --signal-dim: rgba(255, 74, 21, 0.14);
  --scan:   #46E3FF;
  --scan-dim: rgba(70, 227, 255, 0.14);

  --font-d: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-m: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gut: clamp(20px, 4.2vw, 76px);
  --maxw: 1640px;

  --e-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --e-inout: cubic-bezier(0.76, 0, 0.24, 1);

  --nav-h: 74px;
}

@property --wdth { syntax: '<number>'; inherits: false; initial-value: 100; }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: clamp(0.98rem, 0.42vw + 0.87rem, 1.12rem);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}
body.is-booting  { overflow: hidden; height: 100vh; }
body.is-locked   { overflow: hidden; }

img, svg, canvas, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--signal); color: #08090B; }

:focus-visible {
  outline: 2px solid var(--scan);
  outline-offset: 3px;
  border-radius: 2px;
}

.mono {
  font-family: var(--font-m);
  font-size: 0.688rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.5;
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 999;
  padding: 10px 16px; background: var(--signal); color: #08090B;
  font-family: var(--font-m); font-size: 0.75rem; letter-spacing: .1em;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* ── scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23272E; }
::-webkit-scrollbar-thumb:hover { background: #33383F; }

/* ══ BACKGROUND LAYERS ═══════════════════════════════════════════════ */
#gl {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 1.2s var(--e-out);
}
body.gl-ready #gl { opacity: 1; }

.gl-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: rgba(8, 9, 11, var(--veil, 0));
  transition: background .35s linear;
}
.gl-veil::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 145% 120% at 50% 42%,
      rgba(6,7,9,0) 0%, rgba(6,7,9,.06) 40%, rgba(6,7,9,.16) 58%,
      rgba(6,7,9,.32) 74%, rgba(6,7,9,.50) 88%, rgba(6,7,9,.62) 100%);
}

.grain {
  position: fixed; inset: -120px; z-index: 2; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 5s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) }   16% { transform: translate(-24px, 12px) }
  33% { transform: translate(16px,-18px) } 50% { transform: translate(-12px,20px) }
  66% { transform: translate(22px, 8px) }  83% { transform: translate(-18px,-14px) }
}

/* viewfinder frame */
.frame { position: fixed; inset: 14px; z-index: 3; pointer-events: none; }
.frame-t { position: absolute; width: 13px; height: 13px; opacity: .5; }
.frame-t::before, .frame-t::after { content: ''; position: absolute; background: var(--line-2); }
.frame-t::before { width: 100%; height: 1px; } .frame-t::after { width: 1px; height: 100%; }
.frame-tl { top: 0; left: 0; } .frame-tl::before { top: 0 } .frame-tl::after { left: 0 }
.frame-tr { top: 0; right: 0; } .frame-tr::before { top: 0 } .frame-tr::after { right: 0 }
.frame-bl { bottom: 0; left: 0; } .frame-bl::before { bottom: 0 } .frame-bl::after { left: 0 }
.frame-br { bottom: 0; right: 0; } .frame-br::before { bottom: 0 } .frame-br::after { right: 0 }
@media (max-width: 860px) { .frame { display: none } }

/* ── HUD readouts ───────────────────────────────────────────────────── */
.hud {
  position: fixed; bottom: 26px; z-index: 40; pointer-events: none;
  display: flex; align-items: baseline; gap: 9px;
  font-family: var(--font-m); font-size: .625rem; letter-spacing: .2em;
  text-transform: uppercase; opacity: 0;
}
body.gl-ready .hud { opacity: 1; transition: opacity .9s var(--e-out) .5s; }
.hud-l { left: var(--gut) }
.hud-r { right: var(--gut) }
.hud-key { color: var(--ink-4) }
.hud-val { color: var(--scan); font-variant-numeric: tabular-nums }
@media (max-width: 860px) { .hud { display: none } }

/* ══ BOOT ════════════════════════════════════════════════════════════ */
.boot {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
}
.boot.is-done { pointer-events: none; }
.boot-inner {
  position: relative; z-index: 1;
  width: min(420px, 78vw);
  display: flex; flex-direction: column; gap: 26px;
}
.boot-mark { display: flex; align-items: baseline; gap: 12px; }
.boot-mark-a {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  font-variation-settings: 'wdth' 118;
}
.boot-mark-b { font-family: var(--font-m); font-size: .625rem; letter-spacing: .28em; color: var(--ink-4); }

.boot-log {
  font-family: var(--font-m); font-size: .688rem; letter-spacing: .06em;
  color: var(--ink-3); display: flex; flex-direction: column; gap: 7px;
}
.boot-log li { opacity: 0; display: flex; gap: 8px; align-items: center; }
.boot-log li::before { content: '›'; color: var(--signal); }
.boot-log li > * { color: var(--scan) }

.boot-bar { height: 1px; background: var(--line); overflow: hidden; }
.boot-bar-fill { display: block; height: 100%; width: 0%; background: var(--signal); }
.boot-pct {
  font-family: var(--font-m); font-size: .625rem; letter-spacing: .2em;
  color: var(--ink-4); text-align: right; font-variant-numeric: tabular-nums;
}
.boot-curtain {
  position: absolute; inset: 0; z-index: 0;
  background: var(--bg);
  transform-origin: 50% 100%;
}

/* ══ NAV ═════════════════════════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--gut);
  transition: transform .55s var(--e-out), background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(8, 9, 11, .72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-101%); }

.nav-mark { display: flex; align-items: baseline; gap: 11px; margin-right: auto; padding: 10px 0 }
.nav-mark-glyph {
  font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em;
  font-variation-settings: 'wdth' 118;
  color: var(--signal);
}
.nav-mark-text {
  font-size: .92rem; font-weight: 500; letter-spacing: -.005em;
  transition: color .3s;
}
.nav-mark:hover .nav-mark-text { color: var(--ink-2) }

.nav-links { position: relative; display: flex; gap: 4px; }
.nav-links a {
  position: relative; padding: 8px 14px;
  font-family: var(--font-m); font-size: .656rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
  transition: color .3s var(--e-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-ink {
  position: absolute; left: 0; bottom: 2px; height: 1px; width: 0;
  background: var(--signal); opacity: 0; pointer-events: none;
}

.nav-cta {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 15px; border: 1px solid var(--line-2); border-radius: 100px;
  font-family: var(--font-m); font-size: .625rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-2);
  transition: border-color .3s, color .3s, background .3s;
}
.nav-cta:hover { border-color: var(--ink-2); color: var(--ink); background: rgba(237,235,230,.04) }
.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 0 0 rgba(255,74,21,.7); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,74,21,.55) }
  70%  { box-shadow: 0 0 0 9px rgba(255,74,21,0) }
  100% { box-shadow: 0 0 0 0 rgba(255,74,21,0) }
}

.nav-burger { display: none; width: 44px; height: 44px; margin-right: -10px; position: relative; }
.nav-burger i {
  position: absolute; left: 11px; width: 22px; height: 1px; background: var(--ink);
  transition: transform .4s var(--e-inout), opacity .25s;
}
.nav-burger i:first-child { top: 19px } .nav-burger i:last-child { top: 25px }
.nav-burger[aria-expanded="true"] i:first-child { transform: translateY(3px) rotate(45deg) }
.nav-burger[aria-expanded="true"] i:last-child  { transform: translateY(-3px) rotate(-45deg) }

@media (max-width: 940px) {
  .nav-links, .nav-cta { display: none }
  .nav-burger { display: block }
}

/* mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 110;
  background: var(--bg);
  display: grid; place-items: center;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
}
.menu.is-open { visibility: visible }
.menu-links { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 var(--gut) }
.menu-links a {
  display: flex; align-items: baseline; gap: 18px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(1.7rem, 8vw, 2.6rem); font-weight: 600; letter-spacing: -.025em;
  font-variation-settings: 'wdth' 108;
}
.menu-links a span { font-family: var(--font-m); font-size: .625rem; letter-spacing: .2em; color: var(--signal) }

/* ── section rail ───────────────────────────────────────────────────── */
.rail {
  position: fixed; right: calc(var(--gut) - 6px); top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 14px; align-items: flex-end;
  opacity: 0;
}
body.gl-ready .rail { opacity: 1; transition: opacity .8s var(--e-out) .6s }
.rail-tick { display: flex; align-items: center; gap: 10px; pointer-events: auto }
.rail-tick b { display: block; width: 18px; height: 1px; background: var(--ink-4); transition: all .4s var(--e-out) }
.rail-tick em {
  font-family: var(--font-m); font-style: normal; font-size: .563rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-4);
  opacity: 0; transform: translateX(6px); transition: all .4s var(--e-out);
}
.rail-tick:hover b, .rail-tick.is-active b { width: 30px; background: var(--signal) }
.rail-tick:hover em, .rail-tick.is-active em { opacity: 1; transform: none; color: var(--ink-2) }
.rail-tick.is-active em { color: var(--ink) }
@media (max-width: 1180px) { .rail { display: none } }

/* ══ LAYOUT PRIMITIVES ═══════════════════════════════════════════════ */
#main { position: relative; z-index: 10; }

.sec {
  position: relative;
  padding: clamp(96px, 13vh, 190px) var(--gut);
  max-width: var(--maxw); margin: 0 auto;
}

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 28px;
  margin-bottom: clamp(46px, 6vw, 92px);
}
.sec-num { grid-row: 1; grid-column: 1 / -1; color: var(--signal) }
.sec-title {
  grid-row: 2; grid-column: 1; align-self: end;
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  font-weight: 600; letter-spacing: -.035em; line-height: 1;
  font-variation-settings: 'wdth' 108;
}
.sec-note { grid-row: 2; grid-column: 2; align-self: end; color: var(--ink-3); text-align: right; padding-bottom: .5em }
.sec-rule { grid-row: 3; grid-column: 1 / -1; width: 100%; height: 1px; margin-top: 6px }
.sec-rule line { stroke: var(--line-2); stroke-width: 1 }
@media (max-width: 720px) {
  .sec-head { grid-template-columns: 1fr }
  .sec-note { grid-row: 3; grid-column: 1; text-align: left; padding-bottom: 0 }
  .sec-rule { grid-row: 4 }
}

/* text reveal primitives (JS fills these) ─ each word is its own mask so
   characters can slide up from nothing without breaking line wrapping */
.line { display: block }
.split-word {
  display: inline-block; overflow: hidden; white-space: nowrap;
  padding: .16em 0; margin: -.16em 0;
  vertical-align: baseline;
}
.split-char, .split-word > span { display: inline-block; will-change: transform }
[data-reveal] { opacity: 0 }
body.no-motion [data-reveal] { opacity: 1 }

/* button */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 22px; border: 1px solid var(--line-2);
  font-family: var(--font-m); font-size: .656rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink);
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .35s var(--e-out), border-color .35s;
}
.btn svg { width: 12px; height: 12px; transition: transform .4s var(--e-out) }
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--signal); transform: translateY(101%);
  transition: transform .5s var(--e-inout);
}
.btn:hover { color: #08090B; border-color: var(--signal) }
.btn:hover::before { transform: none }
.btn:hover svg { transform: translate(3px,-3px) }

/* ══ HERO ════════════════════════════════════════════════════════════ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--nav-h) var(--gut) 0;
  max-width: var(--maxw); margin: 0 auto;
}
.hero-grid {
  flex: 1; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: clamp(24px, 4vw, 76px);
  align-items: center;
  padding-bottom: 4vh;
}
.hero-copy { min-width: 0 }

.hero-kicker {
  color: var(--ink-3); margin-bottom: clamp(16px, 2.6vh, 30px);
  display: flex; align-items: center; gap: 12px; min-height: 1.5em;
}
.hero-kicker::before { content: ''; width: 34px; height: 1px; background: var(--signal); flex: none }

.hero-title {
  font-size: clamp(2.7rem, 7.5vw, 8.2rem);
  font-weight: 800; line-height: .86; letter-spacing: -.045em;
  font-variation-settings: 'wdth' var(--wdth, 118);
  margin-bottom: clamp(24px, 3.6vh, 48px);
}
.hero-title .line-in { display: block }

.hero-lede {
  color: var(--ink-2); font-size: clamp(1.02rem, 1.15vw, 1.26rem);
  line-height: 1.55; max-width: 44ch;
  margin-bottom: clamp(28px, 4.2vh, 54px);
}

.hero-spec { display: grid; gap: 10px; max-width: 460px }
.hero-spec > div {
  display: grid; grid-template-columns: 88px 1fr; gap: 20px; align-items: baseline;
  border-top: 1px solid var(--line); padding-top: 8px;
}
.hero-spec dt { color: var(--ink-4) }
.hero-spec dd { color: var(--ink-2); text-transform: none; letter-spacing: .04em }
.hero-spec dd.live { color: var(--ink); display: flex; align-items: center; gap: 9px }
.hero-spec dd.live::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--signal);
  animation: pulse 2.4s infinite; flex: none;
}

/* the right column is deliberately empty: it frames the WebGL machine and
   labels it like a plate in a technical drawing */
.hero-stage {
  position: relative; align-self: stretch; min-height: 44vh;
  border-left: 1px solid var(--line);
}
.hero-stage-tick { position: absolute; background: var(--line-2) }
.hero-stage-tick-a { top: 0; left: -1px; width: 1px; height: 34px; background: var(--signal) }
.hero-stage-tick-b { top: 0; left: 0; width: 34px; height: 1px }
.hero-stage-cap {
  position: absolute; left: 22px; bottom: 0; right: 0;
  display: flex; flex-direction: column; gap: 5px;
  font-size: .563rem; color: var(--ink-4); letter-spacing: .2em;
}
.hero-stage-cap span:first-child { color: var(--signal) }
.hero-stage-live { color: var(--scan); display: flex; align-items: center; gap: 8px }
.hero-stage-live::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--scan); animation: blink 1.6s steps(2) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: .15 } }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr }
  .hero-stage { display: none }
  .hero-title { font-size: clamp(2.7rem, 11.5vw, 7rem) }
  .hero-lede { max-width: 52ch }
}

.hero-scroll {
  position: absolute; right: var(--gut); bottom: 96px;
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-4); writing-mode: vertical-rl; letter-spacing: .22em;
}
.hero-scroll-line { display: block; width: 1px; height: 54px; background: var(--line-2); position: relative; overflow: hidden }
.hero-scroll-line::after {
  content: ''; position: absolute; inset: 0; background: var(--signal);
  animation: trickle 2.1s var(--e-inout) infinite;
}
@keyframes trickle { 0% { transform: translateY(-100%) } 55%,100% { transform: translateY(100%) } }
@media (max-width: 1180px) { .hero-scroll { display: none } }

/* ticker */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 13px 0; margin: 0 calc(var(--gut) * -1);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: flex; width: max-content; will-change: transform }
.ticker-set { color: var(--ink-4); white-space: nowrap; font-size: .625rem; letter-spacing: .2em }

/* ══ ABOUT ═══════════════════════════════════════════════════════════ */
.index-body {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 110px); align-items: start;
}
.index-prose { max-width: 62ch; display: flex; flex-direction: column; gap: 22px; align-items: flex-start }
.index-prose p { color: var(--ink-2) }
.index-prose .lede {
  font-size: clamp(1.3rem, 2.4vw, 2.05rem); line-height: 1.32; color: var(--ink);
  font-weight: 500; letter-spacing: -.02em; font-variation-settings: 'wdth' 102;
}
.index-prose em { color: var(--signal); font-style: italic }
.index-prose .btn { margin-top: 12px }

.stats {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.stat {
  padding: clamp(20px, 2.4vw, 34px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .45s var(--e-out);
}
.stat:hover { background: rgba(237,235,230,.03) }
.stat-n {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem); font-weight: 700; line-height: .92;
  letter-spacing: -.045em; font-variation-settings: 'wdth' 112;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat-n sup { font-size: .4em; vertical-align: super; color: var(--signal); font-weight: 500 }
.stat dt { color: var(--ink-4); margin-top: 10px; font-size: .625rem }
@media (max-width: 900px) {
  .index-body { grid-template-columns: 1fr }
}

/* ══ WORK ════════════════════════════════════════════════════════════ */
.work-list { border-top: 1px solid var(--line) }
.work-row {
  position: relative; display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 190px 200px 44px;
  gap: 26px; align-items: center;
  padding: clamp(22px, 2.6vw, 34px) 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: opacity .45s var(--e-out);
}
.work-row::before {
  content: ''; position: absolute; left: calc(var(--gut) * -0.5); right: calc(var(--gut) * -0.5);
  top: 0; bottom: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(255,74,21,.07), rgba(255,74,21,0) 62%);
  opacity: 0; transition: opacity .45s var(--e-out);
}
.work-list:hover .work-row:not(:hover) { opacity: .34 }
.work-row:hover::before, .work-row:focus-visible::before { opacity: 1 }

.work-num { color: var(--ink-3); align-self: start; padding-top: .35em; transition: color .4s }
.work-row:hover .work-num { color: var(--signal) }

.work-main { transition: transform .5s var(--e-out) }
.work-row:hover .work-main { transform: translateX(14px) }
.work-title {
  font-size: clamp(1.35rem, 2.6vw, 2.15rem); font-weight: 500;
  letter-spacing: -.028em; line-height: 1.06; margin-bottom: 9px;
  font-variation-settings: 'wdth' 104;
}
.work-desc { color: var(--ink-2); font-size: .94rem; line-height: 1.55; max-width: 58ch }

.work-tags { display: flex; flex-wrap: wrap; gap: 6px; align-content: start }
.work-tags li {
  padding: 4px 9px; border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: .563rem; letter-spacing: .12em; white-space: nowrap;
  background: rgba(8,9,11,.5);
  transition: border-color .4s, color .4s;
}
.work-row:hover .work-tags li { border-color: var(--line-2); color: var(--ink-2) }

.work-cat { color: var(--ink-3); text-align: right; font-size: .625rem }
.work-open {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink-3);
  transition: all .45s var(--e-out); justify-self: end;
}
.work-open svg { width: 13px; height: 13px }
.work-row:hover .work-open {
  background: var(--signal); border-color: var(--signal); color: #08090B;
  transform: rotate(45deg);
}

@media (max-width: 1200px) {
  .work-row { grid-template-columns: 48px minmax(0,1fr) 170px 40px }
  .work-cat { display: none }
}
@media (max-width: 820px) {
  .work-row { grid-template-columns: 40px minmax(0,1fr) 36px; gap: 14px; align-items: start }
  .work-tags { grid-column: 2 / -1; margin-top: 12px }
  .work-open { width: 32px; height: 32px; align-self: center }
  .work-row:hover .work-main { transform: none }
  .work-list:hover .work-row:not(:hover) { opacity: 1 }
}

/* cursor-tracked schematic preview */
.peek {
  position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none;
  width: 260px; height: 172px; margin: -86px 0 0 -130px;
  background: #070809; border: 1px solid var(--line-2);
  opacity: 0; transform: scale(.92);
  clip-path: inset(50% 0 50% 0);
  will-change: transform, opacity, clip-path;
}
.peek-canvas { width: 100%; height: 100%; display: block }
.peek-label {
  position: absolute; left: 10px; bottom: 8px; color: var(--scan);
  font-size: .563rem; letter-spacing: .24em;
}
@media (max-width: 1024px), (hover: none) { .peek { display: none } }

/* ══ TRACK ═══════════════════════════════════════════════════════════ */
.track { position: relative; padding-left: clamp(0px, 4vw, 56px) }
.track-spine {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px;
  background: var(--line);
}
.track-spine-fill { display: block; width: 100%; height: 0%; background: var(--signal) }
@media (max-width: 760px) { .track-spine { display: none } .track { padding-left: 0 } }

.trk {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(28px, 3.4vw, 46px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.trk::before {
  content: ''; position: absolute; left: clamp(0px, -4vw, 0px); top: 0; width: 0; height: 1px;
}
.trk:last-child { border-bottom: 0 }
.trk-when { color: var(--signal); padding-top: .45em }
.trk-edu .trk-when { color: var(--scan) }
.trk-kind {
  display: inline-block; margin-bottom: 12px; padding: 3px 8px;
  border: 1px solid var(--scan-dim); color: var(--scan); font-size: .563rem;
}
.trk-body h3 {
  font-size: clamp(1.18rem, 2.1vw, 1.72rem); font-weight: 500;
  letter-spacing: -.024em; line-height: 1.14; margin-bottom: 6px;
  font-variation-settings: 'wdth' 104;
}
.trk-org { color: var(--ink-2); font-family: var(--font-m); font-size: .688rem; letter-spacing: .06em; margin-bottom: 16px }
.trk-body > p:last-of-type { color: var(--ink-2); max-width: 68ch }
.trk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px }
.trk-tags li { padding: 4px 9px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: .563rem; letter-spacing: .12em; background: rgba(8,9,11,.5) }
@media (max-width: 760px) { .trk { grid-template-columns: 1fr; gap: 12px } }

/* ══ SYSTEMS ═════════════════════════════════════════════════════════ */
.cap-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.cap {
  padding: clamp(24px, 2.6vw, 38px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  position: relative; transition: background .45s var(--e-out);
}
.cap:hover { background: rgba(237,235,230,.035) }
.cap-i { color: var(--ink-4); position: absolute; top: clamp(24px,2.6vw,38px); right: clamp(24px,2.6vw,38px); transition: color .4s }
.cap:hover .cap-i { color: var(--signal) }
.cap h4 {
  font-size: 1.06rem; font-weight: 500; letter-spacing: -.018em; margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.cap ul { display: flex; flex-wrap: wrap; gap: 7px 14px }
.cap li {
  font-family: var(--font-m); font-size: .688rem; letter-spacing: .03em; color: var(--ink-2);
  transition: color .3s;
}
.cap:hover li { color: var(--ink) }

/* a lone cell on the last row would leave the bordered grid ragged: run it full width */
.cap:last-child:nth-child(3n + 1) { grid-column: 1 / -1 }
@media (max-width: 1080px) {
  .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .cap:last-child:nth-child(3n + 1) { grid-column: auto }
  .cap:last-child:nth-child(2n + 1) { grid-column: 1 / -1 }
}
@media (max-width: 620px) {
  .cap-grid { grid-template-columns: 1fr }
  .cap:last-child { grid-column: auto }
}

/* ══ SIGNAL ══════════════════════════════════════════════════════════ */
.signal-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 96px); align-items: start;
}
.awards { display: grid; border-top: 1px solid var(--line); border-left: 1px solid var(--line) }
.award {
  padding: clamp(26px, 3vw, 42px); transition: background .45s;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.award:hover { background: rgba(237,235,230,.035) }
.award-meta { color: var(--signal); margin-bottom: 14px }
.award h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.95rem); font-weight: 500;
  letter-spacing: -.026em; margin-bottom: 12px; line-height: 1.1;
  font-variation-settings: 'wdth' 104;
}
.award p { color: var(--ink-3); max-width: 54ch; font-size: .95rem }

.signal-side { display: flex; flex-direction: column; gap: 38px }
.signal-side h4 { color: var(--ink-3); margin-bottom: 16px; font-weight: 400 }
.pub {
  display: block; padding: 14px 0; border-top: 1px solid var(--line);
  transition: padding-left .4s var(--e-out);
}
a.pub:hover { padding-left: 10px }
.pub-title { display: block; font-size: .98rem; line-height: 1.4; margin-bottom: 5px; transition: color .3s }
a.pub:hover .pub-title { color: var(--scan) }
.pub-venue { display: block; color: var(--ink-3); font-size: .625rem }
.certs ul, .langs ul { display: flex; flex-direction: column; gap: 0 }
.certs li, .langs li {
  padding: 11px 0; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: .688rem; letter-spacing: .06em; text-transform: none;
}
@media (max-width: 900px) { .signal-grid { grid-template-columns: 1fr } }

/* ══ CONTACT ═════════════════════════════════════════════════════════ */
.sec-contact {
  min-height: 92svh; display: flex; flex-direction: column; justify-content: center;
  padding-bottom: clamp(70px, 9vh, 130px);
}
.contact-kicker { color: var(--ink-4); margin-bottom: clamp(24px, 4vh, 44px) }
.contact-title {
  font-size: clamp(2.3rem, 7.6vw, 8.4rem);
  font-weight: 800; line-height: .86; letter-spacing: -.045em;
  font-variation-settings: 'wdth' var(--wdth, 116);
  margin-bottom: clamp(36px, 6vh, 70px);
}
.contact-title .line-in { display: block }

.contact-mail {
  display: inline-block; position: relative; align-self: flex-start;
  font-size: clamp(1.18rem, 3vw, 2.3rem); font-weight: 400; letter-spacing: -.028em;
  color: var(--ink-2); margin-bottom: clamp(46px, 7vh, 80px); padding: 6px 0;
  transition: color .4s var(--e-out);
}
.contact-mail:hover { color: var(--signal) }
.contact-mail-line {
  position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--line-2); transform-origin: 0 50%;
}
.contact-mail:hover .contact-mail-line { background: var(--signal) }

.contact-links { display: flex; flex-wrap: wrap; gap: 8px 40px; margin-bottom: clamp(56px, 9vh, 110px) }
.contact-links a {
  position: relative; display: inline-block; padding: 11px 0 5px;
  font-family: var(--font-m); font-size: .75rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); transition: color .35s;
}
.contact-links a i {
  position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .45s var(--e-out);
}
.contact-links a:hover { color: var(--ink) }
.contact-links a:hover i { transform: scaleX(1); transform-origin: 0 50% }

.foot {
  display: flex; flex-wrap: wrap; gap: 10px 40px; justify-content: space-between;
  padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink-4);
  font-size: .563rem;
}

/* ══ DETAIL PANEL ════════════════════════════════════════════════════ */
.detail { position: fixed; inset: 0; z-index: 200; visibility: hidden }
.detail.is-open { visibility: visible }
.detail-scrim {
  position: absolute; inset: 0; background: rgba(4, 5, 6, .82);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  opacity: 0;
}
.detail-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(880px, 100vw);
  background: var(--bg-2); border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  box-shadow: -40px 0 90px rgba(0,0,0,.6);
}
.detail-close {
  position: absolute; top: 20px; right: 22px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border: 1px solid var(--line-2); color: var(--ink-2);
  background: rgba(12,14,18,.8); transition: all .35s var(--e-out);
}
.detail-close svg { width: 11px; height: 11px }
.detail-close:hover { background: var(--signal); border-color: var(--signal); color: #08090B }
.detail-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1 }
.detail-inner { padding: clamp(56px, 6vw, 86px) clamp(24px, 4.5vw, 76px) }
.detail-inner > *, .detail-inner section { opacity: 0 }

.detail-num { color: var(--signal); margin-bottom: 16px }
.detail-title {
  font-size: clamp(1.8rem, 4.4vw, 3.1rem); font-weight: 600; line-height: 1.03;
  letter-spacing: -.038em; margin-bottom: 12px; font-variation-settings: 'wdth' 108;
}
.detail-meta { color: var(--ink-4); margin-bottom: 28px }
.detail-desc {
  font-size: clamp(1.05rem, 1.5vw, 1.28rem); line-height: 1.5; color: var(--ink);
  max-width: 60ch; margin-bottom: 42px;
}
.detail-panel h3.mono {
  color: var(--ink-3); padding-bottom: 12px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line); font-weight: 400;
}
.detail-how { margin-bottom: 46px }
.detail-how-text { color: var(--ink-2); max-width: 68ch }
.detail-spec { margin-bottom: 46px }
.detail-points { display: flex; flex-direction: column; gap: 14px }
.detail-points li {
  display: grid; grid-template-columns: 26px 1fr; gap: 4px;
  color: var(--ink-2); font-size: .95rem; line-height: 1.55;
}
.detail-points li::before {
  content: attr(data-i); font-family: var(--font-m); font-size: .625rem;
  color: var(--ink-4); padding-top: .38em;
}
.detail-media { margin-bottom: 46px }
.detail-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px }
.media-tile {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--e-out) }
.media-tile:hover img { transform: scale(1.055) }
.media-tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 11px 9px;
  background: linear-gradient(transparent, rgba(4,5,6,.55) 35%, rgba(4,5,6,.94));
  font-family: var(--font-m); font-size: .563rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
}
.media-tile.is-doc { display: grid; place-items: center; gap: 12px; align-content: center; color: var(--signal) }
.media-tile.is-doc svg { width: 34px; height: 34px }
.media-tile.is-doc span {
  font-family: var(--font-m); font-size: .563rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3); padding: 0 12px; text-align: center;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 34px }
.detail-tags li { padding: 5px 11px; border: 1px solid var(--line); color: var(--ink-3); font-size: .563rem; letter-spacing: .12em }

@media (max-width: 620px) { .detail-panel { width: 100vw; border-left: 0 } }

/* ══ LIGHTBOX ════════════════════════════════════════════════════════ */
.lightbox { position: fixed; inset: 0; z-index: 300; visibility: hidden }
.lightbox.is-open { visibility: visible }
.lightbox-scrim { position: absolute; inset: 0; background: rgba(4,5,6,.95); opacity: 0 }
.lightbox-stage {
  position: absolute; inset: clamp(40px, 7vh, 90px) clamp(20px, 8vw, 130px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  opacity: 0;
}
.lightbox-img { max-width: 100%; max-height: calc(100% - 44px); object-fit: contain; border: 1px solid var(--line) }
.lightbox-cap { color: var(--ink-3); display: flex; gap: 14px; align-items: baseline }
.lightbox-count { color: var(--signal) }
.lb-btn {
  position: absolute; z-index: 2; width: 46px; height: 46px;
  display: grid; place-items: center; border: 1px solid var(--line-2);
  color: var(--ink-2); font-size: 1.1rem; background: rgba(8,9,11,.6);
  transition: all .3s var(--e-out);
}
.lb-btn:hover { background: var(--signal); border-color: var(--signal); color: #08090B }
.lb-prev { left: clamp(12px, 2.4vw, 34px); top: 50% ; transform: translateY(-50%) }
.lb-next { right: clamp(12px, 2.4vw, 34px); top: 50%; transform: translateY(-50%) }
.lb-close { top: clamp(12px, 2.4vw, 30px); right: clamp(12px, 2.4vw, 34px) }

/* ══ PDF ═════════════════════════════════════════════════════════════ */
.pdf { position: fixed; inset: 0; z-index: 320; visibility: hidden }
.pdf.is-open { visibility: visible }
.pdf-scrim { position: absolute; inset: 0; background: rgba(4,5,6,.9); opacity: 0 }
.pdf-panel {
  position: absolute; inset: clamp(16px, 4vh, 54px) clamp(12px, 6vw, 110px);
  background: var(--bg-2); border: 1px solid var(--line-2);
  display: flex; flex-direction: column; opacity: 0;
}
.pdf-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.pdf-name { color: var(--ink-2) }
.pdf-actions { display: flex; gap: 8px; align-items: center }
.pdf-open, .pdf-close {
  padding: 7px 12px; border: 1px solid var(--line-2); color: var(--ink-3);
  transition: all .3s;
}
.pdf-open:hover, .pdf-close:hover { color: var(--ink); border-color: var(--ink-3) }
.pdf-stage { flex: 1; background: #15171B }
.pdf-frame { width: 100%; height: 100%; border: 0 }

/* ══ CURSOR ══════════════════════════════════════════════════════════ */
.cursor { position: fixed; top: 0; left: 0; z-index: 500; pointer-events: none; mix-blend-mode: difference }
.cursor-dot, .cursor-ring {
  position: absolute; top: 0; left: 0; border-radius: 50%;
  will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(255,255,255,.6);
}
@media (hover: none), (max-width: 900px) { .cursor { display: none } }
body.cursor-on, body.cursor-on * { cursor: none }
body.cursor-on a, body.cursor-on button, body.cursor-on [role="button"] { cursor: none }

/* ══ MOTION PREFERENCES ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .grain { animation: none }
  [data-reveal], .detail-inner > *, .detail-inner section { opacity: 1 !important }
  .cursor { display: none }
}
