/* ---------------------------------------------------------------------------
   design.html — design specimens. Self-contained (not main.css).
   Palette in OKLCH; the canvases read these vars at draw time, so a theme or
   accent change re-colors everything (see pal() in js/design.js).
   --------------------------------------------------------------------------- */

:root {
  --bg:      oklch(14% 0.008 260);
  --bg2:     oklch(16.5% 0.01 260);
  --panel:   oklch(19% 0.012 260);
  --panel2:  oklch(22% 0.012 260);
  --line:    oklch(30% 0.012 260);
  --line2:   oklch(24% 0.012 260);
  --ink:     oklch(93% 0.01 85);
  --ink2:    oklch(70% 0.014 260);
  --ink3:    oklch(50% 0.014 260);
  --accent-h: 75;
  --accent:  oklch(80% 0.15 var(--accent-h));
  --accent-dim: oklch(80% 0.15 var(--accent-h) / 0.18);
  --blue:    oklch(72% 0.14 250);
  --green:   oklch(76% 0.17 150);
  --red:     oklch(64% 0.21 25);
  --orange:  oklch(70% 0.19 45);
  --glass:   oklch(100% 0 0 / 0.06);
  --shadow:  0 30px 60px -30px oklch(0% 0 0 / 0.8);
  --mono: 'Recursive', ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
  --sans: 'Recursive', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fvs-mono: "MONO" 1, "CASL" 0, "slnt" 0, "CRSV" 0.5;
  --fvs-sans: "MONO" 0, "CASL" 0, "slnt" 0, "CRSV" 0.5;
  --wrap: 1080px;
  --gut: 24px;
  color-scheme: dark;
}

html[data-theme="day"] {
  --bg:      oklch(96.5% 0.008 85);
  --bg2:     oklch(94.5% 0.01 85);
  --panel:   oklch(99% 0.004 85);
  --panel2:  oklch(97% 0.006 85);
  --line:    oklch(84% 0.012 85);
  --line2:   oklch(89% 0.01 85);
  --ink:     oklch(22% 0.015 260);
  --ink2:    oklch(45% 0.014 260);
  --ink3:    oklch(62% 0.012 260);
  --accent:  oklch(60% 0.15 var(--accent-h));
  --accent-dim: oklch(60% 0.15 var(--accent-h) / 0.16);
  --blue:    oklch(52% 0.16 250);
  --green:   oklch(55% 0.17 150);
  --red:     oklch(55% 0.21 25);
  --orange:  oklch(62% 0.19 45);
  --glass:   oklch(0% 0 0 / 0.04);
  --shadow:  0 30px 60px -30px oklch(0% 0 0 / 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-variation-settings: var(--fvs-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

.mono {
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
}

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- page chrome ---------------------------------------------------------- */

#progress {
  position: fixed; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  z-index: 60;
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  #progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

#ctl {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  display: flex; gap: 6px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink2);
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
  user-select: none;
  -webkit-user-select: none;
}
.chip:hover { border-color: var(--ink3); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#rail {
  position: fixed; left: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 40;
}
#rail a {
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 11px;
  color: var(--ink3);
  letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  transition: color .2s;
}
#rail a::before {
  content: ""; width: 14px; height: 1px; background: currentColor;
  transition: width .25s;
}
#rail a:hover { color: var(--ink); }
#rail a.cur { color: var(--accent); }
#rail a.cur::before { width: 26px; }
@media (max-width: 1240px) { #rail { display: none; } }

/* grid overlay: 8 px baseline + 12 columns inside the wrap */
#gridlay {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  display: none;
  background-image: repeating-linear-gradient(to bottom, color-mix(in oklch, var(--ink) 7%, transparent) 0 1px, transparent 1px 8px);
}
#gridlay::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: min(var(--wrap), 100%);
  padding: 0 var(--gut);
  background-clip: content-box;
  background-image: repeating-linear-gradient(to right,
    color-mix(in oklch, var(--accent) 10%, transparent) 0 calc((100% - 11 * 20px) / 12),
    transparent calc((100% - 11 * 20px) / 12) calc((100% - 11 * 20px) / 12 + 20px));
}
html.grid #gridlay { display: block; }
html.grid .plate::before, html.grid .plate::after,
html.grid .plate > .ph::before, html.grid .plate > .ph::after { opacity: 1; }

