/*
  Halo One: hardware product landing (Screenery template 08)
  1. Tokens (registered so the whole page can cross-fade between day and evening), base, header.
  2. Stage and chapters: sticky lamp stage, callouts, hero, light panel, hinge, finishes.
  3. Specification sheet, packing list, closing statement, buy bar, pre-order popover, footer.
  4. Components: the themed kit (dial, segmented switch, range, listbox, toast, dialog), then responsive rules.
*/

/* ---------- Tokens ---------- */
@property --bg      { syntax: '<color>'; inherits: true; initial-value: #e9e7e2; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: #f4f2ee; }
@property --ink     { syntax: '<color>'; inherits: true; initial-value: #1d1d1f; }
@property --ink-2   { syntax: '<color>'; inherits: true; initial-value: #55534f; }
@property --bar-bg  { syntax: '<color>'; inherits: true; initial-value: #1d1d1f; }

:root {
  /* palette */
  --bg: #e9e7e2;
  --surface: #f4f2ee;
  --ink: #1d1d1f;
  --ink-2: #55534f;
  --accent: #ff5a1f;
  --on-accent: #1d1d1f;
  --bar-bg: #1d1d1f;
  --bar-ink: #e9e7e2;
  --rule: color-mix(in oklab, var(--ink) 18%, transparent);
  --rule-strong: color-mix(in oklab, var(--ink) 42%, transparent);
  --error: #b3260a;

  /* lamp state, written by script.js */
  --lamp: #ffd2a3;        /* colour of the light at the chosen temperature */
  --bf: .8;               /* brightness, 0 to 1 */
  --finish: #2b2b2e;      /* body colour */
  --dial: #ff5a1f;        /* dial colour */
  --dial-tick: #1d1d1f;
  --light-gain: .5;       /* how strongly the drawn light reads against the page */
  --glow: 0;              /* strength of the evening glow behind the lamp */

  /* space */
  --gutter: clamp(20px, 4.4vw, 72px);
  --col-gap: clamp(2rem, 6vw, 6rem);   /* between the text column and the sheet column */
  /* where the sheet column starts, measured from the left edge of a full-width block */
  --col-2: calc(var(--gutter) + (100% - 2 * var(--gutter) - var(--col-gap)) * 5 / 12 + var(--col-gap));
  --s-1: .5rem;
  --s-2: .75rem;
  --s-3: 1rem;
  --s-4: 1.5rem;
  --s-5: 2.5rem;
  --s-6: 4rem;
  --s-7: 7rem;
  --bar-h: 72px;
  --head-h: 76px;
  --cap-h: 80px;          /* caption strip at the foot of the stage */

  /* shape */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 12px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: 'Onest', ui-sans-serif, system-ui, sans-serif;

  transition: --bg .9s var(--ease), --surface .9s var(--ease), --ink .9s var(--ease),
              --ink-2 .9s var(--ease), --bar-bg .9s var(--ease);
  color-scheme: light;
  scrollbar-color: color-mix(in oklab, var(--ink) 45%, var(--bg)) var(--bg);
  scroll-behavior: smooth;
}

/* Evening: brightness at or below 30 %. The ink takes a little of the lamp's colour. */
:root[data-scene='evening'] {
  --bg: #121110;
  --surface: #1b1a18;
  --ink: color-mix(in oklab, var(--lamp) 26%, #f3f0ea);
  --ink-2: color-mix(in oklab, var(--lamp) 20%, #aaa69f);
  --bar-bg: #1e1d1b;
  --error: #ff8a66;
  --light-gain: 1;
  --glow: calc(.1 + var(--bf) * 1.6);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, p, dl, dd, ol, figure, fieldset { margin: 0; padding: 0; }
ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
input { caret-color: var(--accent); accent-color: var(--accent); }
/* autofill keeps the sheet's own paper and ink instead of the browser's yellow or blue */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--bg) inset;
  caret-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

svg { display: block; }

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

.skip {
  position: fixed; left: var(--gutter); top: -4rem; z-index: 50;
  padding: .7rem 1rem; background: var(--ink); color: var(--bg);
  border-radius: var(--r-2); text-decoration: none;
  transition: top .3s var(--ease);
}
.skip:focus-visible { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: 0 1.25rem;
  border: 1px solid var(--ink); border-radius: var(--r-2);
  background: transparent; color: var(--ink);
  font-weight: 500; font-size: 1rem; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn--line:hover { background: var(--ink); color: var(--bg); }
.btn--line svg { transition: transform .35s var(--ease); }
.btn--line:hover svg { transform: translateY(3px); }
.btn:active { transform: translateY(1px); }

.btn--buy {
  border-color: var(--accent); background: var(--accent); color: var(--on-accent);
  font-weight: 600; padding: 0 1.6rem;
}
.btn--buy:hover { background: #ff6f3a; border-color: #ff6f3a; }
.btn--buy:focus-visible { outline-color: var(--bar-ink); }
.btn--wide { width: 100%; }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { background: color-mix(in oklab, var(--ink) 84%, var(--bg)); }

/* a quiet text button with a drawn icon */
.link-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: 0; border: 0; background: none;
  font-size: .9375rem; font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color .25s var(--ease);
}
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn--center { width: 100%; justify-content: center; margin-top: var(--s-1); color: var(--ink-2); }
.link-btn--center:hover { color: var(--ink); }

.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: none; border-radius: var(--r-2);
}
.icon-btn:hover { background: color-mix(in oklab, var(--ink) 10%, transparent); }

/* ---------- Header ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 6;
  height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 0 var(--gutter);
}
.mark {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; text-decoration: none;
  min-height: 44px;
}
.mark svg { color: var(--ink); }
.mark svg ellipse:first-child { stroke: var(--accent); }

.nav { display: flex; gap: clamp(1rem, 2vw, 2rem); }
.nav a {
  font-size: .9375rem; text-decoration: none; padding: .75rem 0;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - .55rem) / 0 1px;
  transition: background-size .35s var(--ease);
}
.nav a:hover { background-size: 100% 1px; }

.menu-btn { display: none; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; place-items: center; }

.menu {
  inset: 0 0 auto 0; margin: 0; width: 100%; max-width: none; border: 0;
  padding: 0 var(--gutter) var(--s-4);
  background: var(--surface); color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  box-shadow: 0 24px 48px -24px rgb(0 0 0 / .35);
}
.menu::backdrop { background: rgb(0 0 0 / .28); }
.menu__head { display: flex; align-items: center; justify-content: space-between; height: var(--head-h); font-weight: 600; }
.menu__head button { width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; display: grid; place-items: center; }
.menu nav { display: grid; }
.menu nav a {
  padding: .95rem 0; border-top: 1px solid var(--rule);
  font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none;
}

/* ---------- Stage ---------- */
.stage-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  overflow-x: clip;
}

.stage {
  grid-column: 2; grid-row: 1 / span 5;
  position: sticky; top: 0; align-self: start;
  height: calc(100svh - var(--bar-h));
  min-height: 420px;
  z-index: 0;
}

/* evening: a pool of the lamp's own colour behind it, centred on the ring */
.stage__glow {
  position: absolute; left: 0; top: 0;
  width: 190vmin; height: 190vmin;
  translate: calc(var(--gx, 50cqw) - 50%) calc(var(--gy, 30vh) - 50%);
  background: radial-gradient(closest-side,
    color-mix(in oklab, var(--lamp) 34%, transparent) 0,
    color-mix(in oklab, var(--lamp) 13%, transparent) 30%,
    color-mix(in oklab, var(--lamp) 4%, transparent) 62%,
    transparent 100%);
  opacity: min(1, var(--glow));
  transition: opacity .9s var(--ease);
  pointer-events: none;
}

.stage__canvas {
  position: absolute; inset: 0 0 var(--cap-h) 0; width: 100%; height: calc(100% - var(--cap-h));
  opacity: 0; transition: opacity .2s linear;
}
.gl .stage__canvas { opacity: 1; }

/* the drawn lamp */
.stage__draw { position: absolute; inset: 0 0 var(--cap-h) 0; overflow: clip; pointer-events: none; }
.lamp-drawing {
  position: absolute; left: 50%; top: 52%;
  height: min(80%, 620px); aspect-ratio: 460 / 560;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%);
  transition: transform 1.1s var(--ease), opacity .15s linear;
  overflow: visible;
}
.gl .lamp-drawing { opacity: 0; pointer-events: none; }
.stage[data-scene='1'] .lamp-drawing { transform: translate(-50%, -50%) translate(-3%, -5%) scale(.96); }
.stage[data-scene='2'] .lamp-drawing { transform-origin: 61.5% 14.5%; transform: translate(-50%, -50%) translate(-11.5%, 34%) scale(1.75); }
.stage[data-scene='3'] .lamp-drawing { transform-origin: 42.4% 8.75%; transform: translate(-50%, -50%) translate(9%, 40%) scale(2.3); }

.d-body { fill: var(--finish); transition: fill .5s var(--ease); }
.d-shade { fill: rgb(0 0 0 / .24); }
.d-sheen { fill: rgb(255 255 255 / .07); }
.d-shadow { fill: rgb(0 0 0 / .13); }
.d-dial { fill: var(--dial); transition: fill .5s var(--ease); }
.d-tick { stroke: var(--dial-tick); stroke-width: 2; stroke-linecap: round; }
.d-arm { fill: none; stroke: var(--finish); stroke-width: 7; stroke-linecap: round; transition: stroke .5s var(--ease); }
.d-boom { stroke-width: 6; }
.d-ring { fill: none; stroke: var(--finish); stroke-width: 15; transition: stroke .5s var(--ease); }
.d-led { fill: none; stroke: color-mix(in oklab, var(--lamp) 70%, white); stroke-width: 4.5; stroke-linecap: round; opacity: calc(.2 + var(--bf) * .8); }
.d-led-blur { fill: none; stroke: var(--lamp); stroke-width: 16; stroke-linecap: round; opacity: var(--bf); }
.d-light { opacity: calc(var(--bf) * var(--light-gain)); transition: opacity .3s linear; }
.d-guide { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 6; opacity: .35; }
.d-pin { fill: #b9b6ae; }
.d-anchors circle { fill: none; }
[data-scene='evening'] .lamp-drawing { filter: drop-shadow(0 0 .6px rgb(255 255 255 / .55)); }

/* callouts */
.leaders { position: absolute; inset: 0 0 var(--cap-h) 0; width: 100%; height: calc(100% - var(--cap-h)); overflow: visible; pointer-events: none; }
.leaders path {
  fill: none; stroke: var(--ink); stroke-width: 1;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .7s var(--ease);
}
.leaders circle { fill: var(--ink); opacity: 0; transition: opacity .3s linear; }
.leaders .on path { stroke-dashoffset: 0; }
.leaders .on circle { opacity: 1; }

.callouts { position: absolute; inset: 0; pointer-events: none; }
.callout {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: .45rem;
  padding-bottom: 5px;
  font-size: .8125rem; font-weight: 500; line-height: 1.2; white-space: nowrap;
  text-shadow: 0 0 3px var(--bg), 0 0 6px var(--bg), 0 0 10px var(--bg);
  opacity: 0; transition: opacity .35s linear;
  will-change: transform;
}
.callout.on { opacity: 1; transition-delay: .25s; }
.callout b {
  display: grid; place-items: center; width: 1.3rem; height: 1.3rem;
  border: 1px solid var(--ink); border-radius: 50%;
  font-size: .6875rem; font-weight: 600;
}

/* caption bar at the foot of the stage */
.stage__bar {
  /* the left inset puts the caption on the same axis as the specification sheet further down */
  position: absolute; inset: auto var(--gutter) var(--s-4) calc(var(--gutter) / 6 + var(--col-gap) * 7 / 12);
  height: calc(var(--cap-h) - var(--s-4));
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
  font-size: .8125rem;
}
.stage__fig { color: var(--ink-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage__fig span { color: var(--ink); font-weight: 600; margin-right: .5rem; }
.stage__live { display: flex; align-items: center; gap: var(--s-3); }
.stage__read { display: flex; gap: .9rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.scene-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: 0 .9rem 0 .7rem;
  border: 1px solid var(--rule-strong); border-radius: var(--r-2);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  font-weight: 500; white-space: nowrap; flex: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.scene-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.scene-btn .i-sun { display: none; }
.scene-btn[aria-pressed='true'] .i-sun { display: block; }
.scene-btn[aria-pressed='true'] .i-moon { display: none; }

/* ---------- Hero and chapters ---------- */
.hero, .chapter {
  grid-column: 1; position: relative; z-index: 1;
  padding-left: var(--gutter); padding-right: var(--s-4);
}

.hero {
  min-height: calc(100svh - var(--bar-h));
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(1rem, 3vh, 2.5rem);
  /* the vertical measures follow the viewport height, so headline, dial and strip share one screen on a laptop */
  padding-top: calc(var(--head-h) + clamp(1.5rem, 7vh, 6.5rem));
  padding-bottom: var(--s-4);
}
.hero h1 {
  /* the headline is allowed to run past the text column, over the empty left of the stage */
  font-size: clamp(2.75rem, min(6.7vw, 10.6vh), 6rem);
  line-height: .94; letter-spacing: -.04em; font-weight: 500;
  width: max-content; max-width: 9ch;
}
.lede { margin-top: clamp(.75rem, 2.4vh, 1.5rem); max-width: 28rem; font-size: 1.1875rem; line-height: 1.45; color: var(--ink-2); }

.sheet-strip {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: var(--s-3);
  min-height: calc(var(--cap-h) - var(--s-4)); align-content: center;
  padding-top: var(--s-2); border-top: 1px solid var(--ink);
  font-size: .8125rem;
}
.sheet-strip dt { color: var(--ink-2); }
.sheet-strip dd { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.chapter {
  min-height: calc(100svh - var(--bar-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-top: var(--s-7); padding-bottom: var(--s-7);
  scroll-margin-top: 0;
}
.chapter > * { max-width: 30rem; }
.chapter h2 { font-size: clamp(2.5rem, 4.6vw, 4.5rem); line-height: .96; letter-spacing: -.04em; }
.lead { margin-top: var(--s-3); font-size: 1.375rem; line-height: 1.3; letter-spacing: -.015em; font-weight: 500; text-wrap: balance; }
.chapter .lead + p { margin-top: var(--s-3); color: var(--ink-2); }

/* small ruled fact list under a chapter */
.facts { margin-top: var(--s-5); border-top: 1px solid var(--ink); font-size: .9375rem; }
.facts > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: var(--s-3); padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-2); }
.facts dd { font-weight: 500; font-variant-numeric: tabular-nums; text-wrap: balance; }

/* ---------- Control panel ---------- */
.panel { margin-top: var(--s-5); border-top: 1px solid var(--ink); }
.panel--slim { margin-top: var(--s-5); }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); }
.preset {
  display: grid; gap: .15rem; justify-items: start;
  min-height: 60px; padding: .7rem .75rem;
  border: 0; border-right: 1px solid var(--rule); background: none;
  font-weight: 500; font-size: .9375rem; text-align: left;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.preset:last-child { border-right: 0; }
.preset span { font-size: .75rem; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: color .3s var(--ease); }
.preset:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.preset[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.preset[aria-pressed='true'] span { color: color-mix(in oklab, var(--bg) 78%, var(--ink)); }
.preset:focus-visible { outline-offset: -3px; }

.ctl { padding: var(--s-3) 0 var(--s-2); border-bottom: 1px solid var(--rule); }
.ctl__head { display: flex; align-items: baseline; justify-content: space-between; }
.ctl__head label { font-size: .9375rem; font-weight: 500; }
.ctl__head output { font-size: 1.375rem; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.range {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 44px; margin: 0;
  background: transparent; cursor: grab;
  --p: 80%;
}
.range:active { cursor: grabbing; }
#tilt { --p: 13.6%; }
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--p), var(--rule-strong) var(--p));
}
.range::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--p), var(--rule-strong) var(--p));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; margin-top: -12px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--ink), 0 4px 10px -2px rgb(0 0 0 / .4);
  transition: scale .25s var(--ease), border-color .9s var(--ease);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--ink), 0 4px 10px -2px rgb(0 0 0 / .4);
}
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { scale: 1.12; }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--bg), 0 0 0 7px var(--ink); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--bg), 0 0 0 7px var(--ink); }

