/* ───────────────────────────  RESET  ─────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ol,
ul {
  list-style: none;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

/* ───────────────────────────  TOKENS  ─────────────────────────── */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --ash: #b9b9b9;
  --mute: #6c6c6c;
  --hairline: rgba(10, 10, 10, 0.18);

  --font-serif: "Fraunces", "Times New Roman", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --tracking-tight: -0.02em;
  --tracking-mono: 0.04em;
  --tracking-caps: 0.18em;

  --maxw: 1320px;
  --pad-x: clamp(20px, 5vw, 80px);
  --pad-y: clamp(80px, 12vh, 160px);
  --cell: clamp(24px, 2.16vw, 34px);

  --dur-fast: 200ms;
  --dur-mid: 600ms;
  --dur-slow: 1200ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ───────────────────────────  BASE  ─────────────────────────── */

body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-optical-sizing: auto;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  font-size: clamp(16px, 1.1vw, 18px);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: var(--tracking-mono);
}

em {
  font-style: italic;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 100;
}

/* ───────────────────────────  SECTIONS  ─────────────────────────── */

.section {
  position: relative;
  padding: var(--pad-y) var(--pad-x);
  min-height: 100vh;
  min-height: 100dvh;
}

.section-head {
  margin-bottom: clamp(40px, 7vh, 100px);
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: var(--tracking-tight);
}

.section-rule {
  display: block;
  height: 1px;
  background: var(--ink);
  width: 100%;
  margin-top: clamp(20px, 3vh, 40px);
  transform-origin: left center;
  animation: rule-in 1100ms var(--ease-out) both;
  animation-play-state: paused;
}

[data-section].in-view .section-rule {
  animation-play-state: running;
}

@keyframes rule-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ───────────────────────────  HERO  ─────────────────────────── */

.section--hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-title {
  position: absolute;
  left: var(--pad-x);
  bottom: clamp(48px, 9vh, 96px);
  z-index: 3;
  display: grid;
  gap: clamp(8px, 1.6vh, 16px);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
}

.hero-title__main {
  display: block;
  line-height: 0;
  animation: hero-rise 1100ms var(--ease-out) 200ms both;
}

.hero-logo {
  display: block;
  width: clamp(88px, 11.34vw, 164px);
  height: auto;
  color: var(--ink);
}

.hero-title__sub {
  font-size: clamp(11px, 0.86vw, 13px);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  line-height: 1.55;
  animation: hero-fade 900ms var(--ease-out) 700ms both;
}

.hero-apps {
  margin-top: clamp(10px, 1.6vh, 18px);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: baseline;
  gap: 10px;
  animation: hero-fade 900ms var(--ease-out) 900ms both;
}

.hero-app {
  position: relative;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--hairline);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.hero-app:hover {
  border-bottom-color: var(--ink);
}

.hero-apps__sep {
  color: var(--mute);
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes hero-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-time-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---- clock grid embedded in the hero ---- */

/* The clock is positioned absolutely by clock.js, snapped to the field grid.
   It contains 30 cells (5 cols × 6 rows), each var(--cell) px square. */

.clock {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(6, 1fr);
  /* left/top/width/height set inline by JS to land on integer grid cells */
}

.clock-cell {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.clock-bit {
  width: 62%;
  height: 62%;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: transparent;
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.clock-bit.is-on {
  background: var(--ink);
  border-color: var(--ink);
}

.clock-bit.is-flipping {
  animation: bit-flip 360ms var(--ease-out);
}

@keyframes bit-flip {
  0% {
    transform: scale(0.65);
    opacity: 0.2;
  }
  60% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.clock-sep__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ash);
}

/* ---- hero meta corners ---- */

.hero-meta {
  position: absolute;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink);
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.hero-meta--right {
  right: var(--pad-x);
  bottom: clamp(48px, 9vh, 96px);
  display: grid;
  justify-items: end;
  gap: 12px;
}

.hero-read-link {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
}

.hero-read-link:hover .hero-read {
  opacity: 0.6;
}

.hero-read-link:hover .hero-read-line {
  opacity: 1;
}

.hero-read {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.hero-read-line {
  width: 1px;
  height: 80px;
  background: var(--ink);
  transform-origin: top;
  animation: read-line 1400ms var(--ease-out) 1000ms both,
    read-pulse 2400ms ease-in-out 2400ms infinite;
}

@keyframes read-line {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes read-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.hero-corner {
  position: absolute;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-caps);
  color: var(--mute);
  pointer-events: none;
}

.hero-corner--tl {
  top: clamp(20px, 4vh, 44px);
  left: var(--pad-x);
}

.hero-corner--br {
  top: clamp(20px, 4vh, 44px);
  right: var(--pad-x);
}

.hero-corner--toggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--ink);
}

.hero-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-toggle-label {
  font-size: 11px;
  line-height: 1;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: currentColor;
}

.toggle-switch.hero-toggle {
  width: 38px;
  border-color: currentColor;
}

.toggle-switch.hero-toggle .toggle-thumb {
  background: currentColor;
}

.toggle-switch.hero-toggle[aria-pressed="true"] .toggle-thumb {
  transform: translateX(18px);
}

/* ---- hero idle mode ----
   After a few seconds of inactivity the peripheral chrome slides away, leaving
   just the clock and the field. Top elements exit upward, bottom elements
   downward. Any pointer/tap/scroll brings them back (JS toggles .is-idle). */

.hero-title,
.hero-meta--right,
.hero-corner--tl,
.hero-corner--br {
  transition: opacity var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}

.section--hero.is-idle .hero-corner--tl,
.section--hero.is-idle .hero-corner--br {
  opacity: 0;
  transform: translateY(-40px);
}

.section--hero.is-idle .hero-title,
.section--hero.is-idle .hero-meta--right {
  opacity: 0;
  transform: translateY(48px);
}

/* Don't let faded-out chrome catch clicks. */
.section--hero.is-idle .hero-title,
.section--hero.is-idle .hero-meta--right,
.section--hero.is-idle .hero-corner--br {
  pointer-events: none;
}

/* time readout below the binary clock */

.hero-time {
  position: absolute;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.1vw, 17px);
  letter-spacing: 0.28em;
  color: currentColor;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease-out);
  /* top set inline by clock.js, just below the clock grid */
}

