
/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  color-scheme: light dark;
  --bg: #f5f4ef;
  --surface: #efeee9;
  --surface-strong: #e7e6e1;
  --ink: #171817;
  --muted: #5d5f5a;
  --faint: #6d6f69;
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 24%, transparent);
  --accent: #47545a;

  --space-1: .5rem;
  --space-2: .75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3.25rem;
  --space-6: 5.25rem;
  --space-7: 8.5rem;

  --page-pad: clamp(1rem, 3.6vw, 4.25rem);
  --grid-gap: clamp(.75rem, 1.35vw, 1.5rem);
  --content-max: 96rem;
  --nav-h: 0px;
  --bar-h: 30px;

  --text-xs: clamp(.72rem, .69rem + .1vw, .8rem);
  --text-sm: clamp(.86rem, .82rem + .12vw, .95rem);
  --text-body: clamp(1rem, .96rem + .18vw, 1.125rem);
  --text-section: clamp(2.2rem, 1.7rem + 2.4vw, 4.5rem);
  --text-name: clamp(3.5rem, 2.5rem + 4.6vw, 5.5rem);

  --duration-micro: 160ms;
  --duration-structural: 480ms;
  --ease-settle: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --duration-reveal: 760ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121312;
    --surface: #181918;
    --surface-strong: #202220;
    --ink: #efeee9;
    --muted: #a8aaa4;
    --faint: #8f928c;
    --accent: #b8c1c5;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--text-body);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }

h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: var(--text-name); line-height: .96; font-weight: 620; letter-spacing: -.055em; }
h2 { font-size: var(--text-section); line-height: .98; font-weight: 580; letter-spacing: -.045em; }
h3 { font-size: clamp(1rem, .9rem + .35vw, 1.35rem); line-height: 1.12; font-weight: 600; letter-spacing: -.02em; }
p { line-height: 1.58; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 99;
  transform: translateY(-200%);
  background: var(--bg);
  padding: .65rem .8rem;
  border: 1px solid var(--line);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.shell { width: min(100%, var(--content-max)); margin-inline: auto; padding-inline: var(--page-pad); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid-gap); }
.section { position: relative; padding-block: var(--space-7); }
.section-header { grid-column: 1 / span 3; }

