/*
  Tactile Seventy: keyboard configurator (Screenery template)
  Studio product photography as a page: a soft seamless backdrop in the chosen colourway, a warm paper ground below,
  chunky Bai Jamjuree, big friendly radii and soft lifted shadows like toys on a sweep. Keycap colours are registered
  properties so the page, the SVG drawing and the 3D board all glide together when the colourway changes.

  Contents
   1. Tokens (colourway properties registered for transitions, per-colourway values)
   2. Base and browser surfaces
   3. Components: buttons, icons, fields, select, checkbox, toggle, option chips
   4. Header
   5. Hero: intro, stage (canvas over the drawn keyboard), type test, configurator
   6. Keyboard drawing (hero fallback and layout plan)
   7. Layout section
   8. Build section (exploded stack)
   9. Switch comparison and force curves
  10. Kits
  11. Buy box and states
  12. Questions
  13. Footer
  14. Motion
  15. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
@property --bd { syntax: '<color>'; inherits: true; initial-value: #f7c6ad; }
@property --bd-soft { syntax: '<color>'; inherits: true; initial-value: #fbe3d6; }
@property --deep { syntax: '<color>'; inherits: true; initial-value: #a8361d; }
@property --cap-a { syntax: '<color>'; inherits: true; initial-value: #fbf1e4; }
@property --cap-m { syntax: '<color>'; inherits: true; initial-value: #f4b49a; }
@property --cap-x { syntax: '<color>'; inherits: true; initial-value: #e8553f; }
@property --lg { syntax: '<color>'; inherits: true; initial-value: #5a2c22; }
@property --lg-x { syntax: '<color>'; inherits: true; initial-value: #fff6ef; }
@property --case { syntax: '<color>'; inherits: true; initial-value: #c9ccd1; }

:root {
  /* Ground: studio white with a breath of the colourway in it, and a plum-black ink */
  --paper: color-mix(in oklab, var(--bd) 9%, #ffffff);
  --paper-2: color-mix(in oklab, var(--bd) 30%, #ffffff);   /* wells, toggles */
  --ink: #1f1b2b;          /* 15.8:1 on paper */
  --ink-2: #4a4458;        /* secondary, 8.9:1 on paper, 6:1 on the lightest backdrop */
  --line: rgb(31 27 43 / 0.14);
  --line-strong: rgb(31 27 43 / 0.32);
  --white: #ffffff;
  --error: #b3261e;        /* 6.3:1 on paper */
  --ok: #2f6b3a;

  /* Colourway (Sherbet by default; the others below). --deep is the text-safe accent for buttons and links. */
  --bd: #f7c6ad;
  --bd-soft: #fbe3d6;
  --deep: #a8361d;
  --cap-a: #fbf1e4;
  --cap-m: #f4b49a;
  --cap-x: #e8553f;
  --lg: #5a2c22;
  --lg-x: #fff6ef;
  --case: #c9ccd1;

  /* Type */
  --sans: "Bai Jamjuree", "Trebuchet MS", system-ui, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.4rem, 1.15rem + 0.9vw, 1.75rem);
  --fs-h2: clamp(2rem, 1.35rem + 2.5vw, 3.4rem);
  --fs-h1: clamp(3rem, 1.6rem + 5vw, 6rem);

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: clamp(80px, 9vw, 136px);
  --gutter: clamp(16px, 4vw, 56px);
  --wrap: 1280px;

  /* Shape: toy radii */
  --r-1: 10px;
  --r-2: 16px;
  --r-3: 26px;
  --r-pill: 999px;

  /* Depth: soft, lifted, always offset downward like a studio key light from above */
  --sh-1: 0 2px 4px rgb(31 27 43 / 0.08), 0 6px 14px -6px rgb(31 27 43 / 0.18);
  --sh-2: 0 4px 10px rgb(31 27 43 / 0.08), 0 22px 40px -18px rgb(31 27 43 / 0.3);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);   /* exponential ease-out */
  --t-colour: 800ms;
  color-scheme: light;
}