.hero-time:not([hidden]) {
  opacity: 1;
}

/* hero dark mode */

.section--hero[data-mode="dark"] {
  --ink: #f5f5f5;
  --paper: #0a0a0a;
  --mute: #8a8a8a;
  --hairline: rgba(245, 245, 245, 0.22);
  --ash: #6c6c6c;
  background-color: #0a0a0a;
  color: var(--ink);
}

.section--hero[data-mode="dark"] .hero-title,
.section--hero[data-mode="dark"] .hero-corner,
.section--hero[data-mode="dark"] .hero-meta--right,
.section--hero[data-mode="dark"] .hero-time {
  color: var(--ink);
}

.section--hero[data-mode="dark"] .hero-read-line {
  background: var(--ink);
}

.section--hero[data-mode="dark"] .hero-app {
  border-bottom-color: rgba(245, 245, 245, 0.25);
}

.section--hero[data-mode="dark"] .hero-app:hover {
  border-bottom-color: var(--ink);
}


/* ───────────────────────────  ESSAY  ─────────────────────────── */

.section--essay {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.essay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(40px, 6vw, 120px);
  max-width: var(--maxw);
  margin: 0 auto;
}

.essay-prose {
  display: grid;
  gap: clamp(28px, 4vh, 48px);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.essay-prose p {
  position: relative;
  max-width: 56ch;
}

.essay-prose p[data-marginalia]::before {
  content: attr(data-marginalia);
  position: absolute;
  left: calc(-1 * clamp(140px, 14vw, 220px));
  top: 0.4em;
  width: clamp(120px, 12vw, 200px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
  line-height: 1.4;
  text-align: right;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.essay-prose p.is-active::before {
  opacity: 1;
  transform: translateX(0);
  color: var(--ink);
}

.dropcap {
  float: left;
  font-size: 4.2em;
  line-height: 0.88;
  padding-right: 0.08em;
  font-style: italic;
  font-weight: 500;
}

.essay-attribution {
  margin-top: clamp(20px, 4vh, 40px);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  color: var(--mute);
  text-transform: uppercase;
}

.essay-aside {
  position: relative;
}

.aside-sticky {
  position: sticky;
  top: clamp(40px, 12vh, 120px);
  border-top: 1px solid var(--ink);
  padding-top: 18px;
  display: grid;
  gap: 18px;
}

.aside-label {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.aside-clock {
  display: grid;
  gap: 10px;
}

.aside-row {
  display: grid;
  grid-template-columns: 18px 32px 14px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}

.aside-key {
  color: var(--mute);
}

.aside-dec {
  font-size: 22px;
  font-weight: 500;
}

.aside-eq {
  color: var(--mute);
}

.aside-bin {
  font-size: 16px;
  letter-spacing: 0.1em;
}

.aside-footnote {
  font-size: 11px;
  color: var(--mute);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

/* ───────────────────────────  DECODE  ─────────────────────────── */

.section--decode {
  border-bottom: 1px solid var(--ink);
}

.decode-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 100px);
  max-width: var(--maxw);
  margin: 0 auto;
  align-items: start;
}

.decode-interactive {
  display: grid;
  gap: clamp(20px, 3vh, 36px);
}

.decode-label {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.decode-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1px;
  background: var(--ink);
  outline: none;
  cursor: pointer;
}

.decode-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: grab;
  transition: transform var(--dur-fast) var(--ease-out);
}
.decode-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}
.decode-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: grab;
}

