/* Fifty Hours. Layout: the paper DMV log sheet, set in highway-sign type, with
   hours drawn as squares (yellow for day, navy for night) wherever counts matter.
   The brand is those two colors: navy leads, yellow marks what matters. */
:root {
  --paper: #f3f4f7;
  --surface: #ffffff;
  --ink: #141a2b;
  --muted: #525b6f;
  --rule: #d5d9e2;
  --soft: #e7eaf1;
  --sign: #1d2e55;      /* night navy: the brand color */
  --on-sign: #ffffff;
  --link: #2446a0;
  --day: #f3c22f;       /* student-driver yellow */
  --on-day: #141a2b;
  --night: #1d2e55;
  --on-night: #ffffff;

  --display: "Overpass", "Arial Narrow", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Overpass Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  --step-3: clamp(2.25rem, 1.5rem + 3.4vw, 4.25rem);
  --radius: 14px;

  color-scheme: light dark;
  accent-color: var(--sign);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e111a;
    --surface: #151a26;
    --ink: #e6e9f0;
    --muted: #9ca3b5;
    --rule: #283044;
    --soft: #161c2a;
    --sign: #26407e;
    --link: #f0c53a;
    --day: #e5b522;
    --night: #4a63a8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
  font-size-adjust: from-font;
}
a { color: var(--link); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--day); outline-offset: 2px; border-radius: 4px;
}
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); font-weight: 900; line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 800; line-height: 1.25; }
p { margin: 0; }
.sr-only, .hp {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.wrap {
  max-width: 1120px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 760px; }
main > section { padding-block: clamp(40px, 6vw, 80px); }

/* Header: sticky; gains a rule once it's actually stuck (progressive enhancement). */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--paper);
  container: topbar / scroll-state;
}
.top > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; border-bottom: 1px solid transparent; }
@container topbar scroll-state(stuck: top) {
  .top > .wrap { border-bottom-color: var(--rule); }
}
@supports not (container-type: scroll-state) {
  .top > .wrap { border-bottom-color: var(--rule); }
}
.logo { display: flex; align-items: center; gap: 10px; font: 800 1.15rem/1 var(--display); color: var(--ink); text-decoration: none; white-space: nowrap; }
nav { display: flex; align-items: center; gap: 18px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0 22px; border-radius: 10px; border: 2px solid var(--sign);
  background: var(--sign); color: var(--on-sign);
  font: 800 1rem/1 var(--display); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.95rem; }
.btn-sign { background: var(--day); color: var(--on-day); border-color: var(--day); }

/* Hero */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 36ch; line-height: 1.5; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.magnet {
  justify-self: start; background: var(--day); color: var(--on-day); border: 2px solid var(--on-day);
  border-radius: 8px; padding: 6px 12px 4px; font: 900 0.85rem/1 var(--display);
  text-transform: uppercase; letter-spacing: 0.12em; rotate: -2deg;
}

/* The log card: a filled-in log sheet */
.logcard {
  margin: 0; min-width: 0; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgb(20 26 43 / 0.35);
}
.logcard figcaption {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--sign); color: var(--on-sign); padding: 12px 18px;
  font: 800 0.85rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.1em;
}
.tag { background: rgb(255 255 255 / 0.16); border-radius: 6px; padding: 4px 8px 3px; letter-spacing: 0.04em; text-transform: none; font-weight: 600; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font: 700 0.75rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.r { text-align: right; }
.log td { font-family: var(--mono); font-size: 0.95rem; }
.log td:first-child { font-family: var(--body); font-weight: 600; }
.nite { background: var(--night); color: var(--on-night); border-radius: 5px; padding: 2px 7px; }

.hours {
  display: grid; grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); gap: 5px;
  padding: 18px 18px 8px;
}
.hours i { aspect-ratio: 1; max-width: 100%; border-radius: 3px; }
.hours .d { background: var(--day); }
.hours .n { background: var(--night); }
.hours .o { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); }
.tally { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 18px 18px; color: var(--muted); font-size: 0.95rem; }
.tally strong { font: 900 1.4rem/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.sep { width: 4px; height: 4px; border-radius: 50%; background: var(--rule); }

/* Features: plain list with a heavy top rule, like form sections */
.section-title { margin-bottom: 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px 40px; }
.features > div { border-top: 3px solid var(--ink); padding-top: 14px; display: grid; gap: 8px; align-content: start; }
.features p { color: var(--muted); }

/* Switching section: a real sequence, so it's numbered */
.switch { background: var(--soft); }
.switch .wrap { display: grid; gap: 18px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 0; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--ink); color: var(--paper); font: 900 1.2rem/1 var(--display);
}