/* film grain */
#grain {
  position: fixed; inset: -50%; width: 200%; height: 200%;
  z-index: 70; pointer-events: none; display: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
html[data-theme="day"] #grain { opacity: .12; mix-blend-mode: multiply; }
html.grain #grain { display: block; }
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-4%); }
  60% { transform: translate(-1%,3%); } 80% { transform: translate(3%,1%); } 100% { transform: translate(0,0); }
}

/* view-transition theme reveal (JS supplies the circle clip) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ---- hero: split-flap board ---------------------------------------------- */

.hero {
  padding: 96px 0 72px;
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, color-mix(in oklch, var(--accent) 7%, transparent), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.kicker {
  margin: 0 0 22px;
  text-align: center;
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink3);
}

.board {
  /* 22 cells + 21 gaps + padding must fit the wrap on a 375 px phone */
  --cw: clamp(10px, calc((100vw - 2 * var(--gut) - 86px) / 22), 34px);
  --ch: calc(var(--cw) * 1.45);
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 22px);
  background: oklch(10% 0.005 260);
  border: 1px solid oklch(26% 0.01 260);
  border-radius: 12px;
  box-shadow: inset 0 0 50px oklch(0% 0 0 / .7), var(--shadow);
  display: grid;
  gap: 5px;
}
.brow {
  display: flex; gap: 3px;
  padding: 0; margin: 0; border: 0; background: none;
  cursor: default;
  border-radius: 4px;
}
.brow.link { cursor: pointer; }
.brow.link:hover .flap .h, .brow.link:focus-visible .flap .h { filter: brightness(1.35); }
.brow.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brow.gap { height: calc(var(--ch) * .35); }
.brow.head .c {
  width: var(--cw); text-align: center;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-weight: 600; font-size: calc(var(--ch) * .36); line-height: 1.6;
  color: var(--ink3); letter-spacing: 0.02em;
}
.brow.title .flap { color: var(--accent); }
.brow.clock .flap { color: oklch(85% 0.02 85); }

.flap {
  position: relative;
  width: var(--cw); height: var(--ch);
  perspective: 220px;
  font-family: var(--mono);
  font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0, "CRSV" 0;
  font-weight: 800;
  font-size: calc(var(--ch) * .70);
  color: oklch(94% 0.01 85);
  transform-style: preserve-3d;
}
.flap .h {
  position: absolute; left: 0; right: 0; height: 50%;
  overflow: hidden;
  display: flex; justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: filter .15s;
}
.flap .h span {
  display: block;
  height: var(--ch); line-height: var(--ch);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.flap .t {
  top: 0; border-radius: 3px 3px 0 0;
  transform-origin: 50% 100%;
  background: linear-gradient(oklch(24% 0.006 260), oklch(19% 0.006 260));
}
.flap .b {
  bottom: 0; border-radius: 0 0 3px 3px;
  transform-origin: 50% 0%;
  background: linear-gradient(oklch(16% 0.006 260), oklch(12% 0.006 260));
}
.flap .b span { transform: translateY(-50%); }
.flap .ft, .flap .fb { z-index: 2; }
.flap .fb { transform: rotateX(90deg); }
.flap::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; margin-top: -0.5px;
  background: oklch(0% 0 0 / .9);
  z-index: 3;
}
.hero .hint { text-align: center; margin: 18px 0 0; }

/* ---- plates -------------------------------------------------------------- */

main { padding: 0 0 40px; }

.plate {
  position: relative;
  padding: 72px 0 80px;
  border-top: 1px solid var(--line2);
}
.plate > .wrap { position: relative; }
/* registration marks, visible with the grid overlay */
.plate::before, .plate::after,
.plate > .ph::before, .plate > .ph::after {
  content: ""; position: absolute; width: 14px; height: 14px; opacity: 0;
  border-color: var(--accent); border-style: solid; border-width: 0;
  transition: opacity .3s; pointer-events: none;
}
.plate::before { left: max(8px, calc((100% - var(--wrap)) / 2 + 2px)); top: 10px; border-left-width: 1px; border-top-width: 1px; }
.plate::after  { right: max(8px, calc((100% - var(--wrap)) / 2 + 2px)); top: 10px; border-right-width: 1px; border-top-width: 1px; }

