:root {
  --scheme: light;
  --page: #F7F7F2; --ink: #111111; --meta: #55565A; --field: #315BEF;
  --mark: #F7F7F2; --soft: #8EA4FF; --deep: #2146C7; --dark: #111111;
  --accent: #315BEF; --night: #111111; --line: rgba(17, 17, 17, 0.14);
  --footer-bg: #111111; --on-footer: #F7F7F2; --foot-accent: #8EA4FF;
  --solid-bg: #315BEF; --solid-fg: #F7F7F2; --solid-hover: #2146C7;
  --t-a: #2146C7; --t-b: #8EA4FF; --t-c: #111111; --t-d: #315BEF;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(20px, 5.6vw, 80px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --scheme: dark;
    --page: #1B1621; --ink: #F4EFF4; --meta: #B4A9B8; --field: #251E2D;
    --mark: #EAA5DD; --soft: #7E5C7C; --deep: #F2B7E8; --dark: #120E16;
    --accent: #EAA5DD; --night: #120E16; --line: rgba(244, 239, 244, 0.16);
    --footer-bg: #EAA5DD; --on-footer: #211B27; --foot-accent: #6B2F60;
    --solid-bg: #EAA5DD; --solid-fg: #211B27; --solid-hover: #F2B7E8;
    --t-a: #EAA5DD; --t-b: #7E5C7C; --t-c: #F4EFF4; --t-d: #C27BB5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --scheme: dark;
  --page: #1B1621; --ink: #F4EFF4; --meta: #B4A9B8; --field: #251E2D;
  --mark: #EAA5DD; --soft: #7E5C7C; --deep: #F2B7E8; --dark: #120E16;
  --accent: #EAA5DD; --night: #120E16; --line: rgba(244, 239, 244, 0.16);
  --footer-bg: #EAA5DD; --on-footer: #211B27; --foot-accent: #6B2F60;
  --solid-bg: #EAA5DD; --solid-fg: #211B27; --solid-hover: #F2B7E8;
  --t-a: #EAA5DD; --t-b: #7E5C7C; --t-c: #F4EFF4; --t-d: #C27BB5;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* paper grain: a whisper of printed texture over everything */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
canvas { display: block; width: 100%; height: 100%; }
img { max-width: 100%; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 200; background: var(--page); padding: 8px 12px; }

.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--meta); }
.serif { font-family: var(--serif); font-weight: 400; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: 72px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-links a { text-decoration: none; }
.nav-links a:not(.btn-line):hover { color: var(--deep); }
.btn-line { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border: 1px solid var(--ink); text-decoration: none; }
.btn-line:hover { background: var(--ink); color: var(--page); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 700fr) minmax(0, 740fr); min-height: min(860px, calc(100svh - 72px)); }
.hero-copy { padding: clamp(32px, 4vw, 56px) clamp(24px, 4.4vw, 64px) clamp(32px, 4vw, 56px) var(--gutter); display: flex; flex-direction: column; justify-content: space-between; gap: 56px; }
.hero-main { display: flex; flex-direction: column; gap: 32px; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(84px, 11.4vw, 168px); line-height: 0.88; letter-spacing: -0.03em; }
.lede { margin: 0; max-width: 38ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; height: 52px; padding: 0 26px; font-size: 15px; font-weight: 500; text-decoration: none; }
.btn-solid { background: var(--solid-bg); color: var(--solid-fg); }
.btn-solid:hover { background: var(--solid-hover); }
.btn-ghost { border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--page); }
.index { display: flex; flex-direction: column; gap: 14px; }
.index-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; font-family: var(--mono); font-size: 13px; }
.index-grid a { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 28px; }
.index-grid a:hover { color: var(--deep); }
.hero-art { position: relative; background: var(--field); min-height: 420px; overflow: hidden; }
.hero-art canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: pan-y; }
.fig { position: absolute; left: 24px; bottom: 20px; background: var(--field); padding: 6px 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mark); pointer-events: none; }

/* ---------- work ---------- */
.work { padding: clamp(96px, 11vw, 160px) var(--gutter) clamp(80px, 8vw, 120px); display: flex; flex-direction: column; gap: 64px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 5.6vw, 80px); line-height: 1; letter-spacing: -0.02em; }
.work-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 96px; }
.card { display: flex; flex-direction: column; gap: 20px; text-decoration: none; }
.card.span-7 { grid-column: span 7; }
.card.span-5 { grid-column: span 5; }
.card.drop { padding-top: 120px; }
.card-art { height: clamp(300px, 29vw, 420px); border: 1px solid var(--line); overflow: hidden; }
.card-art canvas { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-art canvas { transform: scale(1.025); }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.card h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 2.8vw, 40px); line-height: 1.1; }
.card .meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--meta); }
.card p { margin: 0; max-width: 52ch; }
.card .more { font-size: 15px; font-weight: 500; color: var(--deep); text-decoration: underline; text-underline-offset: 5px; }

