/* Railnotes base — reset, @font-face, typography scale, layout container.
 * DESIGN_SPEC §2.2 / §2.6. Depends on tokens.css. */

/* ---- @font-face (self-hosted, latin subset, swap) ---- */
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/nunito-400.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/nunito-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/nunito-800.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("../fonts/nunito-900.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/robotomono-500.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/robotomono-700.woff2") format("woff2");
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--color-ink);
  background: var(--color-surface-sunk);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--color-blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

/* Visible keyboard focus everywhere (§6). */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Typography scale (§2.2) ---- */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; }

.t-station-name { font-size: var(--fs-station-name); font-weight: 800; line-height: 1.1; }
.t-modal-title  { font-size: var(--fs-modal-title);  font-weight: 800; line-height: 1.15; }
.t-display      { font-size: var(--fs-display); font-weight: 900; line-height: 1.15; letter-spacing: 0.005em; color: var(--color-ink); }
.t-heading      { font-size: var(--fs-heading); font-weight: 800; line-height: 1.2; }
.t-body         { font-size: var(--fs-body); font-weight: 400; line-height: 1.45; }
.t-body-strong  { font-size: var(--fs-body-strong); font-weight: 700; line-height: 1.45; }
.t-small        { font-size: var(--fs-small); font-weight: 400; line-height: 1.4; }
.t-caption      { font-size: var(--fs-caption); font-weight: 600; line-height: 1.3; }
.t-mono-code    { font-family: var(--font-mono); font-size: var(--fs-mono-code); font-weight: 700; line-height: 1; }
.t-mono-label   { font-family: var(--font-mono); font-size: var(--fs-mono-label); font-weight: 500; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase; }

.t-mute { color: var(--color-ink-mute); }
.t-soft { color: var(--color-ink-soft); }

/* ---- Layout container (§2.6) ---- */
.app-content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-4) var(--page-pad-x) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
@media (min-width: 600px) {
  .app-content { padding-left: var(--space-6); padding-right: var(--space-6); }
}

/* Utility: visually-hidden (accessible names) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Icons (docs/DESIGN_SPEC.md "Icons") ----
   Vendored Font Awesome Free SVGs, inlined server-side via icon(). Default
   size matches cap height (1em) and inherits text colour; components override
   width/height with a more specific selector where a fixed pixel size is
   needed (nav hamburger, POI nodes, etc). */
.icon {
  width: 1em; height: 1em; flex: 0 0 auto;
  display: inline-block; vertical-align: -0.125em;
  fill: currentColor;
}

/* Reduced motion: disable transitions/animations (§6). */
@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;
  }
}
