/* FlatMile — "the honest odometer" · asphalt + lane-paint */

:root {
  --asphalt: #101112;
  --tarmac: #1a1c1e;
  --tarmac-2: #212325;
  --hairline: #2a2c2e;
  --paint: #ffc400;
  --paint-dim: #b38a00;
  --paper: #f5f1e8;
  --gravel: #9a9890;
  --gravel-dim: #8a8880;
  --danger-strike: #6e6a60;

  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --w: 1080px;
  --radius: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--asphalt);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(255, 196, 0, 0.14);
  /* faint asphalt grain */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, #1b1d1f 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--paint); color: var(--asphalt); }

a { color: var(--paint); text-decoration: none; }
a:hover { text-decoration: underline; }

a, button, summary, input, .chip { touch-action: manipulation; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* honeypot */
.hp { position: absolute; left: -9999px; }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; }

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.06;
  font-weight: 700;
  text-wrap: balance;
}

h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.15; font-weight: 700; text-wrap: balance; }
h3 { font-size: 1.12rem; font-weight: 600; }

p { text-wrap: pretty; }

.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.paint { color: var(--paint); }
.ink { color: var(--paper); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paint);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 5px;
  background: var(--paint);
  border-radius: 2px;
  flex: none;
}

.muted { color: var(--gravel); }

/* the pitch, crossed out by hand: the paint bar draws itself on load */
.strike {
  position: relative;
  color: var(--danger-strike);
}
.strike::after {
  content: "";
  position: absolute;
  left: -0.08em; right: -0.08em; top: 50%;
  height: 0.085em;
  border-radius: 2px;
  background: var(--paint);
  transform: translateY(-50%) rotate(-3deg) scaleX(0);
  transform-origin: left center;
  animation: strike-draw 0.5s var(--ease-out) 1.05s both;
}
@keyframes strike-draw {
  to { transform: translateY(-50%) rotate(-3deg) scaleX(1); }
}

/* ---------- lane line connector ---------- */

.lane {
  width: 6px;
  height: 104px;
  margin: 0 auto;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg,
    var(--paint) 0 22px, transparent 22px 46px);
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: top;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.lane.in { opacity: 0.85; transform: scaleY(1); }

/* ---------- header ---------- */

/* Vertical spacing uses padding-block throughout: these classes share elements
   with .wrap, and the padding shorthand would wipe out its horizontal gutter. */
.site-head {
  padding-block: 26px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.22rem; color: var(--paper);
  padding: 9px 10px; margin: -9px -10px; /* ≥44px tap target, no layout shift */
  border-radius: 10px;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }

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

.hero { padding-block: 64px 30px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero p.sub {
  margin: 22px 0 30px;
  font-size: 1.13rem;
  color: var(--gravel);
  max-width: 34em;
}
.hero p.sub strong { color: var(--paper); font-weight: 600; }

/* entrance choreography */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.hero .eyebrow  { animation: rise 0.6s var(--ease-out) both; }
.hero h1        { animation: rise 0.7s var(--ease-out) 0.06s both; }
.hero p.sub     { animation: rise 0.7s var(--ease-out) 0.16s both; }
.hero .signup   { animation: rise 0.7s var(--ease-out) 0.26s both; }
.hero .odo-card { animation: rise 0.8s var(--ease-out) 0.34s both; }

/* odometer card */
.odo-card {
  background: linear-gradient(180deg, var(--tarmac) 0%, #17191b 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
}
.odo-label {
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.22em;
  color: var(--gravel); text-transform: uppercase;
  margin-bottom: 14px;
}
.odometer {
  display: flex; align-items: baseline; gap: 2px;
  font-family: var(--font-mono);
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  font-weight: 600;
  color: var(--paint);
  line-height: 1;
}
.odometer .sym { font-size: 0.6em; color: var(--paper); margin-right: 4px; }
.digit {
  height: 1em;
  overflow: hidden;
  border-radius: 4px;
}
.digit .strip {
  display: flex; flex-direction: column;
  transform: translateY(0);
  transition: transform 1.6s cubic-bezier(0.22, 1, 0.3, 1);
}
.digit .strip span { height: 1em; line-height: 1; display: block; }
.odo-sub {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gravel);
  display: flex; align-items: center; gap: 10px;
}
.odo-sub .dot {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paint); flex: none;
}
.odo-sub .dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--paint);
  animation: ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0%        { transform: scale(1); opacity: 0.6; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}

/* ---------- form ---------- */

.signup { max-width: 470px; }
.signup .row { display: flex; gap: 10px; }
.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  background: var(--tarmac);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--paper);
  font: inherit;
  padding: 14px 16px;
  height: 52px;
  transition: border-color 0.15s ease;
}
.signup input[type="email"]:hover { border-color: #3a3c3e; }
.signup input[type="email"]::placeholder { color: #7f7d75; }
.signup input[type="email"]:focus-visible,
.chip:focus-visible, .btn:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--paint);
  outline-offset: 2px;
}