/* ---------- about ---------- */
.about { margin: 0 var(--gutter); padding: clamp(80px, 8vw, 120px) 0 clamp(96px, 10vw, 140px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 72px; }
.about .label { grid-column: 1 / span 3; padding-top: 14px; }
.about-text { grid-column: 4 / span 8; margin: 0; font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1.2; letter-spacing: -0.01em; }
.facts { grid-column: 4 / span 9; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.fact { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--ink); padding-top: 16px; }
.fact .label { font-size: 11px; padding: 0; }
.fact span:last-child { font-size: 18px; }

/* ---------- footer ---------- */
.band { height: 112px; }
.footer { background: var(--footer-bg); color: var(--on-footer); padding: clamp(64px, 6vw, 88px) var(--gutter) 40px; display: flex; flex-direction: column; gap: clamp(72px, 9vw, 140px); }
.footer h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(60px, 9.2vw, 132px); line-height: 0.95; letter-spacing: -0.025em; }
.email { display: inline-block; margin-top: 36px; font-family: var(--serif); font-size: clamp(28px, 3vw, 44px); color: var(--foot-accent); text-underline-offset: 8px; text-decoration-thickness: 1px; }
.email:hover { color: var(--on-footer); }
.foot-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.socials { display: flex; gap: 32px; flex-wrap: wrap; }
.socials a { text-decoration: none; }
.socials a:hover { color: var(--foot-accent); }

/* ---------- case study ---------- */
.cs-hero { height: clamp(360px, 52vw, 640px); position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.cs-head { padding: clamp(56px, 7vw, 96px) var(--gutter) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; }
.cs-head .back { grid-column: 1 / -1; }
.cs-head h1 { grid-column: 1 / span 8; margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 8vw, 120px); line-height: 0.95; letter-spacing: -0.025em; }
.cs-head .summary { grid-column: 1 / span 7; margin: 0; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; }
.cs-meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cs-body { padding: clamp(72px, 8vw, 120px) var(--gutter); display: flex; flex-direction: column; gap: clamp(72px, 8vw, 112px); }
.cs-block { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 20px; }
.cs-block .label { grid-column: 1 / span 3; padding-top: 10px; }
.cs-block .copy { grid-column: 4 / span 7; }
.cs-block .copy p { margin: 0 0 1em; font-size: 18px; line-height: 1.65; }
.cs-block .copy p.big { font-family: var(--serif); font-size: clamp(28px, 2.6vw, 36px); line-height: 1.25; }
.figure { grid-column: 1 / -1; aspect-ratio: 16 / 9; border: 1px solid var(--line); background-image: radial-gradient(var(--line) 1px, transparent 1.2px); background-size: 12px 12px; display: flex; align-items: center; justify-content: center; }
.figure.half { grid-column: span 6; aspect-ratio: 4 / 5; }
.figure span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--meta); background: var(--page); padding: 6px 10px; }
.next { display: flex; flex-direction: column; gap: 12px; padding: clamp(56px, 6vw, 80px) var(--gutter); border-top: 1px solid var(--line); text-decoration: none; }
.next .serif { font-size: clamp(44px, 6vw, 88px); line-height: 1; letter-spacing: -0.02em; }
.next:hover .serif { color: var(--deep); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: -1; height: min(92vw, 560px); }
  .hero-copy { padding-top: 40px; }
  .work-grid { row-gap: 72px; }
  .card.span-7, .card.span-5 { grid-column: 1 / -1; }
  .card.drop { padding-top: 0; }
  .about .label, .about-text, .facts { grid-column: 1 / -1; }
  .about { row-gap: 40px; }
  .cs-head h1, .cs-head .summary, .cs-block .label, .cs-block .copy { grid-column: 1 / -1; }
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav-links a:not(.btn-line) { display: none; }
  .index-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .figure.half { grid-column: 1 / -1; }
  .band { height: 80px; }
}

