/* =============================================================================
   Roadbooker base styles: fonts, reset, typography, layout primitives.
   Depends on tokens.css (copied unchanged from docs/design/tokens-final.css).
   Mobile-first; breakpoints sm 480, md 768, lg 1024, xl 1280 (min-width).
   ============================================================================= */

/* ---- Inter, self-hosted (variable weight axis; latin + latin-ext) -------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../../vendor/inter-fontsource-5.3.0/inter-latin-wght-normal.woff2') format('woff2-variations'),
       url('../../vendor/inter-fontsource-5.3.0/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../../vendor/inter-fontsource-5.3.0/inter-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('../../vendor/inter-fontsource-5.3.0/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: dark;
  scroll-padding-top: calc(var(--nav-height) + var(--space-4));
}
html:has(body.has-preview) { scroll-padding-top: calc(var(--nav-height) + var(--preview-height) + var(--space-4)); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
main { flex: 1 0 auto; display: block; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* ---- Typography ------------------------------------------------------------ */
h1, h2, h3, h4 { color: var(--text-1); text-wrap: balance; }
h1 { font-size: var(--type-h1-app); font-weight: var(--fw-extrabold); line-height: var(--lh-snug); letter-spacing: var(--ls-heading); }
h2 { font-size: var(--type-h2-app); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: var(--ls-title); }
h3 { font-size: var(--type-h3); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: var(--ls-title); }
h4 { font-size: var(--type-h4); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
p { text-wrap: pretty; }
strong, b { color: var(--text-1); font-weight: var(--fw-bold); }
small { font-size: var(--type-xs); }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

.display {
  font-size: var(--type-display);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}
.h2-marketing {
  font-size: var(--type-h2);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}
.hl { color: var(--accent); font-style: normal; }          /* orange highlight words */
.lead { font-size: var(--type-lead); line-height: var(--lh-relaxed); color: var(--text-2); }
.eyebrow {
  display: inline-block;
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}
.fine { font-size: var(--type-fine); color: var(--text-3); }
.num, .tabular { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; }

/* ---- Links ----------------------------------------------------------------- */
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--dur-base); }
a:hover { color: var(--accent-lt); }
/* Links in running text are underlined (colour alone isn't enough) */
.prose a, p a, li a { text-decoration: underline; }

/* ---- Focus (R2): one indicator everywhere ---------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}
/* Programmatic focus targets (headings, main) don't need a ring for mouse users */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

::selection { background: rgba(232,137,12,0.35); color: var(--text-1); }

/* ---- Skip link -------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: var(--z-skip);
  min-height: var(--target-min);
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; color: var(--on-accent); }

/* ---- Layout primitives ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow  { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container--reading { max-width: calc(var(--container-reading) + 2 * var(--gutter)); }
@media (min-width: 768px) {
  .container { padding-inline: var(--gutter-md); max-width: calc(var(--container) + 2 * var(--gutter-md)); }
  .container--narrow  { max-width: calc(var(--container-narrow) + 2 * var(--gutter-md)); }
  .container--reading { max-width: calc(var(--container-reading) + 2 * var(--gutter-md)); }
}
@media (min-width: 1024px) {
  .container { padding-inline: var(--gutter-lg); max-width: calc(var(--container) + 2 * var(--gutter-lg)); }
  .container--narrow  { max-width: calc(var(--container-narrow) + 2 * var(--gutter-lg)); }
  .container--reading { max-width: calc(var(--container-reading) + 2 * var(--gutter-lg)); }
}

.section { padding-block: var(--section-pad-y-sm); }
@media (min-width: 768px) { .section { padding-block: var(--section-pad-y); } }
.section--band { background: var(--surface); }
.section-head { max-width: 640px; margin-bottom: var(--space-9); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: var(--space-3); }
.section-head p { margin-top: var(--space-4); }

.stack > * + * { margin-top: var(--stack-gap, var(--space-4)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--space-3)); align-items: center; }

.visually-hidden, .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Scroll reveal (landing only). Content is visible without JS and under
       reduced motion: the hidden start state only applies when JS adds .js-reveal. */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .fade-up { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-reveal) var(--ease-reveal), transform var(--dur-reveal) var(--ease-reveal); }
  .js-reveal .fade-up.is-visible { opacity: 1; transform: none; }
  .js-reveal .fade-up[data-delay="1"] { transition-delay: 0.1s; }
  .js-reveal .fade-up[data-delay="2"] { transition-delay: 0.2s; }
}

/* ---- Reduced motion: kill remaining animation/transition ------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Prose (legal pages and long text) ------------------------------------ */
.prose { color: var(--text-2); font-size: var(--type-body); line-height: var(--lh-relaxed); max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-9); font-size: var(--type-h2-app); scroll-margin-top: calc(var(--nav-height) + var(--space-4)); }
.prose h3 { margin-top: var(--space-7); font-size: var(--type-h3); }
.prose h4 { margin-top: var(--space-6); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: var(--space-3); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--accent); }
.prose a { overflow-wrap: anywhere; }
.prose table { width: 100%; font-size: var(--type-small); display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-md); vertical-align: top; }
.prose th { color: var(--text-1); }
.prose blockquote { border-left: 3px solid var(--accent-bd); padding-left: var(--space-4); }
.prose address { font-style: normal; }
.prose hr { border: 0; border-top: 1px solid var(--border-md); margin-block: var(--space-7); }
