/* =========================================================================
   Mountain Log design system
   Single source of truth for every page in site/.

   The structure, type and spacing are Routehold's "Roadbook" system
   (routehold-app/site/assets/routehold.v1.css). The colours are taken from
   the app icon: its pale sky for the ground, its dark rock for ink and
   rules, and the red of its checkbox as the one accent. Sampled from
   ios/Wainwrights/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
     sky #E2E9FB / #B5C5FB, rock #0A1A54 / #10247A / #374EB3, red #F92022.
   Light only, as Routehold is.
   ========================================================================= */

/* ---------- 1. TOKENS ---------------------------------------------------- */

:root{
  color-scheme: light;

  /* Ground and ink: the icon's sky, lightened, and its darkest rock. */
  --paper:        #EEF2FC;   /* page ground */
  --panel:        #F8FAFF;   /* roadbook body, raised surfaces */
  --ink:          #0A1A54;   /* primary text, structural rules */
  --ink-2:        #2B3970;   /* body copy, secondary */
  --ink-3:        #56628C;   /* labels, captions, table headers */
  --rule:         #C3CDEC;   /* hairlines inside panels */
  --rule-strong:  #0A1A54;   /* structural rules: nav underline, section head */

  /* Accent: the icon's checkbox red, darkened a little so it reads as text on
     the pale ground. It means "climbed", as it does in the app. --todo is the
     app's blue for a hill still to climb. */
  --accent:       #D91C1E;
  --on-accent:    #FFFFFF;
  --todo:         #1E63D8;

  /* Status. Distinct from the accent on purpose. */
  --good:         #2E6B4F;
  --warn:         #A8322A;

  /* Type. All three are on Google Fonts under open licences.
     Display  — Libre Franklin 800, tight, left-aligned, never centred
     Body     — Source Serif 4, the only serif in the category
     Data     — IBM Plex Mono, for waypoints, distances, labels, nav */
  --f-display: "Libre Franklin", system-ui, -apple-system, sans-serif;
  --f-body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-data:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale. Six sizes. Do not invent a seventh. */
  --t-display: clamp(38px, 6vw, 64px);
  --t-h2:      30px;
  --t-h3:      21px;
  --t-lead:    20px;
  --t-body:    17px;
  --t-small:   15px;
  --t-label:   11px;   /* mono, uppercase, tracked */

  --lh-display: 1.03;
  --lh-heading: 1.15;
  --lh-body:    1.6;

  /* Spacing scale. Eight steps, 4px base. Every margin and padding in the
     site comes from this list. */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;

  /* Radius BY ROLE, not by taste. The old site had eight radii with no rule.
     Roadbook is a paper document, so structure is square. */
  --r-flat:    0;     /* rules, table cells, roadbook — the default */
  --r-control: 2px;   /* buttons, inputs */
  --r-panel:   3px;   /* raised panels, images */
  /* There is no pill radius. Pills were tell 03 and 04 in the audit. */

  --maxw:      1080px;
  --maxw-prose: 68ch;
  --border:    1px;
  --border-strong: 1.5px;
}

/* ---------- 2. RESET AND BASE -------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/var(--lh-body) var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

::selection { background: var(--accent); color: var(--on-accent); }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 3. LAYOUT ---------------------------------------------------- */

.wrap{ max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s5); }
@media (max-width: 640px){ .wrap{ padding-inline: var(--s4); } }

.band{ padding-block: var(--s9); }
.band + .band{ border-top: var(--border) solid var(--rule); }
@media (max-width: 640px){ .band{ padding-block: var(--s8); } }

.prose{ max-width: var(--maxw-prose); }

/* Two-column split. Text left, artefact right. Never centred. */
.split{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); align-items: start; }
@media (max-width: 860px){ .split{ grid-template-columns: 1fr; gap: var(--s6); } }

/* ---------- 4. TYPOGRAPHY ------------------------------------------------ */

h1, h2, h3{ margin: 0; font-family: var(--f-display); letter-spacing: -0.03em; text-wrap: balance; }

h1, .display{
  font-weight: 800;
  font-size: var(--t-display);
  line-height: var(--lh-display);
  max-width: 16ch;
}

h2{ font-weight: 800; font-size: var(--t-h2); line-height: var(--lh-heading); letter-spacing: -0.024em; }
h3{ font-weight: 700; font-size: var(--t-h3); line-height: var(--lh-heading); letter-spacing: -0.018em; }