/* ---------- interactions ---------- */
.field { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.dissolve { position: absolute; pointer-events: none; }
.hero h1 { will-change: opacity; }
.play-btn {
  position: absolute; right: 20px; top: 20px; z-index: 2; height: 40px; padding: 0 16px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--field); color: var(--mark); border: 1px solid var(--mark); cursor: pointer;
}
.play-btn:hover, .play-btn[aria-pressed="true"] { background: var(--mark); color: var(--field); }
.play-btn:focus-visible { outline-color: var(--mark); }
.hero-art.playing .fig { display: none; }
.band canvas { cursor: cell; touch-action: none; user-select: none; -webkit-user-select: none; }
.hint { color: var(--foot-accent); text-transform: none; letter-spacing: 0.02em; }
.hint kbd { font: inherit; border: 1px solid currentColor; padding: 1px 6px; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.linkbtn:hover { color: var(--foot-accent); }

/* snake dialog */
.snake-dialog { border: 1px solid var(--ink); padding: 0; background: var(--page); color: var(--ink); width: min(620px, calc(100vw - 32px)); max-width: none; }
.snake-dialog::backdrop { background: rgba(17, 17, 17, 0.55); }
.game-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.game-bar button { height: 36px; padding: 0 14px; border: 1px solid var(--ink); background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; color: inherit; }
.game-bar button:hover { background: var(--ink); color: var(--page); }
.snake-canvas { width: 100%; height: auto; aspect-ratio: 28 / 18; touch-action: none; }
.game-foot { padding: 12px 18px; font-family: var(--mono); font-size: 12px; color: var(--meta); white-space: pre; }

/* play page and 404 */
.play-head { padding: clamp(56px, 7vw, 96px) var(--gutter) 40px; display: flex; flex-direction: column; gap: 20px; max-width: 900px; }
.play-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 8vw, 120px); line-height: 0.95; letter-spacing: -0.025em; }
.play-head p { margin: 0; max-width: 52ch; font-size: 18px; }
.stitch { padding: 0 var(--gutter) clamp(80px, 8vw, 120px); display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.hoop { border: 1px solid var(--ink); padding: 14px; background: var(--page); }
.hoop canvas { touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.side { display: flex; flex-direction: column; gap: 32px; }
.threads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.thread { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); background: none; color: var(--ink); font: 400 14px var(--sans); text-align: left; cursor: pointer; }
.thread[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.thread .swatch { width: 22px; height: 22px; flex-shrink: 0; }
.thread .key { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--meta); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.stats .fact span:last-child { font-size: 22px; font-family: var(--serif); }
.msg { min-height: 1.6em; font-size: 16px; color: var(--deep); margin: 0; }
.more-games { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 24px; }
.inline-snake { margin: 0 var(--gutter) clamp(80px, 8vw, 120px); max-width: 720px; border: 1px solid var(--ink); }
@media (max-width: 900px) { .stitch { grid-template-columns: 1fr; } }
.dissolve { z-index: 0; }
.hero-main > :not(h1):not(.dissolve) { position: relative; z-index: 1; }

/* ---------- voice agent ---------- */
.voice { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: calc(100vw - 40px); }
.voice-pill { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 10px; background: var(--solid-bg); color: var(--solid-fg); border: 0; cursor: pointer; font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; box-shadow: 0 0 0 1px var(--page), 0 0 0 2px var(--ink); }
.voice-pill:hover { background: var(--solid-hover); }
.voice-pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.voice-icon { width: 32px; height: 32px; }
.voice-pill .short { display: none; }
.voice-bar { display: none; align-items: center; gap: 12px; width: 420px; max-width: 100%; height: 68px; padding: 10px; background: var(--page); border: 1px solid var(--ink); }
.voice-orb { width: 48px; height: 48px; flex-shrink: 0; }
.voice-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.voice-status { font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--meta); }
.voice-wave { width: 100%; height: 28px; }
.voice-time { font: 500 15px/1 var(--mono); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.voice-end { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; background: var(--ink); color: var(--page); border: 0; cursor: pointer; }
.voice-end:hover { background: var(--accent); }
.voice-caption { display: none; margin: 0; width: 420px; max-width: 100%; padding: 12px 14px; background: var(--page); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.voice-note-wrap { display: none; position: relative; width: 360px; max-width: 100%; }
.voice-note { padding: 14px 40px 14px 16px; background: var(--page); border: 1px solid var(--ink); font-size: 14px; line-height: 1.5; }
.voice-note a { color: var(--deep); font-weight: 500; }
.voice-dismiss { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--ink); }
.voice[data-state="connecting"] .voice-pill, .voice[data-state="live"] .voice-pill, .voice[data-state="ended"] .voice-pill { display: none; }
.voice[data-state="connecting"] .voice-bar, .voice[data-state="live"] .voice-bar, .voice[data-state="ended"] .voice-bar { display: flex; }
.voice[data-state="live"] .voice-caption:not(:empty) { display: block; }
.voice[data-state="ended"] .voice-wave, .voice[data-state="ended"] .voice-end { visibility: hidden; }
.voice[data-state="error"] .voice-note-wrap { display: block; }
.footer { padding-bottom: 136px; }
@media (max-width: 640px) {
  .voice { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .voice-pill .full { display: none; } .voice-pill .short { display: inline; }
  .voice-pill { height: 48px; padding-right: 16px; }
  .voice-bar, .voice-caption { width: calc(100vw - 24px); }
}

/* ---------- portrait ---------- */
.about-side { grid-column: 1 / span 3; grid-row: span 2; display: flex; flex-direction: column; gap: 20px; }
.about-side > .label { padding-top: 14px; }
.about .about-side .label { grid-column: auto; }
.portrait { border: 1px solid var(--line); background: var(--field); }
.portrait canvas { height: auto; cursor: crosshair; }
.portrait-toggle { align-self: flex-start; height: 40px; padding: 0 16px; border: 1px solid var(--ink); background: none; color: var(--ink); font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.portrait-toggle:hover, .portrait-toggle[aria-pressed="true"] { background: var(--ink); color: var(--page); }
@media (max-width: 1000px) { .about-side { grid-column: 1 / -1; grid-row: auto; } .portrait { max-width: 340px; } }

/* ---------- resume ---------- */
.resume-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
.jobs { display: flex; flex-direction: column; gap: 48px; }
.job-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; border-top: 1px solid var(--ink); padding-top: 16px; }
.job-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.2vw, 32px); line-height: 1.15; }
.job-head .meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--meta); }
.job ul { margin: 16px 0 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 10px; }
.job li { font-size: 17px; line-height: 1.6; }
.job li::marker { color: var(--accent); }
.skills { display: flex; flex-direction: column; gap: 28px; }
.skill { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.skill p { margin: 0 !important; }

/* ---------- page transitions (browsers that support cross-document view transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 0.55s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- print (resume and case studies) ---------- */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; font-size: 12px; }
  body::after, .field, .nav, .voice, .band, .footer, .snake-dialog, .resume-links, .back, .next { display: none !important; }
  .cs-head, .cs-body { padding: 0 !important; }
  .cs-body { gap: 24px !important; margin-top: 24px; }
  .cs-head h1 { font-size: 44px; }
  .cs-block .copy p.big { font-size: 18px; }
  .job li { font-size: 12.5px; }
  .job-head h3 { font-size: 20px; }
  .jobs { gap: 20px; }
  .job, .skill, .job-head { break-inside: avoid; }
}
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .contact-line { grid-column: 1 / -1; margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--meta); }
  .cs-head { row-gap: 10px !important; }
  .cs-head h1 { font-size: 40px; }
  .cs-head .summary { font-size: 14px; }
  .cs-body { gap: 18px !important; margin-top: 18px; }
  .cs-block { row-gap: 8px !important; }
  .cs-block .copy p.big { font-size: 15px; line-height: 1.45; }
  .jobs { gap: 14px; }
  .job ul { margin-top: 8px; gap: 4px; }
  .job li { font-size: 11.5px; line-height: 1.5; }
  .job-head { padding-top: 8px; }
  .job-head h3 { font-size: 17px; }
  .skills { gap: 10px; }
  .skill { padding-top: 8px; gap: 4px; }
  .skill p { font-size: 11.5px !important; line-height: 1.5 !important; }
}

