/* ==========================================================================
   Krystyna Ewing — homepage
   One continuous instrument surface: a shared hairline grid, a spine that
   runs the length of the page, engraved seams between sections. The cicada
   is blended into the surface itself; projects float over it as lit panes.
   The workbench is a cutting mat laid on that same surface.
   ========================================================================== */

/* ---------- Tokens ---------- */
/* Palette matches the case study pages: near-black / warm off-white, one lime accent. */
:root {
  --bg: #0B0B0B;
  --room: #0B0B0B;
  --ink: #F2F0E9;
  --ink-2: #c9c7bf;
  --muted: #9a978e;
  --line: rgba(242, 240, 233, .2);
  --line-strong: rgba(242, 240, 233, .34);
  --accent: #A8FF00;
  --accent-rgb: 168, 255, 0;
  --accent-hi: #c8ff5e;
  --accent-side: #4f7a00;
  --on-accent: #0B0B0B;
  --rail-w: 48px;

  --glow-a: rgba(242, 240, 233, .045);
  --glow-b: rgba(168, 255, 0, .025);
  --grid-minor: rgba(242, 240, 233, .022);
  --grid-major: rgba(242, 240, 233, .05);
  --ch-hi: #3a3a38;
  --ch-1: #1d1d1c;
  --ch-2: #141414;
  --ch-lo: #050505;
  --ch-edge: #000;
  --screen-bg: #0B0B0B;
  --led-off: #262624;
  --etch: rgba(242, 240, 233, .5);
  --etch-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 -1px 0 rgba(0, 0, 0, .7);
  --key-1: #2a2a29;
  --key-2: #1a1a19;
  --key-side: #050505;
  --key-ink: #F2F0E9;
  --focus: #A8FF00;
  --drop: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 18px 30px -18px rgba(0, 0, 0, .8);

  --glass: rgba(11, 11, 11, .58);
  --glass-line: rgba(242, 240, 233, .16);
  --axis: rgba(168, 255, 0, .38);
  --plane-glow: rgba(242, 240, 233, .07);
  --pool: rgba(242, 240, 233, .07);
  --ghost: rgba(242, 240, 233, .13);
  --cicada-blend: screen;
  --cicada-filter: saturate(1.08) contrast(1.05);

  --mat: #171716;
  --mat-line: rgba(242, 240, 233, .08);
  --mat-line-major: rgba(242, 240, 233, .17);
  --mat-ink: rgba(242, 240, 233, .5);
  --lamp: rgba(242, 240, 233, .07);
  --paper: #F2F0E9;
  --tape: rgba(236, 232, 214, .72);
  --dymo: #121212;
  --dymo-ink: #F2F0E9;

  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 3.4vw, 48px);
  --side: max(var(--gutter), calc((100% - 1440px) / 2));
  --radius: 14px;
  color-scheme: dark;
}

/* Light theme, as on the case study pages; the cicada prints as an inverted plate. */
:root[data-theme="light"] {
  --bg: #F2F0E9;
  --room: #F2F0E9;
  --ink: #0B0B0B;
  --ink-2: #2e2d29;
  --muted: #5f5c4e;
  --line: rgba(11, 11, 11, .2);
  --line-strong: rgba(11, 11, 11, .34);
  --accent: #447000;
  --accent-rgb: 68, 112, 0;
  --accent-hi: #5c9200;
  --accent-side: #223800;
  --on-accent: #F2F0E9;

  --glow-a: rgba(255, 255, 255, .5);
  --glow-b: rgba(68, 112, 0, .03);
  --grid-minor: rgba(11, 11, 11, .03);
  --grid-major: rgba(11, 11, 11, .065);
  --ch-hi: #ffffff;
  --ch-1: #ebe8de;
  --ch-2: #e4e1d6;
  --ch-lo: #cfcbbd;
  --ch-edge: #b5b1a3;
  --led-off: #cfcbbd;
  --etch: rgba(11, 11, 11, .6);
  --etch-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 -1px 0 rgba(0, 0, 0, .08);
  --key-1: #fbfaf6;
  --key-2: #e4e1d6;
  --key-side: #b5b1a3;
  --key-ink: #0B0B0B;
  --focus: #447000;
  --drop: 0 40px 70px -34px rgba(11, 11, 11, .3), 0 14px 24px -16px rgba(11, 11, 11, .25);
  --glass: rgba(242, 240, 233, .62);
  --glass-line: rgba(11, 11, 11, .18);
  --axis: rgba(68, 112, 0, .5);
  --plane-glow: rgba(11, 11, 11, .1);
  --pool: rgba(255, 255, 255, .6);
  --ghost: rgba(11, 11, 11, .12);
  --cicada-blend: multiply;
  --cicada-filter: invert(1) hue-rotate(180deg) saturate(1.3) contrast(1.08);
  --mat: #262624;
  --lamp: rgba(242, 240, 233, .08);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(70vw 46vw at 72% 6%, var(--glow-a), transparent 70%),
    radial-gradient(60vw 50vw at 18% 58%, var(--glow-b), transparent 70%),
    linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--room);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::after { /* film grain over everything — keeps flat fills from looking digital */
  content: ""; position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background: url("images/grain.png") 0 0 / 120px 120px;
  opacity: .08; mix-blend-mode: overlay;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  padding: 10px 16px; background: var(--accent); color: var(--on-accent);
  font: 600 13px/1 var(--f-mono); text-decoration: none; border-radius: 6px;
  transition: top .2s;
}
.skip:focus { top: 16px; }

