/* Motorbook
   Concept: the instrument cluster of a classic car. A racing-green hero holds the
   headline and a rolling odometer; below it, a car's records are laid out against
   the kilometres they happened at, the way a service book reads.
   Palette: racing green, brass needle, cool sage paper. Type: Big Shoulders Display
   (condensed, signage-like) for headlines and numbers; Instrument Sans for reading. */
:root {
  --green: #17352a;
  --green-soft: #21493a;
  --on-green: #e9efe9;
  --on-green-muted: #a9bdb2;
  --brass: #d6a92e;
  --paper: #eef1ec;
  --sheet: #f8faf7;
  --ink: #15211b;
  --muted: #56665d;
  --rule: #cfd8d1;
  --drum: #0f1512;
  --drum-digit: #f2f4f1;

  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --text: "Instrument Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 64px);
  --max: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #123024;
    --green-soft: #1b4233;
    --paper: #0f1814;
    --sheet: #15201b;
    --ink: #e5ece7;
    --muted: #9cafa4;
    --rule: #26352d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green: #123024;
  --green-soft: #1b4233;
  --paper: #0f1814;
  --sheet: #15201b;
  --ink: #e5ece7;
  --muted: #9cafa4;
  --rule: #26352d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header (sits on the green hero) ---------- */
.top { background: var(--green); color: var(--on-green); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: 0.01em; line-height: 1; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: clamp(14px, 3vw, 28px); flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--on-green-muted); text-decoration: none; }
.nav a:hover { color: var(--on-green); }

/* ---------- Hero ---------- */
.hero { background: var(--green); color: var(--on-green); overflow: hidden; }
.hero .wrap { padding-block: clamp(32px, 7vw, 88px) clamp(48px, 8vw, 104px); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 48px); }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 1.2rem + 9.5vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: -0.005em;
  max-width: 11ch;
}
.hero-copy { display: grid; grid-template-columns: minmax(0, 34rem) auto; gap: 24px 48px; align-items: end; justify-content: space-between; }
.lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); line-height: 1.5; color: var(--on-green-muted); }
.lede strong { color: var(--on-green); font-weight: 600; }
.actions { display: grid; gap: 10px; justify-items: start; }
.btn { display: inline-block; padding: 14px 24px; border-radius: 999px; background: var(--brass); color: #1b1606; font-weight: 600; text-decoration: none; font-size: 1rem; transition: transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.beta { font-size: 0.9rem; color: var(--on-green-muted); }

/* Odometer */
.odometer { display: flex; align-items: flex-end; gap: clamp(10px, 2vw, 20px); flex-wrap: wrap; }
.drums {
  display: inline-flex;
  padding: clamp(6px, 1vw, 10px);
  gap: clamp(3px, 0.6vw, 6px);
  background: #08100c;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), 0 24px 48px -24px rgb(0 0 0 / 0.6);
  --h: clamp(44px, (100vw - 76px) / 5, 128px);
}
.drum {
  width: calc(var(--h) * 0.62);
  height: var(--h);
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(#000 0%, var(--drum) 22%, #27302b 50%, var(--drum) 78%, #000 100%);
  color: var(--drum-digit);
  position: relative;
}
.drum.tenth { background: linear-gradient(#9da39f 0%, #f4f6f3 30%, #fff 50%, #f4f6f3 70%, #9da39f 100%); color: #101512; }
.drum::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgb(0 0 0 / 0.45), transparent 28%, transparent 72%, rgb(0 0 0 / 0.45)); pointer-events: none; }
.drum.tenth::after { background: linear-gradient(rgb(0 0 0 / 0.25), transparent 30%, transparent 70%, rgb(0 0 0 / 0.25)); }
.strip { display: flex; flex-direction: column; transform: translateY(calc(var(--pos) * var(--h) * -1)); }
.strip span {
  height: var(--h);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(var(--h) * 0.78);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.odo-unit { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); line-height: 1; color: var(--on-green); }
.odo-note { flex-basis: 100%; font-size: 0.9rem; color: var(--on-green-muted); }
.needle { color: var(--brass); }

@media (prefers-reduced-motion: no-preference) {
  .strip { animation: roll var(--t, 1.6s) cubic-bezier(0.16, 0.8, 0.24, 1) 0.2s both; }
  @keyframes roll { from { transform: translateY(0); } }
}

/* ---------- Sections ---------- */
.section > .wrap { padding-block: clamp(64px, 9vw, 120px); }
.section + .section > .wrap { border-top: 1px solid var(--rule); }
.section h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.4rem);
  line-height: 0.95;
  max-width: 14ch;
}
.section .intro { margin-top: 20px; max-width: 36rem; color: var(--muted); font-size: 1.1rem; }