/* ---------- theme toggle and dark-mode touches ---------- */
.theme-toggle { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { display: block; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
  :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; opacity: 0.035; }
}
:root[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: 0.035; }
.thread .swatch .sym { mix-blend-mode: difference; }
@media (max-width: 640px) { .theme-toggle { width: 40px; height: 40px; } }
@media print {
  :root:root:not([data-print-x]) { --page: #FFFFFF; --ink: #111111; --meta: #55565A; --line: rgba(17,17,17,0.14); --accent: #315BEF; --deep: #2146C7; color-scheme: light; }
}

/* ---------- Sprout the mascot ---------- */
.sprout { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 58; padding: 8px 8px 6px; background: var(--page); border: 1px solid var(--line); cursor: pointer; line-height: 0; }
.sprout:hover { border-color: var(--ink); }
.sprout canvas { image-rendering: pixelated; }
.sprout:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sprout.hop { animation: sprout-hop .5s steps(4) 1; }
.sprout.hop3 { animation: sprout-hop .5s steps(4) 3; }
@keyframes sprout-hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-9px); } 70% { transform: translateY(-3px); } }
.sprout-bubble { position: fixed; left: max(84px, calc(env(safe-area-inset-left) + 84px)); bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px)); z-index: 58; max-width: 230px; padding: 10px 12px; background: var(--page); color: var(--ink); border: 1px solid var(--ink); font: 500 12px/1.45 var(--mono); letter-spacing: 0.02em; transition: opacity .3s; pointer-events: none; }
.sprout-bubble::after { content: ""; position: absolute; left: -7px; bottom: 10px; width: 10px; height: 10px; background: var(--page); border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: rotate(45deg); }
.sprout-bubble.out { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .sprout.hop, .sprout.hop3 { animation: none; } }
@media (max-width: 640px) { .sprout-bubble { left: 66px; bottom: 60px; max-width: 180px; font-size: 11px; } }
@media print { .sprout, .sprout-bubble { display: none !important; } }