/* ---------- Small parts ---------- */
.led {
  display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .5);
}
.led--on, .led--amber {
  background: radial-gradient(circle at 40% 35%, #f3ffd9, var(--accent) 55%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 8px 1px rgba(var(--accent-rgb), .7);
}
.led--on { background: radial-gradient(circle at 40% 35%, #f3ffd9, var(--accent) 55%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 8px 1px rgba(var(--accent-rgb), .55); }

.etch {
  margin: 0; font: 500 11px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--etch); text-shadow: var(--etch-shadow);
}
.etch--small { font-size: 10px; }

/* Engraved tick scale, used wherever a rule needs to read as an instrument. */
.hero__scale {
  flex: 1 1 auto; height: 9px; min-width: 40px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 60px) 0 100% / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) 0 100% / 100% 5px no-repeat;
}

/* Corner registration marks */
.marks::before {
  content: ""; position: absolute; inset: -7px; pointer-events: none;
  --m: var(--line-strong);
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 0 / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 1px 14px no-repeat;
}

/* Buttons: low physical keys */
.btn {
  --b1: var(--key-1); --b2: var(--key-2);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 7px;
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px rgba(0, 0, 0, .55), 0 3px 0 var(--key-side), 0 6px 10px -4px rgba(0, 0, 0, .6);
  color: var(--key-ink);
  font: 600 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active, .btn[aria-expanded="true"] {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(0, 0, 0, .55), 0 1px 0 var(--key-side), 0 2px 4px -2px rgba(0, 0, 0, .6);
}
.btn--primary { --b1: var(--accent-hi); --b2: var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px rgba(0, 0, 0, .55), 0 3px 0 var(--accent-side), 0 6px 14px -4px rgba(var(--accent-rgb), .4); }
.btn--primary:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px rgba(0, 0, 0, .55), 0 1px 0 var(--accent-side); }
.btn--small { min-height: 38px; padding: 0 12px; font-size: 11px; }

/* ---------- Menu: the same rail and mobile bar as the case study pages ---------- */
body { padding-right: var(--rail-w); }
.mono { font-family: "Space Mono", monospace; }
nav[aria-label="Primary"] a[aria-current="true"] { color: var(--accent) !important; box-shadow: inset 3px 0 0 var(--accent); }
.rail-item:hover { letter-spacing: .26em !important; }
nav[aria-label="Primary"] a:hover, #mobileMenu a:hover { color: var(--accent) !important; }
#themeToggle:hover { color: var(--accent) !important; }
#mobileMenu a[aria-current="true"] { color: var(--accent) !important; }
#mobileBar { display: none !important; }
#menuToggle:hover { color: var(--accent) !important; border-color: var(--accent) !important; }
#themeToggleMobile:hover { color: var(--accent) !important; }
#mobileMenu, #mobileMenuBackdrop { display: none; }
@media (max-width: 859px) {
  nav[aria-label="Primary"] { display: none !important; }
  #mobileBar { display: flex !important; }
  body { padding-right: 0; padding-top: 56px; }
  html .section, html .bench, html .case { scroll-margin-top: 72px; } /* clear the fixed 56px bar */
}
@media (min-width: 860px) {
  #mobileMenu, #mobileMenuBackdrop { display: none !important; }
}
html:not(.js) #mobileMenu { display: grid; position: static !important; }

/* ---------- The surface: sections, spine, seams ---------- */
main { position: relative; }
main::before { /* the spine that ties every section together */
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--side) / 2); width: 1px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--line-strong) 4%, var(--line) 96%, transparent);
}
.section { position: relative; padding: clamp(64px, 8vw, 120px) var(--side) 0; scroll-margin-top: 24px; }
.section--seam-only { padding-bottom: clamp(26px, 3vw, 40px); }

.seam { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: clamp(28px, 3.4vw, 48px); }
.seam::before { /* node where the seam meets the spine */
  content: ""; position: absolute; top: 50%; left: calc(var(--side) / -2 - 4px);
  width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--room);
  box-shadow: 0 0 0 3px var(--room);
}
.seam::after { /* lead from the node into the seam */
  content: ""; position: absolute; top: 50%; left: calc(var(--side) / -2 + 8px); width: calc(var(--side) / 2 - 16px); height: 1px;
  background: var(--line-strong);
}
.seam__idx { font: 600 12px/1 var(--f-mono); letter-spacing: .1em; color: var(--accent); }
.seam__title { margin: 0; font: 700 clamp(32px, 3.6vw, 52px)/.9 var(--f-display); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.seam__rule {
  flex: 1 1 auto; height: 9px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) 0 0 / 100% 9px no-repeat;
}