/* Ruled data tables */
.ruled { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.ruled tr:last-child td { border-bottom: 0; }
.ruled td.r { font: 800 1.05rem/1 var(--display); }
.fine { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }

/* Reserve: a highway sign */
.band { background: var(--paper); }
.band .wrap { display: grid; gap: 24px; justify-items: start; }
.sign {
  width: 100%; max-width: 760px; background: var(--sign); color: var(--on-sign);
  border-radius: 20px; padding: clamp(24px, 4vw, 40px);
  box-shadow: inset 0 0 0 6px var(--sign), inset 0 0 0 9px var(--day);
  display: grid; gap: 14px; justify-items: start;
}
.sign-top { font: 800 0.85rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.85; }
.sign h2 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); font-weight: 900; line-height: 1; }
.sign h2 span { display: block; font-size: var(--step-1); font-weight: 600; margin-top: 6px; }
.sign p { max-width: 56ch; }
.notify { display: grid; gap: 8px; width: 100%; max-width: 760px; }
.notify label { color: var(--muted); }
.notify .row { display: flex; flex-wrap: wrap; gap: 10px; }
.notify input[type=email] {
  flex: 1 1 240px; min-width: 0; min-height: 48px; padding: 0 14px;
  font: 400 max(1rem, 1em) var(--body); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--rule); border-radius: 10px;
}
.notify input[type=email]:user-invalid { border-color: #c2410c; }

/* State pages */
.hero-state { padding-bottom: clamp(16px, 3vw, 32px); }
.state-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 5vw, 56px); align-items: end; }
.state-grid > div { display: grid; gap: 18px; min-width: 0; }
.crumb { font: 700 0.85rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.crumb a { color: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 18px 18px; color: var(--muted); font-size: 0.95rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend .d { background: var(--day); }
.legend .n { background: var(--night); }
.prose { display: grid; gap: 14px; }
.prose h2 { margin-top: 22px; }
.faq { border-top: 1px solid var(--rule); }
details { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 48px; list-style-position: outside; }
details p { color: var(--muted); padding-bottom: 16px; }
@media (prefers-reduced-motion: no-preference) {
  details::details-content {
    block-size: 0; overflow: clip; interpolate-size: allow-keywords;
    transition: block-size 0.25s ease, content-visibility 0.25s allow-discrete;
  }
  details[open]::details-content { block-size: auto; }
}
.others { display: flex; flex-wrap: wrap; gap: 10px; }
.others a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--rule);
  border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600;
}

footer { border-top: 1px solid var(--rule); padding-block: 40px 56px; }
footer .wrap { display: grid; gap: 10px; }

@media (max-width: 820px) {
  .hero-grid, .state-grid { grid-template-columns: minmax(0, 1fr); }
  .lead { max-width: none; }
}
@media (forced-colors: active) {
  .hours i, .legend i { forced-color-adjust: none; }
  .sign { border: 3px solid CanvasText; }
}
.log th, .log td { padding: 9px 10px; }
.log th:first-child, .log td:first-child { padding-left: 18px; }
.log th:last-child, .log td:last-child { padding-right: 18px; }
.log td { font-size: 0.86rem; }
[id] { scroll-margin-top: 80px; }