html[data-colour="lido"] { --bd: #a6d9de; --bd-soft: #d6eef0; --deep: #0d6574; --cap-a: #f6f8f7; --cap-m: #7cc7d3; --cap-x: #f2c94c; --lg: #173a4a; --lg-x: #173a4a; }
html[data-colour="matcha"] { --bd: #c8d7ae; --bd-soft: #e3ebd5; --deep: #496528; --cap-a: #efe9d6; --cap-m: #9cb48a; --cap-x: #c7462f; --lg: #2f3d25; --lg-x: #fbf3e6; }
html[data-colour="nightswim"] { --bd: #bcb6e2; --bd-soft: #dfdcf1; --deep: #4b3c95; --cap-a: #2b3150; --cap-m: #6d5fa8; --cap-x: #f08a4b; --lg: #efe6d6; --lg-x: #2b1a10; }
html[data-case="graphite"] { --case: #4a4d55; }
html[data-case="sand"] { --case: #cdb592; }
html[data-case="red"] { --case: #c2412f; }

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--deep) var(--paper-2);
  transition: --bd var(--t-colour) var(--ease), --bd-soft var(--t-colour) var(--ease), --deep var(--t-colour) var(--ease),
    --cap-a var(--t-colour) var(--ease), --cap-m var(--t-colour) var(--ease), --cap-x var(--t-colour) var(--ease),
    --lg var(--t-colour) var(--ease), --lg-x var(--t-colour) var(--ease), --case var(--t-colour) var(--ease);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--ink); color: var(--bd); }
input, textarea { caret-color: var(--deep); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
a:hover { color: var(--deep); }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
h2 { font-size: var(--fs-h2); max-width: 20ch; }
h3 { font-size: var(--fs-xl); letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.defs { position: absolute; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: var(--s-3) var(--s-4); border-radius: var(--r-1); }
.skip:focus { top: var(--s-4); }
.skip:hover { color: var(--paper); }
/* secondary text on the coloured bands is tinted from the colourway, not grey */
.top, .hero, .band--build, .band--kits, .band--buy, .layout__plan { --ink-2: color-mix(in oklab, var(--ink) 78%, var(--deep)); }
.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.tnum, output, .kit__price, .kit b, .totals td, .config__sum, .typetest__stats, .kp__price { font-variant-numeric: tabular-nums; }

/* ---------- 3. Components ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  --btn-bg: var(--ink); --btn-fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 0 var(--s-5);
  border: 2px solid transparent; border-radius: var(--r-2);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: var(--fs-md); letter-spacing: -0.005em; text-decoration: none;
  /* a keycap: lighter top edge, soft lifted shadow */
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.18), var(--sh-1);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background-color 200ms;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.18), var(--sh-2); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.1), 0 1px 2px rgb(31 27 43 / 0.2); }
.btn--accent { --btn-bg: var(--deep); --btn-fg: var(--white); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--paper); }
.btn--ghost { --btn-bg: var(--white); --btn-fg: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-1); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--small { min-height: 44px; padding: 0 var(--s-4); font-size: var(--fs-sm); border-radius: var(--r-1); }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .ico { width: 18px; height: 18px; }

.field { display: grid; gap: var(--s-2); align-content: start; }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.field__opt { font-weight: 500; color: var(--ink-2); }
.field input, .select select, .typetest textarea {
  width: 100%; min-height: 52px; padding: var(--s-3) var(--s-4);
  border: 2px solid var(--line-strong); border-radius: var(--r-1); background: var(--white);
  transition: border-color 160ms, box-shadow 160ms;
}
.field input:hover, .select select:hover { border-color: var(--ink-2); }
.field input:focus, .select select:focus, .typetest textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--bd) 70%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field__row { position: relative; }
.field__row input { padding-right: 76px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.field__count { position: absolute; right: var(--s-4); top: 50%; translate: 0 -50%; font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.field__count.is-over { color: var(--error); font-weight: 700; }
.field__help { font-size: var(--fs-xs); color: var(--ink-2); }
.field__err { font-size: var(--fs-sm); color: var(--error); font-weight: 600; }
.field__err:empty { display: none; }
.select { position: relative; }
.select select { appearance: none; padding-right: 44px; cursor: pointer; }
.select .ico { position: absolute; right: 14px; top: 50%; translate: 0 -50%; pointer-events: none; }

.check { display: flex; gap: var(--s-3); align-items: center; min-height: 44px; cursor: pointer; font-size: var(--fs-sm); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 2px solid var(--line-strong); border-radius: 8px; background: var(--white); color: transparent; transition: background-color 160ms, border-color 160ms; }
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.check input:focus-visible + .check__box { outline: 3px solid var(--ink); outline-offset: 3px; }
.check em { font-style: normal; font-weight: 700; margin-left: var(--s-1); }

.toggle { display: inline-flex; gap: var(--s-3); align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__track { position: relative; width: 50px; height: 30px; border-radius: var(--r-pill); background: var(--paper-2); border: 2px solid var(--line-strong); transition: background-color 200ms; }
.toggle__track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); box-shadow: var(--sh-1); transition: translate 260ms var(--ease), background-color 200ms; }
.toggle input:checked + .toggle__track { background: var(--deep); border-color: var(--deep); }
.toggle input:checked + .toggle__track::after { translate: 20px 0; background: var(--white); }
.toggle input:focus-visible + .toggle__track { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- 4. Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5);
  padding: var(--s-3) var(--gutter);
  background: color-mix(in oklab, var(--bd) 88%, var(--paper));
  border-bottom: 1px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; min-height: 44px; }