.ph {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 18px;
  margin: 0 0 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line2);
}
.ph .num {
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-weight: 300;
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.ph h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1;
}
.ph .tags {
  margin: 0;
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink3);
  text-align: right;
}
@media (max-width: 640px) {
  .ph { grid-template-columns: auto 1fr; }
  .ph .tags { grid-column: 1 / -1; text-align: left; }
}

.hint {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink3);
}
.kv {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 18px;
  margin: 0;
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 12.5px;
}
.kv dt { color: var(--ink3); }
.kv dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
  margin: 0;
}
output { font-variant-numeric: tabular-nums; }

/* ---- 01 type ------------------------------------------------------------- */

.type-hero {
  margin: 0 0 28px;
  font-size: clamp(34px, 7.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-wrap: balance;
  overflow-wrap: anywhere;
  font-variation-settings: "wght" var(--w, 500), "slnt" var(--s, 0), "CASL" var(--c, 0), "CRSV" var(--r, 0.5), "MONO" var(--m, 0);
  transition: none;
}
.axes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 22px;
  align-items: center;
  margin-bottom: 40px;
}
.axes label {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  font-family: var(--mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 11.5px; letter-spacing: 0.05em;
  color: var(--ink2);
}
.axes label input { grid-column: 1 / -1; }
.axes .chip { justify-self: start; }

.type-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
}
@media (max-width: 820px) { .type-grid { grid-template-columns: 1fr; } }

.waterfall { display: grid; gap: 2px; }
.waterfall .wl {
  display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: 10px;
  font-size: 26px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.waterfall .wl b {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-weight: 400; font-size: 11px; color: var(--ink3); letter-spacing: 0.05em;
}
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quad .q {
  padding: 14px 16px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--bg2);
}
.quad .q .big { font-size: 40px; line-height: 1; margin: 0 0 8px; }
.quad .q .lab {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink3);
}
.scale { display: grid; gap: 8px; margin-top: 28px; }
.scale .sc {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 1px dashed var(--line2); padding-bottom: 6px;
  line-height: 1.1;
}
.scale .sc span:first-child { font-size: var(--fs); font-weight: 560; letter-spacing: -0.01em; }
.scale .sc .px {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 11px; color: var(--ink3); text-align: right; max-width: 60%;
}

/* ---- 02 color ------------------------------------------------------------ */

.color-grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
@media (max-width: 820px) { .color-grid { grid-template-columns: 1fr; justify-items: center; } }

.dial-wrap { display: grid; gap: 14px; justify-items: center; }
.dial {
  position: relative;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: conic-gradient(in oklch longer hue from 0deg, oklch(72% 0.17 0), oklch(72% 0.17 360));
  box-shadow: inset 0 0 0 1px oklch(0% 0 0 / .4), var(--shadow);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dial:active { cursor: grabbing; }
.dial:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.dial::after {
  content: ""; position: absolute; inset: 34px; border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 2px 12px oklch(0% 0 0 / .4);
}
.dial-handle {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px;
  border-radius: 50%;
  background: var(--sw);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px oklch(0% 0 0 / .5);
  transform: rotate(var(--a, 0deg)) translateY(-113px);
  z-index: 2;
}
.dial-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.dial-center .hv {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 34px; font-weight: 300; letter-spacing: -0.02em; line-height: 1;
}
.dial-center .sub {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 10.5px; letter-spacing: 0.1em; color: var(--ink3); margin-top: 6px;
}
.dial-wrap .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.ramps { display: grid; gap: 18px; width: 100%; }
.ramp-label {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 11px; letter-spacing: 0.06em; color: var(--ink3);
  margin: 0 0 6px;
  display: flex; justify-content: space-between; gap: 10px;
}
.ramp { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; height: 54px; }
.ramp .sw {
  border-radius: 4px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 4px;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 9.5px; letter-spacing: 0.02em;
  overflow: hidden;
  transition: transform .15s;
}
.ramp .sw:hover { transform: translateY(-3px); }
@media (max-width: 700px) { .ramp .sw { font-size: 0; } }
.grad { height: 34px; border-radius: 6px; }
.color-read { margin-top: 6px; }
.color-read dd { display: flex; align-items: center; gap: 8px; }
.color-read .dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }

/* ---- 03 motion ----------------------------------------------------------- */

.lanes { display: grid; gap: 8px; }
.lane {
  display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line2);
}
.lane svg { width: 104px; height: 60px; overflow: visible; }
.lane svg .ax { stroke: var(--line); stroke-width: 1; }
.lane svg .cv { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.lane .track { position: relative; height: 40px; }
.lane .track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line2);
}
.lane .dot {
  position: absolute; left: 0; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
  will-change: transform;
}
.lane .name {
  position: absolute; right: 0; top: -8px;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 11px; letter-spacing: 0.04em; color: var(--ink3);
}
.lane-ctl { display: flex; gap: 8px; margin: 18px 0 40px; align-items: center; }

.ripple {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 5px;
  touch-action: manipulation;
}
@media (max-width: 640px) { .ripple { grid-template-columns: repeat(10, 1fr); } }
.ripple .tile {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  cursor: pointer;
  will-change: transform;
}
@media (max-width: 640px) { .ripple .tile:nth-child(n + 61) { display: none; } }

/* ---- 04 light ------------------------------------------------------------ */

.light-grid { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; }
@media (max-width: 820px) { .light-grid { grid-template-columns: 1fr; justify-items: center; } }

.tilt-scene { perspective: 1100px; }
.tilt-card {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%;
  position: relative;
  width: min(420px, calc(100vw - 2 * var(--gut)));
  aspect-ratio: 1;
  border-radius: 18px;
  background:
    radial-gradient(circle at var(--gx) var(--gy), oklch(100% 0 0 / .07), transparent 55%),
    linear-gradient(160deg, oklch(24% 0.008 260), oklch(16% 0.008 260));
  border: 1px solid oklch(34% 0.01 260);
  box-shadow: var(--shadow), inset 0 1px 0 oklch(100% 0 0 / .08);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
html[data-theme="day"] .tilt-card {
  background:
    radial-gradient(circle at var(--gx) var(--gy), oklch(100% 0 0 / .5), transparent 55%),
    linear-gradient(160deg, oklch(86% 0.006 85), oklch(76% 0.008 85));
  border-color: oklch(70% 0.01 85);
}
.tilt-card .screw {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, oklch(60% 0.01 260), oklch(22% 0.01 260));
  box-shadow: inset 0 0 0 1px oklch(0% 0 0 / .6);
}
.tilt-card .screw::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 1.5px; margin-top: -1px;
  background: oklch(10% 0 0 / .8); transform: rotate(var(--sa, 20deg));
}
.tilt-card .screw:nth-child(1) { left: 12px; top: 12px; --sa: 20deg; }
.tilt-card .screw:nth-child(2) { right: 12px; top: 12px; --sa: -35deg; }
.tilt-card .screw:nth-child(3) { left: 12px; bottom: 12px; --sa: 70deg; }
.tilt-card .screw:nth-child(4) { right: 12px; bottom: 12px; --sa: -10deg; }