.section-index {
  font-size: var(--text-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.section-index { margin-bottom: var(--space-2); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Status bar: the only navigation. Current section opens in place; M opens the index.
   ========================================================================== */

body { padding-bottom: var(--bar-h); }
.bar {
  position: fixed;
  z-index: 30;
  inset: auto 0 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-inline: var(--page-pad);
  border-top: 1px solid var(--line);
  background: var(--bg);
  font: 400 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  white-space: nowrap;
}
.bar a { color: var(--faint); text-decoration: none; transition: color var(--duration-micro) linear; }
.bar a:hover, .bar a[aria-current] { color: var(--ink); }
/* The menu button: a solid block at the bar's edge, like a taskbar's start button. */
.bar__m {
  flex: none;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: .9em;
  margin-left: calc(var(--page-pad) * -1);
  padding: 0 1.1em 0 var(--page-pad);
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  cursor: pointer;
  transition: box-shadow var(--duration-micro) linear;
}
.bar__m b { font-size: 13px; font-weight: 700; }
.bar__m-label::after { content: "menu \25B4"; }
.bar__m[aria-expanded="true"] .bar__m-label::after { content: "close \25BE"; }
.bar__m:hover { box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 3px var(--ink); }
.bar__m:active { box-shadow: inset 0 2px 0 var(--bg); }
.bar__m[aria-expanded="true"] { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bar__m:focus-visible { outline: 2px solid var(--ink); outline-offset: -5px; box-shadow: inset 0 0 0 3px var(--bg); }
.bar__path { margin-right: auto; color: var(--ink); overflow: hidden; }
.bar__path small { font-size: inherit; color: var(--faint); margin-left: .6em; }
.bar__list { list-style: none; display: flex; align-items: center; gap: 1.4em; margin: 0; padding: 0; }
.bar__list li { display: flex; align-items: center; }
.bar__list a { display: inline-flex; align-items: center; min-height: var(--bar-h); }
.bar__list i { font-style: normal; margin-right: .5em; }
.bar__subs { display: inline-flex; gap: 1em; max-width: 0; overflow: hidden; visibility: hidden; transition: max-width 360ms steps(8), visibility 0s 360ms; }
.bar__list a[aria-current] + .bar__subs { max-width: 44em; margin-left: 1em; visibility: visible; transition: max-width 360ms steps(8); }
.bar__subs a[aria-current]::before { content: ">"; margin-right: .35em; }
.bar__progress { position: absolute; left: 0; top: -1px; width: 100%; height: 1px; background: var(--line-strong); transform: scaleX(var(--nav-progress, 0)); transform-origin: left; pointer-events: none; }

/* The index: the page dithers away behind a full list of everything */
.site-index {
  position: fixed;
  z-index: 29;
  inset: 0 0 var(--bar-h);
  display: grid;
  align-items: center;
  padding: var(--space-4) var(--page-pad);
  overflow: auto;
  visibility: hidden;
  background: repeating-conic-gradient(var(--line-strong) 0 25%, transparent 0 50%) 0 0 / 4px 4px, var(--bg);
  image-rendering: pixelated;
}
.bar[data-open] + .site-index { visibility: visible; animation: index-in 240ms steps(4); }
@keyframes index-in { from { opacity: 0; } }
.site-index ol { list-style: none; margin: 0; padding: 0; }
.site-index > ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--grid-gap); width: min(100%, 64rem); margin-inline: auto; }
.site-index a { display: inline-flex; align-items: baseline; gap: .6em; padding: 0 .25em; background: var(--bg); color: var(--ink); text-decoration: none; font-size: clamp(1.8rem, 4.2vw, 3.2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.site-index a:hover { background: var(--ink); color: var(--bg); }
.site-index i { font: 400 11px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; color: var(--faint); }
.site-index ol ol { margin-top: .35rem; display: grid; justify-items: start; gap: .1rem; }
.site-index ol ol a { font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.site-index ol ol a:hover { color: var(--bg); }
@media (max-width: 900px) { .bar__list { display: none; } }
@media (max-width: 700px) { .site-index > ol { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: calc(var(--nav-h) + var(--space-4)) var(--space-5);
}
.hero__grid { align-items: end; }
.hero__identity { grid-column: 1 / span 7; }
.hero__sentence {
  margin-top: var(--space-4);
  max-width: 37rem;
  color: var(--muted);
  font-size: clamp(1.06rem, .98rem + .4vw, 1.38rem);
  line-height: 1.48;
}
.hero__aside { grid-column: 9 / -1; align-self: end; }
.hero__facts { display: grid; gap: .1rem; list-style: none; padding: 0; margin: 0; }
.hero__fact { padding-block: .82rem; border-bottom: 1px solid var(--line); font-size: var(--text-sm); line-height: 1.25; }
.hero__grid { position: relative; z-index: 1; }

.hero__fact--links { display: flex; gap: var(--space-3); }
.hero__fact--links a { text-underline-offset: .2em; }

.hero__field {
  display: block;
  width: 100%;
  height: clamp(11rem, 34svh, 22rem);
  margin-bottom: var(--space-4);
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 1400ms linear;
  pointer-events: none;
}
.hero__field[data-on] { opacity: .55; }

/* With the nav at the bottom, the hero is a poster: the field fills the top,
   the name runs the full width, and the details sit under it. */
@media (min-width: 701px) {
  .hero { height: calc(100svh - var(--bar-h)); min-height: 30rem; grid-template-rows: minmax(0, 1fr); align-items: stretch; padding-block: var(--space-4); }
  .hero__grid { min-height: 0; grid-template-rows: minmax(0, 1fr) auto auto; align-items: start; }
  .hero__identity, .hero__aside { display: contents; }
  .hero__field { grid-column: 1 / -1; grid-row: 1; height: 100%; min-height: 0; margin: 0; }
  .hero h1 { grid-column: 1 / -1; grid-row: 2; margin-top: var(--space-3); font-size: min(10.3vw, 22svh); white-space: nowrap; }
  .hero__sentence { grid-column: 1 / span 6; grid-row: 3; }
  .hero__facts { grid-column: 8 / -1; grid-row: 3; margin-top: var(--space-4); }
  .hero__fact { padding-block: .6rem; }
}

/* ==========================================================================
   Origins
   ========================================================================== */

.origins .grid { align-items: start; }
.origins__beats { grid-column: 4 / span 5; display: grid; gap: var(--space-5); }
.origins__beat {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.origins__beat p { color: var(--muted); max-width: 36rem; }
/* Deobfuscation panel: minified noise resolves into readable code as the beats scroll past. */
.origins__code {
  grid-column: 9 / -1;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 16vh);
  margin: 0;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  font: 400 11.5px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--muted);
}
.origins__code figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.origins__code-bar {
  display: block;
  height: 1px;
  margin-top: .7rem;
  background: var(--ink);
  transform: scaleX(var(--decode, 1));
  transform-origin: left;
}
.origins__code pre { margin: var(--space-3) 0 0; overflow: hidden; }
.origins__code code { font: inherit; white-space: pre; }
.dc-o { color: var(--faint); opacity: .55; }
.dc-s { color: var(--muted); }
.dc-r { color: var(--ink); }
.dc-c { color: var(--faint); }

/* ==========================================================================
   Continuum: pinned stage shared by Systems and Work
   ========================================================================== */

.continuum { position: relative; }
.continuum__sticky, .work__track { display: none; }

[data-js] .continuum__sticky { display: block; position: sticky; top: 0; height: 100svh; z-index: 2; padding-top: var(--nav-h); }
[data-js] .continuum__stage { position: relative; height: calc(100svh - var(--bar-h)); overflow: hidden; }
[data-js] .systems { min-height: 150svh; margin-top: -100svh; padding: 0; } /* scroll length for the two scenes */
[data-js] .work { padding: 0; }
[data-js] .work__track { display: block; padding-bottom: 100svh; }
.work__sentinel--first { height: 90svh; }
.work__sentinel:not(.work__sentinel--first) { height: 75svh; }

/* Semantic copies of the stage: the readable page without JS, screen-reader-only with it. */
.systems__copy > div { grid-column: 5 / span 6; }
.systems__copy > div > p { color: var(--muted); max-width: 40rem; }
.systems__copy > div > p:first-child { color: var(--ink); }
.systems__copy h3 { margin-top: var(--space-4); }
.systems__copy h3 + p { margin-top: .5rem; }
.work__semantic > .grid { padding-top: var(--space-6); }
.work__fallback {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--grid-gap);
  padding-block: var(--space-6);
}
.work__fallback article { padding-top: var(--space-3); border-top: 1px solid var(--line); }
.work__fallback h3 { font-size: 2rem; }
.work__fallback p { margin-top: var(--space-2); color: var(--muted); max-width: 35rem; }
.work__fallback a { display: inline-block; margin-top: var(--space-3); }
[data-js] .work__fallback { display: none; }
[data-js] .systems__copy,
[data-js] .work__semantic > .grid {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layers: Systems and Work share the stage; only one is ever showing. */
.systems-layer, .work-stage-shell { position: absolute; inset: 0; }
.systems-layer { transition: opacity 240ms linear 120ms, visibility 0s; }
.work-stage-shell { opacity: 0; visibility: hidden; transition: opacity 160ms linear, visibility 0s linear 160ms; }
.continuum__stage[data-mode^="work-"] .systems-layer { opacity: 0; visibility: hidden; transition: opacity 160ms linear, visibility 0s linear 160ms; }
.continuum__stage[data-mode^="work-"] .work-stage-shell { opacity: 1; visibility: visible; transition: opacity 240ms linear 120ms, visibility 0s; }

/* ---- Systems layer: laid out like a Work project ---- */
.systems-layer {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: var(--grid-gap);
  padding-block: var(--space-4);
}
.systems-layer [data-scene] { display: none; }
.continuum__stage[data-mode="systems-browser"] [data-scene="browser"],
.continuum__stage[data-mode="systems-qureway"] [data-scene="qureway"] { display: block; }
.continuum__stage[data-mode^="systems-"] .systems-scene[data-scene] { animation: caption-in 520ms var(--ease-settle) both; }
@keyframes caption-in { from { opacity: 0; transform: translateY(6px); } }
.systems-scene { grid-column: 1 / span 5; grid-row: 2 / span 2; padding-top: var(--space-3); min-height: 0; }
.systems-map { grid-column: 7 / -1; grid-row: 2; min-height: 0; border-left: 1px solid var(--line); }
.systems-layer .pm-caption { grid-row: 3; }
.systems-scene .pm-meta > div:last-child dd { color: var(--ink); }

/* ---- Figures (iso.js canvas): Systems scenes and Work projects ---- */
.figure { pointer-events: none; }
.figure__stage { position: absolute; inset: 0; contain: strict; } /* repaints stay inside the figure */
.pm-viz.figure .figure__stage { inset: var(--space-4) 0 var(--space-4) var(--grid-gap); }
.figure__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.systems-map { position: relative; }
.figure--slot { position: absolute; inset: var(--space-4) 0 var(--space-4) var(--grid-gap); }
.figure--slot[hidden] { display: none; }

/* ---- Work shell: one composed screen per project ---- */
.work-stage-shell { display: grid; grid-template-rows: minmax(0, 1fr); padding-block: var(--space-4); }
.work-stage-panels { position: relative; min-height: 0; }

.project-stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  column-gap: var(--grid-gap);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms linear, visibility 0s linear 140ms;
}
.project-stage[data-active="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0s linear 140ms, visibility 0s linear 140ms;
}
/* Modules settle in one after another; the panel itself only toggles. */
.project-stage > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 140ms linear, transform 0s linear 140ms;
}
.project-stage[data-active="true"] > * {
  opacity: 1;
  transform: none;
  transition: opacity 360ms linear, transform 720ms var(--ease-settle);
  transition-delay: calc(160ms + var(--d, 0) * 70ms);
}
.pm-head { --d: 1; }
.pm-viz, .pm-meta { --d: 2; }
.pm-foot, .pm-caption { --d: 3; }

/* Modules: left column reads top to bottom; the diagram owns the right; hairlines divide them. */
.pm-status {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  padding-block: var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.pm-status[data-state="live"] span:last-child::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: .6rem;
  vertical-align: 1px;
  background: var(--ink);
}
.project-stage[data-active="true"] .pm-status[data-state="live"] span:last-child::before { animation: live 2.4s steps(1) infinite; }
@keyframes live { 50% { opacity: .25; } }
.pm-head { grid-column: 1 / span 5; grid-row: 2; align-self: start; padding-top: var(--space-3); min-height: 0; }
.pm-head h3, .pm-name { font-size: clamp(3rem, 2rem + 4.2vw, 6.25rem); line-height: .88; letter-spacing: -.06em; font-weight: 620; }
.pm-head { display: flex; flex-direction: column; align-self: stretch; }
.pm-shot { position: relative; display: block; flex: 1 1 0; min-height: 0; margin-top: var(--space-3); padding: 1px; overflow: hidden; background: var(--line-strong); cursor: zoom-in; transition: background-color var(--duration-micro) linear; }
/* Stepped pixel corners. The link and its image both clip, so the padding between them draws the outline. */
.pm-shot, .pm-shot img, .viewer__frame img { clip-path: polygon(0 6px, 2px 6px, 2px 2px, 6px 2px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 2px) calc(100% - 6px), calc(100% - 2px) calc(100% - 2px), calc(100% - 6px) calc(100% - 2px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 6px), 0 calc(100% - 6px)); }
.pm-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; filter: grayscale(1) brightness(.82); transition: filter 200ms steps(3); }
/* Same solid block as the menu button, so it reads as a control. */
.pm-shot::after { content: "expand"; position: absolute; right: 0; bottom: 0; padding: .55em .8em; background: var(--ink); color: var(--bg); font: 400 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; visibility: hidden; }
.pm-shot:hover, .pm-shot:focus-visible { background: var(--ink); }
.pm-shot:focus-visible { padding: 2px; } /* clip-path hides the outline */
.pm-shot:hover img, .pm-shot:focus-visible img { filter: grayscale(1); }
.pm-shot:hover::after, .pm-shot:focus-visible::after { visibility: visible; }
@media (hover: none) { .pm-shot::after { visibility: visible; } }
@media (max-height: 720px) and (min-width: 701px) { .pm-shot { display: none; } }
/* MDMesh has a fourth row; on short laptops Stack gives way so its screenshot keeps some height. */
@media (max-height: 820px) and (min-width: 701px) { .pm-meta > div:nth-child(2):nth-last-child(3) { display: none; } }
.project-summary { margin-top: var(--space-4); max-width: 34rem; font-size: clamp(1rem, .9rem + .42vw, 1.3rem); line-height: 1.45; }
.pm-meta { grid-column: 1 / span 5; grid-row: 3; margin: var(--space-4) 0 0; border-top: 1px solid var(--line); }
.pm-meta > div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-2); padding-block: .6rem; border-bottom: 1px solid var(--line); }
.pm-meta dt { padding-top: .1rem; font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pm-meta dd { margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--muted); }
.pm-foot { grid-column: 1 / span 5; grid-row: 4; margin: 0; padding-top: var(--space-3); }
.project-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; text-decoration: none; }
.project-link:hover { text-decoration: underline; }
.pm-viz {
  grid-column: 7 / -1;
  grid-row: 2 / span 2;
  position: relative;
  min-height: 0;
  padding: var(--space-4) 0 var(--space-4) var(--grid-gap);
  border-left: 1px solid var(--line);
}
.pm-caption {
  grid-column: 7 / -1;
  grid-row: 4;
  margin: 0;
  padding: var(--space-3) 0 0 var(--grid-gap);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  max-width: none;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--muted);
}

