/* Vishal Raj — portfolio
   Tokens first; everything else reads from them. */
:root {
  --bg: #f3f0ea;
  --bg-2: #ebe7df;
  --surface: #fbfaf7;
  --ink: #141312;
  --ink-2: #3b3936;
  --muted: #6f6b64;
  --line: rgba(20, 19, 18, .12);
  --line-2: rgba(20, 19, 18, .22);
  --accent: #e8461c;
  --accent-ink: #fff;
  --accent-soft: rgba(232, 70, 28, .12);
  --ok: #1f8a4c;
  --violet: #7b5cff;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 20px 50px -24px rgba(30, 20, 10, .28);
  --viz-bg: #ece8e0;
  --viz-ink: #2a2826;

  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 1360px;
  --radius: 22px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0c; --bg-2: #141413; --surface: #171715; --ink: #f2efe9; --ink-2: #cfcac2; --muted: #8f8a82;
    --line: rgba(242, 239, 233, .1); --line-2: rgba(242, 239, 233, .2);
    --accent: #ff6a3d; --accent-ink: #120a06; --accent-soft: rgba(255, 106, 61, .14); --ok: #3ccf7a; --violet: #9d86ff;
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -30px rgba(0,0,0,.8);
    --viz-bg: #1d1d1b; --viz-ink: #e9e5de;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0c; --bg-2: #141413; --surface: #171715; --ink: #f2efe9; --ink-2: #cfcac2; --muted: #8f8a82;
  --line: rgba(242, 239, 233, .1); --line-2: rgba(242, 239, 233, .2);
  --accent: #ff6a3d; --accent-ink: #120a06; --accent-soft: rgba(255, 106, 61, .14); --ok: #3ccf7a; --violet: #9d86ff;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -30px rgba(0,0,0,.8);
  --viz-bg: #1d1d1b; --viz-ink: #e9e5de;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
code { font: .88em var(--mono); background: var(--accent-soft); padding: .1em .35em; border-radius: 5px; }
kbd { font: 500 .72rem var(--mono); padding: .1rem .38rem; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--ink-2); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.shell { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: fixed; z-index: 1000; left: 1rem; top: -4rem; padding: .7rem 1rem; border-radius: 10px; background: var(--ink); color: var(--bg); transition: top .2s; }
.skip-link:focus { top: 1rem; }

.progress { position: fixed; z-index: 120; inset: 0 0 auto; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 46px; padding: 0 1.15rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: transparent;
  font: 500 .95rem var(--sans); white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn-light { border-color: rgba(255,255,255,.25); color: #f2efe9; }
.btn-light:hover { background: #f2efe9; color: #0d0d0c; border-color: #f2efe9; }
.btn.copied .copy-label::before { content: "✓ "; color: var(--ok); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.chip {
  min-height: 38px; padding: 0 .95rem; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; font: 500 .86rem var(--sans); color: var(--ink-2);
  transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; z-index: 100; top: .75rem; left: 50%; transform: translateX(-50%);
  width: calc(100% - 1.5rem); max-width: calc(var(--max) - 2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .45rem .5rem .45rem .6rem;
  border: 1px solid transparent; border-radius: 999px;
  transition: background .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), transform .45s var(--ease-out);
}
.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.35);
}
.nav.hide { transform: translate(-50%, -140%); }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 600; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font: 600 .78rem var(--mono); letter-spacing: -.04em;
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.nav-links { display: flex; gap: .2rem; }
.nav-links a { position: relative; padding: .5rem .8rem; border-radius: 999px; font-size: .92rem; color: var(--ink-2); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--ink); background: var(--line); }
.nav-links a.current { color: var(--ink); }
.nav-links a.current::after { content: ""; position: absolute; left: 50%; bottom: .15rem; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.nav-tools { display: flex; align-items: center; gap: .4rem; }
.kbd-btn {
  display: inline-flex; align-items: center; gap: .6rem; height: 40px; padding: 0 .55rem 0 .9rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .88rem;
  transition: border-color .2s, color .2s;
}
.kbd-btn:hover { border-color: var(--line-2); color: var(--ink); }
.menu-btn { display: none; }

.mobile-menu {
  position: fixed; z-index: 90; inset: 0; padding: 6rem var(--gutter) 2rem;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--bg);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu:not([hidden]) { animation: fadeIn .35s var(--ease-out); }
.mobile-menu a { display: flex; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font: 500 clamp(2.2rem, 10vw, 3.4rem)/1.1 var(--sans); letter-spacing: -.045em; }
.mobile-menu a span { font: .75rem var(--mono); color: var(--accent); letter-spacing: 0; }
.mobile-menu p { font: .85rem var(--mono); color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(6.5rem, 12vh, 8.5rem); padding-bottom: clamp(2.5rem, 6vh, 4rem); }
.hero-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem 2rem; margin-bottom: clamp(1.5rem, 4vh, 3rem); }
.status, .clock { font: 500 .8rem var(--mono); color: var(--ink-2); letter-spacing: -.01em; }
.status { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .85rem .45rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--ok); opacity: 0; animation: ping 2.2s var(--ease-out) infinite; }
.clock { align-self: center; color: var(--muted); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 27vw, 380px); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.hero-title { font: 600 clamp(4.2rem, 15.5vw, 13.5rem)/.82 var(--sans); letter-spacing: -.065em; margin-left: -.06em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line:last-child { padding-bottom: .2em; margin-bottom: -.14em; }
.hero-title .line > span { display: inline-block; }
.hero-title em { font-size: 1.08em; letter-spacing: -.02em; color: var(--accent); padding-right: .04em; }
.hero-sup { display: inline-block; vertical-align: top; margin: .9em 0 0 .6em; padding: .35rem .6rem; border: 1px solid var(--line-2); border-radius: 999px; font: 500 clamp(.7rem, 1vw, .82rem) var(--mono); letter-spacing: 0; color: var(--muted); transform: rotate(-4deg); }
.hero-lede { max-width: 40rem; margin-top: clamp(1.5rem, 4vh, 2.5rem); font-size: clamp(1.08rem, 1.5vw, 1.32rem); line-height: 1.55; color: var(--ink-2); letter-spacing: -.012em; }
.hero-lede strong { font-weight: 500; color: var(--ink); background: linear-gradient(transparent 62%, var(--accent-soft) 62%); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }

.hero-card { position: relative; margin: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: .55rem; transform: rotate(1.5deg); transition: transform .6s var(--ease-out); }
.hero-card:hover { transform: rotate(0deg) translateY(-4px); }
.hero-photo { position: relative; aspect-ratio: 4 / 4.4; overflow: hidden; border-radius: calc(var(--radius) - 8px); background: var(--bg-2); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.04); transition: transform 1.2s var(--ease-out); }
.hero-card:hover .hero-photo img { transform: scale(1); }
.scope { position: relative; margin-top: .55rem; border-radius: calc(var(--radius) - 10px); background: #0f0f0e; overflow: hidden; height: 92px; }
.scope canvas { display: block; width: 100%; height: 100%; }
.scope-meta { position: absolute; inset: .5rem .7rem auto; display: flex; justify-content: space-between; font: 500 .62rem var(--mono); color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }
.hero-card figcaption { display: flex; justify-content: space-between; padding: .7rem .45rem .2rem; font: 500 .72rem var(--mono); color: var(--muted); }

.hero-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(2.5rem, 6vh, 4.5rem) 0 0; border-top: 1px solid var(--line); }
.hero-facts > div { padding: 1.1rem 1.25rem 0 0; }
.hero-facts > div + div { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.hero-facts dt { font: 500 .72rem var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }
.hero-facts dd { margin: 0; font-size: .95rem; line-height: 1.45; color: var(--ink-2); }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding: 1.05rem 0; -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; align-items: center; gap: 1.6rem; width: max-content; animation: marquee 48s linear infinite; font: 400 clamp(1.4rem, 2.6vw, 2.2rem)/1 var(--serif); font-style: italic; white-space: nowrap; color: var(--ink-2); }
.ticker-track i { font-style: normal; font-size: .6em; color: var(--accent); }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* ---------- Numbers ---------- */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding-block: clamp(3rem, 8vh, 5.5rem); }
.num { padding: .5rem 1.25rem .5rem 0; }
.num + .num { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.num b { display: block; font: 500 clamp(2.6rem, 5.2vw, 4.6rem)/1 var(--sans); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.num span { display: block; max-width: 15rem; margin-top: .7rem; font-size: .92rem; line-height: 1.45; color: var(--muted); }

/* ---------- Section heads ---------- */
.sec-head { display: grid; gap: 1.1rem; margin-bottom: clamp(2rem, 5vh, 3.25rem); }
.sec-head-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); align-items: start; gap: 1.5rem 3rem; }
.sec-head-row .sec-label { margin-top: .9rem; }
.sec-label { display: inline-flex; align-items: center; gap: .7rem; font: 500 .78rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sec-label span { display: inline-grid; place-items: center; min-width: 2rem; height: 1.45rem; padding: 0 .4rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .7rem; letter-spacing: 0; }
.sec-head h2, .contact-title { font: 500 clamp(2.3rem, 5.4vw, 4.7rem)/.98 var(--sans); letter-spacing: -.05em; max-width: 18ch; text-wrap: balance; }
.sec-head h2 em, .contact-title em { color: var(--accent); }
.sec-sub { max-width: 38rem; font-size: 1.05rem; color: var(--muted); }

/* ---------- Work ---------- */
.work { padding-top: clamp(3rem, 8vh, 6rem); }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem; }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(.75rem, 1.4vw, 1.1rem); }
.c-wide { grid-column: span 7; } .c-narrow { grid-column: span 5; } .c-third { grid-column: span 4; } .c-half { grid-column: span 6; }
.bento.filtered .card { grid-column: span 6; }
.card[hidden] { display: none; }