/* ---------- pixel cursor ---------- */
html.has-cursor.cursor-on:not(.cursor-native), html.has-cursor.cursor-on:not(.cursor-native) * { cursor: none !important; }
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .2s; }
html.cursor-on:not(.cursor-native) .cursor-dot, html.cursor-on:not(.cursor-native) .cursor-ring { opacity: 1; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring { --c: var(--ink); width: 28px; height: 28px; margin: -14px 0 0 -14px; }
html.cursor-footer .cursor-ring { --c: var(--on-footer); }
html.cursor-footer .cursor-dot { background: var(--foot-accent); }
.cursor-ring::before { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--c); transition: inset .18s steps(3), opacity .15s; }
.cursor-ring i { position: absolute; width: 8px; height: 8px; border: 0 solid var(--c); opacity: 0; transition: opacity .15s, inset .18s steps(3); }
.cursor-ring i:nth-child(1) { left: -8px; top: -8px; border-top-width: 2px; border-left-width: 2px; }
.cursor-ring i:nth-child(2) { right: -8px; top: -8px; border-top-width: 2px; border-right-width: 2px; }
.cursor-ring i:nth-child(3) { left: -8px; bottom: -8px; border-bottom-width: 2px; border-left-width: 2px; }
.cursor-ring i:nth-child(4) { right: -8px; bottom: -8px; border-bottom-width: 2px; border-right-width: 2px; }
/* links and buttons: the square opens into viewfinder brackets */
.cursor-ring[data-mode="link"]::before { opacity: 0; }
.cursor-ring[data-mode="link"] i { opacity: 1; }
.cursor-dot[data-mode="link"] { opacity: 0 !important; }
/* interactive art: a pixel crosshair */
.cursor-ring[data-mode="cross"]::before { inset: 13px -2px; border: 0; background: var(--c); }
.cursor-ring[data-mode="cross"]::after { content: ""; position: absolute; inset: -2px 13px; background: var(--c); }
.hero-art .cursor-ring, .cursor-ring[data-mode="cross"] { }
.cursor-dot[data-mode="cross"] { opacity: 0 !important; }
/* during Breakout the paddle is the cursor */
.cursor-ring[data-mode="hide"], .cursor-dot[data-mode="hide"] { opacity: 0 !important; }
.cursor-ring.down::before { inset: 5px; }
.cursor-ring.down i { opacity: .6; }
.cursor-bit { position: fixed; z-index: 9999; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--accent); pointer-events: none; animation: cursor-bit .42s steps(5) forwards; }
@keyframes cursor-bit { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@media print { .cursor-dot, .cursor-ring, .cursor-bit { display: none !important; } }

/* ---------- secret Ember palette (unlocked by collecting every sticker) ---------- */
:root[data-theme="ember"] {
  --scheme: dark;
  --page: #2B0B02; --ink: #FBEBDD; --meta: #D9A98C; --field: #3A1306;
  --mark: #FF6A1A; --soft: #8A3A14; --deep: #FF8A45; --dark: #1E0701;
  --accent: #FF6A1A; --night: #1E0701; --line: rgba(251, 235, 221, 0.16);
  --footer-bg: #FF6A1A; --on-footer: #2B0B02; --foot-accent: #6B1E00;
  --solid-bg: #FF6A1A; --solid-fg: #2B0B02; --solid-hover: #FF8A45;
  --t-a: #FF6A1A; --t-b: #8A3A14; --t-c: #FBEBDD; --t-d: #F04A0B;
  color-scheme: dark;
}
:root[data-theme="ember"] body::after { mix-blend-mode: screen; opacity: 0.035; }
:root[data-theme="ember"] .theme-toggle .sun { display: none; }
:root[data-theme="ember"] .theme-toggle .moon { display: block; }

/* sound toggle */
[data-sound-toggle] .mute { display: block; } [data-sound-toggle] .waves { display: none; }
[data-sound-toggle][aria-pressed="true"] .mute { display: none; } [data-sound-toggle][aria-pressed="true"] .waves { display: block; }
.nav-links { gap: clamp(14px, 2.4vw, 40px); }

/* toast */
.toast { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--page); color: var(--ink); border: 1px solid var(--ink); padding: 12px 16px; font: 500 12px/1.5 var(--mono); letter-spacing: 0.02em; transition: opacity .3s; max-width: calc(100vw - 32px); }
.toast.out { opacity: 0; }
.toast-body { display: flex; align-items: center; gap: 14px; }
.toast-body svg { color: var(--accent); flex-shrink: 0; }
.toast b { font-weight: 500; color: var(--accent); }

/* sticker sheet and help */
.sheet { border: 1px solid var(--ink); padding: 0; background: var(--page); color: var(--ink); width: min(640px, calc(100vw - 32px)); max-width: none; }
.sheet::backdrop { background: rgba(17, 17, 17, 0.55); }
.stickers { list-style: none; margin: 0; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sticker { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px dashed var(--line); color: var(--meta); }
.sticker svg { opacity: 0.25; }
.sticker.have { border: 1px solid var(--ink); color: var(--ink); }
.sticker.have svg { opacity: 1; color: var(--accent); }
.st-name { font: 500 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.st-hint { font-size: 13px; line-height: 1.4; }
.sheet-foot { margin: 0; padding: 0 20px 20px; font: 12px/1.5 var(--mono); color: var(--meta); }
.keys { margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.keys div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.keys dt { margin: 0; font: 13px var(--mono); } .keys dd { margin: 0; }
.keys kbd, .hint kbd { font: 500 12px var(--mono); border: 1px solid currentColor; padding: 2px 7px; }

/* konami curtain, stitch mode, screensaver */
.curtain { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 9000; pointer-events: none; }
html.stitch-mode .hero h1, html.stitch-mode .section-head h2, html.stitch-mode .footer h2 { text-decoration: underline wavy var(--accent); text-underline-offset: 12px; text-decoration-thickness: 2px; }
.saver { position: fixed; inset: 0; z-index: 8000; transition: opacity .3s; }
.saver canvas { width: 100%; height: 100%; }
.saver.out { opacity: 0; }

/* shared garden */
.garden { display: flex; flex-direction: column; gap: 10px; margin-top: -24px; }
.garden canvas { width: 100%; height: 30px; }
.garden-text { margin: 0; font: 500 12px/1.4 var(--mono); letter-spacing: 0.04em; color: var(--foot-accent); }
@media print { .toast, .sheet, .saver, .curtain { display: none !important; } }
.btn-line { white-space: nowrap; }
.cta-short { display: none; }
@media (max-width: 640px) {
  .nav-links { gap: 8px; }
  .btn-line { padding: 0 14px; height: 40px; }
  .cta-full { display: none; } .cta-short { display: inline; }
}

/* ---------- experience ---------- */
.experience { padding: 0 var(--gutter) clamp(96px, 10vw, 140px); display: flex; flex-direction: column; gap: 48px; }
.xp { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.xp-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 10px; align-items: baseline; padding: 28px 0; border-top: 1px solid var(--line); position: relative; }
.xp-row::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--ink); transition: width .5s steps(12); }
.xp-row:hover::before { width: 100%; }
.xp-dates { grid-column: 1 / span 3; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--meta); }
.xp-now { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.xp-now i { width: 8px; height: 8px; background: var(--accent); animation: xp-blink 1.2s steps(1) infinite; }
@keyframes xp-blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .xp-now i { animation: none; } .xp-row::before { transition: none; } }
.xp-role { grid-column: 4 / span 4; display: flex; flex-direction: column; gap: 4px; }
.xp-role h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1; }
.xp-co { font-size: 16px; color: var(--meta); }
.xp-text { grid-column: 8 / span 5; margin: 0; font-size: 16px; line-height: 1.6; }
.xp-edu .xp-text { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--meta); }
@media (max-width: 1000px) {
  .xp-dates, .xp-role, .xp-text { grid-column: 1 / -1; }
  .xp-row { padding: 22px 0; }
}
section[id], footer[id] { scroll-margin-top: 88px; }