/* the temperature track shows the light it will give */
.range--k::-webkit-slider-runnable-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right, #ffa757, #ffd2a3 34%, #ffe6cf 60%, #e4ebff);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.range--k::-moz-range-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right, #ffa757, #ffd2a3 34%, #ffe6cf 60%, #e4ebff);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.range--k::-webkit-slider-thumb { margin-top: -9px; }

.scale { position: relative; height: 1.4rem; margin: -6px 14px 0; font-size: .75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.scale span { position: absolute; left: var(--at); top: 0; translate: -50% 0; white-space: nowrap; padding-top: 7px; }
.scale span::before { content: ''; position: absolute; left: 50%; top: 0; width: 1px; height: 5px; background: var(--rule-strong); }
.scale span:first-child { translate: -14px 0; }
.scale span:first-child::before { left: 14px; }
.scale span:last-child { translate: calc(-100% + 14px) 0; }
.scale span:last-child::before { left: calc(100% - 14px); }
.scale__mark { color: var(--ink); font-weight: 600; }
.scale__mark::before { background: var(--accent) !important; width: 2px !important; height: 7px !important; }

.readout { display: grid; grid-template-columns: repeat(3, 1fr); font-size: .8125rem; }
.readout > div { padding: .7rem 0; }
.panel .link-btn { width: 100%; border-top: 1px solid var(--rule); }
.readout dt { color: var(--ink-2); }
.readout dd { font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Finishes ---------- */
.finishes { margin-top: var(--s-5); border-top: 1px solid var(--ink); }
.finish {
  position: relative;
  display: grid; grid-template-columns: 2.25rem 1fr 1.5rem; column-gap: var(--s-3); align-items: center;
  padding: .85rem .25rem .85rem 0; border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.finish input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.finish__chip {
  grid-row: span 2; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18), inset 0 -6px 10px -4px rgb(0 0 0 / .3), 0 0 0 1px var(--rule);
  transition: scale .35s var(--ease);
}
.finish__name { font-weight: 500; }
.finish__note { grid-column: 2; font-size: .875rem; color: var(--ink-2); }
.finish::after {
  content: ''; grid-column: 3; grid-row: 1 / span 2; justify-self: end;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: radial-gradient(circle, var(--accent) 0 38%, transparent 42%) no-repeat center / 0 0;
  transition: background-size .35s var(--ease), border-color .25s var(--ease);
}
.finish:has(:checked)::after { background-size: 100% 100%; border-color: var(--ink); }
.finish:has(:checked) .finish__name { font-weight: 600; }
.finish:hover .finish__chip { scale: 1.08; }
.finish:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-1); }