.mark__cap { width: 36px; height: 36px; }
.mark__side { fill: var(--cap-x); }
.mark__face { fill: color-mix(in oklab, var(--cap-x) 70%, white); }
.mark__t { fill: none; stroke: var(--lg-x); stroke-width: 3; stroke-linecap: round; }
.mark__word { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.03em; }
.nav { display: flex; gap: var(--s-1); margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-1); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.nav a:hover { background: rgb(255 255 255 / 0.5); color: var(--ink); }
.top__price { opacity: 0.8; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  grid-template-areas: "intro config" "stage config";
  column-gap: clamp(24px, 3vw, 48px);
  row-gap: var(--s-4);
  padding: clamp(24px, 3vw, 44px) var(--gutter) var(--s-8);
  /* the seamless sweep: lighter where the key light falls, the floor deepening toward the camera */
  background:
    radial-gradient(120% 80% at 38% 28%, color-mix(in oklab, var(--bd) 55%, white) 0%, transparent 62%),
    linear-gradient(180deg, var(--bd) 0%, color-mix(in oklab, var(--bd) 88%, var(--ink)) 100%);
}
.hero__intro { grid-area: intro; display: grid; gap: var(--s-4); align-content: end; padding-top: var(--s-4); }
.hero h1 { font-size: var(--fs-h1); letter-spacing: -0.045em; line-height: 0.92; max-width: 12ch; }
.hero__lead { font-size: var(--fs-lg); max-width: 54ch; font-weight: 500; }
.hero__stage { grid-area: stage; display: grid; gap: var(--s-4); min-width: 0; }

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 300px;
  border-radius: var(--r-3);
  overflow: hidden;
  touch-action: pan-y;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 600ms var(--ease); cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.stage__drawn { position: absolute; inset: 0; display: grid; place-items: center; padding: 8% 5% 18%; transition: opacity 500ms var(--ease); }
.gl .stage canvas { opacity: 1; }
.gl .stage__drawn { opacity: 0; pointer-events: none; }
.stage__bar {
  position: absolute; left: var(--s-4); right: var(--s-4); bottom: var(--s-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap;
}
.views { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-2); background: rgb(255 255 255 / 0.72); box-shadow: var(--sh-1); }
.view, .sound {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-3); border: 0; border-radius: 12px;
  background: transparent; font-weight: 600; font-size: var(--fs-sm);
  transition: background-color 200ms, color 200ms;
}
.view:hover { background: rgb(255 255 255 / 0.9); }
.view.is-on { background: var(--ink); color: var(--paper); }
html:not(.gl) .view:not([data-view="top"]) { display: none; }
html:not(.gl) .views { display: none; }
.sound { background: rgb(255 255 255 / 0.72); box-shadow: var(--sh-1); border-radius: var(--r-2); padding: 0 var(--s-4); }
.sound:hover { background: var(--white); }
.sound .ico--off, .sound[aria-pressed="false"] .ico--on { display: none; }
.sound[aria-pressed="false"] .ico--off { display: block; }
.stage__hint { position: absolute; left: var(--s-4); top: var(--s-4); display: flex; gap: var(--s-2); align-items: center; padding: 6px 12px 6px 10px; border-radius: var(--r-pill); background: rgb(255 255 255 / 0.66); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); max-width: calc(100% - 32px); }
.gl .hint--flat, html:not(.gl) .hint--gl { display: none; }
/* without JavaScript the sound, the hint and the type test have nothing to drive them */
html:not(.js) .sound, html:not(.js) .stage__hint, html:not(.js) .typetest, html:not(.js) #hear { display: none; }