.wouldpay {
  margin: 14px 0 4px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 0.92rem; color: var(--gravel);
}
.chips { display: inline-flex; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--tarmac);
  color: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 10px 20px;
  min-height: 44px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.12s ease;
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] {
  background: var(--paint);
  border-color: var(--paint);
  color: var(--asphalt);
  font-weight: 600;
  animation: chip-pop 0.28s var(--ease-out);
}
@keyframes chip-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.btn {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-top: 12px;
  background: var(--paint);
  color: var(--asphalt);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  border: 0;
  border-radius: 10px;
  height: 52px;
  padding: 0 26px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(255, 196, 0, 0.45); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: default; transform: none; box-shadow: none; }
.btn.loading::after {
  content: "";
  position: absolute;
  right: 18px; top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(16, 17, 18, 0.25);
  border-top-color: var(--asphalt);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.micro {
  margin-top: 11px;
  font-size: 0.8rem;
  color: var(--gravel);
}

.form-msg { font-size: 0.9rem; margin-top: 10px; min-height: 1.3em; }
/* Reserve the line only once there's something to say. */
.form-msg:empty { margin-top: 0; min-height: 0; }
.form-msg.err { color: #ff9d66; }

.signup-done {
  background: var(--tarmac);
  border: 1px solid var(--paint);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 470px;
  animation: rise 0.5s var(--ease-out) both;
  outline: none;
}
.signup-done h3 {
  color: var(--paint); margin-bottom: 8px; font-family: var(--font-mono);
  display: flex; align-items: center; gap: 10px;
}
.signup-done p { color: var(--gravel); font-size: 0.95rem; }
.signup-done .check {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: var(--paint);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.signup-done .check circle {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: draw 0.6s ease-out 0.15s forwards;
}
.signup-done .check path {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: draw 0.35s ease-out 0.6s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- sections ---------- */

section { padding-block: 56px; }

/* pain cards */
.cards3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}
.pain-card {
  background: var(--tarmac);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.22s var(--ease-out), border-color 0.22s ease;
}
.pain-card .tally { display: flex; gap: 5px; margin-bottom: 18px; }
.pain-card .tally i {
  width: 5px; height: 22px; background: var(--paint);
  border-radius: 2px; transform: rotate(8deg); display: block;
}
.pain-card h3 { margin-bottom: 8px; }
.pain-card p { color: var(--gravel); font-size: 0.95rem; }

@media (hover: hover) {
  .pain-card:hover { transform: translateY(-3px); border-color: #3b3d3f; }
}

/* comparison table */
.table-scroll { overflow-x: auto; margin-top: 34px; -webkit-overflow-scrolling: touch; }
.table-scroll.can-right {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent 100%);
}
table.compare {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}
.compare th, .compare td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  transition: background-color 0.15s ease;
}
.compare thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  border-bottom: 2px solid var(--hairline);
}
.compare td:first-child, .compare th:first-child { color: var(--gravel); font-size: 0.88rem; padding-left: 0; }
.compare .num { color: var(--paper); }
.compare .col-us {
  background: rgba(255, 196, 0, 0.05);
  border-left: 2px solid var(--paint);
  border-right: 2px solid var(--paint);
}
.compare thead .col-us { border-top: 2px solid var(--paint); border-radius: 8px 8px 0 0; color: var(--paint); }
.compare tbody tr:last-child .col-us { border-bottom: 2px solid var(--paint); }
.compare .yes { color: var(--paint); font-weight: 600; }
.compare .meh { color: var(--gravel); }
.footnote { margin-top: 14px; font-size: 0.78rem; color: var(--gravel-dim); }

@media (hover: hover) {
  .compare tbody tr:hover td { background-color: rgba(255, 255, 255, 0.025); }
  .compare tbody tr:hover td.col-us { background-color: rgba(255, 196, 0, 0.09); }
}

/* how it works */
.steps { list-style: none; margin-top: 38px; position: relative; }
.steps::before {
  content: "";
  position: absolute;
  left: 21px; top: 10px; bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--paint) 0 16px, transparent 16px 34px);
  opacity: 0.7;
}
.steps li {
  position: relative;
  padding: 0 0 34px 72px;
}
.steps li:last-child { padding-bottom: 0; }
.step-no {
  position: absolute; left: 0; top: -2px;
  width: 46px; height: 46px;
  background: var(--asphalt);
  border: 2px solid var(--paint);
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--paint);
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--gravel); max-width: 34em; }

/* deduction math */
.math-card {
  margin-top: 34px;
  background: var(--tarmac);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}
.math-big {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  font-weight: 600;
  color: var(--paint);
  line-height: 1;
  white-space: nowrap;
}
.math-big small { display: block; font-size: 0.32em; color: var(--gravel); letter-spacing: 0.18em; margin-top: 10px; text-transform: uppercase; }
.math-card p { color: var(--gravel); }
.math-card p strong { color: var(--paper); }

/* seo page prose */
.prose { margin-top: 22px; color: var(--gravel); display: grid; gap: 16px; }
.prose strong, .prose .ink { color: var(--paper); }

/* manifesto */
.manifesto { text-align: center; }
.manifesto .eyebrow { justify-content: center; }
.manifesto blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.5;
  font-weight: 500;
  max-width: 30em;
  margin: 26px auto 0;
  text-wrap: pretty;
}
.manifesto blockquote em { color: var(--paint); font-style: normal; }
.manifesto .sig {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gravel);
}