/* ---------- Specifications ---------- */
.specs, .box {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-6) var(--col-gap);
  padding: var(--s-7) var(--gutter);
  border-top: 1px solid var(--ink);
  scroll-margin-top: 0;
}
.specs h2, .box h2 { font-size: clamp(2.5rem, 4.6vw, 4.5rem); line-height: .96; letter-spacing: -.04em; }
.specs__side > p, .box__text > p { margin-top: var(--s-4); max-width: 27rem; color: var(--ink-2); }
.specs__side { position: sticky; top: var(--s-5); align-self: start; }

.elevation { margin-top: var(--s-5); width: 100%; max-width: 25rem; height: auto; overflow: visible; }
.e-desk { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.e-part { fill: var(--finish); stroke: var(--ink); stroke-width: 1; transition: fill .5s var(--ease); }
.e-dial { fill: var(--dial); stroke: var(--ink); stroke-width: 1; }
.e-pin { fill: var(--bg); stroke: var(--ink); stroke-width: 1; }
.e-dash { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 6; opacity: .5; }
.e-dim path { fill: none; stroke: var(--ink); stroke-width: .75; }
.e-dim text, .e-note { fill: var(--ink); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }

.spec-group {
  display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 4fr); gap: var(--s-3);
  padding-top: var(--s-2); border-top: 1px solid var(--ink);
}
.spec-group + .spec-group { margin-top: var(--s-5); }
.spec-group h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; padding-top: .15rem; }
.spec-group dl > div {
  display: grid; grid-template-columns: minmax(8rem, 2fr) minmax(0, 3fr); gap: var(--s-3);
  padding: .6rem 0; border-bottom: 1px solid var(--rule);
  font-size: .9375rem;
}
.spec-group dl > div:first-child { padding-top: .15rem; }
.spec-group dt { color: var(--ink-2); }
.spec-group dd { font-weight: 500; font-variant-numeric: tabular-nums; text-wrap: balance; }