.typetest { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-5); border-radius: var(--r-3); background: rgb(255 255 255 / 0.62); box-shadow: var(--sh-1); }
.typetest__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; }
.typetest label { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.02em; }
.typetest__stats { display: flex; gap: var(--s-4); font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.typetest__stats output { font-weight: 700; color: var(--ink); font-size: var(--fs-lg); }
.typetest__prompt { font-size: var(--fs-md); font-weight: 500; color: var(--ink-2); min-height: 1.55em; }
.typetest__prompt .ok { color: var(--ink); }
.typetest__prompt .bad { color: var(--error); text-decoration: underline wavy; text-underline-offset: 0.2em; }
.typetest__prompt .cur { box-shadow: inset 0 -3px 0 var(--deep); color: var(--ink); }
.typetest textarea { resize: none; min-height: 64px; font-weight: 500; }

/* configurator panel */
.config {
  grid-area: config; align-self: start;
  position: sticky; top: 84px;
  display: grid; gap: var(--s-5);
  padding: var(--s-5);
  border-radius: var(--r-3);
  background: var(--paper);
  box-shadow: var(--sh-2);
}
.opt { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-3); min-width: 0; }
.opt legend { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 0; margin-bottom: var(--s-3); font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.02em; }
.opt__val { font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); letter-spacing: 0; }
.opt__note { font-size: var(--fs-sm); color: var(--ink-2); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.sw { position: relative; display: grid; gap: var(--s-2); justify-items: center; padding: var(--s-2) var(--s-1) var(--s-3); border-radius: var(--r-2); border: 2px solid transparent; cursor: pointer; text-align: center; transition: border-color 200ms, background-color 200ms; }
.sw:hover { background: var(--paper-2); }
.sw input, .fin input, .swt input, .kp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw:has(input:checked) { border-color: var(--ink); background: var(--white); }
.sw:has(input:focus-visible), .fin:has(input:focus-visible), .swt:has(input:focus-visible), .kp:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.sw__chip { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; width: 54px; height: 54px; }
.sw__chip i { border-radius: 9px; box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.12), 0 2px 4px rgb(31 27 43 / 0.15); }
.sw__chip i:nth-child(1) { background: var(--a); }
.sw__chip i:nth-child(2) { background: var(--m); }
.sw__chip i:nth-child(3) { background: var(--x); grid-column: span 2; }
.sw__name { font-size: var(--fs-xs); font-weight: 600; line-height: 1.2; }
.sw__stock { position: absolute; top: -9px; right: -4px; padding: 2px 7px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-size: 0.6875rem; font-weight: 700; line-height: 1.4; }
.sw.is-soldout .sw__chip { opacity: 0.55; }
.sw.is-soldout .sw__stock { background: var(--error); color: var(--white); }

.finishes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.fin { position: relative; display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-3); border-radius: var(--r-1); border: 2px solid var(--line); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; transition: border-color 200ms; }
.fin small { font-weight: 500; color: var(--ink-2); font-size: inherit; white-space: nowrap; }
.fin:hover { border-color: var(--line-strong); }
.fin:has(input:checked) { border-color: var(--ink); background: var(--white); }
.fin__dot { width: 22px; height: 22px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--c) 40%, white), var(--c) 60%, color-mix(in oklab, var(--c) 75%, black)); box-shadow: 0 1px 3px rgb(31 27 43 / 0.3); }

.switches-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.swt { position: relative; display: grid; gap: 2px; padding: var(--s-3); min-height: 60px; border-radius: var(--r-1); border: 2px solid var(--line); cursor: pointer; transition: border-color 200ms, background-color 200ms, color 200ms; }
.swt:hover { border-color: var(--line-strong); }
.swt__name { font-weight: 700; font-size: var(--fs-sm); }
.swt__sub { font-size: var(--fs-xs); color: var(--ink-2); }
.swt:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.swt:has(input:checked) .swt__sub { color: color-mix(in oklab, var(--paper) 78%, var(--ink)); }
.spec { margin: 0; display: grid; gap: 0; font-size: var(--fs-sm); }
.spec div { display: grid; grid-template-columns: 68px 1fr; gap: var(--s-3); padding: 7px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-weight: 600; color: var(--ink-2); }
.spec dd { margin: 0; font-weight: 500; }
.spec.is-swap dd { animation: spec-in 500ms var(--ease); }
#hear { justify-self: start; }