.bezel {
  position: absolute; inset: 9%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    oklch(38% 0.005 260), oklch(66% 0.005 260) 9%, oklch(30% 0.005 260) 20%, oklch(72% 0.005 260) 32%,
    oklch(33% 0.005 260) 45%, oklch(68% 0.005 260) 58%, oklch(28% 0.005 260) 70%, oklch(74% 0.005 260) 83%,
    oklch(36% 0.005 260) 95%, oklch(38% 0.005 260));
  box-shadow: 0 10px 30px oklch(0% 0 0 / .5), inset 0 0 0 1px oklch(0% 0 0 / .5);
  transform: translateZ(20px);
}
.bezel::before {
  content: ""; position: absolute; inset: 7%; border-radius: 50%;
  background: oklch(8% 0 0);
  box-shadow: inset 0 0 0 2px oklch(20% 0 0), inset 0 6px 18px oklch(0% 0 0 / .9);
}
.bezel svg { position: absolute; inset: 8%; width: 84%; height: 84%; border-radius: 50%; }
.glass {
  position: absolute; inset: 7%; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle at var(--gx) var(--gy), oklch(100% 0 0 / .22), transparent 38%),
    linear-gradient(135deg, oklch(100% 0 0 / .13), transparent 42%, transparent 60%, oklch(100% 0 0 / .04));
  box-shadow: inset 0 0 40px oklch(0% 0 0 / .55);
}
.ai text { font-family: var(--mono); font-variation-settings: "MONO" 1; font-weight: 700; fill: #fff; }
.tilt-card .lab {
  position: absolute; left: 50%; bottom: 3.6%; transform: translateX(-50%) translateZ(10px);
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 10px; letter-spacing: 0.22em; color: oklch(60% 0.01 260);
}
.light-side { display: grid; gap: 16px; justify-items: start; }
.light-side .kv dd { font-size: 22px; font-weight: 300; line-height: 1; }

/* ---- 05 physics ---------------------------------------------------------- */

.sock-grid { display: grid; grid-template-columns: 1fr 240px; gap: 32px; align-items: stretch; }
@media (max-width: 820px) { .sock-grid { grid-template-columns: 1fr; } }
#sock {
  width: 100%; height: 440px; display: block;
  border-radius: 14px;
  background: linear-gradient(oklch(18% 0.02 250), oklch(13% 0.01 260) 62%, oklch(16% 0.012 120) 62.2%, oklch(12% 0.008 120));
  border: 1px solid var(--line2);
}
html[data-theme="day"] #sock {
  background: linear-gradient(oklch(88% 0.04 240), oklch(95% 0.02 220) 62%, oklch(78% 0.07 130) 62.2%, oklch(70% 0.08 130));
}
@media (max-width: 640px) { #sock { height: 360px; } }
.sock-ctl { display: grid; gap: 16px; align-content: start; }
.sock-ctl label {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 11.5px; letter-spacing: 0.05em; color: var(--ink2);
}
.sock-ctl label input { grid-column: 1 / -1; }
#windDial {
  width: 180px; height: 180px; justify-self: center;
  touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
}
#windDial:active { cursor: grabbing; }
#windDial:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 50%; }
#windDial .ring { fill: var(--panel); stroke: var(--line); }
#windDial .tick { stroke: var(--ink3); }
#windDial .card { fill: var(--ink2); font-family: var(--mono); font-size: 11px; font-weight: 700; }
#windDial .arrow { stroke: var(--accent); fill: var(--accent); }
.readout {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 26px; font-weight: 300; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.readout small { display: block; font-size: 11.5px; color: var(--ink3); letter-spacing: 0.06em; margin-top: 4px; }

/* ---- 06 generative ------------------------------------------------------- */

.iso-wrap { position: relative; }
#iso {
  width: 100%; height: 520px; display: block;
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  cursor: crosshair;
  touch-action: pan-y;
}
@media (max-width: 640px) { #iso { height: 400px; } }
.iso-read {
  position: absolute; left: 14px; top: 12px;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 11.5px; letter-spacing: 0.05em; color: var(--ink2);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ---- 07 sound ------------------------------------------------------------ */

.radio {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  padding: 26px;
  border-radius: 16px;
  background: linear-gradient(170deg, oklch(26% 0.006 260), oklch(17% 0.006 260));
  border: 1px solid oklch(34% 0.008 260);
  box-shadow: var(--shadow), inset 0 1px 0 oklch(100% 0 0 / .08);
}
html[data-theme="day"] .radio {
  background: linear-gradient(170deg, oklch(80% 0.006 85), oklch(70% 0.008 85));
  border-color: oklch(62% 0.01 85);
}
@media (max-width: 640px) { .radio { grid-template-columns: 1fr; justify-items: center; padding: 18px; } }

.disp {
  position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px 14px; align-items: center;
  padding: 16px 18px 12px;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 0%, oklch(18% 0.02 70), oklch(9% 0.01 70) 70%);
  box-shadow: inset 0 2px 14px oklch(0% 0 0 / .9), inset 0 0 0 1px oklch(0% 0 0), 0 1px 0 oklch(100% 0 0 / .08);
  --amber: oklch(82% 0.17 70);
  color: var(--amber);
  min-width: 0;
}
.disp::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none;
  background: linear-gradient(oklch(100% 0 0 / .07), transparent 35%);
}
.freq { display: grid; gap: 2px; min-width: 0; }
.freq .lbl {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 10px; letter-spacing: 0.18em; color: oklch(60% 0.08 70);
}
.digits {
  position: relative;
  font-family: var(--mono); font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0;
  font-weight: 800;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px color-mix(in oklch, var(--amber) 60%, transparent), 0 0 1px var(--amber);
  white-space: nowrap;
}
.digits::before {
  content: "888.88"; position: absolute; left: 0; top: 0;
  color: var(--amber); opacity: .09; text-shadow: none;
}
.freq.sby .digits { opacity: .78; }
.flipbtn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid oklch(42% 0.01 260);
  background: radial-gradient(circle at 40% 35%, oklch(44% 0.01 260), oklch(22% 0.01 260));
  color: oklch(90% 0.01 85);
  font-size: 18px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px oklch(0% 0 0 / .6), inset 0 1px 0 oklch(100% 0 0 / .15);
  transition: transform .08s;
}
.flipbtn:active { transform: translateY(1px); box-shadow: 0 1px 3px oklch(0% 0 0 / .6); }
.ident {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  min-height: 22px;
}
.ident .id { font-size: 18px; font-weight: 800; letter-spacing: 0.2em; }
.ident .id .on { text-shadow: 0 0 10px var(--amber), 0 0 2px var(--amber); }
.ident .id .off { opacity: .4; }
.ident .code { font-size: 15px; letter-spacing: 0.1em; opacity: .7; }
.ident .nm { font-size: 10.5px; letter-spacing: 0.08em; opacity: .6; margin-left: auto; }
#scope { grid-column: 1 / -1; width: 100%; height: 26px; display: block; opacity: .9; }

