/*
  Halcyon Lens: AR glasses product page (Screenery template)
  Spatial daylight: a warm paper-white room, kingfisher blue and a little kingfisher orange, Readex Pro throughout.
  UI floats at depth: panels carry two-layer soft shadows; focusing one dims and blurs everything behind it.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Components: buttons, chips, icons, fields
   4. Header
   5. Hero: intro, stage (WebGL canvas, CSS3D layer, drawn fallback room), panes, dock
   6. The glasses (exploded drawing, specs)
   7. Comfort
   8. Privacy
   9. Prescription
  10. Compare
  11. Buy (preview, order form, prescription grid, states)
  12. Questions
  13. Footer
  14. Narrow screens and reduced motion
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Daylight ground */
  --ground: #eef0ec;        /* cool daylight: the light in the room, not its walls */
  --ground-2: #fbfaf7;      /* raised: panels, fields */
  --tint: #e1e6e2;          /* alternate bands, the floor in shade */
  --ink: #1d2830;           /* 13.6:1 on ground */
  --ink-2: #44515a;         /* 7.3:1 on ground, 6.6:1 on tint */
  --ink-3: #54606a;         /* 5.6:1 on ground, 5.1:1 on tint */
  --line: rgb(29 40 48 / 0.13);
  --line-strong: rgb(29 40 48 / 0.26);

  /* Kingfisher: blue back, orange breast */
  --accent: #17647f;        /* 5.9:1 on ground */
  --accent-deep: #0f4b61;
  --accent-soft: #d7e6eb;
  --on-accent: #f8fbfb;
  --warm: #a54b1b;          /* 5.3:1 on ground */
  --warm-soft: #f2dccb;
  --error: #a3321f;
  --error-soft: #f6ddd5;
  --ok: #2c6a46;
  --ok-soft: #d9eadf;

  /* Floating panes */
  --pane: rgb(252 251 248 / 0.88);
  --pane-edge: rgb(255 255 255 / 0.95);
  --depth-1: 0 1px 1px rgb(29 40 48 / 0.06), 0 8px 18px -10px rgb(29 40 48 / 0.28);
  --depth-2: 0 1px 2px rgb(29 40 48 / 0.08), 0 26px 50px -22px rgb(29 40 48 / 0.42);
  --depth-3: 0 2px 4px rgb(29 40 48 / 0.1), 0 40px 80px -30px rgb(29 40 48 / 0.55);

  /* Type */
  --font: "Readex Pro", "Segoe UI", 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(1.9rem, 1.3rem + 2.2vw, 3.1rem);
  --fs-h1: clamp(2.5rem, 1.5rem + 3.6vw, 4.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, 140px);
  --gutter: clamp(16px, 4vw, 56px);
  --wrap: 1200px;

  /* Shape: soft, like moulded glass */
  --r-1: 8px;
  --r-2: 14px;
  --r-3: 22px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);   /* exponential ease-out */
  --header-h: 64px;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); scrollbar-color: #b9c4c9 var(--ground); accent-color: var(--accent); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--on-accent); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: #b9c4c9; border-radius: 12px; border: 3px solid var(--ground); }