p{ margin: 0 0 var(--s4); max-width: var(--maxw-prose); }
p:last-child{ margin-bottom: 0; }

.lead{ font-size: var(--t-lead); color: var(--ink-2); max-width: 46ch; }
.small{ font-size: var(--t-small); color: var(--ink-2); }
.muted{ color: var(--ink-3); }

/* The only uppercase device on the site. A label, on its own line, above a
   rule. It replaces the four all-caps pills the old site used. */
.label{
  font: 600 var(--t-label)/1 var(--f-data);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: var(--s3);
}

/* Section heading: label, then heading, then a full-width rule beneath. */
.sechead{ border-bottom: var(--border-strong) solid var(--rule-strong); padding-bottom: var(--s3); margin-bottom: var(--s6); }

/* ---------- 5. NAVIGATION ------------------------------------------------ */

.nav{
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s5);
  padding-block: var(--s5);
  border-bottom: var(--border-strong) solid var(--rule-strong);
}
.nav__brand{
  display: flex; align-items: center; gap: var(--s3);
  font: 600 var(--t-label)/1 var(--f-data);
  letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none;
}
.nav__brand img{ width: 28px; height: 28px; border-radius: 6px; }  /* an app icon, so it keeps a rounded corner */
.nav__links{ display: flex; gap: var(--s5); }
.nav__links a{
  font: 600 var(--t-label)/1 var(--f-data);
  letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-3);
}
.nav__links a:hover, .nav__links a[aria-current="page"]{ color: var(--ink); }
@media (max-width: 560px){
  .nav{ flex-wrap: wrap; gap: var(--s3); }
  .nav__links{ width: 100%; gap: var(--s4); }
}

/* ---------- 6. BUTTONS --------------------------------------------------- */

.btn{
  display: inline-block;
  font: 600 12px/1 var(--f-data);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: var(--s3) var(--s5);
  border: var(--border-strong) solid var(--ink);
  border-radius: var(--r-control);
  background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.btn:hover{ background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--ghost{ background: transparent; color: var(--ink); }
.btn--ghost:hover{ background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 8. SPEC LIST ------------------------------------------------- */
/* Replaces the sixteen bordered cards. Facts on hairlines, not in boxes. */

.spec{ border-top: var(--border) solid var(--rule); margin: 0; }
.spec__row{
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s5);
  padding-block: var(--s3);
  border-bottom: var(--border) solid var(--rule);
  font: 500 14px/1.5 var(--f-data);
}
.spec__row dt{ color: var(--ink-3); }
/* Two left-aligned columns: every value starts at the same edge, and a long value (a sentence rather than a
   figure) wraps within a readable measure (owner 2026-10-18: "the column needs to be left justified"). */
.spec__row dd{ margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; max-width: 40ch; text-align: left; }

/* ---------- 9. FIGURE / PANEL -------------------------------------------- */

.panel{
  background: var(--panel);
  border: var(--border) solid var(--rule);
  border-radius: var(--r-panel);
  padding: var(--s5);
}
figure{ margin: 0; }
figcaption{ font: 500 13px/1.5 var(--f-data); color: var(--ink-3); margin-top: var(--s3); }

/* ---------- 10. FOOTER --------------------------------------------------- */

.foot{
  border-top: var(--border-strong) solid var(--rule-strong);
  padding-block: var(--s6) var(--s8);
  font: 400 var(--t-small)/1.6 var(--f-body);
  color: var(--ink-3);
}
.foot a{ color: var(--ink-3); }
.foot__row{ display: flex; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s4); }
.foot__row a{
  font: 600 var(--t-label)/1 var(--f-data);
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
}

/* ---------- 13. UTILITIES ------------------------------------------------ */

.stack > * + *{ margin-top: var(--s4); }
.stack-lg > * + *{ margin-top: var(--s6); }
.tabular{ font-variant-numeric: tabular-nums; }
.visually-hidden{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* =========================================================================
   BANNED. Do not reintroduce. Each of these was measured on the old site and
   is a documented tell of machine-generated design. See reference/audit.md.

     - the operating-system font stack (use the three faces above)
     - any linear-gradient, on text or on a surface
     - pill-shaped badges above headings, or as section labels
     - more than the three radii declared in this file
     - centred headings or centred body copy
     - repeated hairline-bordered cards used for every block
     - a dark theme bolted on top of this one
   ========================================================================= */