/* ---------- Hero ---------- */
.hero {
  min-height: max(660px, 100vh);
  padding-top: clamp(20px, 2.4vw, 32px);
  display: flex; flex-direction: column;
  overflow-x: clip; /* the cicada bleeds off the right edge; never let it widen the page (iOS ignores body overflow-x) */
}
@supports not (overflow: clip) { .hero { overflow: hidden; } }

/* The cicada is blended into the surface, not framed: its black drops away
   (screen in dark, inverted + multiply in light) and it runs off the right edge. */
.hero__cicada {
  position: absolute; z-index: -1; margin: 0;
  top: clamp(-60px, -3vw, -10px); right: -17vw; width: 114vw;
  transform: translate3d(0, var(--py, 0px), 0) rotate(-7deg);
  transform-origin: 40% 50%;
  mix-blend-mode: var(--cicada-blend);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 24%);
  mask-image: linear-gradient(90deg, transparent 2%, #000 24%);
}
.hero__cicada img {
  width: 100%; height: auto; filter: var(--cicada-filter);
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 97%);
  mask-image: linear-gradient(180deg, #000 58%, transparent 97%);
}
.hero__axis { /* centre line through the body, ticked like a rule */
  position: absolute; left: 14%; right: 3%; top: 50%; height: 9px; margin-top: -4px;
  background:
    linear-gradient(90deg, transparent, var(--axis) 8%, var(--axis) 92%, transparent) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--axis) 0 1px, transparent 1px 22px) 0 50% / 100% 9px no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  opacity: .8;
}
.hero__ring {
  position: absolute; left: 29%; top: 50%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px solid var(--axis); opacity: .55;
}
.hero__ring::after {
  content: ""; position: absolute; inset: 9%; border-radius: 50%;
  border: 1px dashed var(--axis); opacity: .7;
}
.hero__credit {
  position: absolute; right: 23%; top: calc(50% + 12px); margin: 0;
  font: 500 10px/1 var(--f-mono); letter-spacing: .08em; color: var(--axis);
}

.hero__top { display: flex; align-items: center; gap: 18px; }
.hero__top .etch { white-space: nowrap; }
.hero__top .hero__scale { opacity: .7; }

.hero__content {
  margin-top: auto;
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, .85fr);
  gap: 32px clamp(28px, 4vw, 64px); align-items: end;
  padding-top: clamp(140px, 16vw, 260px);
}
.hero__name {
  margin: 0; font: 700 clamp(84px, 12.4vw, 216px)/.8 var(--f-display);
  letter-spacing: -.01em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 0 60px rgba(242, 240, 233, .1), 0 2px 0 rgba(0, 0, 0, .35);
}
.hero__name span { display: block; }
.hero__name span + span { margin-left: .5em; }
.hero__role { margin: 18px 0 0; font: 500 13px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* Glass panel laid over the lower wing */
.deck {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 22px 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--glass-line); border-radius: 4px;
}
.deck::before {
  content: ""; position: absolute; inset: -7px; pointer-events: none;
  --m: var(--line-strong);
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 0 / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 1px 14px no-repeat;
}
.hero__lede { margin: 0; font: 400 clamp(18px, 1.45vw, 21px)/1.45 var(--f-body); color: var(--ink); text-wrap: pretty; }

.spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.spec > div { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.spec > div + div:not(:last-child) { padding-left: 12px; border-left: 1px solid var(--line); }
.spec > div:last-child { grid-column: 1 / -1; }
.spec dt { font: 500 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.spec dd { margin: 0; font: 500 14px/1.3 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.spec a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.spec a:hover { color: var(--accent); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Bio drawer: a second glass sheet that slides open under the hero */
.drawer {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.3, .7, .2, 1);
}
.drawer.is-open { grid-template-rows: 1fr; }
.drawer__inner { overflow: hidden; min-height: 0; }
.js .drawer:not(.is-open) .drawer__inner { visibility: hidden; transition: visibility 0s .45s; }
html:not(.js) .drawer { grid-template-rows: 1fr; }
.drawer__text {
  margin-top: 28px; padding: 26px clamp(20px, 3vw, 40px) 10px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-line); border-left: 2px solid var(--accent); border-radius: 4px;
  columns: 2 300px; column-gap: clamp(24px, 4vw, 56px);
}
.drawer__text p { margin: 0 0 16px; font-size: 17px; line-height: 1.65; color: var(--ink-2); break-inside: avoid; }
.drawer__kicker { font: 600 21px/1.35 var(--f-display) !important; letter-spacing: .02em; text-transform: uppercase; color: var(--accent) !important; }

.hero__strip { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); margin-top: 28px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.indicators { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.indicators li { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- Selected work ---------- */
.console { display: grid; gap: clamp(28px, 3vw, 44px); }

/* Channel tuner: the four projects in a row on a ticked track above the display,
   with a needle that slides along the track to the selection */
.selector { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 14px; }
.selector::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 11px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) 0 10px / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 60px) 0 0 / 100% 11px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) 0 5px / 100% 6px no-repeat;
  opacity: .8;
}
.selector__needle {
  display: none; position: absolute; top: 9px; left: var(--needle-x, 0px); width: var(--needle-w, 25%); height: 3px;
  background: var(--accent); box-shadow: 0 0 12px 1px rgba(var(--accent-rgb), .6);
  transition: left .38s cubic-bezier(.3, .7, .2, 1), width .38s cubic-bezier(.3, .7, .2, 1);
}
.selector[role="tablist"] .selector__needle { display: block; }
.selkey {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: start; column-gap: 14px; row-gap: 5px;
  padding: 18px 34px 20px 16px; text-decoration: none; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  transition: background-color .2s ease, color .2s ease;
}
.selkey + .selkey { border-left: 1px solid var(--line); }
.selkey:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 85%); color: var(--ink); }
.selkey__num { grid-row: 1 / 3; font: 700 34px/1 var(--f-display); color: var(--muted); }
.selkey__name { font: 600 23px/1 var(--f-display); letter-spacing: .03em; text-transform: uppercase; }
.selkey__meta { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.selkey__led { position: absolute; top: 21px; right: 12px; }
.selkey[aria-selected="true"] { color: var(--ink); background: linear-gradient(180deg, rgba(var(--accent-rgb), .12), transparent 90%); }
.selkey[aria-selected="true"] .selkey__num { color: var(--accent); }
.selkey[aria-selected="true"] .selkey__led {
  background: radial-gradient(circle at 40% 35%, #f3ffd9, var(--accent) 55%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 10px 2px rgba(var(--accent-rgb), .65);
}

.cases { display: grid; gap: 64px; min-width: 0; }
.case { display: grid; gap: 26px; min-width: 0; scroll-margin-top: 96px; }

/* The visual floats on the surface: corner marks, a ghost channel number, a light pool. */
.case__visual { position: relative; aspect-ratio: 16 / 7.6; }
.case__visual::before { /* registration marks */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  --m: var(--line-strong);
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 18px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 0 / 1px 18px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 18px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 1px 18px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 18px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 1px 18px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 18px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 1px 18px no-repeat;
}
.case__visual::after { /* light pool on the surface beneath the pane */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -2%; height: 26%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, var(--pool), transparent 72%);
}
.case__ghost {
  position: absolute; left: -.04em; top: -.2em; z-index: 0; pointer-events: none;
  font: 700 clamp(150px, 17vw, 290px)/.8 var(--f-display);
  color: transparent; -webkit-text-stroke: 1px var(--ghost);
}
.plane {
  position: absolute; inset: 5% 3% 10% 7%; z-index: 1;
  transform: perspective(2200px) rotateY(-11deg) rotateX(3deg);
  transform-origin: 20% 50%;
}
.tv {
  position: absolute; inset: 0; overflow: hidden; border-radius: 3px;
  background: var(--screen-bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 60px 90px -34px rgba(0, 0, 0, .9), 0 0 80px -8px var(--plane-glow);
}
.tv::before { /* scanlines */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.tv::after { /* glass sheen */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, .02) 30%, transparent 44%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.screen__pan { position: absolute; inset: 0; }
.screen__pan img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.screen__pan--tall img { object-position: 50% 0%; }
.case:not([hidden]) .screen__pan--tall img { animation: pan-down 26s ease-in-out 1.2s infinite alternate; }
@keyframes pan-down { from { object-position: 50% 0%; } to { object-position: 50% 100%; } }

/* Device renders already have their own hardware; they sit directly on the surface. */
.case__visual--object .plane { inset: 3% 2% 6% 4%; transform: none; }
.case__visual--object .tv { display: grid; place-items: center; overflow: visible; background: none; box-shadow: none; }
.case__visual--object .tv::before, .case__visual--object .tv::after { display: none; }
.case__visual--object .tv img { max-height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 30px 28px rgba(0, 0, 0, .55)); }

/* Channel change: the picture collapses to a line, then blooms back in. */
[data-power].is-powering .tv { animation: power-on .9s cubic-bezier(.2, .7, .2, 1) both; }
[data-power].is-powering .case__ghost { animation: ghost-in .9s ease-out both; }
@keyframes power-on {
  0% { opacity: 0; transform: scaleY(.008) scaleX(.6); filter: brightness(4); }
  35% { opacity: 1; transform: scaleY(.02) scaleX(1); filter: brightness(3); }
  60% { transform: scaleY(1); filter: brightness(1.5); }
  70% { opacity: .75; }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes ghost-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

.case__info {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto;
  grid-template-areas: "meta meta meta" "title dek links" "tag dek links";
  column-gap: clamp(20px, 3vw, 44px); align-items: start;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.case__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0 0 14px; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.case__meta span + span::before { content: "·"; margin: 0 10px; color: var(--line-strong); }
.case__meta span:first-child { color: var(--accent); }
.case__title { grid-area: title; margin: 0; font: 700 clamp(36px, 3.6vw, 56px)/.9 var(--f-display); letter-spacing: .01em; text-transform: uppercase; }
.case__tagline { grid-area: tag; margin: 8px 0 0; font: 500 12.5px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.case__dek { grid-area: dek; margin: 0; max-width: 52ch; font-size: 17px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.case__links { grid-area: links; display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 200px; }
.case__links .btn { justify-content: space-between; }

/* ---------- Workbench: cutting mat ---------- */
.bench { width: min(100% - 2 * var(--gutter), 1440px); margin: 0 auto clamp(28px, 4vw, 56px); scroll-margin-top: 84px; }
.mat {
  position: relative; padding: clamp(46px, 5vw, 64px) clamp(22px, 3.4vw, 52px) clamp(28px, 3vw, 44px) clamp(46px, 5vw, 70px);
  border-radius: 10px;
  background:
    radial-gradient(70% 60% at 30% 10%, var(--lamp), transparent 70%),
    linear-gradient(var(--mat-line-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, var(--mat-line-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(var(--mat-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--mat);
  background-position: 0 0, 46px 46px, 46px 46px, 46px 46px, 46px 46px, 0 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 0 80px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .6), var(--drop);
  overflow: hidden;
}
.mat::before { /* printed 45° guide */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(32deg, transparent calc(50% - .5px), var(--mat-line-major) 50%, transparent calc(50% + .5px));
  opacity: .7;
}
.mat__ruler { position: absolute; color: var(--mat-ink); pointer-events: none; }
.mat__ruler--top {
  left: 46px; right: 0; top: 0; height: 30px;
  background:
    linear-gradient(90deg, var(--mat-ink) 1px, transparent 1px) 0 0 / 120px 16px no-repeat repeat-x,
    linear-gradient(90deg, var(--mat-line-major) 1px, transparent 1px) 0 0 / 24px 9px repeat-x;
  background-repeat: repeat-x;
  border-bottom: 1px solid var(--mat-line-major);
}
.mat__ruler--left {
  top: 46px; bottom: 0; left: 0; width: 30px;
  background:
    linear-gradient(var(--mat-ink) 1px, transparent 1px) 0 0 / 16px 120px repeat-y,
    linear-gradient(var(--mat-line-major) 1px, transparent 1px) 0 0 / 9px 24px repeat-y;
  border-right: 1px solid var(--mat-line-major);
}
.mat__ruler span { position: absolute; font: 500 10px/1 var(--f-mono); color: var(--mat-ink); }
.mat__ruler--top span { top: 17px; transform: translateX(4px); }
.mat__ruler--left span { left: 17px; transform: translateY(3px); }

.bench__head { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 32px; row-gap: 14px; margin-bottom: clamp(22px, 3vw, 36px); }
.bench__title { margin: 0; font: 700 clamp(40px, 5vw, 76px)/.86 var(--f-display); text-transform: uppercase; letter-spacing: .01em; color: #eef3ee; }
.bench__intro { margin: 0 0 4px; font: 500 italic clamp(17px, 1.5vw, 21px)/1.3 var(--f-body); color: rgba(238, 243, 238, .82); }
.labels { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 0; padding: 0; list-style: none; }
.labels li { /* embossed label-maker tape */
  padding: 6px 10px 5px; border-radius: 2px;
  background: linear-gradient(180deg, #1d1d1d, var(--dymo) 50%, #0a0a0a);
  color: var(--dymo-ink); font: 600 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .9), 0 -1px 0 rgba(255, 255, 255, .25);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: rotate(var(--lr, -.6deg));
}
.labels li:nth-child(2) { --lr: .8deg; }
.labels li:nth-child(3) { --lr: -1.2deg; }
.labels li:nth-child(4) { --lr: .4deg; }
.labels li:nth-child(5) { --lr: -.3deg; }
.bench__hint { position: absolute; right: 0; top: 0; margin: 0; font: 500 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mat-ink); }

.spread { position: relative; aspect-ratio: 16 / 9.6; }
.print {
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  display: block; padding: 6px 6px 0; margin: 0;
  border: 0; border-radius: 2px; background: #f7f5ef; cursor: grab; text-align: left;
  transform: rotate(var(--r)); transform-origin: 50% 40%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 10px 18px -6px rgba(0, 0, 0, .55), 0 26px 40px -24px rgba(0, 0, 0, .6);
  transition: box-shadow .2s ease, transform .2s ease;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.print::before { /* strip of tape */
  content: ""; position: absolute; top: -10px; left: 50%; width: 46%; max-width: 90px; height: 20px;
  transform: translateX(-50%) rotate(calc(var(--r) * -1.6));
  background: var(--tape); box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent 0);
  mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent 0);
}
.print img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; pointer-events: none; background: #ddd; }
.print--paper { background: var(--paper); }
.print--paper img { aspect-ratio: auto; object-fit: contain; background: var(--paper); padding: 6%; }
.print .tag {
  display: block; padding: 7px 2px 8px; color: #23211c;
  font: 500 10px/1.3 var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
}
.print .tag b { display: block; font: 700 12.5px/1.2 var(--f-mono); letter-spacing: .02em; text-transform: none; }
.print:hover, .print:focus-visible { z-index: 20; transform: rotate(0deg) scale(1.03); box-shadow: 0 2px 2px rgba(0, 0, 0, .25), 0 22px 36px -10px rgba(0, 0, 0, .65); }
.print:focus-visible { outline-offset: 4px; }
.print.is-dragging { z-index: 40; cursor: grabbing; transition: none; transform: rotate(0deg) scale(1.06); box-shadow: 0 4px 4px rgba(0, 0, 0, .2), 0 40px 60px -16px rgba(0, 0, 0, .75); }

.bench__more {
  position: relative; display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(16px, 2vw, 28px);
  min-height: 44px; padding: 0 16px; border-radius: 3px;
  background: var(--paper); color: #1d1c18; text-decoration: none;
  font: 600 13px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .6);
  transform: rotate(-.6deg);
}
.bench__more:hover { background: #fff; }

/* ---------- Loupe ---------- */
.loupe {
  width: min(96vw, 1100px); max-height: 94vh; padding: 0; border: 0; border-radius: 14px;
  background: linear-gradient(180deg, var(--ch-1), var(--ch-2)); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--ch-hi), 0 0 0 1px var(--ch-edge), 0 40px 120px rgba(0, 0, 0, .8);
}
.loupe::backdrop { background: rgba(4, 6, 6, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.loupe__frame { display: flex; flex-direction: column; max-height: 94vh; padding: 14px; gap: 14px; }
.loupe__view {
  flex: 1 1 auto; min-height: 0; display: grid; place-items: center; border-radius: 8px; overflow: hidden;
  background: radial-gradient(80% 70% at 50% 30%, #2a2e31, #0d0f10);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .8);
}
.loupe__view img { max-width: 100%; max-height: calc(94vh - 120px); width: auto; object-fit: contain; }
.loupe__view.is-paper { background: var(--paper); }
.loupe__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.loupe__cap { margin: 0; font: 500 12px/1.4 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loupe__cap b { color: var(--ink); font-size: 14px; letter-spacing: .02em; text-transform: none; margin-right: 8px; }
.loupe__ctrls { display: flex; gap: 10px; }

/* The mat lies on the same surface and spine as everything else. */
.bench { width: auto; margin: 0; padding: 0 var(--side); scroll-margin-top: 24px; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.about__lede { margin: 0 0 24px; font: 400 clamp(20px, 1.9vw, 27px)/1.45 var(--f-body); color: var(--ink); text-wrap: pretty; max-width: 38ch; }
.about__links { display: flex; flex-wrap: wrap; gap: 12px; }
.ledger-wrap { position: relative; }
.ledger { width: 100%; border-collapse: collapse; font: 500 13px/1.35 var(--f-mono); }
.ledger caption { text-align: left; padding: 0 0 10px; font: 500 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ledger tbody { border-top: 1px solid var(--line-strong); }
.ledger tr { border-bottom: 1px solid var(--line); }
.ledger th, .ledger td { padding: 12px 0; vertical-align: top; }
.ledger th { text-align: left; font-weight: 600; color: var(--ink); padding-right: 16px; }
.ledger td { text-align: right; color: var(--ink-2); }
.ledger tbody tr:first-child th { color: var(--accent); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(56px, 7vw, 100px); }
.contact__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px 40px; }
.contact__line { margin: 0; font: 700 clamp(38px, 5vw, 80px)/.92 var(--f-display); text-transform: uppercase; max-width: 16ch; text-wrap: balance; }
.bigkey {
  display: block; padding: 10px; border-radius: 16px; text-decoration: none;
  background: var(--ch-lo);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .06);
}
.bigkey__cap {
  display: flex; align-items: center; gap: 14px; padding: 26px 28px; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--on-accent); font: 600 clamp(15px, 1.5vw, 19px)/1 var(--f-mono); letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .15), 0 6px 0 var(--accent-side), 0 14px 24px -8px rgba(var(--accent-rgb), .4);
  transition: transform .08s ease, box-shadow .08s ease;
}
.bigkey__cap .led { background: rgba(0, 0, 0, .55); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .7); }
.bigkey:hover .bigkey__cap { filter: brightness(1.05); }
.bigkey:hover .bigkey__cap .led { background: radial-gradient(circle at 40% 35%, #fff, #ffe9c4); box-shadow: 0 0 10px 2px #fff4dc; }
.bigkey:active .bigkey__cap { transform: translateY(5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 0 var(--accent-side); }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  padding: 18px var(--side) 48px; border-top: 1px solid var(--line);
  font: 500 11px/1.5 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.foot__links { display: inline-flex; gap: 16px; }
.foot__links a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.foot__links a:hover { color: var(--accent); }
.foot__credit { margin-left: auto; text-transform: none; letter-spacing: .02em; }


/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 1099px) {

  .hero__cicada { top: 0; right: -46vw; width: 150vw; }
  .hero__content { grid-template-columns: 1fr; padding-top: clamp(220px, 34vw, 340px); }
  .hero__name span + span { margin-left: .35em; }
  .spec { grid-template-columns: 1fr 1fr 1fr 2fr; }
  .spec > div:last-child { grid-column: auto; padding-left: 12px; border-left: 1px solid var(--line); }

  .selector { display: none; }               /* every case is shown in full instead */
  .case__visual { aspect-ratio: 16 / 9.4; }
  .case__info { grid-template-columns: 1fr; grid-template-areas: "meta" "title" "tag" "dek" "links"; }
  .case__dek { margin-top: 12px; }
  .case__links { flex-direction: row; flex-wrap: wrap; min-width: 0; padding-top: 16px; }

  .spread { aspect-ratio: auto; display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; gap: 34px 20px; padding-top: 12px; }
  .print { position: relative; left: auto; top: auto; width: auto; cursor: pointer; touch-action: auto; }
  .bench__hint { display: none; }

  .about__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Phone — its own layout: the cicada turns upright and runs down the screen,
   the menu becomes the mobile bar, prints go two-up.
   ========================================================================== */
@media (max-width: 699px) {
  :root { --gutter: 16px; }
  main::before, .seam::before, .seam::after { display: none; }


  .section { padding-top: 64px; }

  .hero { min-height: 0; padding-top: 0; }
  .hero__top { display: none; }
  .hero__cicada {
    position: relative; z-index: 0; top: auto; right: auto;
    width: auto; height: 132vw; margin: 0 calc(-1 * var(--side)) -46vw;
    transform: none; overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 52%, transparent 96%);
    mask-image: linear-gradient(180deg, #000 52%, transparent 96%);
  }
  .hero__cicada img {
    position: absolute; left: 50%; top: 60%; width: 236vw; max-width: none;
    transform: translate(-50%, -50%) rotate(90deg);
    -webkit-mask-image: none; mask-image: none;
  }
  .hero__axis { left: 50%; right: auto; top: 3%; bottom: 30%; width: 9px; height: auto; margin: 0 0 0 -4px;
    background:
      linear-gradient(180deg, transparent, var(--axis) 8%, var(--axis) 92%, transparent) 50% 0 / 1px 100% no-repeat,
      repeating-linear-gradient(180deg, var(--axis) 0 1px, transparent 1px 22px) 50% 0 / 9px 100% no-repeat;
    -webkit-mask-image: none; mask-image: none; }
  .hero__ring { display: none; }
  .hero__credit { top: 14px; right: var(--side); }

  .hero__content { position: relative; z-index: 1; padding-top: 0; gap: 22px; }
  .hero__name { font-size: clamp(64px, 21vw, 100px); }
  .hero__name span + span { margin-left: .3em; }
  .deck { padding: 18px 16px 20px; }
  .spec { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec > div:last-child { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .drawer__text { padding: 20px 16px 6px; }
  .hero__strip { flex-wrap: wrap; }
  .hero__strip .hero__scale, .hero__strip .etch { display: none; }

  .seam .etch { display: none; }
  .seam__title { font-size: 34px; }
  .cases { gap: 54px; }
  .case__visual { aspect-ratio: 4 / 3.3; }
  .case__ghost { font-size: 120px; }
  .plane { inset: 9% 2% 8% 6%; transform: perspective(1400px) rotateY(-7deg) rotateX(2deg); }
  .case__visual--object .plane { inset: 6% 0 6%; transform: none; }
  .case__links .btn { flex: 1 1 100%; }

  .mat { padding: 40px 14px 24px 38px; }
  .bench__head { grid-template-columns: 1fr; }
  .labels li { font-size: 10.5px; padding: 5px 8px 4px; }
  .spread { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .print .tag b { font-size: 11.5px; }

  .contact__body { grid-template-columns: 1fr; }
  .bigkey__cap { justify-content: center; padding: 22px 16px; font-size: 15px; }

  .foot { padding-bottom: 24px; }
  .foot__credit { margin-left: 0; }


  .loupe { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .loupe__frame { height: 100%; max-height: none; }
  .loupe__view img { max-height: calc(100dvh - 150px); }
  .loupe__ctrls { width: 100%; }
  .loupe__ctrls .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Interaction layer
   A work light follows the cursor across the whole surface: it brightens the
   grid, picks out the cicada's veins, and becomes the lamp over the mat.
   Without a mouse (or with reduced motion) it rests in one place.
   ========================================================================== */
:root {
  --lx: 72%; --ly: 22%; --lo: .55; --gy: 0px;
  --grid-hot: rgba(242, 240, 233, .085);
  --light-pool: rgba(242, 240, 233, .045);
  --veins-filter: grayscale(1) contrast(2.4) brightness(1.15) sepia(1) hue-rotate(38deg) saturate(7);
  --lamp-hot: rgba(255, 238, 205, .16);
}
:root[data-theme="light"] {
  --grid-hot: rgba(11, 11, 11, .1);
  --light-pool: rgba(255, 255, 255, .5);
  --veins-filter: grayscale(1) invert(1) contrast(2.2) sepia(1) hue-rotate(40deg) saturate(5) brightness(.75);
}

.surface-light {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: var(--lo);
  background:
    radial-gradient(circle 340px at var(--lx) var(--ly), var(--light-pool), transparent 72%),
    linear-gradient(var(--grid-hot) 1px, transparent 1px) 0 var(--gy) / 24px 24px,
    linear-gradient(90deg, var(--grid-hot) 1px, transparent 1px) 0 0 / 24px 24px;
  -webkit-mask-image: radial-gradient(circle 300px at var(--lx) var(--ly), #000, transparent 75%);
  mask-image: radial-gradient(circle 300px at var(--lx) var(--ly), #000, transparent 75%);
  transition: opacity .4s ease;
}

/* Cicada: a second, edge-lit copy revealed only inside the light */
.hero__veins {
  position: absolute; inset: 0; pointer-events: none;
  opacity: var(--vo, 0); transition: opacity .35s ease;
  -webkit-mask-image: radial-gradient(circle 190px at var(--vx, -999px) var(--vy, -999px), #000 0, rgba(0, 0, 0, .55) 45%, transparent 100%);
  mask-image: radial-gradient(circle 190px at var(--vx, -999px) var(--vy, -999px), #000 0, rgba(0, 0, 0, .55) 45%, transparent 100%);
}
.hero__veins img { filter: var(--veins-filter); }
.hero__ring { transform: translate(calc(-50% + var(--rdx, 0px)), calc(-50% + var(--rdy, 0px))); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }

/* Workbench: the light becomes the desk lamp, and prints throw their shadows away from it */
.mat::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 30;
  background: radial-gradient(circle 460px at var(--mx, 30%) var(--my, 12%), var(--lamp-hot), transparent 70%);
  mix-blend-mode: screen; opacity: var(--mo, .6); transition: opacity .4s ease;
}
.print {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, .25),
    calc(var(--shx, 0) * 1px) calc(10px + var(--shy, 0) * 1px) 18px -6px rgba(0, 0, 0, .55),
    calc(var(--shx, 0) * 2px) calc(26px + var(--shy, 0) * 2px) 40px -24px rgba(0, 0, 0, .6);
}

/* ---------- Case display: the pane leans toward the cursor ---------- */
@media (min-width: 700px) {
  .case__visual .plane {
    transform: perspective(2200px) rotateY(calc(-11deg + var(--ty, 0deg))) rotateX(calc(3deg + var(--tx, 0deg)));
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  }
  .case__visual--object .plane { transform: perspective(2200px) rotateY(var(--ty, 0deg)) rotateX(var(--tx, 0deg)); }
}
/* Channel change on a screen also throws a burst of static */
.case__visual--screen .plane::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: 3px;
  background: url("images/grain.png") 0 0 / 90px 90px;
  filter: contrast(2.2) brightness(1.7); mix-blend-mode: screen; opacity: 0;
}
.case__visual--screen.is-powering .plane::after { animation: static-burst .65s steps(7) both; }
@keyframes static-burst {
  0% { opacity: .95; background-position: 0 0; }
  25% { opacity: .8; background-position: -37px 21px; }
  50% { opacity: .5; background-position: 23px -41px; }
  75% { opacity: .2; background-position: -11px 33px; }
  100% { opacity: 0; background-position: 41px -9px; }
}

.seam__hint { display: none; }
@media (min-width: 1100px) and (pointer: fine) {
  .seam__hint { display: block; color: var(--accent); opacity: .75; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .print:hover, .print:focus-visible { transform: rotate(var(--r)); }
}

/* ---------- Forced colors / high contrast ---------- */
@media (forced-colors: active) {
  .btn, .selkey, .bigkey__cap { border: 1px solid ButtonText; }
  .selkey[aria-selected="true"] { outline: 3px solid Highlight; }
  .tv::before, .tv::after, body::after, .hero__axis, .hero__ring { display: none; }
}