/* ---------- In the box ---------- */
.box { align-items: start; }
.packing { margin-top: var(--s-5); border-top: 1px solid var(--ink); max-width: 30rem; }
.packing li {
  display: grid; grid-template-columns: 1.6rem 1fr; column-gap: var(--s-2); align-items: baseline;
  padding: .7rem 0; border-bottom: 1px solid var(--rule);
}
.packing__n {
  grid-row: span 2; align-self: start; display: grid; place-items: center;
  width: 1.4rem; height: 1.4rem; margin-top: .1rem; border: 1px solid var(--ink); border-radius: 50%;
  font-size: .6875rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.packing__item { font-weight: 500; }
.packing__note { grid-column: 2; font-size: .875rem; color: var(--ink-2); }

.knoll { width: 100%; height: auto; border: 1px solid var(--ink); border-radius: var(--r-1); background: var(--surface); }
.k-grid { fill: none; stroke: var(--rule); stroke-width: 1; }
.k { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.k-o { fill: var(--accent); }
.k-dash { stroke-dasharray: 1 5; }
.k-keys text { fill: var(--ink); font-size: 13px; font-weight: 600; }

/* ---------- Buy bar ---------- */
.buybar {
  position: sticky; bottom: 0; z-index: 8;
  background: var(--bar-bg); color: var(--bar-ink);
  border-top: 1px solid color-mix(in oklab, var(--bar-ink) 18%, transparent);
}
.buybar__inner {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--s-4);
  /* the bar sits under the sheet column, so it lines up with the stage caption and the specifications */
  height: var(--bar-h); padding: 0 var(--gutter) 0 var(--col-2);
}
.buybar__what { display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.buybar__chip {
  display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; flex: none;
  background: var(--finish);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .45), inset 0 -3px 5px -2px rgb(0 0 0 / .35);
  transition: background-color .5s var(--ease);
}
.buybar__name { font-weight: 600; }
.buybar__finish { color: color-mix(in oklab, var(--bar-ink) 72%, var(--bar-bg)); }
.buybar__ship { font-size: .875rem; color: color-mix(in oklab, var(--bar-ink) 72%, var(--bar-bg)); text-align: right; white-space: nowrap; }
.buybar__price { font-size: 1.375rem; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.buybar .btn--buy { min-height: 46px; }

/* ---------- Pre-order popover ---------- */
.confirm {
  inset: auto var(--gutter) calc(var(--bar-h) + 14px) auto; margin: 0;
  width: min(23.5rem, calc(100vw - 24px));
  padding: var(--s-4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--r-3);
  box-shadow: 0 28px 60px -20px rgb(0 0 0 / .45), 0 6px 16px -8px rgb(0 0 0 / .25);
  max-height: calc(100dvh - var(--bar-h) - 28px); overflow: auto;
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
  opacity: 0; translate: 0 12px;
  transition: opacity .35s var(--ease), translate .45s var(--ease), display .35s allow-discrete, overlay .35s allow-discrete;
}
.confirm:popover-open { opacity: 1; translate: 0 0; }
@starting-style { .confirm:popover-open { opacity: 0; translate: 0 12px; } }
.confirm::backdrop { background: transparent; }

.confirm__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.confirm__head .icon-btn { margin: -10px -10px 0 0; }
.confirm h2 { font-size: 1.375rem; line-height: 1.15; letter-spacing: -.02em; }
.confirm__sum { margin-top: var(--s-3); border-top: 1px solid var(--ink); font-size: .9375rem; }
.confirm__sum > div { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.confirm__sum dt { color: var(--ink-2); }
.confirm__sum dd { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.confirm__sum .buybar__chip { box-shadow: 0 0 0 1px var(--rule-strong), inset 0 -3px 5px -2px rgb(0 0 0 / .35); }

.field { margin-top: var(--s-4); }
.field--first { margin-top: var(--s-3); }
.field label, .field__label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 500; }
.field input {
  width: 100%; height: 48px; padding: 0 .85rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--r-2);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder { color: var(--ink-2); opacity: 1; }
.field input:hover { border-color: var(--ink); }
.field input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 22%, transparent); }
.field input[aria-invalid='true'] { border-color: var(--error); box-shadow: 0 0 0 3px color-mix(in oklab, var(--error) 18%, transparent); }
.field__msg { min-height: 1.3rem; margin-top: .4rem; font-size: .8125rem; line-height: 1.3; color: var(--error); text-wrap: balance; }

.confirm .btn--wide { margin-top: var(--s-2); }
.confirm .btn--buy:focus-visible { outline-color: var(--ink); }
.btn__spin {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--on-accent) 30%, transparent); border-top-color: var(--on-accent);
  animation: spin .7s linear infinite;
}
.btn[aria-busy='true'] { pointer-events: none; }
.btn[aria-busy='true'] .btn__spin { display: block; }
@keyframes spin { to { rotate: 1turn; } }
.confirm__fine { margin-top: var(--s-2); font-size: .8125rem; color: var(--ink-2); text-align: center; }

