/* Mr. Driver's Ed — mrdriversed.com
 *
 * One stylesheet for all four pages (index, privacy, terms, 404). It replaces four copy-pasted
 * <style> blocks that had already drifted apart.
 *
 * The design tokens below are deliberately the SAME ones daliapps.dev uses (cream canvas, ink text,
 * the house maroon, Geist): this is a product site under the DALiApps roof, and a visitor who
 * follows a link from the parent site should land somewhere that is obviously the same company.
 * What differs is the accent — the parent leans on BleacherBrag's coral, this leans on the gold
 * that is already in the app icon.
 *
 * The CSP served by CloudFront is
 *   default-src 'none'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
 * so: no CDN anything. The font is self-hosted, every image is same-origin, and there is no
 * JavaScript on this site at all — the app's whole pitch is that it does not track you, and the
 * site keeps that promise too. Every interaction here is CSS-only.
 */

/* Geist — SIL Open Font License 1.1, (c) 2023 Vercel in collaboration with basement.studio.
 * Full license text ships alongside the font at /fonts/OFL.txt, as the OFL requires.
 * One variable file covers 100-900, which is smaller than the two static weights it replaces. */
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Canvas — a warm cream rather than a blue-grey white; this is most of the site's character. */
  --cream: #f9f7f4;
  --cream-2: #f1eeea;
  --surface: #ffffff;
  --ink: #1e1e24;
  --muted: #6d6a67;
  --line: #e2ded7;

  /* House accents, shared with the app icon (brand/mrdriversed.svg). */
  --maroon: #500000;
  --maroon-lift: #5c0a0a;
  --gold: #ffc21a;
  /* Gold on cream is ~1.6:1 — nowhere near readable. It is used for decoration ONLY (rules, the
   * hover underline, the checkmark); anything that has to be read uses ink, muted, or maroon. */
  --green: #1c6b45;

  --r-card: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --sec: clamp(64px, 9vw, 128px);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}

a { color: inherit; }

/* `padding-inline`, NOT the `padding` shorthand: .wrap sits on the <section> elements themselves
 * (`<section id="what" class="wrap">`), and on class-vs-element specificity the shorthand beats
 * `section { padding-bottom: var(--sec) }` and resets it to 0 — silently flattening the vertical
 * rhythm of every section. Same bug daliapps.dev hit and fixed. */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 760px; }

/* Anchored sections must clear the sticky nav when jumped to. */
[id] { scroll-margin-top: 96px; }

/* Present to assistive tech, absent on screen — used for the empty corner cell of the privacy
 * table, which needs a name for screen readers but must stay blank visually. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- nav */

/* The gutter lives on the outer element: .nav sets its own padding for the pill's interior, which
 * would otherwise override the horizontal padding .wrap is trying to supply. */
.nav-outer { position: sticky; top: 0; z-index: 20; padding: 12px var(--gutter); }
.nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  /* Opaque, not translucent: with no JS we cannot add a scrolled state, and a blurred bar over
   * cream reads as muddy. A solid pill is cleaner and costs nothing. */
  background: var(--surface);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.nav-brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--cream-2); }
.nav-cta {
  padding: 9px 18px;
  border-radius: var(--r-pill);
  background: var(--maroon);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.nav-cta:hover { background: var(--maroon-lift); }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav { padding-left: 14px; }
  /* margin-left:auto lives on .nav-links, which is now hidden — move it to the button. */
  .nav-cta { margin-left: auto; }
}

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

