/* SPOOL. The site is drawn like the gauge: a black face, a status bar with the page name in
   amber and a pip per page, values in cells with an amber spine. Colours are the firmware's
   own (ui_theme.h). One look on purpose: the gauge has no light theme for the car either.
   Layout: a 1100 px column; each page is a view you turn, as on the gauge. */
:root {
  --bg: #000000;        /* the screen face */
  --cell: #070809;      /* the well behind a value */
  --edge: #16191e;      /* its hairline */
  --rule: #1c1c1c;      /* the line under the status bar */
  --track: #2a2a2a;     /* empty bar segments, idle pips */
  --dim: #6e6e6e;       /* labels, units */
  --tick: #d9d9d9;      /* clock, small text */
  --tx: #c4c6c9;        /* running text */
  --white: #ffffff;     /* numbers */
  --amber: #f7941d;
  --green: #3ddc84;
  --bezel: #0d0e10;
  --bezel-edge: #1d2024;
  --gauge: "SPOOL Montserrat", Montserrat, "Segoe UI", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font: 16px/1.65 var(--text);
}
[hidden] { display: none !important; }
a { color: var(--white); text-underline-offset: 3px; text-decoration-color: var(--dim); }
a:hover { color: var(--amber); text-decoration-color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
img { max-width: 100%; }

h1, h2 {
  font-family: var(--gauge); font-weight: 500; color: var(--white);
  line-height: 1.15; margin: 0 0 18px; text-wrap: balance;
}
h1 { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h2.sub { margin-top: 64px; }
p { margin: 0 0 1em; }
b { color: var(--white); font-weight: 600; }
.small { font-size: 14px; color: var(--dim); }
.center { text-align: center; }
.narrow { max-width: 640px; }

/* ------------------------------------------------------------ the status bar */

body::before {   /* the band above a sticky bar, on a phone */
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; gap: 14px;
  height: 58px; background: var(--bg); border-bottom: 1px solid var(--rule);
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  font-family: var(--gauge); font-weight: 500;
}
.mark { line-height: 0; }
.name {
  color: var(--amber); font-size: 19px; letter-spacing: 0.2em;
  border-bottom: 2px solid var(--amber); padding-bottom: 1px; line-height: 1.2;
}
.pips { display: flex; gap: 6px; align-items: center; }
.pips button {
  width: 7px; height: 7px; border-radius: 4px; border: 0; padding: 0; background: var(--track);
  cursor: pointer; transition: width 0.15s, background 0.15s;
}
.pips button[aria-current="true"] { background: var(--amber); width: 18px; }
.names { display: flex; gap: 22px; margin-left: auto; font-size: 13px; letter-spacing: 0.16em; }
.names a { color: var(--dim); text-decoration: none; }
.names a:hover { color: var(--tick); }
.names a[aria-current="true"] { color: var(--white); }
.clock { color: var(--tick); font-size: 17px; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }

/* ------------------------------------------------------------ the page */

main, .foot {
  max-width: 1100px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
main { padding-block: 44px 24px; }
.view { animation: turn 0.18s ease-out; }
@keyframes turn { from { opacity: 0.25; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.two > * { min-width: 0; }

/* the gauge's value cell: an amber spine, a spaced-out label, the figure under it */
.cell {
  background: var(--cell); border: 1px solid var(--edge); border-radius: 3px;
  padding: 14px 16px 16px; min-width: 0;
}
.lbl {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--gauge); font-weight: 500; font-size: 13px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--dim); line-height: 1.2;
}
.lbl::before { content: ""; width: 4px; height: 15px; background: var(--amber); flex: none; }
.num {
  display: block; font-family: var(--gauge); font-weight: 500; color: var(--white);
  font-size: 46px; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums;
}
.num small { font-size: 17px; color: var(--dim); margin-left: 8px; letter-spacing: 0.06em; }
.cell p { margin: 8px 0 0; font-size: 15px; }

.bezel {
  background: var(--bezel); border: 1px solid var(--bezel-edge); border-radius: 12px; padding: 14px;
}
.bezel canvas, .bezel > img, .g-screen {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; max-width: 100%; background: #000;
}

/* SPOOL (home) */
.home { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.home > * { min-width: 0; }
.home-gauge .small { margin-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 26px 0; max-width: 460px; }
.facts .num { font-size: 38px; }
.turn {
  display: inline-block; font-family: var(--gauge); font-weight: 500; letter-spacing: 0.06em;
  color: var(--amber); text-decoration: none; border-bottom: 2px solid var(--amber); padding-bottom: 2px;
}
.turn:hover { color: var(--white); border-color: var(--white); }
.photo { margin: 64px 0 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 3px; }
figcaption { font-size: 14px; color: var(--dim); margin-top: 10px; }
.index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 40px; }
.cell.link { text-decoration: none; color: var(--tx); display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.cell.link:hover { border-color: var(--amber); color: var(--white); }
.cell.link:hover .lbl { color: var(--white); }

/* PAGES */
.viewer { outline: none; }
.viewer:focus-visible .bezel { border-color: var(--amber); }
#screen { cursor: pointer; user-select: none; }
.stalk { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--gauge); }
.stalk button {
  width: 46px; height: 40px; border: 1px solid var(--edge); background: var(--cell); color: var(--white);
  border-radius: 3px; font-size: 15px; cursor: pointer;
}
.stalk button:hover { border-color: var(--amber); color: var(--amber); }
.stalk button:active { background: var(--track); }
.pname { color: var(--amber); letter-spacing: 0.18em; margin-left: 10px; font-weight: 500; }
.count { color: var(--dim); margin-left: auto; font-size: 14px; font-variant-numeric: tabular-nums; }
.plist { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.plist button {
  font-family: var(--gauge); font-weight: 500; font-size: 12px; letter-spacing: 0.14em;
  border: 1px solid var(--edge); background: none; color: var(--dim); padding: 5px 9px; border-radius: 3px; cursor: pointer;
}
.plist button:hover { color: var(--white); }
.plist button[aria-current="true"] { color: var(--amber); border-color: var(--amber); }
.ptext h2 { color: var(--amber); letter-spacing: 0.18em; font-size: 26px; }
.ptext #pcap { font-size: 18px; color: var(--white); line-height: 1.55; min-height: 5em; }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.groups.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 48px; }

/* PHONE */
.steps { padding-left: 1.3em; margin: 0 0 22px; }
.steps li { margin-bottom: 4px; }
.small-bezel { max-width: 460px; margin-bottom: 14px; }
.phone-col { display: flex; flex-direction: column; align-items: center; }
.phone {
  width: 340px; max-width: 100%; height: 690px; background: var(--bezel); border: 1px solid var(--bezel-edge);
  border-radius: 34px; padding: 14px 10px;
}
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 22px; display: block; background: #0b0d10; }
.phone-col .small { margin-top: 12px; }
.textbtn {
  border: 0; background: none; padding: 0; font: inherit; color: var(--tick); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--dim);
}
.textbtn:hover { color: var(--amber); }

/* UPDATE: a phone and the gauge, drawn */
.ota { display: grid; grid-template-columns: 260px 70px minmax(0, 1fr); align-items: center; margin: 36px 0 24px; }
.ota > * { min-width: 0; }
.ota-phone {
  background: var(--bezel); border: 1px solid var(--bezel-edge); border-radius: 26px; padding: 10px 8px 12px;
  font: 11px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; color: #e8eaed;
}
.ph-url { background: #1d2024; color: #9aa0a8; border-radius: 8px; padding: 3px 10px; margin: 0 4px 8px; }
.ph-screen { background: #0b0d10; border-radius: 14px; overflow: hidden; height: 370px; display: flex; flex-direction: column; }
.ph-hdr { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-bottom: 1px solid #272c33; }
.ph-hdr b { letter-spacing: 3px; font-weight: 500; font-size: 12px; color: #e8eaed; }
.ph-hdr > span { color: #8a909b; font-size: 10px; }
.ph-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 5px; vertical-align: 1px; }
.ph-dot.bad { background: #e5484d; }
.ph-body { padding: 4px 10px; flex: 1; }
.ph-h2 { color: #8a909b; font-size: 10px; letter-spacing: 1.5px; margin: 10px 0 6px; }
.ph-card { background: #15181d; border-radius: 8px; padding: 10px; }
.ph-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #272c33; }
.ph-row span { color: #8a909b; }
.ph-row b { font-weight: 500; color: #e8eaed; transition: color 0.3s; }
.ph-row b.new { color: var(--amber); }
.ph-lbl { color: #8a909b; font-size: 10px; margin: 10px 0 4px; }
.ph-file { border: 1px solid #272c33; border-radius: 6px; padding: 6px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.ph-choose { background: #e8eaed; color: #111; border-radius: 3px; padding: 1px 5px; font-size: 10px; }
.ph-prog { height: 4px; background: #272c33; border-radius: 2px; margin-top: 8px; overflow: hidden; visibility: hidden; }
.ph-prog i { display: block; height: 100%; width: 0; background: var(--amber); }
.ph-btn { border: 1px solid #272c33; border-radius: 6px; padding: 7px; text-align: center; margin-top: 8px; transition: background 0.15s; }
.ph-btn.press { background: #272c33; }
.ph-btn.off { opacity: 0.4; }
.ph-hint { color: #8a909b; font-size: 10px; margin-top: 7px; min-height: 5.6em; }
.ph-nav { display: flex; border-top: 1px solid #272c33; }
.ph-nav span { flex: 1; text-align: center; padding: 8px 0; color: #8a909b; font-size: 10px; }
.ph-nav .on { color: var(--amber); }

.ota-wire { position: relative; height: 2px; background: var(--track); margin: 0 8px; }
.ota-wire i { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); opacity: 0; }
.ota[data-step="3"] .ota-wire i { animation: send 0.9s linear infinite; }
.ota[data-step="3"] .ota-wire i:nth-child(2) { animation-delay: 0.3s; }
.ota[data-step="3"] .ota-wire i:nth-child(3) { animation-delay: 0.6s; }
@keyframes send { 0% { left: 0; opacity: 1; } 100% { left: calc(100% - 8px); opacity: 1; } }

.g-screen { position: relative; overflow: hidden; }
.g-screen > img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.35s; }
#g-page { opacity: 0; }
.g-boot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; opacity: 0; transition: opacity 0.3s; }
.g-boot img { width: 58%; height: auto; }
.ota.page #g-card { opacity: 0; }
.ota.page #g-page { opacity: 1; }
.ota.black #g-page, .ota.black #g-card { opacity: 0; transition: opacity 0.15s; }
.ota.boot .g-boot { opacity: 1; }

.ota-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ota-steps li { min-width: 0; }
.ota-steps button {
  display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; text-align: left;
  background: var(--cell); border: 1px solid var(--edge); border-radius: 3px; padding: 12px 14px 14px;
  color: var(--dim); font: 14px/1.5 var(--text); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.ota-steps button .lbl::before { background: var(--track); transition: background 0.2s; }
.ota-steps li.on button { color: var(--white); border-color: #3a3f46; }
.ota-steps li.on button .lbl { color: var(--white); }
.ota-steps li.on button .lbl::before { background: var(--amber); }

/* FIT */
.rules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

/* ORDER */
.prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; max-width: 900px; }
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 900px; margin-bottom: 10px; }
.contact .num { font-size: 26px; text-decoration: none; overflow-wrap: anywhere; }
.contact a.num:hover { color: var(--amber); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 40px; max-width: 1060px; }
.duo figure { margin: 0; }
.duo img, .narrow-photo img { display: block; width: 100%; height: auto; border-radius: 3px; }
.narrow-photo { max-width: 760px; }
.kit { margin: 0; }
.kit img { display: block; width: 100%; height: auto; border-radius: 3px; }
.duo.cars { margin-top: 56px; }
.duo figcaption b { color: var(--white); font-weight: 500; }
.todo { display: inline-block; border: 1px dashed var(--amber); color: var(--amber); padding: 4px 10px; font-size: 14px; border-radius: 3px; }
.faq { max-width: 760px; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 15px 0; color: var(--white); font-family: var(--gauge); font-weight: 500;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "▼"; color: var(--dim); font-size: 13px; font-family: var(--text); }
.faq details[open] summary::after { content: "▲"; color: var(--amber); }
.faq details p { margin: 0 0 16px; max-width: 640px; }

/* turning pages, at the foot of every view */
.turns {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; padding-top: 18px;
  border-top: 1px solid var(--rule); font-family: var(--gauge); font-weight: 500; letter-spacing: 0.16em; font-size: 15px;
}
.turns a { color: var(--dim); text-decoration: none; }
.turns a:hover { color: var(--amber); }
.foot { padding-block: 20px 40px; font-size: 13px; color: #555; }

/* ------------------------------------------------------------ narrower */

@media (max-width: 1000px) {
  /* the names get a row of their own under the bar: pips alone are too small to tap */
  .bar { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 10px; }
  .clock { margin-left: auto; }
  .names {
    order: 5; flex-basis: 100%; margin: 8px 0 0; padding: 8px 0 10px; border-top: 1px solid var(--rule);
    justify-content: space-between; gap: 8px; font-size: 12px; letter-spacing: 0.12em;
  }
  .home, .two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules, .ota-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .groups.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  main { padding-block: 28px 16px; }
  .bar { gap: 10px; }
  .name { font-size: 16px; letter-spacing: 0.16em; }
  .groups, .prices, .contact, .duo { grid-template-columns: minmax(0, 1fr); }
  .ota { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; }
  .ota-wire { display: none; }
  .ph-screen { height: 320px; }
  .ota-phone { border-radius: 18px; padding: 6px 5px 8px; font-size: 10px; }
  .bezel { padding: 8px; border-radius: 9px; }
  .phone { height: 640px; }
  h2.sub { margin-top: 48px; }
}
@media (max-width: 460px) {
  .index, .rules, .ota-steps, .groups.four { grid-template-columns: minmax(0, 1fr); }
  .ota { grid-template-columns: minmax(0, 1fr); }
  .ota-phone { max-width: 260px; }
  .pips button { width: 6px; height: 6px; }
  .pips button[aria-current="true"] { width: 14px; }
}
