/* Velo — marketing + legal site
   Palette and type roles mirror App/Velo/Features/Dial/DialTheme.swift.
   Identity: mechanical split-flap transit board + analog signal gauge. */

:root {
  --ink: #171410;
  --tile: #2f2b22;
  --ivory: #f0e9da;
  --ochre: #d98f2b;
  --brick: #b23a2e;
  --olive: #7c8363;

  --hairline: rgba(240, 233, 218, 0.15);
  --muted: rgba(240, 233, 218, 0.55);
  --dim: rgba(240, 233, 218, 0.72);

  /* Display: heavy condensed grotesque. SF Condensed on Apple, Arial Narrow elsewhere. */
  --display: system-ui, -apple-system, "Arial Narrow", "Helvetica Neue", sans-serif;
  /* Legend: the transit-board departure-code type. Uppercase, wide tracking. */
  --legend: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 68ch;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--olive); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ochre); }

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

/* --- shared shell ------------------------------------------------------- */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.legend {
  font-family: var(--legend);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead {
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: rgba(23, 20, 16, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}

.wordmark {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ivory);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.wordmark:hover { color: var(--ivory); }
.wordmark img { border-radius: 6px; display: block; }

.masthead nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.75rem);
  flex-wrap: wrap;
}
.masthead nav a {
  font-family: var(--legend);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--ivory); }

/* "Roadmeter" is a wider wordmark than the nav can sit beside on a phone */
@media (max-width: 480px) {
  .wordmark { font-size: 1.25rem; }
  .wordmark img { width: 24px; height: 24px; }
  .masthead nav { gap: 0.7rem 0.9rem; }
}

/* --- split-flap readout (the signature) --------------------------------- */

.readout {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  justify-content: center;
}

.flaps {
  display: flex;
  gap: 0.375rem;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.flap {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(3.5rem, 13vw, 6.5rem);
  height: clamp(5rem, 19vw, 9.5rem);
  background: var(--tile);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}

/* the split in split-flap */
.flap::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 2px;
  background: var(--ink);
  opacity: 0.75;
}

.flap span {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: clamp(3.75rem, 14vw, 7rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
  transition: color 0.25s ease;
}

.flap.flipping span { animation: flip 0.13s ease-in; }

@keyframes flip {
  0%   { transform: rotateX(0deg);   opacity: 1; }
  49%  { transform: rotateX(-88deg); opacity: 0.25; }
  50%  { transform: rotateX(88deg);  opacity: 0.25; }
  100% { transform: rotateX(0deg);   opacity: 1; }
}

.unit {
  font-family: var(--legend);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding-bottom: 0.3rem;
}

/* limit states — the same three the app uses */
.readout[data-state="approaching"] .flap span { color: var(--ochre); }
.readout[data-state="over"] .flap span { color: var(--brick); }

.gauge-legends {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.gauge-legends span {
  font-family: var(--legend);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 233, 218, 0.3);
  transition: color 0.25s ease;
}

.gauge-legends .lit { color: var(--olive); }
.readout-block[data-state="approaching"] .gauge-legends .alert { color: var(--ochre); }
.readout-block[data-state="over"] .gauge-legends .alert {
  color: var(--brick);
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

.replay {
  display: block;
  margin: 0.75rem auto 0;
  background: none;
  border: 0;
  padding: 0.35rem;
  cursor: pointer;
  font-family: var(--legend);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 233, 218, 0.3);
}
.replay:hover { color: var(--ivory); }

/* --- hero --------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(3rem, 8vw, 5rem);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}

.hero h1 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: clamp(2.25rem, 7vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: clamp(2.5rem, 7vw, 4rem) 0 0;
  text-transform: uppercase;
}

.hero p.lede {
  max-width: 46ch;
  margin: 1.25rem auto 0;
  color: var(--dim);
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
}

.cta-row {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  font-family: var(--legend);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary { background: var(--olive); color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: var(--ivory); color: var(--ink); }

.btn-ghost { border-color: var(--hairline); color: var(--ivory); }
.btn-ghost:hover { border-color: var(--ivory); color: var(--ivory); }

.pending {
  margin-top: 1rem;
  display: block;
}

/* --- generic section ---------------------------------------------------- */

.band { padding-block: clamp(3rem, 8vw, 5.5rem); border-bottom: 1px solid var(--hairline); }

.band-head { margin-bottom: 2.5rem; }

.band-head h2 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1.08;
  text-transform: uppercase;
  margin: 0.6rem 0 0;
}