/* ---------- rich case study blocks ---------- */
:root { --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Noto Sans Devanagari", serif; --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Devanagari", sans-serif; }
.pull { grid-column: 4 / span 8; margin: 0; font-family: var(--serif); font-size: clamp(40px, 5vw, 72px); line-height: 1.05; letter-spacing: -0.02em; color: var(--accent); }
.pull::before { content: "“"; } .pull::after { content: "”"; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ticks li { position: relative; padding-left: 26px; font-size: 18px; line-height: 1.55; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 9px; height: 9px; background: var(--accent); }
.hier { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 32px; align-items: center; margin: 12px 0 28px; }
.mock { aspect-ratio: 4 / 5; border: 1px solid var(--ink); padding: 14px; display: grid; grid-template-rows: 2.2fr 1.6fr 0.9fr 0.6fr; gap: 10px; background-image: radial-gradient(var(--line) 1px, transparent 1.2px); background-size: 10px 10px; }
.mock > div { display: flex; align-items: center; justify-content: center; font: 500 12px var(--mono); }
.m1 { background: var(--accent); color: var(--page); font-size: 22px !important; }
.m2 { width: 62%; justify-self: center; border: 1.5px solid var(--accent); color: var(--accent); }
.m3 { flex-direction: column; gap: 6px; align-items: stretch !important; } .m3 i { height: 5px; background: var(--meta); opacity: .5; } .m3 i:last-child { width: 60%; }
.m4 { width: 44%; justify-self: center; background: var(--ink); color: var(--page); }
.tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tiers li { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.tier-n { grid-row: span 2; width: 28px; height: 28px; display: grid; place-items: center; background: var(--ink); color: var(--page); font: 500 12px var(--mono); }
.tiers li:first-child .tier-n { background: var(--accent); }
.tier-t { font-family: var(--serif); font-size: 24px; line-height: 1.15; }
.tier-d { font-size: 15px; color: var(--meta); }
.figs { row-gap: 24px !important; }
.figs .figure { grid-column: span 6; aspect-ratio: 4 / 3; }
.figs .figure.third { grid-column: span 4; aspect-ratio: 4 / 5; }
.figs .figure.full { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.fig-cap { grid-column: 1 / -1; margin: 0; font: 12px/1.5 var(--mono); color: var(--meta); }
.chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 8px 14px; border: 1px solid var(--ink); font: 500 13px var(--mono); letter-spacing: 0.04em; }
.process { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.process li { flex: 1 1 110px; padding: 14px 14px 14px 0; border-top: 2px solid var(--ink); font-size: 16px; display: flex; flex-direction: column; gap: 6px; }
.process li span { font: 500 11px var(--mono); color: var(--accent); letter-spacing: 0.1em; }
.stat { margin: 0 0 16px !important; display: flex; flex-direction: column; gap: 6px; }
.stat-v { font-family: var(--serif); font-size: clamp(56px, 8vw, 112px); line-height: 0.95; letter-spacing: -0.02em; color: var(--accent); }
.stat-u { font: 500 13px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--meta); }
@media (max-width: 1000px) {
  .pull { grid-column: 1 / -1; }
  .hier { grid-template-columns: 1fr; } .mock { max-width: 220px; }
  .figs .figure, .figs .figure.third { grid-column: 1 / -1; }
}

/* compare, scale, decisions */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cmp { border: 1px solid var(--ink); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.cmp:first-child { background: var(--accent); color: var(--page); border-color: var(--accent); }
.cmp-day { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: .8; }
.cmp h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; }
.cmp-mood { font: 500 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.cmp p { margin: 6px 0 0 !important; font-size: 16px !important; }
.scale { list-style: none; margin: 8px 0 28px; padding: 0; }
.scale li { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.sc-sq { width: calc(12px + 40px * var(--s)); height: calc(12px + 40px * var(--s)); background: var(--accent); justify-self: center;
  background-image: radial-gradient(var(--page) 1px, transparent 1.4px); background-size: 6px 6px; }
.sc-t { font-family: var(--serif); font-size: 22px; line-height: 1.15; }
.sc-d { font-size: 14px; color: var(--meta); }
.decisions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.decisions li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.dc-n { font: 500 13px var(--mono); color: var(--accent); padding-top: 8px; }
.decisions h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.decisions p { margin: 0 !important; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } .scale li { grid-template-columns: 52px 1fr; } .sc-d { grid-column: 2; } }
.team { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; }
.team a { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 28px; line-height: 1.1; text-decoration: none; }
.team li:last-child a { border-bottom: 1px solid var(--line); }
.tm-mark { width: 12px; height: 12px; background: var(--accent); flex-shrink: 0; }
.tm-go { margin-left: auto; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--meta); }
.team a:hover .tm-go { color: var(--accent); }
.team a:hover { color: var(--deep); }
.team-note { font-size: 15px !important; color: var(--meta); }
.cs-meta:has(.fact:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cs-meta:has(.fact:nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }



/* ---------- project reels ---------- */
.reel { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 64px); z-index: 57; }
.reel-mini { display: block; position: relative; width: 150px; aspect-ratio: 9 / 16; padding: 0; border: 1px solid var(--ink); background: var(--field); cursor: pointer; overflow: hidden; box-shadow: 6px 6px 0 var(--accent); transition: transform .2s steps(3), box-shadow .2s steps(3); }
.reel-mini:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--accent); }
.reel-mini video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-tag { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 6px; justify-content: center; padding: 6px 4px; background: var(--page); color: var(--ink); font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.rt-sound { width: 10px; height: 10px; background: currentColor; clip-path: polygon(0 30%, 30% 30%, 70% 0, 70% 100%, 30% 70%, 0 70%); }
.reel-hide { position: absolute; top: -12px; left: -12px; width: 28px; height: 28px; border: 1px solid var(--ink); background: var(--page); color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer; }
.reel.still .reel-mini::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: 22px solid var(--page); border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.reel-watch { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 52px; padding: 10px 22px 10px 14px; text-align: left; border: 1px solid var(--ink); background: none; color: var(--ink); font: 500 15px var(--sans); cursor: pointer; }
.reel-watch:hover { background: var(--ink); color: var(--page); }
.rw-icon { width: 26px; height: 26px; background: var(--accent); clip-path: polygon(30% 20%, 80% 50%, 30% 80%); }
.rw-sub { font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--meta); }
.reel-watch:hover .rw-sub { color: inherit; }
.reel-dialog { padding: 0; border: 1px solid var(--ink); background: #000; width: min(430px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); }
.reel-dialog::backdrop { background: rgba(10, 8, 12, 0.82); }
.rp { display: flex; flex-direction: column; }
.rp video { width: 100%; aspect-ratio: 9 / 16; max-height: calc(100vh - 90px); object-fit: contain; background: #000; display: block; cursor: pointer; }
.rp video::cue { font: 500 15px/1.4 var(--sans); background: rgba(0,0,0,.72); color: #fff; }
.rp-bar { display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--page); color: var(--ink); }
.rp-btn { height: 36px; min-width: 36px; display: grid; place-items: center; border: 1px solid var(--ink); background: none; color: inherit; cursor: pointer; padding: 0 8px; }
.rp-btn:hover { background: var(--ink); color: var(--page); }
.rp-txt { font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.rp-txt[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.rp-ico { width: 12px; height: 12px; background: currentColor; clip-path: polygon(15% 0, 100% 50%, 15% 100%); }
[data-rp-play][data-state="playing"] .rp-ico { clip-path: polygon(0 0, 38% 0, 38% 100%, 0 100%, 0 0, 62% 0, 100% 0, 100% 100%, 62% 100%, 62% 0); }
.rp-track { flex: 1; height: 12px; border: 1px solid var(--ink); cursor: pointer; background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 6px); touch-action: none; }
.rp-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-fill { height: 100%; width: 0; background: var(--accent); }
.rp-time { font: 500 11px var(--mono); font-variant-numeric: tabular-nums; min-width: 78px; text-align: center; }
@media (max-width: 640px) {
  .reel { right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 58px); }
  .reel-mini { width: 96px; box-shadow: 4px 4px 0 var(--accent); }
  .reel-tag { font-size: 8px; padding: 4px 2px; }
  .rp-time { display: none; }
}
@media print { .reel, .reel-dialog { display: none !important; } }
.play-link { grid-column: 1 / -1; justify-self: start; gap: 10px; }
.numbers { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.num { display: flex; flex-direction: column; gap: 8px; padding: 26px 20px 26px 0; }
.num + .num { border-left: 1px solid var(--line); padding-left: 20px; }
.num-v { font-family: var(--serif); font-size: clamp(52px, 6vw, 88px); line-height: 0.95; letter-spacing: -0.02em; color: var(--accent); }
.num-l { font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--meta); max-width: 22ch; }
@media (max-width: 800px) {
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .num:nth-child(3) { border-left: 0; padding-left: 0; }
  .num:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.figure.has-img { display: block; aspect-ratio: auto !important; border: 0; background: none; margin: 0; }
.figure.has-img img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--field); }
.figure.has-img figcaption { margin-top: 10px; font: 12px/1.5 var(--mono); color: var(--meta); }
.tbl-wrap { overflow-x: auto; margin-bottom: 16px; }
.ctrl { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 15px; }
.ctrl th, .ctrl td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-top: 1px solid var(--line); }
.ctrl thead th { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--meta); border-top: 1px solid var(--ink); }
.ctrl tbody th { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.ctrl td:first-of-type { color: var(--ink); }
.annot { margin: 0; }
.annot-img { position: relative; }
.annot-img img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.pin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: var(--page); font: 500 13px var(--mono); box-shadow: 0 0 0 3px var(--page); }
.annot-legend { list-style: none; margin: 18px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.annot-legend li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.pin-n { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; background: var(--accent); color: var(--page); font: 500 11px var(--mono); }
.annot figcaption { margin-top: 8px; font: 12px/1.5 var(--mono); color: var(--meta); }
@media (max-width: 640px) { .pin { width: 22px; height: 22px; font-size: 11px; } .annot-legend { grid-template-columns: 1fr; } }
.tall-imgs { grid-column: 4 / span 5; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tall-imgs img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.tall-notes { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 16px; }
.tall-notes .ticks li { font-size: 16px; }
@media (max-width: 1000px) { .tall-imgs, .tall-notes { grid-column: 1 / -1; } }
.phones { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); margin-top: 16px; }
.phone { margin: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.phone-frame { width: 100%; max-width: 320px; padding: 8px; border: 0; border-radius: 30px; background: var(--accent); }
.phone-frame img { display: block; width: 100%; height: auto; border-radius: 21px; aspect-ratio: 716 / 1340; object-fit: cover; object-position: top; }
.phone figcaption { font: 12px/1.5 var(--mono); color: var(--meta); text-align: center; max-width: 30ch; }
@media (max-width: 800px) { .phones { grid-template-columns: 1fr; } .phone-frame { max-width: 300px; } }
.film { grid-column: 4 / -1; margin: 0; }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.film figcaption { margin-top: 10px; font: 12px/1.5 var(--mono); color: var(--meta); }
@media (max-width: 1000px) { .film { grid-column: 1 / -1; } }
.hero-role { margin: 0; }

/* voice button: negative colours whenever it floats over the matching footer */
.voice.over-footer .voice-pill { background: var(--on-footer); color: var(--footer-bg); box-shadow: 0 0 0 1px var(--footer-bg), 0 0 0 2px var(--on-footer); }
.voice.over-footer .voice-pill:hover { background: var(--on-footer); opacity: .9; }

/* Snake arrows: shown on touch screens only */
.snake-pad { display: none; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 8px; justify-content: center; padding: 16px 0 6px; }
.snake-pad button { display: grid; place-items: center; border: 1px solid var(--ink); background: var(--page); color: var(--ink); touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.snake-pad button:active { background: var(--accent); color: var(--page); border-color: var(--accent); }
.snake-pad button span { width: 18px; height: 18px; background: currentColor; clip-path: polygon(50% 8%, 100% 80%, 0 80%); }
.snake-pad .sp-up { grid-column: 2; grid-row: 1; }
.snake-pad .sp-left { grid-column: 1; grid-row: 2; } .snake-pad .sp-left span { transform: rotate(-90deg); }
.snake-pad .sp-down { grid-column: 2; grid-row: 2; } .snake-pad .sp-down span { transform: rotate(180deg); }
.snake-pad .sp-right { grid-column: 3; grid-row: 2; } .snake-pad .sp-right span { transform: rotate(90deg); }
@media (pointer: coarse) { .snake-pad { display: grid; } .snake-dialog { max-height: calc(100vh - 24px); overflow: auto; } }
@media (pointer: coarse) { .inline-snake { margin-bottom: 190px; } }

/* offline voice assistant */
.voice-chips { display: none; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 420px; }
.voice.local[data-state="live"] .voice-chips { display: flex; }
.voice-chips button { padding: 8px 12px; border: 1px solid var(--ink); background: var(--page); color: var(--ink); font: 500 12px var(--sans); cursor: pointer; }
.voice-chips button:hover { background: var(--ink); color: var(--page); }
.voice.local .voice-status::after { content: "  /  quick assistant"; opacity: .7; }
@media (max-width: 640px) { .voice-chips { max-width: calc(100vw - 24px); } }
.voice-privacy { display: none; margin: 0; max-width: 420px; text-align: right; font: 11px/1.4 var(--mono); color: var(--meta); }
.voice[data-state="live"] .voice-privacy, .voice[data-state="connecting"] .voice-privacy { display: block; }
.voice.over-footer .voice-privacy { color: var(--on-footer); }
.phone { display: inline-block; margin-top: 14px; font-family: var(--serif); font-size: clamp(22px, 2.2vw, 32px); color: var(--foot-accent); text-underline-offset: 6px; text-decoration-thickness: 1px; }
.phone:hover { color: var(--on-footer); }
.footer .email + .phone { display: block; width: fit-content; }