/* ---- Stage: tablet ---- */
@media (max-width: 1100px) {
  .systems-layer { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .systems-scene { grid-column: 1 / span 4; }
  .systems-map, .systems-layer .pm-caption { grid-column: 5 / -1; }
  .pm-name { font-size: clamp(2.6rem, 6.4vw, 4rem); }
  .systems__copy > div { grid-column: 3 / -1; }
  .project-stage { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .pm-head, .pm-meta, .pm-foot { grid-column: 1 / span 4; }
  .pm-viz, .pm-caption { grid-column: 5 / -1; }
  .pm-meta > div:nth-child(n + 3):not(.pm-key) { display: none; }
}

/* ---- Stage: phone ---- */
@media (max-width: 700px) {
  .work__fallback { grid-template-columns: 1fr; gap: var(--space-5); }
  .work__sentinel--first { height: 80svh; }
  .work__sentinel:not(.work__sentinel--first) { height: 65svh; }

  .systems-layer { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); padding-block: 0 var(--space-2); }
  .systems-layer .pm-status { padding-block: var(--space-2); }
  .systems-scene { grid-column: 1; grid-row: 2; padding-top: 0; }
  .pm-name { font-size: clamp(2.6rem, 13vw, 4.5rem); }
  .systems-map { grid-column: 1; grid-row: 3; border-left: 0; }
  .figure--slot { inset: var(--space-2) 0; }
  .systems-layer .pm-caption { display: none; }

  .work-stage-shell { padding-block: var(--space-2) var(--space-3); }

  .project-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
  .pm-status { grid-row: 1; padding-block: var(--space-2); }
  .pm-head { grid-column: 1; grid-row: 2; padding-top: 0; }
  .pm-head h3 { font-size: clamp(2.6rem, 13vw, 4.5rem); }
  .project-summary { margin-top: var(--space-2); font-size: .95rem; line-height: 1.4; }
  .pm-shot { flex: none; height: 9.5rem; margin-top: var(--space-2); }
  .pm-viz { grid-column: 1; grid-row: 4; padding: var(--space-2) 0; border-left: 0; }
  .pm-caption { grid-column: 1; grid-row: 4; padding: var(--space-2) 0 0; border-left: 0; }
  .pm-caption { display: none; }
  .pm-meta { grid-column: 1; grid-row: 3; margin-top: var(--space-2); }
  .pm-meta > div:not(.pm-key) { display: none; }
  .pm-meta > div { padding-block: .4rem; }
  .pm-foot { grid-column: 1; grid-row: 5; padding-top: var(--space-2); }
}

/* ==========================================================================
   Hardware & Elsewhere
   ========================================================================== */

.hardware .grid, .elsewhere .grid { align-items: start; }
.hardware { padding-bottom: var(--space-5); }
.elsewhere { padding-top: var(--space-6); }
.hardware__copy { grid-column: 5 / span 6; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.hardware__copy h3 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.5rem); letter-spacing: -.035em; }
.hardware__copy p { margin-top: var(--space-3); max-width: 34rem; color: var(--muted); }
.hardware__figure { display: none; }
[data-js] .hardware__figure {
  display: block;
  grid-column: 11 / -1;
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.hardware__figure svg { display: block; width: 100%; max-width: 15rem; aspect-ratio: 1; overflow: visible; }
.hardware__figure path {
  fill: none;
  stroke: var(--ink);
  stroke-width: .14; /* user units: ~1px at the figure's size; non-scaling strokes break pathLength dashes in Chrome */
  stroke-linejoin: miter;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: .7;
}
.hardware__figure[data-revealed] path { stroke-dashoffset: 0; transition: stroke-dashoffset 2600ms var(--ease-in-out) 250ms; }
.hardware__figure figcaption {
  display: grid;
  gap: .15rem;
  margin-top: var(--space-2);
  font: 500 10px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .03em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.elsewhere { padding-bottom: var(--space-5); }
.elsewhere__links { grid-column: 5 / span 3; display: grid; align-content: start; }
.elsewhere__links a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.elsewhere__links a::after { content: "↗"; color: var(--faint); font-size: var(--text-sm); }
.elsewhere__links a[href^="mailto:"]::after { content: "→"; }
.elsewhere__links a:first-child { border-top: 1px solid var(--line); }
.elsewhere__links a span,
.elsewhere__links a::after { transition: transform 320ms var(--ease-settle), color var(--duration-micro); }
.elsewhere__links a:hover span { transform: translateX(.35rem); }
.elsewhere__links a:hover::after { color: var(--ink); transform: translate(2px, -2px); }
.elsewhere__links a[href^="mailto:"]:hover::after { transform: translateX(3px); }
.elsewhere__personal { grid-column: 9 / span 3; color: var(--muted); font-size: var(--text-sm); }
.elsewhere__personal p + .section-index { margin-top: var(--space-4); }
.elsewhere__personal p { padding-top: .8rem; line-height: 1.5; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-block: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--faint);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ==========================================================================
   Reveals (attributes are added by script.js, so nothing is hidden without it)
   ========================================================================== */

[data-reveal] {
  transition: opacity 600ms linear, transform var(--duration-reveal) var(--ease-settle);
  transition-delay: calc(var(--i, 0) * 80ms);
}
[data-reveal]:not([data-revealed]) { opacity: 0; transform: translateY(14px); }
.hardware__figure[data-reveal] { transition-delay: 160ms; }

/* Section openings: the dither wipe canvas sits in the section's top padding. */
.section-wipe {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: 10px;
  margin: calc(var(--space-5) * -1) 0 calc(var(--space-5) - 10px);
}
.elsewhere .section-wipe { margin-top: calc(var(--space-4) * -1); }

/* ==========================================================================
   Dimensioned typography (hero name only): a one-shot readout, not ambient decoration
   ========================================================================== */

.measure-host { position: relative; isolation: isolate; }
.measure-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: visible; color: var(--ink); }
.measure-axis { position: absolute; height: 1px; background: color-mix(in srgb, var(--ink) 26%, transparent); transform-origin: center; }
.measure-axis::before, .measure-axis::after { content: ""; position: absolute; top: -2px; height: 5px; width: 1px; background: currentColor; opacity: .42; }
.measure-axis::before { left: 0; }
.measure-axis::after { right: 0; }
.measure-rail { position: absolute; width: 1px; top: 0; height: 100%; background: color-mix(in srgb, var(--ink) 34%, transparent); }
.measure-rail::before, .measure-rail::after { position: absolute; content: ""; width: 5px; height: 1px; background: currentColor; left: -2px; opacity: .45; }
.measure-rail::before { top: 0; }
.measure-rail::after { bottom: 0; }
.measure-num {
  position: absolute;
  white-space: nowrap;
  font: 500 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .03em;
  color: color-mix(in srgb, var(--ink) 56%, transparent);
  font-variant-numeric: tabular-nums;
}
.measure-num--overall { transform: translateX(-50%); }

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .section-header { grid-column: 1 / span 2; }

  .hero__identity { grid-column: 1 / span 5; }
  .hero__aside { grid-column: 6 / -1; }

  .origins__beats { grid-column: 3 / -1; }
  .origins__code { grid-column: 3 / -1; position: static; margin-top: var(--space-5); }

  .hardware__copy { grid-column: 3 / span 5; }
  [data-js] .hardware__figure { grid-column: 3 / span 2; margin-top: var(--space-4); }
  .elsewhere__links { grid-column: 3 / span 3; }
  .elsewhere__personal { grid-column: 6 / -1; }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 700px) {
  :root { --bar-h: 40px; }

  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section { padding-block: var(--space-6); }
  .section-header { grid-column: 1 / -1; margin-bottom: var(--space-4); }


  .hero { min-height: 100svh; }
  .hero__field { height: 18svh; margin-bottom: var(--space-3); }
  [data-js] .hardware__figure { grid-column: 1 / -1; margin-top: var(--space-4); }
  .hardware__figure svg { max-width: 12rem; }
  .hero__identity, .hero__aside,
  .origins__beats, .origins__code,
  .hardware__copy, .elsewhere__links, .elsewhere__personal { grid-column: 1 / -1; }
  .hero__aside { margin-top: var(--space-4); }
  .hero__facts { max-width: 21rem; }
  .origins__code { font-size: 10.5px; }

  .elsewhere__links { margin-top: 0; }
  .elsewhere__personal { margin-top: var(--space-4); }
  .site-footer { margin-top: var(--space-6); }
  .measure-num { font-size: 9px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

/* ==========================================================================
   Screenshot viewer
   ========================================================================== */

html:has(.viewer[open]) { overflow: hidden; scrollbar-gutter: stable; }
.viewer { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0 0 var(--bar-h); border: 0; color: var(--ink); background: repeating-conic-gradient(var(--line-strong) 0 25%, transparent 0 50%) 0 0 / 4px 4px, var(--bg); image-rendering: pixelated; }
.viewer[open] { display: block; animation: index-in 240ms steps(4); }
.viewer::backdrop { background: var(--bg); }
.viewer__frame { display: grid; place-items: center; height: 100%; padding: var(--space-4) var(--page-pad); cursor: zoom-out; }
.viewer__frame img { max-width: 100%; max-height: 100%; min-height: 0; cursor: default; image-rendering: auto; }
.viewer__close { margin: 0 calc(var(--page-pad) * -1) 0 0; padding: 0 var(--page-pad) 0 1.1em; }
.viewer__close span { opacity: .6; }
.viewer__close:hover { box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 3px var(--ink); }
/* A phone can't fit a desktop screen legibly: fill the height and pan sideways. */
@media (max-width: 700px) {
  .viewer__frame { place-items: start; padding: 0; overflow: auto; }
  .viewer__frame img { max-width: none; max-height: none; height: 100%; clip-path: none; }
  .viewer__close span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .measure-overlay { display: none !important; }
}