.band-head p {
  color: var(--muted);
  max-width: var(--measure);
  margin: 0.75rem 0 0;
}

/* --- feature board ------------------------------------------------------ */

/* Seven features into a three-up grid: the seventh takes the remaining width
   rather than leaving two dead cells. */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}

.row {
  background: var(--ink);
  padding: 1.75rem 1.5rem;
}

.row:last-child { grid-column: 1 / -1; }
.row:last-child p { max-width: 62ch; }

@media (max-width: 900px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .board { grid-template-columns: 1fr; } }

.row .legend { display: block; margin-bottom: 0.75rem; }

.row h3 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 1.375rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 0.5rem;
}

.row p { margin: 0; color: var(--dim); font-size: 0.9375rem; line-height: 1.6; }

/* --- shots -------------------------------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.shot {
  aspect-ratio: 9 / 19.5;
  background: var(--tile);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
}

.shot img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }

/* --- privacy strip ------------------------------------------------------ */

.claims {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.claim h3 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 1.125rem;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  color: var(--olive);
}
.claim p { margin: 0; color: var(--dim); font-size: 0.9375rem; }

/* --- pricing ------------------------------------------------------------ */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.plan {
  background: var(--tile);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1.75rem 1.5rem;
}

.plan.featured { border-color: var(--olive); }

.plan h3 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  margin: 0.6rem 0 0.25rem;
}

.price {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 2.25rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 0.5rem 0 0.25rem;
}

.plan ul { list-style: none; margin: 1.25rem 0 0; padding: 0; }

.plan li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  color: var(--dim);
  font-size: 0.9375rem;
  border-top: 1px solid var(--hairline);
}
.plan li:first-child { border-top: 0; }

.plan li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 1.1rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--olive);
}

.fineprint {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  max-width: var(--measure);
}

/* --- legal / prose pages ------------------------------------------------ */

.doc { padding-block: clamp(2.5rem, 7vw, 4.5rem) 4rem; }

.doc-head { border-bottom: 1px solid var(--hairline); padding-bottom: 1.75rem; margin-bottom: 2.5rem; }

.doc-head h1 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3rem);
  text-transform: uppercase;
  line-height: 1.05;
  margin: 0.6rem 0 0;
}

.doc-head .dates { margin: 0.85rem 0 0; }

.prose { max-width: var(--measure); }

.prose > section { border-top: 1px solid var(--hairline); padding-top: 1.75rem; margin-top: 2.25rem; }
.prose > section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

.prose h2 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

/* clause numbers are real reference handles in a legal doc, not decoration */
.prose h2 .n {
  font-family: var(--legend);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--olive);
  font-weight: 400;
  flex: none;
}

.prose h3 {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.prose p, .prose li { color: var(--dim); }
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { color: var(--ivory); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9375rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--dim);
}
.prose th {
  font-family: var(--legend);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.scroller { overflow-x: auto; }

/* the one thing a reviewer and a driver both need to see first */
.warning {
  border: 1px solid var(--brick);
  border-left-width: 3px;
  border-radius: 4px;
  background: rgba(178, 58, 46, 0.12);
  padding: 1.25rem 1.35rem;
  margin: 0 0 2rem;
}
.warning .legend { color: var(--brick); display: block; margin-bottom: 0.5rem; }
.warning p { margin: 0 0 0.75rem; color: var(--ivory); }
.warning p:last-child { margin-bottom: 0; }

.todo {
  background: rgba(217, 143, 43, 0.18);
  border-bottom: 1px dashed var(--ochre);
  color: var(--ochre);
  font-family: var(--legend);
  font-size: 0.8125em;
  padding: 0 0.25em;
}

/* --- faq ---------------------------------------------------------------- */

.faq > div { border-top: 1px solid var(--hairline); padding: 1.5rem 0; }
.faq > div:first-child { border-top: 0; }

.faq h3 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 1.25rem;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.faq p { margin: 0 0 0.75rem; color: var(--dim); }
.faq p:last-child { margin-bottom: 0; }

/* --- footer ------------------------------------------------------------- */

.foot { padding-block: 3rem; }

.foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.foot nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.foot nav a {
  font-family: var(--legend);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.foot nav a:hover { color: var(--ivory); }
.foot .legend { max-width: 34ch; line-height: 1.8; }

@media (prefers-reduced-motion: reduce) {
  .flap.flipping span { animation: none; }
  .readout-block[data-state="over"] .gauge-legends .alert { animation: none; }
  * { scroll-behavior: auto !important; }
}