/* Timeline: records placed by odometer reading */
.timeline-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.timeline-layout > div:first-child { position: sticky; top: 32px; }
.records { list-style: none; padding: 0; border-left: 2px solid var(--ink); }
.records li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 4px 24px; padding: 18px 0 18px 24px; position: relative; border-bottom: 1px solid var(--rule); }
.records li:last-child { border-bottom: 0; }
.records li::before { content: ""; position: absolute; left: -7px; top: 30px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.km { font-family: var(--display); font-weight: 700; font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; padding-top: 6px; }
.km small { font-size: 0.55em; font-weight: 600; color: var(--muted); margin-left: 2px; }
.rec { min-width: 0; display: grid; gap: 2px; }
.rec-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.rec-type { font-weight: 600; }
.rec-cost { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-desc { color: var(--muted); font-size: 0.98rem; }
.rec-date { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.records li.total { border-top: 2px solid var(--ink); }
.records li.total::before { background: var(--brass); border-color: var(--brass); }
.example-note { margin-top: 14px; font-size: 0.85rem; color: var(--muted); }

/* Spec sheet of features */
.spec { margin-top: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr); }
.spec > div { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 8px 32px; padding-block: 22px; border-top: 1px solid var(--rule); align-items: baseline; }
.spec > div:last-child { border-bottom: 1px solid var(--rule); }
.spec dt { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.4rem); line-height: 1; }
.spec dd { color: var(--muted); max-width: 40rem; }

/* Next: ownership */
.next { background: var(--sheet); }
.next .wrap { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.status { display: inline-block; margin-bottom: 18px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--muted); color: var(--muted); font-size: 0.85rem; }
.owners { list-style: none; padding: 0; display: grid; gap: 12px; }
.owners li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; align-items: baseline; padding: 16px 20px; border-radius: 10px; background: var(--paper); }
.owners li.you { background: var(--green); color: var(--on-green); }
.owners b { font-family: var(--display); font-size: 1.5rem; font-weight: 700; line-height: 1; grid-row: span 2; min-width: 2.6ch; font-variant-numeric: tabular-nums; }
.owners span { font-size: 0.95rem; }
.owners .range { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.owners li.you .range { color: var(--on-green-muted); }

/* Company */
.company { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 32px; }
.facts dt, .facts dd { padding-block: 14px; border-top: 1px solid var(--rule); }
.facts dt { color: var(--muted); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }

/* Footer */
footer { background: var(--green); color: var(--on-green-muted); font-size: 0.92rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 32px; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--on-green); }

/* Legal page */
.doc { max-width: 42rem; padding-block: clamp(48px, 7vw, 96px); }
.doc h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem); line-height: 0.95; }
.doc h2 { font-size: 1.15rem; margin-top: 36px; }
.doc p, .doc ul { margin-top: 12px; color: var(--muted); }
.doc .updated { margin-top: 10px; font-size: 0.9rem; }

@media (max-width: 860px) {
  .hero-copy, .timeline-layout, .next .wrap, .company { grid-template-columns: minmax(0, 1fr); }
  .timeline-layout > div:first-child { position: static; }
  .spec > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .records li { grid-template-columns: minmax(0, 1fr); padding-left: 20px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dd { border-top: 0; padding-top: 0; }
}
.section.next > .wrap, .next + .section > .wrap { border-top: 0; }