.confirm__done { text-align: left; }
.confirm__done svg { color: var(--ink); }
.confirm__done .confirm__sum { margin-top: var(--s-3); }
.confirm__done h2 { margin-top: var(--s-3); font-size: 1.75rem; }
.confirm__done h2:focus-visible { outline: none; }
.confirm__done p { margin-top: var(--s-2); color: var(--ink-2); overflow-wrap: anywhere; }
.confirm__done strong { color: var(--ink); font-weight: 600; white-space: nowrap; }
.confirm__done .btn { margin-top: var(--s-4); }

/* ---------- Closing statement ---------- */
/* The one big block of dial orange on the page. It stays orange in the evening. */
.creed {
  --ink: #1d1d1f;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-5) var(--col-gap); align-items: end;
  padding: clamp(4rem, 11vw, 9rem) var(--gutter) clamp(3rem, 7vw, 6rem);
  background: var(--accent); color: var(--ink);
  position: relative; z-index: 4;
}
.creed h2 {
  font-size: clamp(3rem, 8.4vw, 8rem);
  line-height: .9; letter-spacing: -.045em; font-weight: 500; text-wrap: nowrap;
}
.creed__text { display: grid; gap: var(--s-3); max-width: 26rem; font-size: 1.0625rem; padding-bottom: .6rem; }
.creed__text a { justify-self: start; margin-top: var(--s-2); padding: .6rem 0; font-weight: 500; }
.creed ::selection { background: var(--ink); color: var(--accent); }
.creed :focus-visible { outline-color: var(--ink); }

/* ================================================================== */
/* Components: the themed kit. Everything here is drawn from the      */
/* tokens above, so it follows the day and evening themes on its own. */
/* ================================================================== */

