/* ============================================================================
   Roadside Modern — reset, elements, typography, layout primitives
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s3));
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select { font: inherit; color: inherit; }

/* --- display type ---------------------------------------------------------
   Display is never letterspaced; eyebrows always are (spec § 4.2). */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-variation-settings: var(--display-variation);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1, .h1 { font-size: var(--type-h1); }
h2, .h2 { font-size: var(--type-h2); line-height: 1.05; }
h3, .h3 { font-size: var(--type-h3); line-height: 1.15; }

/* Heading level and heading size are separate decisions: a gallery card is an
   h2 in the document outline but reads at h3 scale. */
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-variation-settings: var(--display-variation);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.billboard {
  font-size: var(--type-billboard);
  line-height: 0.95;
}

p { text-wrap: pretty; }

p + p { margin-top: var(--s3); }

strong { font-weight: 700; }

/* --- eyebrow / annotation register ---------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--type-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
}

.fine {
  font-size: var(--type-fine);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --- links ----------------------------------------------------------------- */
a {
  color: var(--rust-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover { color: var(--ink); }

/* Focus: 3px rust outline, 2px offset, on everything, always (spec § 9). */
:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--s2);
  top: -100%;
  z-index: 999;
  background: var(--gold);
  color: var(--ink);
  border: var(--ringer);
  padding: var(--s1) var(--s3);
  border-radius: var(--radius-pill);
  transition: top var(--dur-fast);
}

.skip-link:focus { top: var(--s2); }

/* --- layout primitives ------------------------------------------------------
   Full-bleed color blocks escape the grid; text never does (spec § 5). */
.wrap {
  width: 100%;
  max-width: calc(var(--col-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.read {
  width: 100%;
  max-width: var(--col-read);
  margin-inline: auto;
}

.measure { max-width: var(--measure); }

/* Blocks touch: whitespace lives inside blocks, never between them. */
.block {
  padding-block: var(--s7);
}

.block--tall { padding-block: var(--s8); }

@media (max-width: 767px) {
  .block { padding-block: var(--s6); }
  .block--tall { padding-block: var(--s6); }
}

.block--paper { background: var(--paper); }
.block--paper-warm { background: var(--paper-warm); }
.block--sand { background: var(--sand); }
.block--box { background: var(--box); color: var(--paper-warm); }
.block--tint { background: var(--tint); color: var(--paper-warm); }
.block--gold { background: var(--gold); color: var(--ink); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.stack > * + * { margin-top: var(--s3); }
.stack-lg > * + * { margin-top: var(--s5); }

/* --- utility ---------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.on-dark { color: var(--paper-warm); }
.on-dark a { color: var(--gold); }
.text-gold { color: var(--gold); }
.text-tint { color: var(--tint-deep); }