.knob-wrap { display: grid; gap: 10px; justify-items: center; }
.knob {
  position: relative; width: 132px; height: 132px; border-radius: 50%;
  touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.knob:active { cursor: grabbing; }
.knob:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.knob-outer, .knob-inner { position: absolute; border-radius: 50%; }
.knob-outer {
  inset: 0;
  background:
    repeating-conic-gradient(from 0deg, oklch(30% 0.006 260) 0 3deg, oklch(42% 0.006 260) 3deg 6deg);
  box-shadow: 0 8px 18px oklch(0% 0 0 / .6), inset 0 0 0 6px oklch(26% 0.006 260), inset 0 2px 4px oklch(100% 0 0 / .15);
  transform: rotate(var(--ao, 0deg));
}
.knob-outer::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 3px; height: 14px; margin-left: -1.5px;
  background: oklch(92% 0.01 85); border-radius: 2px;
}
.knob-inner {
  inset: 30px;
  background: radial-gradient(circle at 40% 30%, oklch(48% 0.006 260), oklch(20% 0.006 260) 75%);
  box-shadow: 0 4px 12px oklch(0% 0 0 / .7), inset 0 1px 0 oklch(100% 0 0 / .2);
  transform: rotate(var(--ai, 0deg));
}
.knob-inner::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 12px; margin-left: -1.5px;
  background: oklch(92% 0.01 85); border-radius: 2px;
}
.knob-lbl {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink3); text-align: center;
}
.stations { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.stations .chip b { font-weight: 800; }
.stations .chip.tuned { border-color: var(--accent); color: var(--accent); }

/* ---- 08 icons ------------------------------------------------------------ */

.icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.icons figure {
  margin: 0; padding: 22px 10px 14px;
  display: grid; gap: 14px; justify-items: center;
  border: 1px solid var(--line2); border-radius: 10px;
  background: var(--bg2);
  cursor: pointer;
  transition: border-color .15s;
}
.icons figure:hover, .icons figure:focus-visible { border-color: var(--accent); outline: none; }
.icons svg { width: 48px; height: 48px; overflow: visible; }
.icons figcaption {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 11px; letter-spacing: 0.06em; color: var(--ink3);
}
.ico { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico .ac { stroke: var(--accent); }
.ico .fa { fill: var(--accent); stroke: none; }
.icon-sizes { display: flex; align-items: flex-end; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.icon-sizes div { display: grid; gap: 8px; justify-items: center; }
.icon-sizes small {
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 10.5px; color: var(--ink3); letter-spacing: 0.06em;
}

/* icon animations: run on hover/focus and while .play is set */
.icons figure:hover .needle, .icons figure.play .needle, .icons figure:focus-visible .needle
  { animation: needle 1.6s cubic-bezier(.3,1.6,.4,1) infinite; transform-origin: 12px 12px; }
@keyframes needle { 0%,100% { transform: rotate(-25deg); } 50% { transform: rotate(35deg); } }
.icons figure:hover .sock, .icons figure.play .sock, .icons figure:focus-visible .sock
  { animation: wag 1.1s ease-in-out infinite; transform-origin: 8px 8px; }
@keyframes wag { 0%,100% { transform: rotate(-6deg) scaleX(1); } 50% { transform: rotate(8deg) scaleX(1.06); } }
.icons figure:hover .drop, .icons figure.play .drop, .icons figure:focus-visible .drop
  { animation: drop 1s ease-in infinite; }
.icons .drop:nth-of-type(2) { animation-delay: .25s !important; }
.icons .drop:nth-of-type(3) { animation-delay: .5s !important; }
@keyframes drop { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(5px); opacity: 0; } }
.icons figure:hover .plane, .icons figure.play .plane, .icons figure:focus-visible .plane
  { animation: bank 2.2s ease-in-out infinite; transform-origin: 12px 12px; }
@keyframes bank { 0%,100% { transform: rotate(-14deg) translateY(1px); } 50% { transform: rotate(14deg) translateY(-1px); } }
.icons figure:hover .wave, .icons figure.play .wave, .icons figure:focus-visible .wave
  { animation: wave 1.4s ease-out infinite; }
.icons .wave.w2 { animation-delay: .35s !important; }
@keyframes wave { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.icons figure:hover .bolt, .icons figure.play .bolt, .icons figure:focus-visible .bolt
  { animation: flash 1.3s steps(1) infinite; }
@keyframes flash { 0% { opacity: .25; } 10% { opacity: 1; filter: drop-shadow(0 0 4px var(--accent)); } 22% { opacity: .35; } 30% { opacity: 1; } 60% { opacity: .25; } }
.icons figure:hover .rays, .icons figure.play .rays, .icons figure:focus-visible .rays
  { animation: spin 6s linear infinite; transform-origin: 12px 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.icons figure:hover .cl, .icons figure.play .cl, .icons figure:focus-visible .cl
  { animation: rabbit .7s linear infinite; }
@keyframes rabbit { to { stroke-dashoffset: -8; } }

/* ---- colophon ------------------------------------------------------------ */

.colophon { padding: 40px var(--gut) 20px; border-top: 1px solid var(--line2); }
#back-link {
  display: block; width: max-content; margin: 0 auto 70px;
  font-family: var(--mono); font-variation-settings: var(--fvs-mono);
  font-size: 12px; color: var(--ink3); letter-spacing: 0.04em;
}
#back-link:hover { color: var(--ink); text-decoration: none; }

/* ---- motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #grain { animation: none; }
  .icons figure.play .needle, .icons figure.play .sock, .icons figure.play .drop, .icons figure.play .plane,
  .icons figure.play .wave, .icons figure.play .bolt, .icons figure.play .rays, .icons figure.play .cl { animation: none; }
}