/* ---------- Dial (rotary slider) ---------- */
/* --turn runs from 0 to 1 and is written by script.js; the knob sweeps 270 degrees. */
.dialer {
  --dial-size: clamp(8.5rem, 23vh, 14.5rem);
  display: grid; grid-template-columns: var(--dial-size) minmax(0, 1fr); gap: clamp(1rem, 2.2vw, 2rem); align-items: center;
  margin-top: clamp(1rem, 3.2vh, 2.5rem); max-width: 31rem;
}
.dial {
  --turn: .8;
  width: var(--dial-size); aspect-ratio: 1; border-radius: 50%;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dial:active, .dial.is-turning { cursor: grabbing; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial__ticks { fill: none; stroke: var(--ink); stroke-width: 9; stroke-dasharray: .8 4.825; opacity: .6; }
.dial__arc { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: calc(var(--turn) * 100) 100; }
.dial__dark { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.dial__ends text { fill: var(--ink-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dialer[data-mode='b'] .dial__ends--k, .dialer[data-mode='k'] .dial__ends--b, .dialer[data-mode='k'] .dial__dark { display: none; }
/* only the fluted wall and the index mark turn, so the shadow stays put under the knob */
.dial__knurl, .dial__index { transform: rotate(calc(var(--turn) * 270deg - 135deg)); }
.dial__knob {
  transform-origin: 0 0;
  filter: drop-shadow(0 9px 10px rgb(0 0 0 / .28)) drop-shadow(0 1px 1px rgb(0 0 0 / .3));
  transition: scale .3s var(--ease);
}
.dial:hover .dial__knob, .dial.is-turning .dial__knob { scale: 1.02; }
.dial__body { fill: var(--dial); transition: fill .5s var(--ease); }
.dial__knurl { fill: none; stroke: rgb(0 0 0 / .26); stroke-width: 8; stroke-dasharray: 2.2 3.25; }
.dial__cap { fill: var(--dial); stroke: rgb(0 0 0 / .2); stroke-width: 1; transition: fill .5s var(--ease); }
.dial__dish { fill: rgb(0 0 0 / .05); stroke: rgb(255 255 255 / .16); stroke-width: 1; }
.dial__index { stroke: var(--dial-tick); stroke-width: 7; stroke-linecap: round; transition: stroke .5s var(--ease); }
/* keyboard focus is a ring drawn round the knob, inside the scale */
.dial__focus { fill: none; stroke: var(--ink); stroke-width: 2.5; opacity: 0; }
.dial:focus-visible { outline: none; }
.dial:focus-visible .dial__focus { opacity: 1; }
[data-scene='evening'] .dial__knob { filter: drop-shadow(0 0 18px color-mix(in oklab, var(--lamp) calc(var(--bf) * 160%), transparent)); }

.dialer__value { display: flex; align-items: baseline; gap: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dialer__value output { font-size: clamp(2.25rem, 3.6vw, 3.25rem); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.dialer__value span { color: var(--ink-2); font-size: .9375rem; }
.dialer__hint { margin-top: var(--s-2); max-width: 15rem; font-size: .8125rem; line-height: 1.4; color: var(--ink-2); }

/* ---------- Segmented switch (two or three radios) ---------- */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: var(--s-2); border: 1px solid var(--ink); border-radius: var(--r-2); }
.seg label { position: relative; display: grid; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-height: 40px; padding: 0 .9rem;
  font-size: .875rem; font-weight: 500; white-space: nowrap;
  border-radius: calc(var(--r-2) - 1px);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.seg label:hover span { background: color-mix(in oklab, var(--ink) 9%, transparent); }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.seg input:disabled + span { color: var(--ink-2); opacity: .55; cursor: not-allowed; }

/* ---------- Disabled states for the drawn inputs ---------- */
.range:disabled { cursor: not-allowed; opacity: .5; }
.range:disabled::-webkit-slider-thumb { background: var(--ink-2); }
.range:disabled::-moz-range-thumb { background: var(--ink-2); }
.finish:has(:disabled) { cursor: not-allowed; opacity: .55; }
.finish:has(:disabled) input { cursor: not-allowed; }

/* ---------- Listbox (themed select) ---------- */
/* Markup: .select > button.select__btn[role=combobox] + ul.select__list[role=listbox][popover=manual] + input[type=hidden] */
.select { position: relative; }
.select__btn {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem;
  width: 100%; height: 48px; padding: 0 .7rem 0 .85rem;
  background: var(--bg); color: var(--ink); text-align: left;
  border: 1px solid var(--rule-strong); border-radius: var(--r-2);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.select__btn:hover { border-color: var(--ink); }
.select__btn:focus-visible, .select__btn[aria-expanded='true'] {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 22%, transparent);
}
.select__btn:disabled { color: var(--ink-2); opacity: .6; cursor: not-allowed; }
.select__value { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__meta { font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.select__btn svg { transition: rotate .35s var(--ease); }
.select__btn[aria-expanded='true'] svg { rotate: 180deg; }

/* the list is a ruled register, like the specification sheet; left, top and width are set by script.js */
.select__list {
  position: fixed; inset: auto; margin: 0; padding: 0; list-style: none;
  max-height: min(19rem, calc(100dvh - 24px)); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--r-2);
  box-shadow: 0 20px 44px -18px rgb(0 0 0 / .45), 0 4px 12px -6px rgb(0 0 0 / .25);
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
  opacity: 0; clip-path: inset(0 0 100% 0 round var(--r-2));
  transition: opacity .2s linear, clip-path .35s var(--ease), display .35s allow-discrete, overlay .35s allow-discrete;
}
.select__list[data-side='top'] { clip-path: inset(100% 0 0 0 round var(--r-2)); }
.select__list:popover-open { opacity: 1; clip-path: inset(0 round var(--r-2)); }
@starting-style {
  .select__list:popover-open { opacity: 0; clip-path: inset(0 0 100% 0 round var(--r-2)); }
  .select__list[data-side='top']:popover-open { clip-path: inset(100% 0 0 0 round var(--r-2)); }
}
.select__list::-webkit-scrollbar { width: 8px; }
.select__list::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 4px; border: 2px solid var(--surface); }
.select__list [role='option'] {
  display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto 4.6rem; align-items: center; gap: .6rem;
  min-height: 44px; padding: 0 .85rem 0 .7rem;
  border-bottom: 1px solid var(--rule);
  font-size: .9375rem; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.select__list [role='option']:last-child { border-bottom: 0; }
/* the mark for the chosen row is the same orange pip the finish rows use */
.select__list [role='option']::before {
  content: ''; width: .5rem; height: .5rem; border-radius: 50%; justify-self: center;
  background: var(--accent); scale: 0; transition: scale .3s var(--ease);
}
.select__list [role='option'][aria-selected='true']::before { scale: 1; }
.select__list [role='option'][aria-selected='true'] span:first-of-type { font-weight: 600; }
.select__list [role='option'] span:nth-of-type(2) { font-size: .8125rem; color: var(--ink-2); }
.select__list [role='option'] span:nth-of-type(3) { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.select__list [role='option'].is-active { background: var(--ink); color: var(--bg); }
.select__list [role='option'].is-active span:nth-of-type(2) { color: color-mix(in oklab, var(--bg) 78%, var(--ink)); }

/* ---------- Toast (themed notice) ---------- */
/* A dark plate that sits just above the buy bar, with a rule that runs out as its time does. */
.toasts {
  position: fixed; inset: auto auto calc(var(--bar-h) + 14px) var(--gutter); margin: 0; padding: 0; border: 0;
  width: min(24rem, calc(100vw - 24px)); background: none; overflow: visible;
  display: grid; gap: var(--s-1);
}
.toasts:not(:popover-open):not(.is-open) { display: none; }
.toast {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: .7rem;
  padding: .8rem .5rem .9rem .9rem;
  background: var(--bar-bg); color: var(--bar-ink);
  border: 1px solid color-mix(in oklab, var(--bar-ink) 22%, transparent); border-radius: var(--r-2);
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / .5), 0 4px 10px -6px rgb(0 0 0 / .3);
  font-size: .9375rem; line-height: 1.4;
  animation: toast-in .5s var(--ease) both;
}
.toast.is-leaving { animation: toast-out .28s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; translate: 0 14px; } }
@keyframes toast-out { to { opacity: 0; translate: 0 8px; } }
.toast > svg { margin-top: .1rem; color: var(--accent); }
.toast--error > svg { color: #ff8a66; }
.toast__text { padding-top: .05rem; text-wrap: pretty; }
.toast__text b { font-weight: 600; font-variant-numeric: tabular-nums; }
.toast__close {
  display: grid; place-items: center; width: 36px; height: 36px; margin: -.45rem 0 -.5rem;
  border: 0; border-radius: var(--r-2); background: none; color: inherit;
}
.toast__close:hover { background: color-mix(in oklab, var(--bar-ink) 14%, transparent); }
.toast__close:focus-visible { outline-color: var(--bar-ink); outline-offset: -2px; }
.toast::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform-origin: 0 50%;
  animation: toast-time var(--toast-ms, 5000ms) linear forwards;
}
.toast:hover::after, .toast:focus-within::after { animation-play-state: paused; }
@keyframes toast-time { to { transform: scaleX(0); } }

/* ---------- Confirmation dialog ---------- */
/* The backdrop is the evening: the room dims behind the question. */
.dialog {
  width: min(27rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: var(--s-4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--r-3);
  box-shadow: 0 32px 70px -22px rgb(0 0 0 / .6), 0 8px 18px -10px rgb(0 0 0 / .35);
  opacity: 0; translate: 0 14px; scale: .98;
  transition: opacity .3s var(--ease), translate .45s var(--ease), scale .45s var(--ease), display .3s allow-discrete, overlay .3s allow-discrete;
}
.dialog[open] { opacity: 1; translate: 0 0; scale: 1; }
@starting-style { .dialog[open] { opacity: 0; translate: 0 14px; scale: .98; } }
.dialog::backdrop {
  background: rgb(18 17 16 / 0);
  transition: background-color .45s var(--ease), display .45s allow-discrete, overlay .45s allow-discrete;
}
.dialog[open]::backdrop { background: rgb(18 17 16 / .66); }
@starting-style { .dialog[open]::backdrop { background: rgb(18 17 16 / 0); } }
.dialog h2 { font-size: 1.625rem; line-height: 1.1; letter-spacing: -.025em; padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink); }
.dialog h2 span { white-space: nowrap; }
.dialog p { margin-top: var(--s-3); color: var(--ink-2); }
.dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-top: var(--s-4); }
.dialog__actions .btn { padding: 0 .75rem; }

/* ---------- Footer ---------- */
.foot { padding: var(--s-6) var(--gutter) calc(var(--s-5) + 40px); border-top: 1px solid var(--rule); }
.foot__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-5) var(--col-gap); }
.foot__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5) clamp(1.5rem, 3vw, 3rem); }
.foot__brand p { margin-top: var(--s-3); max-width: 22rem; font-size: .9375rem; color: var(--ink-2); }
.foot__col { display: grid; align-content: start; font-size: .9375rem; }
.foot__col h2 { font-size: .9375rem; font-weight: 600; padding-bottom: .5rem; margin-bottom: .25rem; border-bottom: 1px solid var(--ink); }
.foot__col a { padding: .55rem 0; text-decoration: none; color: var(--ink-2); transition: color .2s var(--ease); }
.foot__col a:hover { color: var(--ink); text-decoration: underline; }
.foot__legal { margin-top: var(--s-6); font-size: .8125rem; color: var(--ink-2); }

/* ---------- Scroll-driven polish (content is visible without it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .spec-group, .packing li {
      animation: rule-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
      /* tall groups on phones: finish within 9rem of the bottom edge, so text at rest is never left faded */
      animation-range: entry 0% entry min(60%, 9rem);
    }
    @keyframes rule-in {
      from { opacity: .35; translate: 0 12px; }
    }
  }
}