.hero { padding-block: clamp(48px, 8vw, 104px) var(--sec); }
.hero h1 {
  font-size: clamp(38px, 7.2vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 600;
  max-width: 15ch;
  margin-top: 18px;
  text-wrap: balance;
}
.hero .lead {
  margin-top: 24px;
  max-width: 56ch;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.hero .lead strong { color: var(--ink); font-weight: 550; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-lift); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }

/* "Coming soon to iPhone and Android" — a statement of fact, not a button. It sits in the CTA row
 * but must not look pressable, because there is nothing to press until the listings exist. */
.pill-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: var(--cream-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
.pill-note::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

/* ---------------------------------------------------------------- the sample question */

/* The hero "stage". We have no App Store screenshots to show (there is no listing yet), and a faked
 * device mock-up would be a picture of something that does not exist. Instead: one REAL question,
 * copied verbatim from the shipping Texas bank (pipeline/content/TX/adverse-conditions.json,
 * id tx-adv-001) with its real handbook citation. It is the product's actual differentiator, shown
 * rather than described. Marked-up as a figure, not a form — nothing here is interactive.
 */
.stage { margin-top: clamp(48px, 7vw, 88px); display: flex; justify-content: center; }
.qcard {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: 0 24px 60px -40px rgba(30, 30, 36, 0.55);
}
.qcard .q-topic { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qcard .q-text { margin-top: 14px; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
.qcard ol { list-style: none; margin-top: 20px; display: grid; gap: 8px; }
.qcard li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: 15px;
  color: var(--muted);
}
.qcard li .key {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.qcard li.correct { border-color: var(--green); background: rgba(28, 107, 69, 0.05); color: var(--ink); }
.qcard li.correct .key { border-color: var(--green); background: var(--green); color: #fff; }
/* WCAG 1.4.1: colour alone must not carry the "this is the right answer" meaning. A green border
 * plus a 5%-alpha fill is near-invisible without green perception, and the A/B/C/D keys are
 * aria-hidden, so the card would demonstrate nothing to a screen-reader or colour-blind visitor.
 * This tag states it in words. */
.qcard li.correct .flag {
  margin-left: auto;
  align-self: center;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  white-space: nowrap;
}
.qcard li.correct .flag::before { content: '\2713\00a0'; }
/* The citation is the whole point of the card — give it the gold rule the app uses. */
.qcard .cite {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--gold);
  font-size: 14px;
  color: var(--muted);
}
.qcard .cite strong { color: var(--ink); font-weight: 550; }

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

section { padding-bottom: var(--sec); }

h2 {
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin-top: 12px; }
.section-head p { margin-top: 14px; max-width: 54ch; color: var(--muted); font-size: clamp(17px, 1.4vw, 19px); }
.statement { max-width: 24ch; }

/* --- feature cards --- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); }
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 3vw, 32px);
}
.card h3 { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; }
.card p { margin-top: 10px; color: var(--muted); font-size: 16px; }
.card .card-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--cream-2);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--maroon);
}
.card .card-mark svg { width: 21px; height: 21px; display: block; }

/* --- numbered steps --- */
.steps { list-style: none; counter-reset: step; display: grid; gap: 0; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: clamp(12px, 2vw, 28px);
  padding: clamp(20px, 2.5vw, 28px) 0;
  border-top: 1px solid var(--line);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before {
  content: counter(step);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
  /* NOT --line (the hairline token): at ~1.2:1 on cream the numerals are invisible, and since
   * `list-style: none` removes the marker they are the only ordering cue this list has. */
  color: var(--muted);
}
.steps h3 { font-size: clamp(18px, 1.6vw, 21px); letter-spacing: -0.02em; font-weight: 600; }
.steps p { margin-top: 6px; color: var(--muted); max-width: 62ch; }

/* --- panels: privacy summary + legal links --- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(8px, 1vw, 12px) clamp(20px, 3vw, 32px); }
dl.facts { display: grid; grid-template-columns: 18rem 1fr; }
dl.facts dt, dl.facts dd { padding: 16px 0; border-top: 1px solid var(--line); }
dl.facts dt:first-of-type, dl.facts dt:first-of-type + dd { border-top: 0; }
dl.facts dt { color: var(--muted); font-size: 15px; }

ul.legal-links { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
ul.legal-links li { border-top: 1px solid var(--line); }
ul.legal-links li:first-child, ul.legal-links li:nth-child(2) { border-top: 0; }
ul.legal-links a { display: block; padding: 16px 0; text-decoration: none; font-size: 16px; }
/* The parent site's underline-wipe on hover, done with a gradient so it animates from the left —
 * in this product's gold rather than the parent's coral. */
ul.legal-links a span {
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  padding-bottom: 2px;
  transition: background-size 0.25s ease;
}
ul.legal-links a:hover span { background-size: 100% 2px; }

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

footer { border-top: 1px solid var(--line); background: var(--cream-2); }
.footer-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(24px, 4vw, 48px); padding: clamp(48px, 6vw, 72px) 0 clamp(32px, 4vw, 48px); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; }
.footer-brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.footer-tagline { margin-top: 14px; color: var(--muted); font-size: 15px; max-width: 34ch; }
.footer-col h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.footer-col ul { list-style: none; margin-top: 14px; }
.footer-col li + li { margin-top: 8px; }
.footer-col a { text-decoration: none; font-size: 15px; color: var(--ink); transition: color 0.15s ease; }
.footer-col a:hover { color: var(--maroon); }
.footer-bottom { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
/* On the document pages the footer is just its own links + the copyright, with no columns above it
 * to divide — and the link row wants to be readable rather than fine print. */
.footer-bottom-flush { border-top: 0; padding-top: 40px; font-size: 14px; }
.footer-bottom p + p { margin-top: 6px; }
.footer-bottom a { color: var(--maroon); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- legal documents */

.doc { padding-block: clamp(40px, 6vw, 72px) var(--sec); }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-size: 15px; margin-bottom: 28px; transition: color 0.15s ease; }
.back:hover { color: var(--ink); }
.doc h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; }
.doc .meta { margin-top: 16px; color: var(--muted); }
.doc .meta strong { color: var(--ink); font-weight: 550; }
.doc h2 { font-size: clamp(21px, 2.2vw, 27px); margin-top: clamp(40px, 5vw, 56px); }
.doc p { margin-top: 14px; color: var(--muted); max-width: 68ch; }
.doc p strong { color: var(--ink); font-weight: 550; }
.doc a { color: var(--maroon); }
.doc ul { margin-top: 14px; padding-left: 1.15em; color: var(--muted); max-width: 68ch; }
.doc li + li { margin-top: 8px; }
.doc li strong { color: var(--ink); font-weight: 550; }

/* The privacy policy's "short version" table. Four columns do not fit a phone, so the table scrolls
 * inside its own container rather than forcing the whole page sideways. */
.table-scroll { margin-top: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.doc table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: 15px; }
.doc th, .doc td { padding: 13px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); color: var(--muted); }
.doc thead th { border-top: 0; background: var(--cream-2); color: var(--ink); font-weight: 550; font-size: 13px; letter-spacing: 0.02em; }
/* The row label wraps rather than holding one long line: at this width, `white-space: nowrap` on
 * "Optional anonymous usage stats" ate a third of the table and squeezed the three real columns. */
.doc tbody th { color: var(--ink); font-weight: 550; width: 11rem; }
.doc td strong { color: var(--ink); font-weight: 550; }

/* ---------------------------------------------------------------- 404 */

.center-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.center-page img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 28px; }
.center-page .code { font-size: clamp(56px, 12vw, 96px); line-height: 1; letter-spacing: -0.05em; font-weight: 600; }
.center-page h1 { margin-top: 10px; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.02em; font-weight: 600; }
.center-page p { margin-top: 12px; color: var(--muted); max-width: 42ch; }
.center-page .links { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

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

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  ul.legal-links { grid-template-columns: 1fr; }
  ul.legal-links li:nth-child(2) { border-top: 1px solid var(--line); }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { padding: 14px 0 0; }
  dl.facts dd { padding: 0 0 14px; border-top: 0; }
  dl.facts dt:first-of-type + dd { border-top: 0; }
  .steps li { grid-template-columns: 1fr; gap: 4px; }
  .footer-main { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