.decode-value {
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.decode-bits {
  display: grid;
  grid-auto-flow: column;
  gap: 16px;
  justify-content: start;
}

.decode-bit {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.decode-bit__weight {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: var(--tracking-caps);
}

.decode-bit__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.decode-bit__dot.is-on {
  background: var(--ink);
  border-color: var(--ink);
}

.decode-sentence {
  font-size: clamp(18px, 1.4vw, 22px);
  max-width: 36ch;
  color: var(--ink);
}

.decode-sentence .mono {
  background: var(--ink);
  color: var(--paper);
  padding: 2px 8px;
  font-size: 0.85em;
  letter-spacing: 0.12em;
}

.decode-reference {
  display: grid;
  gap: clamp(16px, 2.4vh, 28px);
}

.ref-card {
  border: 1px solid var(--ink);
  padding: clamp(20px, 2.4vw, 28px);
  display: grid;
  gap: 14px;
}

.ref-card__head {
  font-size: 12px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.ref-card__weights {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  gap: clamp(12px, 1.4vw, 22px);
  font-size: 14px;
  color: var(--mute);
}

.ref-card__note {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--mute);
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}

/* ───────────────────────────  NOISE  ─────────────────────────── */

.section--noise {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.section--noise .section-num,
.section--noise .ref-card__note,
.section--noise .noise-caption {
  color: rgba(255, 255, 255, 0.6);
}

.section--noise .section-rule {
  background: var(--paper);
}

.section--noise .section-title {
  color: var(--paper);
}

.section-head--invert .section-num {
  color: rgba(255, 255, 255, 0.55);
}

.noise-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  transition: opacity 600ms var(--ease-out);
}

.section--noise.is-muted .noise-canvas {
  opacity: 0.12;
}

.section--noise .section-head,
.noise-grid {
  position: relative;
  z-index: 2;
}

.noise-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 120px);
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
}

.noise-control {
  display: grid;
  justify-items: center;
  gap: 20px;
}

.noise-button {
  width: clamp(140px, 14vw, 200px);
  aspect-ratio: 1;
  border: 1px solid var(--paper);
  background: transparent;
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--paper);
  transition: background var(--dur-fast) var(--ease-out);
  position: relative;
}

.noise-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.noise-button__mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  position: relative;
}

.noise-button[aria-pressed="true"] .noise-button__mark {
  background: transparent;
  border: 1px solid var(--paper);
}

.noise-button__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--paper);
  opacity: 0;
  animation: pulse 2400ms ease-in-out infinite;
}
.noise-button[aria-pressed="true"] .noise-button__mark::after {
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.15;
    transform: scale(2.6);
  }
}