.config__foot { display: grid; gap: var(--s-3); padding-top: var(--s-4); border-top: 2px solid var(--ink); }
.config__price { display: flex; justify-content: space-between; align-items: baseline; }
.config__from { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.config__sum { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.config__ship { font-size: var(--fs-xs); color: var(--ink-2); }

/* ---------- 6. Keyboard drawing ---------- */
.kb { width: 100%; height: auto; overflow: visible; }
.kb--hero { max-width: 980px; filter: drop-shadow(0 18px 22px rgb(31 27 43 / 0.22)); }
.kb__case { fill: var(--case); stroke: color-mix(in oklab, var(--case) 70%, black); stroke-width: 2; }
.kb__plate { fill: color-mix(in oklab, var(--case) 60%, #1f1b2b); }
.k { transition: transform 90ms var(--ease); cursor: pointer; }
.k__side { fill: color-mix(in oklab, var(--cap-a) 80%, #1f1b2b); }
.k__top { fill: var(--cap-a); }
.k--mod .k__side { fill: color-mix(in oklab, var(--cap-m) 78%, #1f1b2b); }
.k--mod .k__top { fill: var(--cap-m); }
.k--accent .k__side { fill: color-mix(in oklab, var(--cap-x) 78%, #1f1b2b); }
.k--accent .k__top { fill: var(--cap-x); }
.k__lg { fill: var(--lg); font-family: var(--sans); font-weight: 600; font-size: 15px; text-anchor: middle; }
.k__lg--big { font-size: 19px; }
.k__lg--top { font-size: 12px; opacity: 0.75; }
.k__lg--mod { font-size: 12px; text-anchor: start; }
.k--accent .k__lg, .k--accent .k__glyph { fill: var(--lg-x); stroke: var(--lg-x); }
.k--accent .k__lg { stroke: none; }
.k__glyph { fill: none; stroke: var(--lg); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.k__fn { fill: var(--lg); font-family: var(--sans); font-size: 9px; font-weight: 700; text-anchor: end; opacity: 0; transition: opacity 300ms; }
.k.is-down { transform: translateY(3px); }
.k.is-down .k__top { fill: color-mix(in oklab, var(--cap-a) 82%, #1f1b2b); }
.k--mod.is-down .k__top { fill: color-mix(in oklab, var(--cap-m) 82%, #1f1b2b); }
.k--accent.is-down .k__top { fill: color-mix(in oklab, var(--cap-x) 82%, #1f1b2b); }
.knob__shadow { fill: rgb(31 27 43 / 0.25); }
.knob__ring { fill: var(--case); stroke: color-mix(in oklab, var(--case) 60%, black); stroke-width: 1.5; }
.knob__knurl { fill: none; stroke: color-mix(in oklab, var(--case) 55%, black); stroke-width: 3; stroke-dasharray: 0.5 0.5; }
.knob__cap { fill: color-mix(in oklab, var(--case) 80%, white); }
.knob__text { font-family: var(--sans); font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; text-anchor: middle; fill: color-mix(in oklab, var(--case) 45%, black); }

/* ---------- 7. Layout ---------- */
.band { padding: var(--s-9) 0; }
.band__lead { max-width: 64ch; margin-top: var(--s-4); color: var(--ink-2); font-size: var(--fs-lg); }
.band--layout { background: var(--paper); }
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-6) clamp(32px, 5vw, 80px); align-items: start; }
.layout__text { display: grid; gap: var(--s-4); grid-row: span 2; align-content: start; }
.layout__text p { max-width: 60ch; }
.layout__text h2 { margin-bottom: var(--s-2); }
.zones { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.zone { min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-pill); border: 2px solid var(--line-strong); background: var(--white); font-weight: 600; font-size: var(--fs-sm); transition: background-color 200ms, color 200ms, border-color 200ms; }
.zone:hover { border-color: var(--ink); }
.zone[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.zone__note { min-height: 3.2em; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.layout__plan, .layout__scale { margin: 0; display: grid; gap: var(--s-3); }
.layout__plan { padding: clamp(16px, 2.5vw, 32px); border-radius: var(--r-3); background: var(--bd-soft); }
figcaption { font-size: var(--fs-sm); color: var(--ink-2); max-width: 62ch; }
.kb--plan .k { cursor: default; transition: opacity 350ms var(--ease); }
.layout__plan[data-zone] .kb--plan .k, .layout__plan[data-zone] .kb--plan .kb__knob { opacity: 0.4; }
.layout__plan[data-zone="alpha"] .k[data-zone="alpha"],
.layout__plan[data-zone="num"] .k[data-zone="num"],
.layout__plan[data-zone="arrow"] .k[data-zone="arrow"],
.layout__plan[data-zone="nav"] .k[data-zone="nav"],
.layout__plan[data-zone="knob"] .kb__knob { opacity: 1; }
.layout__plan .kb__knob { transition: opacity 350ms var(--ease); }
.layout__plan.show-fn .k__fn { opacity: 1; }
.scale { width: 100%; height: auto; }
.scale__full { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 7 6; }
.scale__ours { fill: var(--case); stroke: color-mix(in oklab, var(--case) 65%, black); stroke-width: 2; }
.scale__t { font-family: var(--sans); font-weight: 700; font-size: 20px; fill: var(--ink); }
html[data-case="graphite"] .scale__ours + .scale__t, html[data-case="red"] .scale__ours + .scale__t { fill: var(--white); }
.scale__t--ghost { fill: var(--ink-2); font-weight: 600; font-size: 17px; }
.scale__mouse { fill: var(--cap-x); }
.scale__mouse--ghost { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 5 5; }
.scale__dim { fill: none; stroke: var(--ink); stroke-width: 2; }
.scale__dim--save { stroke: var(--deep); stroke-dasharray: 6 5; }
.scale__d { font-family: var(--sans); font-size: 18px; font-weight: 700; fill: var(--ink); }
.scale__d--save { fill: var(--deep); }

/* ---------- 8. Build ---------- */
.band--build { background: var(--bd-soft); }
.build { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7) clamp(32px, 5vw, 80px); align-items: center; }
.build__text { display: grid; gap: var(--s-4); }
.build__text p { max-width: 60ch; }
.build__ctl { margin-top: var(--s-2); }
.build__fig { margin: 0; padding: var(--s-4); border-radius: var(--r-3); background: var(--paper); box-shadow: var(--sh-2); }
.stack { width: 100%; height: auto; overflow: visible; }
.stack__layer { transform: translateY(0); transition: transform 900ms var(--ease); }
.build__fig:not(.is-exploded) .stack__layer { transform: translateY(calc((4 - var(--i)) * 52px)); }
.stack__label { transition: opacity 400ms var(--ease); }
.build__fig:not(.is-exploded) .stack__label { opacity: 0; }
.stack__lead { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 4; }
.stack__name { font-family: var(--sans); font-size: 15px; font-weight: 600; fill: var(--ink); }
.stack__key { display: none; margin: var(--s-4) 0 0; padding-left: 1.4em; font-size: var(--fs-sm); font-weight: 600; columns: 2; column-gap: var(--s-5); }
.stack__key li { padding: 3px 0; break-inside: avoid; }
.f-top { filter: brightness(1.08); }
.f-side { filter: brightness(0.78); }
.f-front { filter: brightness(0.92); }
.l-caps { fill: var(--cap-a); stroke: color-mix(in oklab, var(--cap-a) 70%, black); stroke-width: 0.8; }
.l-switch { fill: #e9e2d6; stroke: #8a8070; stroke-width: 0.8; }
.l-top, .l-bottom { fill: var(--case); stroke: color-mix(in oklab, var(--case) 60%, black); stroke-width: 0.8; }
.l-gasket { fill: #3c3846; }
.l-plate { fill: #e9eef2; stroke: #9aa6b0; stroke-width: 0.8; opacity: 0.95; }
.l-foam { fill: #f1e7c9; stroke: #b6a77c; stroke-width: 0.8; }
.l-pcb { fill: #2f3a32; stroke: #1b221d; stroke-width: 0.8; }
.l-brass { fill: #c9a24b; stroke: #8a6a22; stroke-width: 0.8; }
.facts { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--s-6); border-top: 2px solid var(--ink); }
.facts div { padding: var(--s-4) 0; border-bottom: 1px solid var(--line-strong); }
.facts dt { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: var(--fs-sm); }

/* ---------- 9. Switches ---------- */
.band--switches { background: var(--paper); }
.table-scroll { margin-top: var(--s-7); overflow-x: auto; border-radius: var(--r-3); background: var(--white); box-shadow: var(--sh-2); }
.cmp { width: 100%; min-width: 760px; border-collapse: collapse; font-size: var(--fs-sm); }
.cmp th, .cmp td { padding: var(--s-4) var(--s-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cmp tbody th { width: 150px; font-weight: 700; color: var(--ink-2); }
.cmp thead th { padding-top: var(--s-5); }
.cmp__name { display: block; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
.cmp__kind { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
.cmp [data-col] { transition: background-color 300ms; }
.cmp [data-col].is-current { background: color-mix(in oklab, var(--bd) 30%, white); }
.cmp thead [data-col].is-current .cmp__kind::after { content: ", on your board"; }
.cmp__pick td { border-bottom: 0; padding-bottom: var(--s-5); }
.cmp__pick td.is-current .btn { --btn-bg: var(--ink); --btn-fg: var(--paper); border-color: var(--ink); }
.curve { width: 100%; max-width: 300px; height: auto; }
.curve__grid { stroke: var(--line); stroke-width: 1; }
.curve__ax, .curve__unit { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); }
.curve__area { fill: color-mix(in oklab, var(--bd) 50%, transparent); }
.curve__line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.curve__act { stroke: var(--deep); stroke-width: 1.5; stroke-dasharray: 4 4; }
.curve__dot { fill: var(--deep); stroke: var(--white); stroke-width: 2; }
.curve__note { font-family: var(--sans); font-size: 12px; font-weight: 700; fill: var(--deep); }

/* ---------- 10. Kits ---------- */
.band--kits { background: var(--bd-soft); }
.kits { margin-top: var(--s-7); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); align-items: stretch; }
.kit { display: grid; grid-template-rows: auto 1fr auto auto; gap: var(--s-5); padding: clamp(24px, 3vw, 40px); border-radius: var(--r-3); background: var(--paper); box-shadow: var(--sh-1); border: 2px solid transparent; transition: border-color 300ms; }
.kit--hi { box-shadow: var(--sh-2); }
.kit.is-current { border-color: var(--ink); }
.kit__head { display: grid; gap: var(--s-2); }
.kit__price { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.kit__for { color: var(--ink-2); font-size: var(--fs-sm); max-width: 42ch; }
.kit__list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; }
.kit__list li { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.kit__list li.is-out { color: var(--ink-2); }
.kit__list b { font-weight: 700; white-space: nowrap; }
.kit__list .is-save b { color: var(--ok); }
.kit__total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding-top: var(--s-2); border-top: 2px solid var(--ink); font-size: var(--fs-sm); color: var(--ink-2); }
.kit__total b { font-size: var(--fs-xl); color: var(--ink); }
.kit .btn { width: 100%; }

/* ---------- 11. Buy box ---------- */
.band--buy { background: linear-gradient(180deg, var(--bd) 0%, color-mix(in oklab, var(--bd) 80%, var(--paper)) 100%); }
.buy { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-7) clamp(32px, 5vw, 80px); align-items: start; }
.buy__preview { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s-5) var(--s-6); align-items: center; position: sticky; top: 100px; }
.buy__preview > h2, .buy__board, #back-to-config { grid-column: 1 / -1; }
.buy__board { padding: var(--s-2) 0; }
.kb--buy { filter: drop-shadow(0 14px 16px rgb(31 27 43 / 0.2)); }
.kb--buy .k { cursor: default; }
.buy__knob { width: 150px; }
.knobview { width: 100%; height: auto; overflow: visible; }
.knobview__shadow { fill: rgb(31 27 43 / 0.2); filter: blur(6px); }
.knobview__ring { fill: var(--case); }
.knobview__knurl { fill: none; stroke: color-mix(in oklab, var(--case) 55%, black); stroke-width: 10; stroke-dasharray: 0.5 0.5; }
.knobview__cap { fill: color-mix(in oklab, var(--case) 82%, white); stroke: color-mix(in oklab, var(--case) 60%, black); stroke-width: 1.5; }
.knobview__text { font-family: var(--sans); font-weight: 700; font-size: 26px; letter-spacing: 0.06em; text-anchor: middle; fill: color-mix(in oklab, var(--case) 40%, black); }
.summary { margin: 0; display: grid; border-top: 2px solid var(--ink); }
.summary div { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line-strong); }
.summary dt { color: var(--ink-2); font-weight: 600; }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
#back-to-config { justify-self: start; }

.order { display: grid; gap: var(--s-5); padding: clamp(20px, 3vw, 40px); border-radius: var(--r-3); background: var(--paper); box-shadow: var(--sh-2); }
.kitpick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.kp { position: relative; display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); min-height: 56px; padding: 0 var(--s-4); border-radius: var(--r-1); border: 2px solid var(--line); cursor: pointer; font-weight: 700; transition: border-color 200ms, background-color 200ms, color 200ms; }
.kp:hover { border-color: var(--line-strong); }
.kp:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kp__price { font-weight: 600; }
.addons { display: grid; gap: var(--s-1); padding: var(--s-2) var(--s-4); border-radius: var(--r-1); background: var(--paper-2); }
.addons[hidden] { display: none; }
.order__who { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.order.is-notify .order__who, .order.is-notify .totals, .order.is-notify .addons, .order.is-notify .order__small,
.order.is-notify fieldset, .order.is-notify .field:has(#engrave) { display: none; }
.soldout { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: var(--r-2); background: color-mix(in oklab, var(--bd) 45%, white); border: 2px solid var(--ink); font-size: var(--fs-sm); }
.soldout[hidden] { display: none; }
.soldout .ico { margin-top: 2px; }
.totals { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.totals th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 7px 0; }
.totals td { text-align: right; font-weight: 600; padding: 7px 0; }
.totals tbody tr { border-bottom: 1px solid var(--line); }
.totals .is-free td { color: var(--ok); }
.totals tfoot th, .totals tfoot td { padding-top: var(--s-3); font-size: var(--fs-xl); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.totals tfoot tr { border-top: 2px solid var(--ink); }
.order__small { font-size: var(--fs-xs); color: var(--ink-2); text-align: center; margin-top: calc(var(--s-3) * -1); }
.spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgb(255 255 255 / 0.35); border-top-color: var(--white); animation: spin 800ms linear infinite; }
.is-loading .spinner { display: block; }
.status:empty { display: none; }
.status { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: var(--r-2); font-size: var(--fs-sm); }
.status .ico { margin-top: 2px; }
.status.is-error { background: #fbe6e3; color: #7d1a14; border: 2px solid var(--error); }
.status.is-ok { background: #e3f1e4; color: #1f4a27; border: 2px solid var(--ok); }
.status b { display: block; font-size: var(--fs-md); }
.status__retry { margin-top: var(--s-2); }
.order.is-done > :not(.status) { display: none; }
.order.is-done .status { padding: var(--s-6) var(--s-5); }
.order.is-done .status .btn { margin-top: var(--s-4); }

/* ---------- 12. Questions ---------- */
.band--faq { background: var(--paper); }
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--s-6) clamp(32px, 5vw, 80px); }
.faq__list { display: grid; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 64px; padding: var(--s-3) 0; cursor: pointer; list-style: none; font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: rotate 300ms var(--ease); }
.faq details[open] summary .ico { rotate: 180deg; }
.faq summary:hover { color: var(--deep); }
.faq details p { padding: 0 0 var(--s-5); max-width: 64ch; color: var(--ink-2); }

/* ---------- 13. Footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding: var(--s-8) 0 var(--s-6); }
.foot__grid { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr; gap: var(--s-6); }
.foot__word { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--s-2); }
.foot__brand p:not(.foot__word) { color: #cfc9d9; max-width: 36ch; }
.foot__addr { font-style: normal; display: grid; gap: var(--s-2); align-content: start; }
.foot__addr p { display: flex; gap: var(--s-3); align-items: center; color: #cfc9d9; }
.foot__addr a { color: var(--paper); }
.foot__addr a:hover, .foot__nav a:hover { color: var(--bd); }
.foot__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-4); align-content: start; }
.foot__nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.foot__small { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid rgb(251 248 243 / 0.18); font-size: var(--fs-xs); color: #b7b0c4; }
.foot :focus-visible { outline-color: var(--paper); }

/* ---------- 14. Motion ---------- */
@keyframes spin { to { rotate: 360deg; } }
@keyframes spec-in { from { opacity: 0.2; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }
@keyframes bump { 0% { scale: 1; } 40% { scale: 1.08; } 100% { scale: 1; } }
.is-bump { animation: bump 420ms var(--ease); display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; --t-colour: 0ms; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- 15. Narrow screens ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "stage" "config"; }
  .config { position: static; grid-template-columns: 1fr 1fr; column-gap: var(--s-6); }
  .config__foot { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; }
  .config__ship { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .top__cta { margin-left: auto; }
  .layout, .build, .buy, .faq { grid-template-columns: minmax(0, 1fr); }
  .layout__text { grid-row: auto; }
  .buy__preview { position: static; }
  .kits { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .config { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .config__foot { grid-template-columns: minmax(0, 1fr); }
  .stage { aspect-ratio: 4 / 3.4; min-height: 0; border-radius: var(--r-2); }
  .stage__drawn { padding: 14% 3% 30%; }
  .stage__hint { right: var(--s-4); }
  .stage__bar { left: var(--s-2); right: var(--s-2); bottom: var(--s-2); gap: var(--s-2); }
  .views { flex: 1 1 auto; }
  .view { flex: 1; justify-content: center; padding: 0 var(--s-2); }
  .view span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sound span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sound { padding: 0 var(--s-3); }
  .typetest { padding: var(--s-4); }
  .stack__label { display: none; }
  .stack__key { display: block; columns: 1; }
  .cmp tbody th, .cmp thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--white); width: 104px; box-shadow: 1px 0 0 var(--line); }
  .cmp { min-width: 820px; }
  .order__who, .kitpick { grid-template-columns: minmax(0, 1fr); }
  .finishes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .foot__grid { grid-template-columns: minmax(0, 1fr); }
  .buy__preview { grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-4); }
  .buy__knob { width: 96px; }
  .mark__word { font-size: var(--fs-md); }
  .top { gap: var(--s-3); }
}
@media (max-width: 400px) {
  .swatches { gap: 4px; }
  .sw__chip { width: 46px; height: 46px; }
  .top__price { display: none; }
}
