/* The Guardrail Co. site. Brand tokens from the brand kit (highway-sign green, reflector amber, galvanized steel). */
:root {
  --ground: #F2F4F1;
  --surface: #FFFFFF;
  --ink: #14262E;
  --ink-muted: #4E6066;
  --rail-green: #1F5F4A;
  --rail-green-deep: #164536;
  --reflector: #E8A33B;
  --steel: #C9D3D2;
  --on-brand: #FFFFFF;
  --ok: #2F7A55;
  --caution: #9A6408;
  --alert: #B33A2E;
  --font: "Overpass", "Public Sans", Arial, sans-serif;
  --mono: "Overpass Mono", "IBM Plex Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 12px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--rail-green); text-underline-offset: 3px; }
a:hover { color: var(--rail-green-deep); }
:focus-visible { outline: 3px solid var(--reflector); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 680px; }

h1, h2, h3 { line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
p { margin: 0; }
.label {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.muted { color: var(--ink-muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* Header */
.site-header { background: var(--rail-green); color: var(--on-brand); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--on-brand); text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand:hover { color: var(--on-brand); }
.brand svg { width: 36px; height: 36px; flex: none; }
.site-header .cred { font-family: var(--mono); font-size: 0.78rem; opacity: 0.85; text-align: right; }
.brand { white-space: nowrap; }
@media (max-width: 560px) { .site-header .cred { display: none; } }

/* Hero */
.hero { background: var(--rail-green); color: var(--on-brand); padding-block: 40px 64px; position: relative; overflow: hidden; }
.hero .wrap { display: grid; gap: 28px; }
.hero .label { color: var(--reflector); }
.hero h1 .hl { box-shadow: inset 0 -0.18em 0 var(--reflector); }
.hero p.lede { font-size: 1.2rem; max-width: 36ch; opacity: 0.95; }
.rails { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.rails span { display: block; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.18); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-amber { background: var(--reflector); color: var(--ink); }
.btn-amber:hover { background: #F0B455; color: var(--ink); }
.btn-green { background: var(--rail-green); color: var(--on-brand); }
.btn-green:hover { background: var(--rail-green-deep); color: var(--on-brand); }
.btn-ghost { background: transparent; color: var(--ink-muted); padding: 0 8px; min-height: 44px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hero-cta small { font-size: 0.9rem; opacity: 0.85; }

/* Facts */
.facts { margin-top: -32px; position: relative; }
.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fact { background: var(--surface); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 0 rgba(20,38,46,0.06); }
.fact b { font-size: 2.2rem; font-weight: 800; color: var(--rail-green); line-height: 1; font-variant-numeric: tabular-nums; }
.fact .src { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-muted); margin-top: auto; }
@media (max-width: 760px) { .facts-grid { grid-template-columns: 1fr; } }

section.block { padding-block: 64px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: step; }
.step { display: flex; flex-direction: column; gap: 8px; }
.step::before { counter-increment: step; content: counter(step); font-family: var(--mono); font-weight: 500; color: var(--rail-green); font-size: 0.9rem; border: 2px solid var(--rail-green); border-radius: 999px; width: 32px; height: 32px; display: grid; place-items: center; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Quiz */
.quiz-section { background: var(--surface); padding-block: 56px; border-top: 1px solid var(--steel); border-bottom: 1px solid var(--steel); }
.quiz { display: flex; flex-direction: column; gap: 22px; }
.progress { height: 8px; border-radius: 4px; background: var(--ground); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--rail-green); transition: width 240ms var(--ease-out); }
.qmeta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.qmeta .label { color: var(--ink-muted); }
.hint { color: var(--ink-muted); font-size: 1rem; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
  background: var(--ground); border: 2px solid transparent; border-radius: var(--radius);
  padding: 14px 16px; font: inherit; color: var(--ink); cursor: pointer; min-height: 56px;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}
.opt:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .opt:hover { border-color: var(--steel); } }
.opt[aria-pressed="true"], .opt[aria-checked="true"] { border-color: var(--rail-green); background: #E6EFEB; }
.mark { flex: none; width: 22px; height: 22px; margin-top: 3px; border: 2px solid var(--ink-muted); background: var(--surface); }
.mark.radio { border-radius: 50%; }
.mark.check { border-radius: 6px; }
.opt[aria-pressed="true"] .mark, .opt[aria-checked="true"] .mark { border-color: var(--rail-green); background: var(--rail-green); box-shadow: inset 0 0 0 4px var(--surface); }
.opt small { display: block; color: var(--ink-muted); font-size: 0.9rem; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Result */
.result { display: flex; flex-direction: column; gap: 22px; }
.signal { display: flex; align-items: center; gap: 16px; }
.lamp { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 7px color-mix(in srgb, var(--lamp) 20%, transparent); }
.count { font-family: var(--mono); font-size: 0.9rem; color: var(--ink-muted); }
.panel { background: var(--ground); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.panel ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.panel.tonight { background: #FFF6E6; border: 2px solid var(--reflector); }
.panel.urgent { background: #FBEDEB; border: 2px solid var(--alert); }
.panel.urgent strong { color: var(--alert); }
.apps dt { font-weight: 800; }
.apps { margin: 0; }
.apps dd { margin: 0 0 10px 0; color: var(--ink-muted); }
.apps dd:last-child { margin-bottom: 0; }

/* Signup */
.signup { background: var(--rail-green); color: var(--on-brand); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.signup .label { color: var(--reflector); }
.signup form { display: flex; flex-direction: column; gap: 12px; }
.signup label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.signup input[type="email"] { font: inherit; font-size: 16px; min-height: 52px; padding: 0 16px; border-radius: 10px; border: 2px solid transparent; background: var(--surface); color: var(--ink); width: 100%; }
.signup .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.signup .consent input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--reflector); }
.signup .note { font-size: 0.9rem; opacity: 0.9; }
.signup .msg { font-weight: 800; }

/* Help strip */
.help { background: var(--ink); color: var(--on-brand); }
.help .wrap { padding-block: 28px; display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; }
.help strong { font-family: var(--mono); font-size: 1.1rem; color: var(--reflector); }
.help a { color: var(--on-brand); }

/* Sources + footer */
.sources ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
footer.site { padding-block: 32px 48px; color: var(--ink-muted); font-size: 0.9rem; }
footer.site .wrap { display: flex; flex-direction: column; gap: 10px; }

/* Long pages (privacy) */
.doc { padding-block: 48px 64px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 8px; }
.doc h2 { font-size: 1.35rem; margin-top: 32px; margin-bottom: 8px; }
.doc p, .doc li { max-width: 68ch; }
.doc ul { padding-left: 22px; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
  .btn:active, .opt:active { transform: none; }
}