/* ---------- Responsive ---------- */
/* the shipping line needs a wide sheet column; the hero strip and the pre-order panel say it too */
@media (max-width: 1599px) {
  .buybar__inner { grid-template-columns: 1fr auto auto; }
  .buybar__ship { display: none; }
}

@media (max-width: 1100px) {
  .nav a:nth-child(-n+3) { display: none; }
}

/* the finish moves under the price when the bar gets tight */
@media (max-width: 980px) {
  .buybar__finish { display: none; }
  .buybar__price { display: grid; justify-items: end; line-height: 1.1; font-size: 1.25rem; }
  .buybar__price::after { content: attr(data-finish); font-size: .75rem; font-weight: 400; letter-spacing: 0; color: color-mix(in oklab, var(--bar-ink) 72%, var(--bar-bg)); }
}

@media (max-width: 860px) {
  :root { --bar-h: 68px; --head-h: 60px; --cap-h: 56px; --stage-h: clamp(300px, 46svh, 460px); --s-7: 4.5rem; }

  .nav { display: none; }
  .menu-btn { display: grid; }

  .stage-wrap { display: block; }
  .stage {
    height: var(--stage-h); min-height: 0; z-index: 3;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    overflow: clip;
  }
  .lamp-drawing { top: 54%; height: 80%; }
  .stage__bar { inset: auto var(--gutter) 6px var(--gutter); height: 44px; border-top: 0; padding-top: 0; }
  .stage__fig { line-height: 1.3; }
  .stage__fig span { display: block; margin-right: 0; }
  .sheet-strip { min-height: 0; }
  .stage__read { display: none; }
  .scene-btn { padding: 0 .75rem 0 .6rem; }
  .callout { font-size: .75rem; }

  .hero, .chapter { padding-right: var(--gutter); }
  .hero { min-height: 0; padding-top: var(--s-5); padding-bottom: var(--s-6); gap: var(--s-5); }
  .hero h1 { width: auto; max-width: none; font-size: clamp(2.6rem, 12.5vw, 4rem); }
  .dialer { --dial-size: clamp(8.5rem, 38vw, 14rem); margin-top: var(--s-4); max-width: none; }
  /* on a phone the dial comes straight after the headline, so it is in the first screen under the lamp */
  .hero__title { display: flex; flex-direction: column; }
  .dial__ends text { font-size: 17px; }
  .hero .lede { order: 2; margin-top: var(--s-4); }
  .creed { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .creed h2 { font-size: clamp(3rem, 15.5vw, 6rem); }
  .toasts { inset: auto 12px calc(var(--bar-h) + 10px) 12px; width: auto; }
  .lede { font-size: 1.0625rem; }
  .sheet-strip { grid-template-columns: 1fr 1fr; justify-content: stretch; gap: 0 var(--s-4); border-top: 0; padding-top: 0; }
  .sheet-strip > div { display: flex; justify-content: space-between; gap: var(--s-2); padding: .6rem 0; border-top: 1px solid var(--rule); }
  .sheet-strip > div:nth-child(-n+2) { border-top-color: var(--ink); }

  .chapter { min-height: calc(100svh - var(--stage-h) - var(--bar-h)); justify-content: flex-start; padding-top: var(--s-5); padding-bottom: var(--s-6); scroll-margin-top: var(--stage-h); border-top: 1px solid var(--rule); }
  .chapter h2 { font-size: 2.25rem; }
  .lead { font-size: 1.25rem; }
  .panel, .finishes, .facts { margin-top: var(--s-4); max-width: none; }
  .facts > div { grid-template-columns: 8rem 1fr; }

  .specs, .box { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); position: relative; z-index: 4; background: var(--bg); }
  .specs__side { position: static; }
  .elevation { max-width: 20rem; margin-inline: auto; }
  .spec-group { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .spec-group + .spec-group { margin-top: var(--s-4); }
  .spec-group dl > div { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .spec-group dl > div:first-child { padding-top: .6rem; border-top: 1px solid var(--rule); }

  .buybar__inner { grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-3); padding: 0 var(--gutter); }
  .buybar__what { display: none; }
  .buybar__price { justify-self: end; }
  .buybar .btn--buy { padding: 0 1.15rem; }

  .confirm { inset: auto 12px calc(var(--bar-h) + 10px) 12px; width: auto; }

  .foot__inner { grid-template-columns: minmax(0, 1fr); }
  .foot__nav { grid-template-columns: 1fr 1fr; }
  .foot__col a { padding: .65rem 0; }
  .foot { position: relative; z-index: 4; background: var(--bg); }
}

@media (max-width: 420px) {
  .foot__nav { gap: var(--s-4) var(--s-3); }
  .foot__col:last-child { grid-column: 1 / -1; }
  .dialog__actions { grid-template-columns: 1fr; }
  .seg span { padding: 0 .65rem; }
  .preset { padding: .65rem .55rem; }
  .preset span { font-size: .6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .btn__spin { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  /* the toast still needs its real lifetime; only the slide is dropped */
  .toast::after { animation-duration: var(--toast-ms, 5000ms) !important; }
}