input, textarea { caret-color: var(--warm); }
h1, h2, h3 { font-weight: 400; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; margin: 0; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
b, strong { font-weight: 500; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; border-radius: 6px; }
table { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: var(--s-4); top: -60px; z-index: 50; background: var(--ink); color: var(--ground); padding: var(--s-2) var(--s-4); border-radius: var(--r-1); }
.skip:focus { top: var(--s-3); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.band { padding-block: var(--s-9); }
.band--tint { background: var(--tint); }
.lede { max-width: 62ch; color: var(--ink-2); font-size: var(--fs-lg); margin-top: var(--s-4); }

/* ---------- 3. Components ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-pill); border: 1px solid transparent;
  font: 400 var(--fs-sm)/1 var(--font); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.3s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease), color 0.3s var(--ease);
}
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--depth-1); }
.btn--primary:hover { background: var(--accent-deep); box-shadow: var(--depth-2); transform: translateY(-1px); }
.btn--quiet { background: var(--ground-2); color: var(--ink); border-color: var(--line); }
.btn--quiet:hover { border-color: var(--line-strong); box-shadow: var(--depth-1); }
.btn--sm { min-height: 44px; padding: 0 var(--s-4); }
.btn--wide { width: 100%; min-height: 56px; font-size: var(--fs-md); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 var(--s-4);
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  font: 400 var(--fs-sm)/1 var(--font); cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.chip-btn:hover { border-color: var(--line-strong); }
.chip-btn .ico { width: 18px; height: 18px; }

/* Fields */
.field { display: grid; gap: 6px; }
.field label, .fit > label { font-weight: 400; font-size: var(--fs-sm); }
input[type="email"], input[type="number"], input[inputmode] {
  width: 100%; min-height: 48px; padding: 0 var(--s-4);
  border: 1px solid var(--line-strong); border-radius: var(--r-1);
  background: var(--ground-2); color: var(--ink);
  font: 400 var(--fs-md)/1 var(--font); font-variant-numeric: tabular-nums;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
input::placeholder { color: #67727a; }
input:hover { border-color: #8a959b; }
input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(23 100 127 / 0.22); }
input[aria-invalid="true"] { border-color: var(--error); background: #fdf6f3; }
input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgb(163 50 31 / 0.2); }
.msg { font-size: var(--fs-xs); color: var(--ink-3); min-height: 0; }
.msg.is-error { color: var(--error); }
.msg:empty { display: none; }
.unit { color: var(--ink-3); font-size: var(--fs-sm); }

/* ---------- 4. Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s-5);
  height: var(--header-h); padding-inline: var(--gutter);
  background: rgb(238 240 236 / 0.86);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--fs-lg); letter-spacing: -0.02em; min-height: 44px; }
.mark__glyph { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.nav { display: flex; gap: var(--s-1); margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); padding: 10px var(--s-3); border-radius: var(--r-pill); }
.nav a:hover { color: var(--ink); background: rgb(29 40 48 / 0.06); }

/* ---------- 5. Hero ---------- */
.hero { position: relative; }
.hero__intro { position: relative; z-index: 4; padding: var(--s-7) var(--gutter) var(--s-6); max-width: 36rem; }
.hero h1 { font-size: var(--fs-h1); font-weight: 300; letter-spacing: -0.035em; }
.hero__lede { margin-top: var(--s-5); font-size: var(--fs-lg); color: var(--ink-2); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__fine { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--ink-3); }

.stage {
  --stage-h: clamp(560px, 82svh, 900px);
  position: relative;
  height: var(--stage-h);
  overflow: hidden;
  background: var(--ground);
  isolation: isolate;
  touch-action: pan-y;
  cursor: grab;
}
.stage:active { cursor: grabbing; }
.stage:focus-visible { outline: 2px solid var(--warm); outline-offset: -6px; border-radius: 0; }

/* WebGL canvas and the CSS3D layer, both filled in by script.js */
.stage canvas.room-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0;
  transition: filter 0.7s var(--ease), transform 0.9s var(--ease); }
.stage.has-focus canvas.room-gl { filter: blur(6px) saturate(0.85) brightness(1.02); transform: scale(1.03); }
.css3d { position: absolute !important; inset: 0; z-index: 2; pointer-events: none; }
.css3d * { pointer-events: none; }
.css3d .pane, .css3d .pane * { pointer-events: auto; }

/* Drawn fallback room: three layers at three depths */
.flat { position: absolute; inset: 0; z-index: 0; perspective: 1400px; perspective-origin: 60% 40%; transition: filter 0.7s var(--ease); }
.flat__layer { position: absolute; inset: -4%; width: 108%; height: 108%; }
.flat__mid { transform: translateZ(40px) scale(0.97); }
.flat__front { transform: translateZ(90px) scale(0.94); }
.stage.has-focus .flat { filter: blur(5px) saturate(0.85); }
.stage.is-3d .flat { display: none; }

/* The panes */
.panes { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pane {
  --w: 330px;
  position: absolute; width: var(--w);
  padding: var(--s-4) var(--s-5) var(--s-5);
  background: var(--pane);
  border: 1px solid var(--pane-edge);
  border-radius: var(--r-3);
  box-shadow: var(--depth-2);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  color: var(--ink);
  font-size: var(--fs-sm);
  pointer-events: auto;
  user-select: none;
  transition: opacity 0.6s var(--ease), filter 0.6s var(--ease), box-shadow 0.6s var(--ease), translate 0.7s var(--ease), scale 0.7s var(--ease), visibility 0.6s;
}
.pane--cal { --w: 340px; }
.pane--timer { --w: 310px; }
.pane--nav { --w: 300px; }
.pane--cc { --w: 500px; }
.stage.is-narrow .pane--cc { --w: 360px; }
.stage.is-3d .panes { display: none; }
.pane.is-dim { opacity: 0.4; filter: blur(3px) saturate(0.7); }
.pane.is-focused { box-shadow: var(--depth-3); border-color: #fff; }
.pane.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; filter: blur(8px); }

.pane__head {
  display: flex; align-items: center; gap: var(--s-2); width: calc(100% + 16px); margin: 0 -8px var(--s-3);
  min-height: 44px; padding: 0 8px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink);
  font: 500 var(--fs-sm)/1.25 var(--font); text-align: left; cursor: pointer;
}
.pane__head span { flex: 1; }
.pane__head:hover { background: rgb(29 40 48 / 0.05); }
.pane__head .ico { color: var(--accent); }
.pane__corner { opacity: 0.55; }
.pane.is-focused .pane__corner { opacity: 1; color: var(--warm); }

/* Calendar */
.cal { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cal__item { display: grid; grid-template-columns: 3.4em 1fr; gap: var(--s-3); padding: 8px 10px; border-radius: var(--r-1); }
.cal__item time { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.cal__item small { display: block; color: var(--warm); font-size: var(--fs-xs); margin-top: 2px; }
.cal__item.is-done span { text-decoration: line-through; text-decoration-color: rgb(29 40 48 / 0.4); color: var(--ink-3); }
.cal__item.is-next { background: var(--accent-soft); }
.cal__item.is-next time { color: var(--accent-deep); font-weight: 500; }

/* Timer */
.timer__step { color: var(--ink-2); }
.timer__clock { font-size: 3.4rem; font-weight: 200; line-height: 1; letter-spacing: -0.03em; margin: var(--s-4) 0 var(--s-3); font-variant-numeric: tabular-nums; }
.timer__track { height: 4px; border-radius: 4px; background: rgb(29 40 48 / 0.1); overflow: hidden; }
.timer__track span { display: block; height: 100%; width: 100%; background: var(--warm); transform-origin: left; transform: scaleX(var(--p, 1)); transition: transform 0.9s linear; }
.timer__controls { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.pane--timer.is-running .timer__clock { color: var(--warm); }
.pane--timer.is-done .timer__clock { color: var(--ok); }

/* Navigation */
.navi { display: flex; align-items: center; gap: var(--s-4); }
.navi__arrow { width: 64px; height: 64px; flex: none; fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.navi p { display: grid; gap: 2px; }
.navi strong { font-size: var(--fs-lg); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.navi span { color: var(--ink-2); }
.navi__eta { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Captions */
.cc { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); font-size: var(--fs-md); line-height: 1.45; min-height: 8.6em; align-content: end; }
.cc li { animation: none; }
.cc li.is-old { color: var(--ink-3); }
.who { display: inline-block; min-width: 3.4em; font-weight: 500; font-size: var(--fs-sm); }
.who--a { color: var(--accent); }
.who--b { color: var(--warm); }
.who--me { color: var(--ink-3); }
.cc .caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: var(--warm); }
.cc__pause { margin-top: var(--s-4); }

/* Fallback placement (no WebGL): the panes sit over the drawn room at fixed spots per mode */
.stage:not(.is-3d) .pane { translate: 0 0; }
.stage:not(.is-3d) .pane--cal { left: 40%; top: 9%; }
.stage:not(.is-3d) .pane--timer { left: 70%; top: 18%; }
.stage:not(.is-3d) .pane--nav { left: 52%; top: 56%; }
.stage:not(.is-3d) .pane--cc { left: 42%; top: 52%; }
.stage[data-mode="social"]:not(.is-3d) .pane--nav { left: 68%; top: 12%; }
.stage:not(.is-3d) .pane.is-focused { z-index: 3; scale: 1.08; translate: 0 -10px; }
.stage:not(.is-3d) .pane--cal { scale: 0.92; }
.stage:not(.is-3d) .pane--cal.is-focused { scale: 1.06; }

.stage__off {
  position: absolute; z-index: 3; left: 50%; top: 42%; translate: -50% 0;
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
  background: rgb(252 251 248 / 0.9); box-shadow: var(--depth-1);
  color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.stage[data-mode="off"] .stage__off { opacity: 1; visibility: visible; }

/* Dock: modes and the hint */
.dock {
  position: absolute; z-index: 5; left: var(--gutter); bottom: var(--s-6);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5);
  max-width: calc(100% - 2 * var(--gutter));
}
.modes { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: rgb(252 251 248 / 0.92); box-shadow: var(--depth-2); border: 1px solid #fff; }
.modes button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 var(--s-4);
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2);
  font: 400 var(--fs-sm)/1 var(--font); cursor: pointer;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.modes button:hover { color: var(--ink); }
.modes button[aria-checked="true"] { background: var(--ink); color: var(--ground); }
.modes .ico { width: 18px; height: 18px; }
.dock__hint { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); background: rgb(238 240 236 / 0.85); padding: 6px 12px; border-radius: var(--r-pill); }
.stage:not(.is-3d) .dock__hint .ico { display: none; }

/* Wide desktop: the room is the whole first screen and the intro sits on its wall.
   Below 1280px the panes would reach the text, so the intro stacks above the room instead. */
@media (min-width: 1280px) {
  .stage__off { left: 64%; }
  .hero { min-height: calc(100svh - var(--header-h)); }
  .stage { position: absolute; inset: 0; height: auto; }
  .hero__intro { position: absolute; top: 0; left: 0; padding-top: clamp(40px, 8vh, 96px); pointer-events: none; }
  .hero__intro a { pointer-events: auto; }
  .hero__intro::before { content: ""; position: absolute; inset: -10% -30% -10% -20%; z-index: -1; background: radial-gradient(closest-side, rgb(238 240 236 / 0.85), rgb(238 240 236 / 0)); }
}

/* ---------- 6. The glasses ---------- */
.glasses__grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-8); align-items: center; }
.glasses__copy > p { margin-top: var(--s-5); color: var(--ink-2); max-width: 52ch; }
.explode { display: grid; gap: var(--s-2); margin-top: var(--s-6); font-size: var(--fs-sm); color: var(--ink-2); max-width: 26rem; }
.explode input { width: 100%; height: 44px; cursor: ew-resize; }
.layers { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: 0; counter-reset: layer; }
.layers li {
  counter-increment: layer;
  display: grid; grid-template-columns: 28px 1fr; column-gap: var(--s-3);
  padding: var(--s-3) 0; border-top: 1px solid var(--line);
  transition: color 0.3s var(--ease);
}
.layers li::before { content: counter(layer); grid-row: span 2; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font-size: var(--fs-xs); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.layers b { font-weight: 500; }
.layers span { color: var(--ink-2); font-size: var(--fs-sm); }
.layers li.is-hot::before { background: var(--accent); color: var(--on-accent); }

.draw { margin: 0; }
.draw__svg { width: 100%; height: auto; display: block; overflow: visible; }
.draw__layer { transform: translate(calc((var(--i) - 1.5) * var(--e) * 62px), calc((var(--i) - 1.5) * var(--e) * -42px)); transition: transform 0.6s var(--ease), opacity 0.4s var(--ease); }
.draw__layer .tag { fill: var(--ground-2); stroke: var(--accent); stroke-width: 1.5; }
.draw__layer .tag-n { fill: var(--accent); font: 500 13px var(--font); }
.draw.is-hot .draw__layer:not(.is-hot) { opacity: 0.35; }
.draw__beam { animation: beam 2.4s linear infinite; }
@keyframes beam { to { stroke-dashoffset: -44; } }
.draw figcaption { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--ink-3); max-width: 60ch; }

.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--s-6); margin-top: var(--s-8); }
.specs div, .facts div { padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.specs dt, .facts dt, .rx__list dt { font-size: var(--fs-sm); color: var(--ink-3); }
.specs dd, .facts dd, .rx__list dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 400; letter-spacing: -0.01em; }

/* ---------- 7. Comfort ---------- */
.comfort__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--s-6); margin-top: var(--s-7); align-items: start; }
.weigh, .day { margin: 0; padding: var(--s-6); background: var(--ground-2); border-radius: var(--r-3); box-shadow: var(--depth-1); }
.weigh figcaption p, .day figcaption p { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--fs-sm); max-width: 52ch; }
.weigh table, .day table { width: 100%; border-collapse: collapse; margin-top: var(--s-5); font-size: var(--fs-sm); }
.weigh th, .weigh td, .day th, .day td { text-align: left; font-weight: 300; padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.weigh td:last-child, .day td:last-child, .weigh thead th:last-child, .day thead th:last-child { text-align: right; }
thead th { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; border-top: 0 !important; padding-bottom: 6px !important; }
tfoot th, tfoot td { font-weight: 500 !important; }
.day td:first-child { color: var(--ink-3); width: 5.2em; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 10px; vertical-align: 0; }
.weigh__bar, .day__bar { display: flex; gap: 3px; height: 14px; margin-top: var(--s-5); }
.weigh__bar span { flex: var(--w) 0 0; background: var(--c); border-radius: 4px; }
.day__bar span { flex: var(--m) 0 0; background: var(--c); border-radius: 4px; }
.day__bar .day__left { background: transparent; border: 1.5px dashed var(--line-strong); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 var(--s-6); margin-top: var(--s-7); }

/* ---------- 8. Privacy ---------- */
.privacy__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7) var(--s-8); align-items: center; }
.privacy__grid > div > p { margin-top: var(--s-5); color: var(--ink-2); max-width: 56ch; }
.led-demo { margin-top: var(--s-6); }
.led-states { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.led-states button {
  min-height: 44px; padding: 0 var(--s-4);
  border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  font: 400 var(--fs-sm)/1 var(--font); cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.led-states button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.led-says { margin-top: var(--s-4); min-height: 3.2em; color: var(--ink-2); font-size: var(--fs-sm); max-width: 52ch; }
.hinge { margin: 0; padding: var(--s-6); border-radius: var(--r-3); background: radial-gradient(120% 90% at 70% 30%, #fbfaf7, var(--tint)); box-shadow: var(--depth-1); }
.hinge svg { width: 100%; height: auto; display: block; }
.hinge figcaption { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-3); }
.hinge__led { fill: #3a464e; transition: fill 0.25s var(--ease); }
.hinge__glow { fill: #fff; opacity: 0; filter: blur(6px); transition: opacity 0.25s var(--ease); }
.hinge[data-led="photo"] .hinge__led, .hinge[data-led="video"] .hinge__led { fill: #fffef8; }
.hinge[data-led="photo"] .hinge__glow { opacity: 0.95; }
.hinge[data-led="video"] .hinge__glow { opacity: 0.95; animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.promises { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--s-7); }
.promises li { padding: var(--s-4) 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); max-width: 60ch; }
.promises b { display: block; color: var(--ink); font-size: var(--fs-md); margin-bottom: 2px; }

/* ---------- 9. Prescription ---------- */
.rx__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--s-8); align-items: center; }
.rx__grid > div > p { margin-top: var(--s-5); color: var(--ink-2); max-width: 56ch; }
.rx__fig { margin: 0; }
.rx__fig svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 30px rgb(29 40 48 / 0.18)); }
.rx__insert { transform: translate(14px, -8px); transition: transform 0.9s var(--ease); }
.rx__fig:hover .rx__insert { transform: translate(-30px, 8px); }
.rx__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--s-6); margin: var(--s-6) 0; }
.rx__list div { padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.rx__list dd { font-size: var(--fs-md); }

/* ---------- 10. Compare ---------- */
.compare__table-wrap { margin-top: var(--s-7); overflow-x: auto; border-radius: var(--r-3); background: var(--ground-2); box-shadow: var(--depth-1); }
.compare__table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare__table th, .compare__table td { text-align: left; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); font-weight: 300; vertical-align: top; }
.compare__table thead th { font-size: var(--fs-xl) !important; color: var(--ink) !important; font-weight: 400 !important; padding-top: var(--s-6) !important; vertical-align: bottom; }
.compare__table thead th, .compare__table thead td { border-top: 0; }
.compare__table tbody th { color: var(--ink-3); font-size: var(--fs-sm); width: 22%; }
.compare__table tfoot td { padding-block: var(--s-5); }
.frame-ico { display: block; width: 120px; height: 48px; margin-bottom: var(--s-2); fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 11. Buy ---------- */
.buy__grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-8); align-items: start; }
.buy__preview { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
.buy__frame { margin: var(--s-6) 0 0; padding: var(--s-6) var(--s-5) var(--s-4); background: var(--ground-2); border-radius: var(--r-3); box-shadow: var(--depth-2); text-align: center; }
.buy__frame svg { width: 100%; max-width: 360px; height: auto; display: block; margin-inline: auto; }
.buy__frame g { fill: none; stroke: var(--frame, #c9b393); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.5s var(--ease), stroke 0.5s var(--ease); }
.buy__frame[data-frame="arc"] .f-plane, .buy__frame[data-frame="plane"] .f-arc { opacity: 0; }
.buy__frame[data-colour="sand"] { --frame: #b39a76; }
.buy__frame[data-colour="slate"] { --frame: #4c5862; }
.buy__frame[data-colour="kelp"] { --frame: #4f6b55; }
.buy__frame figcaption { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-2); }
.summary { margin: var(--s-6) 0 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.summary div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 10px 0; border-top: 1px solid var(--line); }
.summary dd { margin: 0; }
.summary [hidden] { display: none; }
.summary__total { font-size: var(--fs-lg); font-weight: 500; border-top-color: var(--line-strong) !important; }
.summary__total dt { font-weight: 400; }
.buy__fine { margin-top: var(--s-4); color: var(--ink-3); font-size: var(--fs-sm); max-width: 48ch; }

.order { display: grid; gap: var(--s-6); padding: var(--s-6); background: var(--ground-2); border-radius: var(--r-3); box-shadow: var(--depth-2); }
.group { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-3); min-width: 0; }
.group legend { padding: 0; margin-bottom: var(--s-3); font-weight: 500; font-size: var(--fs-md); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.card { position: relative; cursor: pointer; }
.card input, .swatch input, .size input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.card > span { display: grid; gap: 2px; padding: var(--s-4); min-height: 88px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: #fff; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease); }
.card b { font-weight: 500; }
.card small { color: var(--ink-3); font-size: var(--fs-xs); }
.card em { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.card:hover > span { border-color: #8a959b; }
.card input:checked + span { border-color: var(--accent); background: #f2f7f8; box-shadow: 0 0 0 1px var(--accent) inset, var(--depth-1); }
.card input:focus-visible + span, .swatch input:focus-visible + span, .size input:focus-visible + span { outline: 2px solid var(--warm); outline-offset: 3px; }

.swatches { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.swatch { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; cursor: pointer; font-size: var(--fs-sm); }
.swatch span { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12); transition: box-shadow 0.3s var(--ease); }
.swatch input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.swatch.is-unavailable { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.hint { font-size: var(--fs-xs); color: var(--warm); }

.fit { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-2); background: var(--ground); }
.fit > label { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--ink-2); }
.fit > label .ico { color: var(--accent); margin-top: 2px; }
.fit__row { display: flex; align-items: center; gap: var(--s-2); max-width: 12rem; }
.fit__out { font-size: var(--fs-xs); color: var(--ink-3); }
.fit__out.is-set { color: var(--accent-deep); }
.fit__out.is-error { color: var(--error); }
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.size { position: relative; cursor: pointer; }
.size > span { display: grid; place-items: center; gap: 0; min-height: 64px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: #fff; font-size: var(--fs-xs); color: var(--ink-3); transition: border-color 0.3s var(--ease); }
.size b { font-size: var(--fs-lg); color: var(--ink); font-weight: 500; line-height: 1.1; }
.size input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #f2f7f8; }
.size.is-unavailable { opacity: 0.45; cursor: not-allowed; }

.rxform { display: grid; gap: var(--s-4); margin-top: var(--s-2); padding: var(--s-5); border-radius: var(--r-2); background: var(--ground); }
.rxform[hidden] { display: none; }
.rxform__intro { font-size: var(--fs-sm); color: var(--ink-2); }
.rxgrid { width: 100%; border-collapse: separate; border-spacing: 6px; margin: 0 -6px; }
.rxgrid th { text-align: left; font-weight: 400; font-size: var(--fs-sm); }
.rxgrid thead th { font-size: var(--fs-xs) !important; }
.rxgrid tbody th small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.rxgrid input { text-align: center; padding: 0 6px; }
.rxerrors { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--error); }
.rxerrors:empty { display: none; }
.field--pd .fit__row { max-width: 10rem; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: 44px; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.check.is-error { color: var(--error); }

.order__submit { display: grid; gap: var(--s-3); }
.order__note { font-size: var(--fs-xs); color: var(--ink-3); text-align: center; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { rotate: 360deg; } }
.notice { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-2); font-size: var(--fs-sm); }
.notice[hidden] { display: none; }
.notice--error { background: var(--error-soft); color: #6d1f12; }
.notice--error .ico { color: var(--error); margin-top: 2px; }

.done { padding: var(--s-7) var(--s-6); background: var(--ground-2); border-radius: var(--r-3); box-shadow: var(--depth-3); }
.done[hidden], .order[hidden] { display: none; }
@media (min-width: 1024px) { .done { grid-column: 2; grid-row: 1; } }
.done:focus { outline: none; }
.done__ico { width: 52px; height: 52px; padding: 12px; border-radius: 50%; background: var(--ok-soft); fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.done h3 { margin-top: var(--s-4); font-size: var(--fs-xl); font-weight: 400; }
.done > p { margin-top: var(--s-3); color: var(--ink-2); max-width: 52ch; }
.done .summary { margin-bottom: var(--s-5); }

/* ---------- 12. Questions ---------- */
.faq__grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: var(--s-8); align-items: start; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.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-size: var(--fs-lg); font-weight: 400; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: rotate 0.4s var(--ease); color: var(--accent); }
.faq details[open] summary .ico { rotate: 180deg; }
.faq details p { padding: 0 0 var(--s-5); color: var(--ink-2); max-width: 62ch; }

/* ---------- 13. Footer ---------- */
.foot { padding-block: var(--s-8) var(--s-6); background: var(--ink); color: #dfe5e7; }
.foot__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-6); }
.foot__mark { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xl); font-weight: 400; color: #fff; }
.foot__mark .mark__glyph { stroke: #8fc3d6; }
.foot__line { margin-top: var(--s-3); max-width: 46ch; font-size: var(--fs-sm); color: #c3ccd0; }
.foot__nav { display: grid; grid-template-columns: repeat(2, auto); gap: 0 var(--s-6); align-content: start; }
.foot__nav a { color: #dfe5e7; text-decoration: none; font-size: var(--fs-sm); min-height: 40px; display: inline-flex; align-items: center; }
.foot__nav a:hover { text-decoration: underline; }
.foot__fine { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid rgb(255 255 255 / 0.14); font-size: var(--fs-xs); color: #aab5ba; }
.foot ::selection { background: #8fc3d6; color: var(--ink); }

/* ---------- 14. Narrow screens and reduced motion ---------- */
@media (max-width: 1023px) {
  .nav { display: none; }
  .top .btn { margin-left: auto; }
  .hero__intro { max-width: 40rem; padding-top: var(--s-6); }
  .stage { --stage-h: clamp(620px, 94svh, 920px); }
  /* Fallback room on narrow screens: panes stack in a column over the drawing */
  .stage:not(.is-3d) { height: auto; min-height: 560px; }
  .stage:not(.is-3d) .panes { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); padding: var(--s-6) var(--gutter) 150px; }
  .stage:not(.is-3d) .pane { position: relative; left: auto !important; top: auto !important; width: min(var(--w), 100%); scale: 1 !important; }
  .stage:not(.is-3d) .pane:nth-child(even) { align-self: flex-end; margin-right: 4%; }
  .stage:not(.is-3d) .pane:nth-child(odd) { align-self: flex-start; margin-left: 4%; }
  .stage:not(.is-3d) .pane.is-hidden { display: none; }
  .stage:not(.is-3d) .pane--cc { width: 100%; }
  .stage:not(.is-3d) .stage__off { top: 40%; }
  .dock { left: var(--gutter); right: var(--gutter); bottom: var(--s-5); justify-content: center; }
  .glasses__grid, .privacy__grid, .rx__grid, .buy__grid, .faq__grid, .comfort__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .buy__preview { position: static; }
  .rx__fig { max-width: 420px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .specs { grid-template-columns: 1fr 1fr; }
  .promises, .rx__list { grid-template-columns: 1fr; }
  .weigh, .day, .order { padding: var(--s-5) var(--s-4); }
  .hero__cta .btn { flex: 1 1 auto; }
  .dock__hint { display: none; }
  .modes button { padding: 0 var(--s-3); }
  .stage:not(.is-3d) .pane { width: min(var(--w), 92%); }
  .stage:not(.is-3d) .pane:nth-child(n) { align-self: center; margin: 0; }
  .stage:not(.is-3d) .pane--cc { width: 100%; }
  .stage__off { white-space: normal; width: calc(100% - 2 * var(--gutter)); justify-content: center; text-align: center; }
  .cards { grid-template-columns: 1fr 1fr; }
  /* Compare: each row becomes a label over two side-by-side values, no sideways scroll */
  .compare__table { min-width: 0; }
  .compare__table tr { display: grid; grid-template-columns: 1fr 1fr; }
  .compare__table thead td:first-child, .compare__table tfoot td:first-child { display: none; }
  .compare__table th, .compare__table td { padding: var(--s-3) var(--s-4); }
  .compare__table tbody th { grid-column: 1 / -1; width: auto; padding-bottom: 0; }
  .compare__table tbody td { border-top: 0; padding-top: 4px; }
  .compare__table thead th { padding-top: var(--s-5) !important; }
  .frame-ico { width: 96px; height: 40px; }
  .compare__table tfoot .btn { width: 100%; padding: 0 var(--s-3); }
  .specs dd, .facts dd, .rx__list dd { font-size: var(--fs-md); }
  .top .btn { padding: 0 var(--s-3); }
}
@media (max-width: 380px) {
  .facts, .specs { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .hinge[data-led="video"] .hinge__glow { animation: none; }
}