.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; isolation: isolate;
  transition: border-color .35s var(--ease), transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.card:hover::after { opacity: 1; }
.card-viz { position: relative; height: clamp(190px, 20vw, 250px); margin: .5rem .5rem 0; border-radius: calc(var(--radius) - 8px); background: var(--viz-bg); overflow: hidden; color: var(--viz-ink); }
.card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.2rem 1.35rem 1.4rem; flex: 1; }
.card-kicker { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card h3 { font: 600 clamp(1.3rem, 1.9vw, 1.65rem)/1.12 var(--sans); letter-spacing: -.035em; }
.card h3::after { content: " →"; display: inline-block; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: all .35s var(--ease-out); }
.card:hover h3::after, .card:focus-visible h3::after { opacity: 1; transform: none; }
.card-body > p:not(.card-kicker) { color: var(--ink-2); font-size: .97rem; line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .5rem; }
.tags li { padding: .22rem .6rem; border: 1px solid var(--line); border-radius: 999px; font: 500 .72rem var(--mono); color: var(--muted); }
.viz-hint { position: absolute; left: .85rem; bottom: .7rem; font: 500 .66rem var(--mono); color: var(--muted); pointer-events: none; }

/* viz: IoT radar */
.viz-iot svg { width: 100%; height: 100%; }
.viz-iot .rings circle { fill: none; stroke: currentColor; stroke-opacity: .12; stroke-dasharray: 3 5; }
.viz-iot .sweep { fill: var(--accent); opacity: .14; transform-origin: 200px 110px; animation: spin 5s linear infinite; }
.viz-iot .links path { stroke: currentColor; stroke-opacity: .25; stroke-dasharray: 4 4; animation: dash 1.6s linear infinite; fill: none; }
.viz-iot .nodes circle { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; }
.viz-iot .nodes .hub { fill: var(--ink); }
.viz-iot .nodes .flag { fill: var(--accent); stroke: var(--accent); animation: blink 1.4s steps(2) infinite; }
.viz-iot .labels text { font: 500 10px var(--mono); fill: currentColor; opacity: .55; }

/* viz: AES pipeline */
.viz-aes { display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; padding: 1.25rem; }
.pipe { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.pipe span {
  display: grid; place-items: center; aspect-ratio: .55; border-radius: 6px; border: 1px solid var(--line-2);
  font: 500 .66rem var(--mono); color: var(--muted); position: relative; overflow: hidden;
  animation: stage 2.2s var(--ease) infinite; animation-delay: calc(var(--i) * .12s);
}
.pipe span:nth-child(1){--i:0}.pipe span:nth-child(2){--i:1}.pipe span:nth-child(3){--i:2}.pipe span:nth-child(4){--i:3}.pipe span:nth-child(5){--i:4}.pipe span:nth-child(6){--i:5}.pipe span:nth-child(7){--i:6}.pipe span:nth-child(8){--i:7}.pipe span:nth-child(9){--i:8}.pipe span:nth-child(10){--i:9}.pipe span:nth-child(11){--i:10}
.pipe-cap { font: 500 .68rem var(--mono); color: var(--muted); text-align: center; }

/* viz: canvas fields */
.viz-field canvas, .viz-particles canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* viz: attention heatmap */
.viz-gene { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: .4rem .6rem; padding: 1.1rem 1.2rem .9rem; }
.attn { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(50, 1fr); grid-template-rows: repeat(5, 1fr); gap: 2px; }
.attn i { border-radius: 2px; background: var(--accent); opacity: calc(.06 + var(--a) * .94); transition: opacity .6s var(--ease), transform .3s; }
.attn-marks { grid-column: 1; grid-row: 1; display: grid; grid-template-rows: repeat(5, 1fr); align-items: center; font: 500 .6rem var(--mono); color: var(--muted); text-align: right; }
.attn-axis { grid-column: 2; grid-row: 2; display: flex; justify-content: space-between; font: 500 .6rem var(--mono); color: var(--muted); }

/* viz: hex */
.viz-hex { padding: 1rem 1.1rem; }
.viz-hex pre { margin: 0; font: 500 clamp(.62rem, .82vw, .74rem)/1.75 var(--mono); color: var(--viz-ink); white-space: pre; overflow: hidden; }
.viz-hex .o { color: var(--muted); }
.viz-hex .d { color: var(--muted); opacity: .8; }
.viz-hex mark { background: var(--accent); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; }
.scanline { position: absolute; left: 0; right: 0; height: 36px; top: -40px; background: linear-gradient(transparent, var(--accent-soft), transparent); animation: scan 3.2s var(--ease) infinite; }

/* viz: terminal */
.viz-term { background: #121211; color: #e9e5de; padding: 1rem 1.1rem; }
.viz-term pre { margin: 0; font: 500 clamp(.62rem, .82vw, .74rem)/1.7 var(--mono); white-space: pre; overflow: hidden; }
.viz-term .p { color: var(--accent); } .viz-term .m { color: #8f8a82; } .viz-term .a { color: #3ccf7a; }
.viz-term i { display: inline-block; height: .55em; width: calc(var(--w) * .55); max-width: 9ch; margin-right: .6em; background: #e9e5de; border-radius: 2px; vertical-align: middle; transform-origin: left; animation: grow 1.4s var(--ease-out) both; }
.card:not(.in) .viz-term i { animation-play-state: paused; }

/* viz: plot */
.viz-plot svg { width: 100%; height: 100%; padding: .4rem; }
.viz-plot .grid path { stroke: currentColor; stroke-opacity: .12; fill: none; }
.viz-plot .pts circle { fill: currentColor; opacity: .45; }
.viz-plot .nn { fill: none; stroke: currentColor; stroke-opacity: .5; stroke-width: 1.5; stroke-dasharray: 5 5; }
.viz-plot .phys { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 1.8s var(--ease-out) .2s; }
.card.in .viz-plot .phys { stroke-dashoffset: 0; }
.viz-plot .legend text { font: 500 9px var(--mono); fill: currentColor; opacity: .6; }

/* viz: practice heatmap */
.viz-heat { display: grid; place-items: center; padding: 1rem 1rem 2rem; }
.heat { display: grid; grid-template-columns: repeat(16, 1fr); grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; width: min(100%, 420px); aspect-ratio: 16 / 7; }
.heat i { border-radius: 3px; background: var(--accent); opacity: calc(.08 + var(--a) * .92); }

/* Archive */
.archive { margin-top: clamp(3.5rem, 8vh, 5.5rem); }
.archive-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ink); }
.archive-head h3 { font: 500 clamp(1.6rem, 2.6vw, 2.1rem)/1 var(--sans); letter-spacing: -.04em; }
.archive-head p { color: var(--muted); font-size: .95rem; }
.archive-list li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 9rem 2.5rem; align-items: center; gap: 1rem; padding: 1rem .25rem; border-bottom: 1px solid var(--line); transition: background .25s, padding .35s var(--ease-out); }
.archive-list li:hover { background: var(--surface); padding-inline: .9rem; }
.a-year { font: 500 .8rem var(--mono); color: var(--muted); }
.a-name { font-weight: 500; font-size: 1.04rem; letter-spacing: -.015em; }
.a-name small { display: block; margin-top: .1rem; font-weight: 400; font-size: .88rem; color: var(--muted); letter-spacing: 0; }
.a-tag { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.a-link { justify-self: end; }
.a-link a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); transition: all .25s; }
.a-link a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- OSS ---------- */
.oss { padding-top: clamp(5rem, 12vh, 8rem); }
.oss-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.75rem, 1.4vw, 1.1rem); }
.pr { display: flex; flex-direction: column; gap: .8rem; min-height: 230px; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .45s var(--ease-out), border-color .3s, box-shadow .45s; }
.pr:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.pr-state { display: inline-flex; align-items: center; gap: .4rem; align-self: flex-start; padding: .3rem .7rem; border-radius: 999px; font: 600 .74rem var(--sans); color: #fff; }
.pr-state svg { width: 14px; height: 14px; fill: currentColor; }
.pr-state.merged { background: #8250df; } .pr-state.open { background: #1f883d; }
.pr-repo { font: 500 .8rem var(--mono); color: var(--muted); }
.pr-repo i { font-style: normal; color: var(--ink-2); }
.pr-title { font: 500 1.12rem/1.35 var(--sans); letter-spacing: -.02em; }
.pr-meta { margin-top: auto; display: flex; justify-content: space-between; font: 500 .74rem var(--mono); color: var(--muted); }
.pr-meta i { font-style: normal; color: var(--accent); }
.pr-more { background: transparent; border-style: dashed; }

/* ---------- About ---------- */
.about { padding-top: clamp(5rem, 12vh, 8rem); }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about-photo { position: sticky; top: 6rem; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.about-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-tag { position: absolute; left: .8rem; bottom: .8rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(15,15,14,.7); color: #f2efe9; font: 500 .72rem var(--mono); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.about-statement { font: 500 clamp(1.7rem, 3.3vw, 2.85rem)/1.12 var(--sans); letter-spacing: -.04em; text-wrap: balance; }
.about-statement em { color: var(--accent); }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; color: var(--ink-2); font-size: 1.02rem; }
.toolkit { display: grid; grid-template-columns: 1fr 1fr; margin-top: 2.5rem; border-top: 1px solid var(--line); }
.toolkit > div { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--line); }
.toolkit > div:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
.toolkit h3 { font: 500 .72rem var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .45rem; }
.toolkit p { font-size: .95rem; color: var(--ink-2); }

.edu { margin-top: clamp(4rem, 10vh, 6rem); }
.edu-title { font: 500 clamp(1.6rem, 2.6vw, 2.1rem)/1 var(--sans); letter-spacing: -.04em; padding-bottom: 1rem; border-bottom: 1px solid var(--ink); }
.edu-list li { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.edu-year { font: 500 .8rem var(--mono); color: var(--muted); }
.edu-name { display: flex; flex-direction: column; color: var(--muted); font-size: .92rem; }
.edu-name b { color: var(--ink); font-weight: 500; font-size: 1.08rem; letter-spacing: -.015em; }
.edu-score { font: 500 clamp(1.1rem, 2vw, 1.5rem) var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.courses { margin-top: 2rem; }
.courses-label { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .8rem; }
.courses ul { display: flex; flex-wrap: wrap; gap: .45rem; }
.courses li { padding: .45rem .85rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }

/* ---------- Experience ---------- */
.exp { padding-top: clamp(5rem, 12vh, 8rem); }
.timeline { border-top: 1px solid var(--ink); }
.timeline li { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 8rem; gap: 1.5rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -1rem; top: 1.9rem; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .3s; }
.timeline li:hover::before { opacity: 1; }
.timeline time { font: 500 .8rem/1.9 var(--mono); color: var(--muted); }
.timeline h3 { font: 500 clamp(1.15rem, 1.8vw, 1.45rem)/1.25 var(--sans); letter-spacing: -.03em; }
.timeline h3 span { color: var(--muted); font-weight: 400; }
.timeline p { margin-top: .45rem; max-width: 46rem; color: var(--ink-2); }
.t-tag { justify-self: end; align-self: start; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line-2); font: 500 .7rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Music (always dark) ---------- */
.music {
  --m-bg: #0e0d0c; --m-ink: #f2efe9; --m-muted: #8f8a82; --m-line: rgba(242,239,233,.1);
  margin-top: clamp(5rem, 12vh, 8rem); padding-block: clamp(4.5rem, 11vh, 7rem);
  background: radial-gradient(900px 500px at 85% 0%, rgba(255,106,61,.16), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(123,92,255,.14), transparent 60%), var(--m-bg);
  color: var(--m-ink);
}
.music .sec-label { color: var(--m-muted); }
.music .sec-label span { background: var(--m-ink); color: var(--m-bg); }
.music .sec-head h2 { font-size: clamp(2.8rem, 7.5vw, 6.6rem); }
.music .sec-head h2 em { color: #ff6a3d; }
.music .sec-sub { color: var(--m-muted); }
.music-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.stage { position: sticky; top: 6rem; }
.vinyl {
  position: absolute; z-index: 0; top: 8%; right: -14%; width: 76%; aspect-ratio: 1; border-radius: 50%;
  background: repeating-radial-gradient(circle, #1a1918 0 2px, #0b0b0a 2px 4px);
  box-shadow: 0 30px 60px -20px #000; animation: spin 7s linear infinite; animation-play-state: paused;
}
.stage.playing .vinyl { animation-play-state: running; }
.vinyl-label { position: absolute; inset: 33%; display: grid; place-content: center; border-radius: 50%; background: #ff6a3d; color: #120a06; font: 600 .9rem/1.1 var(--sans); text-align: center; }
.vinyl-label small { display: block; font: 500 .55rem var(--mono); }
.stage-frame { position: relative; z-index: 1; width: 82%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; box-shadow: 0 40px 80px -30px #000; background: #1a1918; }
.stage-img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s, transform .6s var(--ease-out); }
.stage-img.swap { opacity: 0; transform: scale(1.04); }
.stage-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem 1.1rem 1rem; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.stage-meta b { display: block; font: 500 1.4rem/1.1 var(--sans); letter-spacing: -.03em; }
.stage-meta small { font: 500 .74rem var(--mono); color: rgba(255,255,255,.7); }
.eq { position: absolute; top: 1rem; right: 1rem; display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 3px; height: 30%; background: #ff6a3d; border-radius: 2px; animation: eq 1s var(--ease) infinite alternate; animation-play-state: paused; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; } .eq i:nth-child(5) { animation-delay: -.45s; }
.stage.playing .eq i { animation-play-state: running; }
.stage-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.6rem 0 0; border-top: 1px solid var(--m-line); }
.stage-stats div { padding: .9rem .5rem 0 0; }
.stage-stats dt { font: 500 .66rem var(--mono); color: var(--m-muted); text-transform: uppercase; letter-spacing: .05em; }
.stage-stats dd { margin: .2rem 0 0; font: 500 1.35rem var(--sans); letter-spacing: -.03em; }

.tracks { border-top: 1px solid var(--m-line); }
.tracks a { position: relative; display: grid; grid-template-columns: 2.2rem 48px minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: .8rem .5rem; border-bottom: 1px solid var(--m-line); transition: background .25s, padding .35s var(--ease-out); }
.tracks a::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: calc(var(--w) * 1%); background: #ff6a3d; opacity: .55; }
.tracks a:hover, .tracks a.active { background: rgba(255,255,255,.04); padding-inline: 1rem; }
.t-no { font: 500 .78rem var(--mono); color: var(--m-muted); }
.tracks img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.t-text b { display: block; font-weight: 500; font-size: 1.05rem; letter-spacing: -.02em; }
.t-text small { color: var(--m-muted); font-size: .85rem; }
.t-plays { display: inline-flex; align-items: center; gap: .5rem; font: 500 .8rem var(--mono); color: var(--m-ink); font-variant-numeric: tabular-nums; }
.t-plays i { width: 7px; height: 7px; border-radius: 50%; background: #ff6a3d; }
.music-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; font: 500 .74rem var(--mono); color: var(--m-muted); }
.music-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.music :focus-visible { outline-color: #ff6a3d; }

/* ---------- Frames ---------- */
.frames { padding-top: clamp(5rem, 12vh, 8rem); }
.frames-sub { grid-column: 2; }
.frames-hint { font: 500 .74rem var(--mono); color: var(--accent); white-space: nowrap; margin-left: .4rem; }
.reel {
  display: flex; gap: clamp(.6rem, 1.2vw, 1rem); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 1rem;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.reel::-webkit-scrollbar { display: none; }
.reel.dragging { cursor: grabbing; scroll-snap-type: none; }
.reel.dragging .frame { pointer-events: none; }
.frame { position: relative; flex: 0 0 auto; height: clamp(320px, 52vh, 520px); max-height: 520px; aspect-ratio: 3 / 5; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); scroll-snap-align: start; cursor: zoom-in; }
.frame.f-wide { aspect-ratio: 2.5 / 1; }
.frame.f-mid { aspect-ratio: 5 / 4; }
.frame picture, .frame img { width: 100%; height: 100%; }
.frame img { object-fit: cover; transition: transform 1s var(--ease-out); -webkit-user-drag: none; user-select: none; }
.frame:hover img { transform: scale(1.04); }
.cap { position: absolute; left: .7rem; bottom: .7rem; display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .75rem; border-radius: 999px; background: rgba(15,15,14,.66); color: #f2efe9; font: 500 .78rem var(--sans); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-align: left; }
.cap i { font: 500 .66rem var(--mono); font-style: normal; color: #ff6a3d; }

/* ---------- Contact ---------- */
.contact { padding-top: clamp(6rem, 14vh, 10rem); padding-bottom: clamp(3rem, 8vh, 5rem); }
.contact .sec-label { margin-bottom: 1.4rem; }
.contact-title { max-width: 20ch; font-size: clamp(2.5rem, 6.4vw, 5.8rem); }
.contact-row { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: clamp(2rem, 5vh, 3rem); }
.mail { display: inline-flex; align-items: center; gap: .6rem; font: 500 clamp(1.4rem, 3.6vw, 2.8rem)/1.1 var(--sans); letter-spacing: -.04em; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; padding-bottom: .2rem; transition: background-size .5s var(--ease-out); overflow-wrap: anywhere; }
.mail:hover { background-size: 100% 2px; }
.mail span { color: var(--accent); font-size: .7em; }
.socials { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: clamp(3rem, 8vh, 4.5rem); border-top: 1px solid var(--line); }
.socials a { display: flex; flex-direction: column; gap: .15rem; padding: 1.1rem 1rem 1.1rem 0; transition: color .25s; }
.socials li + li a { padding-left: 1rem; border-left: 1px solid var(--line); }
.socials span { font-weight: 500; font-size: 1.02rem; }
.socials span::after { content: " ↗"; color: var(--accent); opacity: 0; transition: opacity .25s; }
.socials a:hover span::after { opacity: 1; }
.socials small { font: 500 .74rem var(--mono); color: var(--muted); }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem; padding-block: 1.6rem 2.2rem; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ---------- Dialogs ---------- */
dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(8, 8, 7, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .4s var(--ease-out); }
dialog[open]::backdrop { animation: fadeIn .3s var(--ease-out); }
body.locked { overflow: hidden; }

.sheet { width: min(760px, calc(100% - 1.5rem)); margin: auto; }
.sheet-inner { position: relative; max-height: min(86vh, 900px); overflow-y: auto; padding: clamp(1.5rem, 4vw, 2.75rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 40px 100px -30px rgba(0,0,0,.5); }
.sheet-close { position: sticky; float: right; top: 0; margin: -.5rem -.5rem 0 1rem; z-index: 2; }
.sheet h2 { margin: .6rem 0 1rem; font: 600 clamp(1.8rem, 4vw, 2.7rem)/1.02 var(--sans); letter-spacing: -.045em; }
.sheet .tags { margin: 0 0 1.5rem; padding: 0; }
.case-body { color: var(--ink-2); }
.case-body .case-lede { font-size: 1.12rem; line-height: 1.55; color: var(--ink); margin-bottom: 1.4rem; }
.case-body h4 { margin: 1.6rem 0 .6rem; font: 500 .74rem var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.case-body ul { display: grid; gap: .7rem; }
.case-body li { position: relative; padding-left: 1.3rem; line-height: 1.55; }
.case-body li::before { content: ""; position: absolute; left: 0; top: .72em; width: .55rem; height: 2px; border-radius: 2px; background: var(--accent); }
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1.2rem; }
.case-stats div { padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.case-stats b { display: block; font: 600 clamp(1.3rem, 3vw, 1.75rem)/1.05 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.case-stats span { font-size: .8rem; color: var(--muted); }
.case-note { margin-top: 1.4rem; font-size: .88rem; color: var(--muted); }
.case-links { margin-top: 1.6rem; }
.case-links a { display: inline-flex; padding: .6rem 1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: .92rem; overflow-wrap: anywhere; }
.case-links a:hover { background: var(--accent); color: var(--accent-ink); }

.lightbox { width: 100vw; height: 100vh; height: 100dvh; margin: 0; display: none; place-items: center; }
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: rgba(8, 8, 7, .92); }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: .9rem; max-width: calc(100vw - 8rem); }
.lightbox img { max-width: 100%; max-height: 82vh; max-height: 82dvh; border-radius: 14px; object-fit: contain; }
.lightbox figcaption { color: #f2efe9; font: 500 .85rem var(--mono); }
.lightbox .icon-btn { position: fixed; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.palette { width: min(620px, calc(100% - 1.5rem)); margin: 12vh auto auto; }
.palette-box { border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); box-shadow: 0 40px 100px -20px rgba(0,0,0,.5); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.palette-search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.palette-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 1.05rem var(--sans); }
.palette-search input::placeholder { color: var(--muted); }
#palette-list { max-height: min(52vh, 420px); overflow-y: auto; padding: .4rem; }
#palette-list .group { padding: .7rem .7rem .3rem; font: 500 .68rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
#palette-list [role="option"] { display: flex; align-items: center; gap: .75rem; padding: .65rem .7rem; border-radius: 10px; cursor: pointer; font-size: .96rem; }
#palette-list [role="option"] .ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font: 500 .72rem var(--mono); color: var(--muted); flex: none; }
#palette-list [role="option"] small { margin-left: auto; font: 500 .72rem var(--mono); color: var(--muted); }
#palette-list [aria-selected="true"] { background: var(--accent-soft); }
#palette-list [aria-selected="true"] .ic { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#palette-list .empty { padding: 1.5rem; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 1.2rem; padding: .6rem 1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.palette-foot kbd { margin-right: .2rem; }

.toast { position: fixed; z-index: 300; left: 50%; bottom: 1.5rem; transform: translate(-50%, 200%); opacity: 0; padding: .7rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 500; box-shadow: 0 20px 40px -15px rgba(0,0,0,.45); transition: transform .45s var(--ease-out), opacity .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Motion ---------- */
.js .rise { opacity: 0; transform: translateY(28px); }
.js .hero-title .line.rise { opacity: 1; transform: none; }
.js .hero-title .line.rise > span { transform: translateY(105%); }
.js.loaded .rise { opacity: 1; transform: none; transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--d, 0) * 1ms); }
.js.loaded .hero-title .line.rise > span { transform: none; transition: transform 1.2s var(--ease-out); transition-delay: calc(var(--d, 0) * 1ms); }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--d, 0) * 1ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .card.reveal.in:hover { transform: translateY(-4px); transition-delay: 0s; }

@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -16; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes stage { 0%, 60%, 100% { background: transparent; color: var(--muted); border-color: var(--line-2); } 20% { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } }
@keyframes scan { 0% { top: -40px; } 100% { top: 100%; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes eq { to { height: 100%; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .rise, .js .reveal, .js .hero-title .line.rise > span { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-grid; }
  .c-wide, .c-narrow, .c-third, .c-half, .bento.filtered .card { grid-column: span 6; }
  .hero-facts { grid-template-columns: repeat(2, 1fr); }
  .hero-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 1.1rem; }
  .numbers { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
  .num:nth-child(3) { padding-left: 0; border-left: 0; }
  .oss-grid { grid-template-columns: 1fr 1fr; }
  .pr-more { grid-column: span 2; min-height: 0; }
  .socials { grid-template-columns: repeat(3, 1fr); }
  .socials li:nth-child(4) a { padding-left: 0; border-left: 0; }
  .socials li:nth-child(n+4) a { border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 420px; transform: rotate(0); }
  .sec-head-row { grid-template-columns: 1fr; }
  .frames-sub { grid-column: auto; }
  .bento { grid-template-columns: 1fr; }
  .c-wide, .c-narrow, .c-third, .c-half, .bento.filtered .card { grid-column: auto; }
  .about-grid, .music-grid { grid-template-columns: 1fr; }
  .about-photo, .stage { position: relative; top: 0; }
  .about-photo { max-width: 420px; }
  .stage { max-width: 440px; }
  .about-cols { grid-template-columns: 1fr; gap: 1rem; }
  .timeline li { grid-template-columns: 1fr; gap: .4rem; }
  .t-tag { display: none; }
  .archive-list li { grid-template-columns: 3.4rem minmax(0, 1fr) 2.2rem; }
  .a-tag { display: none; }
  .lightbox figure { max-width: calc(100vw - 1.5rem); }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; }
}

@media (max-width: 560px) {
  .kbd-btn { display: none; }
  .brand-name { display: none; }
  .hero-top { flex-direction: column; align-items: flex-start; }
  .clock { align-self: flex-start; }
  .status { font-size: .72rem; }
  .hero-sup { display: block; margin: .8rem 0 0; width: max-content; transform: none; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .hero-title { font-size: 24vw; }
  .hero-facts { grid-template-columns: 1fr; }
  .numbers { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .num:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
  .num b { font-size: 2.4rem; }
  .hero-facts > div, .hero-facts > div + div { padding-left: 0; border-left: 0; }
  .hero-facts > div + div { border-top: 1px solid var(--line); margin-top: 1rem; }
  .num:nth-child(odd) { padding-left: 0; border-left: 0; }
  .oss-grid { grid-template-columns: 1fr; }
  .pr-more { grid-column: auto; }
  .toolkit { grid-template-columns: 1fr; }
  .toolkit > div:nth-child(even) { padding-left: 0; border-left: 0; }
  .edu-list li { grid-template-columns: 1fr auto; }
  .edu-year { grid-column: 1 / -1; }
  .case-stats { grid-template-columns: 1fr; }
  .tracks a { grid-template-columns: 1.6rem 40px minmax(0, 1fr) auto; gap: .7rem; }
  .tracks img { width: 40px; height: 40px; }
  .socials { grid-template-columns: 1fr 1fr; }
  .socials li a, .socials li + li a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .socials li:nth-child(-n+2) a { border-top: 0; }
  .socials li:nth-child(even) a { padding-left: 1rem; border-left: 1px solid var(--line); }
  .frame { height: 58vh; max-height: 440px; }
  .frame.f-wide { aspect-ratio: 1.6 / 1; height: auto; width: 88vw; }
  .foot { flex-direction: column; }
}