/* faq */
.faq { max-width: 760px; margin: 34px auto 0; }
.faq details {
  border-bottom: 1px solid var(--hairline);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.04rem;
  min-height: 44px;
  transition: color 0.15s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--paint);
  font-size: 1.3rem;
  flex: none;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 4px 22px; color: var(--gravel); max-width: 60ch; }

@media (hover: hover) {
  .faq summary:hover { color: var(--paint); }
}

/* smooth open/close where the browser supports it */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content {
    block-size: 0;
    overflow-y: clip;
    opacity: 0;
    transition: content-visibility 0.32s allow-discrete,
                opacity 0.28s ease,
                block-size 0.32s var(--ease-out);
  }
  .faq details[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}

/* final cta */
.final {
  text-align: center;
  padding-block-end: 96px;
  /* headlights on asphalt */
  background: radial-gradient(ellipse 70% 55% at 50% 108%, rgba(255, 196, 0, 0.06), transparent 65%);
}
.final .signup, .final .signup-done { margin: 34px auto 0; }
.final .wouldpay { justify-content: center; }

/* sticky join dock — only lives in the gap between the two forms */
#join { scroll-margin-top: 20px; }

.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: rgba(18, 20, 22, 0.94);
  border-top: 1px solid var(--hairline);
  padding: 11px 24px calc(11px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 40px -24px rgba(0, 0, 0, 0.9);
  /* hidden and untabbable until the observer reveals it */
  transform: translateY(115%);
  visibility: hidden;
  transition: transform 0.38s var(--ease-out), visibility 0.38s;
}
.dock.show { transform: none; visibility: visible; }

@supports (backdrop-filter: blur(1px)) {
  .dock { background: rgba(18, 20, 22, 0.82); backdrop-filter: blur(14px); }
}

.dock-inner {
  max-width: var(--w);
  margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
.dock-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gravel);
  white-space: nowrap;
}
.dock-btn {
  margin-left: auto;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--paint);
  color: var(--asphalt);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.dock-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -10px rgba(255, 196, 0, 0.5);
}
.dock-btn:active { transform: none; }

/* Below this the note won't fit beside the button — and the button already
   carries the price, so nothing is lost by dropping it. */
@media (max-width: 479px) {
  .dock { padding-inline: 16px; }
  .dock-note { display: none; }
  .dock-btn { margin-left: 0; width: 100%; }
}

/* footer */
.site-foot {
  border-top: 1px solid var(--hairline);
  padding-block: 28px max(46px, env(safe-area-inset-bottom));
  font-size: 0.8rem;
  color: var(--gravel-dim);
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  justify-content: space-between;
}
.site-foot a { display: inline-block; padding: 8px 0; margin: -8px 0; }

/* ---------- scroll reveals (classes added by JS; no-JS gets static page) ---------- */

.rev {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out) var(--d, 0ms),
              transform 0.6s var(--ease-out) var(--d, 0ms);
}
.rev.in { opacity: 1; transform: none; }

/* the dashed step line draws itself */
.steps.rev::before {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1s var(--ease-out) 0.1s;
}
.steps.rev.in::before { transform: scaleY(1); }

/* tally marks chalk in one by one */
.pain-card.rev .tally i {
  transform: rotate(8deg) scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s var(--ease-out) calc(var(--d, 0ms) + 0.15s);
}
.pain-card.rev .tally i:nth-child(2) { transition-delay: calc(var(--d, 0ms) + 0.27s); }
.pain-card.rev .tally i:nth-child(3) { transition-delay: calc(var(--d, 0ms) + 0.39s); }
.pain-card.rev.in .tally i { transform: rotate(8deg) scaleY(1); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .hero { padding-block: 36px 30px; }

  /* Stacked, the proof belongs between the promise and the ask — not after it.
     Flattening the wrapper lets the card sit among its siblings. */
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-grid > div:first-child { display: contents; }
  .hero .eyebrow  { order: 1; }
  .hero h1        { order: 2; }
  .hero p.sub     { order: 3; margin: 18px 0 0; }
  .hero .odo-card { order: 4; margin: 26px 0 28px; padding: 22px 22px 20px; }
  .hero .signup   { order: 5; max-width: none; }
  .hero .odo-label { margin-bottom: 10px; }
  .hero .odo-sub { margin-top: 12px; }

  .cards3 { grid-template-columns: 1fr; }
  .math-card { grid-template-columns: 1fr; gap: 22px; padding: 30px 26px; }
  section { padding-block: 40px; }
  .lane { height: 56px; }

  /* keep row labels readable while the table scrolls */
  .compare td:first-child, .compare th:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--asphalt);
    padding-right: 14px;
  }
  .table-scroll.can-left .compare td:first-child,
  .table-scroll.can-left .compare th:first-child {
    box-shadow: 10px 0 14px -10px rgba(0, 0, 0, 0.7);
  }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .signup .row { flex-direction: column; }
  .signup input[type="email"] { width: 100%; }
}

/* ---------- reduced motion: everything lands in its final state ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
}