.noise-button__state {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.noise-caption {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.noise-text {
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.5;
  max-width: 50ch;
  color: var(--paper);
}

/* ───────────────────────────  SIGNS  ─────────────────────────── */

.section--signs {
  border-bottom: 1px solid var(--ink);
  padding-bottom: calc(var(--pad-y) * 1.2);
}

.marquee {
  margin: clamp(40px, 6vh, 80px) calc(-1 * var(--pad-x));
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: clamp(20px, 3vh, 40px) 0;
}

.marquee-track {
  display: flex;
  gap: clamp(40px, 6vw, 80px);
  width: max-content;
  animation: marquee 60s linear infinite;
  font-size: clamp(28px, 5vw, 60px);
  letter-spacing: 0.04em;
}

.marquee-chunk {
  white-space: nowrap;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.aphorisms {
  display: grid;
  gap: clamp(40px, 7vh, 80px);
  max-width: var(--maxw);
  margin: 0 auto;
  margin-top: clamp(40px, 6vh, 80px);
}

.aphorisms li {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--hairline);
  padding-top: clamp(20px, 3vh, 32px);
}

.aphorism {
  font-size: clamp(36px, 6vw, 96px);
  font-style: italic;
  letter-spacing: var(--tracking-tight);
  line-height: 1.02;
  font-weight: 400;
}

.aphorism em {
  font-style: italic;
}

.aphorism-echo {
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0.12em;
}

/* ───────────────────────────  ARTIST  ─────────────────────────── */

.section--artist {
  border-bottom: 1px solid var(--ink);
}

.artist-grid {
  display: grid;
  grid-template-columns: minmax(160px, 234px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 120px);
  max-width: var(--maxw);
  margin: 0 auto;
  align-items: start;
}

.artist-portrait {
  margin: 0;
  display: grid;
  gap: 14px;
}

.artist-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 752 / 948;
  background: var(--paper);
}

.artist-canvas--missing {
  width: 100%;
  aspect-ratio: 752 / 948;
  border: 1px dashed var(--hairline);
}

.artist-caption {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.artist-text {
  display: grid;
  gap: clamp(20px, 3vh, 32px);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.5;
  letter-spacing: -0.005em;
  max-width: 52ch;
}

.artist-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: var(--tracking-tight);
  margin-bottom: clamp(-8px, -1vh, 0px);
}

.artist-rule {
  display: block;
  height: 1px;
  background: var(--ink);
  width: 100%;
  margin-bottom: clamp(8px, 2vh, 20px);
}

.artist-lede em {
  font-style: italic;
}

@media (max-width: 920px) {
  .artist-grid {
    grid-template-columns: 1fr;
  }
  .artist-portrait {
    max-width: 200px;
  }
}

/* ───────────────────────────  COLOPHON  ─────────────────────────── */

.section--colophon {
  padding-bottom: clamp(40px, 6vh, 80px);
}

.wall-label {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(20px, 3vh, 36px) clamp(40px, 6vw, 80px);
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: clamp(30px, 5vh, 60px) 0;
}

.wall-label > div {
  display: grid;
  gap: 8px;
}

.wall-label dt {
  font-size: 10px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.wall-label dd {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2vw, 30px);
  font-style: italic;
  letter-spacing: -0.01em;
}

/* --- restyled controls --- */

.colophon-controls {
  max-width: var(--maxw);
  margin: clamp(40px, 6vh, 80px) auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.control-pair {
  display: flex;
  align-items: center;
  gap: 18px;
}

.control-pair__label {
  font-size: 10px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-option {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
  transition: color var(--dur-fast) var(--ease-out);
}

.toggle-option.is-active {
  color: var(--ink);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 20px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out);
}

.toggle-switch[aria-pressed="true"] .toggle-thumb {
  transform: translateX(28px);
}

.traditional-time {
  font-size: clamp(20px, 1.6vw, 26px);
  letter-spacing: 0.2em;
  color: var(--ink);
}

/* --- app block --- */

.app-block {
  max-width: var(--maxw);
  margin: clamp(40px, 6vh, 80px) auto 0;
  display: grid;
  gap: clamp(20px, 3vh, 30px);
}

.app-block__intro {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.app-block__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.app-link {
  border: 1px solid var(--ink);
  padding: 16px 24px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.app-link__icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink);
}

.app-link:hover {
  background: var(--ink);
  color: var(--paper);
}

.app-link__os {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.app-link:hover .app-link__os {
  color: rgba(255, 255, 255, 0.6);
}

.app-link:hover .app-link__icon {
  color: var(--paper);
}

.app-link__cta {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 1.4vw, 22px);
}

.footer {
  max-width: var(--maxw);
  margin: clamp(60px, 8vh, 100px) auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mute);
}

.footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ───────────────────────────  REVEAL  ─────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ───────────────────────────  RESPONSIVE  ─────────────────────────── */

@media (max-width: 920px) {
  .essay-grid {
    grid-template-columns: 1fr;
  }
  .essay-prose p[data-marginalia]::before {
    position: static;
    display: block;
    width: auto;
    text-align: left;
    margin-bottom: 8px;
    opacity: 1;
    transform: none;
  }
  .essay-aside {
    display: none;
  }
  .decode-grid,
  .noise-grid {
    grid-template-columns: 1fr;
  }
  .hero-meta--right,
  .hero-corner--tl {
    display: none;
  }
  .hero-corner--toggle {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    top: clamp(16px, 3vh, 32px);
  }
  .hero-title {
    bottom: clamp(32px, 6vh, 64px);
  }
  .hero-logo {
    width: clamp(76px, 18.9vw, 126px);
  }
}

@media (max-width: 560px) {
  /* Zoom the binary clock (and the woven field grid) up on phones — the
     default cell size clamps to its floor on narrow viewports. */
  :root {
    --cell: clamp(34px, 11vw, 48px);
  }
  .section {
    padding: clamp(60px, 10vh, 100px) 24px;
  }
  .decode-value {
    font-size: clamp(70px, 22vw, 120px);
  }
  .aphorism {
    font-size: clamp(32px, 11vw, 60px);
  }
  .marquee-track {
    font-size: clamp(24px, 8vw, 40px);
  }
  .footer {
    font-size: 10px;
  }
}

/* ───────────────────────────  REDUCED MOTION  ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .marquee-track {
    animation: none;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .hero-read-line {
    transform: scaleY(1);
    animation: none;
  }
  .noise-canvas {
    display: none;
  }
}
