/* SPDX-License-Identifier: MIT
 *
 * Stone Lane — page styles. Adopted structurally from hire4real's layout sheets, reduced to
 * the surfaces this site has.
 *
 * THE COLOUR LAW, MECHANICALLY: there is no hex value in this file. Every colour is a
 * var() into design-tokens.css, which is the only source of truth. scripts/lint_colorlaw.sh
 * is red the moment a literal appears here, and red on any token whose name carries a
 * direction (up/down/good/bad/gain/loss). Hue means which series. Direction is a number
 * with an arrow.
 */

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--earth); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Keyboard users land here first. Visible the moment it has focus, never before. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--earth); color: var(--sand);
  padding: 0.6rem 1rem; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

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

/* ------------------------------------------------------------------ header */

.site-header { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4rem; flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-word { font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.brand-mark { display: block; border-radius: 3px; }

.site-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-right: auto; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--ink); text-decoration: underline;
}

.nav-tools { display: flex; gap: 0.5rem; }
.term-toggle, .theme-toggle {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); border-radius: 4px;
  padding: 0.35rem 0.7rem; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.term-toggle:hover, .theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle::after { content: "Theme"; }

/* -------------------------------------------------------------------- hero */

.hero { background: var(--tile-sand); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15;
  letter-spacing: -0.02em; margin: 0 0 0.75rem;
}
.hero .lede { color: var(--ink-2); margin: 0 0 1.75rem; max-width: 46ch; }

.searchbox { display: flex; gap: 0.5rem; max-width: 34rem; }
.searchbox input {
  flex: 1; padding: 0.7rem 0.9rem; font: inherit;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface-2); color: var(--ink);
}
.searchbox button {
  padding: 0.7rem 1.2rem; font: inherit; cursor: pointer;
  border: 0; border-radius: 4px;
  background: var(--earth); color: var(--sand);
}

.try { margin: 0.9rem 0 0; color: var(--ink-2); font-size: 0.9rem; }
.try a { margin-right: 0.75rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; padding: 0; list-style: none; }
.chips a {
  display: inline-block; padding: 0.4rem 0.8rem; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); text-decoration: none; color: var(--ink);
}

/* ------------------------------------------------------------------- prose */

main .wrap { padding-top: 2.5rem; padding-bottom: 3rem; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin-top: 2.5rem; }
h3 { font-size: 1.15rem; margin-top: 1.75rem; }
.prose { max-width: 68ch; }
.prose p, .prose li { color: var(--ink); }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
th { color: var(--ink-2); font-weight: 600; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

/* The slab: the hero tile on /about, and nothing else. Never a favicon. */
.slab { display: block; max-width: 12rem; border-radius: 6px; }

/* A stat tile carries the series hue as a LEFT RULE, never as a fill. There is no
 * "good" tile and no "bad" tile; there is a tile per series. */
.tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-2);
  border-radius: 4px; padding: 1rem 1.15rem;
}
.tile[data-series="lca"]   { border-left-color: var(--series-lca); }
.tile[data-series="perm"]  { border-left-color: var(--series-perm); }
.tile[data-series="warn"]  { border-left-color: var(--series-warn); }
.tile .label { color: var(--ink-2); font-size: 0.85rem; }
.tile .value { font-size: 1.6rem; font-weight: 700; }

/* Missing data renders as words, never as a zero line. */
.absent { color: var(--ink-2); font-style: italic; }

/* ------------------------------------------------------------------- 404 */

.lost { text-align: center; padding: 3rem 0; }
.lost img { width: 9rem; height: auto; margin-bottom: 1.5rem; }
.lost p { color: var(--ink-2); max-width: 44ch; margin: 0 auto 2rem; }

/* ------------------------------------------------------------------ footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  margin-top: 4rem;
}
.site-footer .wrap { padding-top: 2rem; padding-bottom: 2.5rem; }
.site-footer .disclaimer { color: var(--ink-2); font-size: 0.9rem; margin: 0 0 0.4rem; }
.family-strip { margin: 1.25rem 0 0.75rem; color: var(--ink-2); font-size: 0.9rem; }
.family-strip a { margin-left: 0.6rem; }
.licence { color: var(--ink-2); font-size: 0.8rem; margin: 0.75rem 0 0; }

@media (max-width: 40rem) {
  .site-header .wrap { min-height: auto; padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .site-nav { gap: 0.85rem; order: 3; width: 100%; }
}
