/* ==========================================================================
   tokens.css — design tokens, reset, base type and layout primitives.
   Change the theme here: every other stylesheet reads these variables.
   ========================================================================== */

:root {
  /* Colour: white base, navy ink, baseball-seam red, Kenyan green for "official" */
  --paper: #ffffff;
  --chalk: #f4f6f9;
  --line: #e2e6ed;
  --line-strong: #c5cddb;

  --ink: #0d2240;
  --ink-2: #17335c;
  --ink-soft: #43506a;
  --ink-faint: #66718a;

  --stitch: #c8102e;
  --stitch-deep: #9f0c24;
  --stitch-tint: #fdeef1;

  --pitch: #0a7a42;
  --pitch-tint: #e5f4ec;

  --amber: #8a4b06;
  --amber-tint: #fff2dc;

  --board: #0d2240;
  --board-line: #2a4166;
  --board-text: #f4f7fb;
  --board-muted: #b9c6dc;

  /* Type: no web fonts, so pages load fast on mobile data */
  --font-display: "Roboto Condensed", "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", sans-serif-condensed, "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --text-xs: 0.8125rem;
  --text-s: 0.9375rem;

  /* Space and shape */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;

  --r-s: 4px;
  --r-m: 10px;
  --r-l: 18px;

  --container: 74rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --measure: 62ch;
  --header-h: 4rem;

  --shadow-pop: 0 12px 32px rgb(13 34 64 / 0.18);

  /* Fixed dark surface, independent of light/dark theme. A few elements —
     the footer band, dark buttons, the active dashboard tab, the skip link —
     are meant to read as "the dark accent" in both themes, not flip to
     white when the page goes dark. Never redefined inside the dark-theme
     blocks below. */
  --surface-strong: #0d2240;
  --surface-strong-2: #17335c;
  --on-surface-strong: #f4f7fb;

  color-scheme: light;
}

/* Dark theme: same names, different values, so every other file just works.
   Applied via [data-theme="dark"] (explicit toggle) or, with no explicit
   choice made, by the system's own preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1420;
    --chalk: #161f30;
    --line: #263349;
    --line-strong: #35455f;

    --ink: #eef2f9;
    --ink-2: #ffffff;
    --ink-soft: #b7c2d6;
    --ink-faint: #8996ae;

    --stitch: #ff5c72;
    --stitch-deep: #ff8394;
    --stitch-tint: #3a1620;

    --pitch: #3ddc8a;
    --pitch-tint: #0f2e20;

    --amber: #ffb648;
    --amber-tint: #3a2a0c;

    --board: #060b16;
    --board-line: #1f2c44;
    --board-text: #f4f7fb;
    --board-muted: #93a2c0;

    --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1420;
  --chalk: #161f30;
  --line: #263349;
  --line-strong: #35455f;

  --ink: #eef2f9;
  --ink-2: #ffffff;
  --ink-soft: #b7c2d6;
  --ink-faint: #8996ae;

  --stitch: #ff5c72;
  --stitch-deep: #ff8394;
  --stitch-tint: #3a1620;

  --pitch: #3ddc8a;
  --pitch-tint: #0f2e20;

  --amber: #ffb648;
  --amber-tint: #3a2a0c;

  --board: #060b16;
  --board-line: #1f2c44;
  --board-text: #f4f7fb;
  --board-muted: #93a2c0;

  --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font: 400 1rem/1.6 var(--font-body);
  color: var(--ink);
  background: var(--paper);
  transition: background-color 0.15s, color 0.15s;
}

#main { flex: 1; }
#main:focus, h1:focus { outline: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
h1, h2, h3, h4, p, dd, dt, a, span, td, th { overflow-wrap: break-word; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface-strong);
  color: #fff;
}
.skip-link:focus { left: 0; }

/* Layout primitives ------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tint { background: var(--chalk); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-6);
}
.section__head > *:first-child { min-width: 0; flex: 1 1 16rem; }
.section__head p { margin-top: var(--s-2); color: var(--ink-soft); max-width: var(--measure); }

.link-more {
  font-weight: 700;
  color: var(--stitch-deep);
  text-underline-offset: 0.25em;
}

.grid-cards {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.num { font-variant-numeric: tabular-nums; }

/* The seam: one signature device, used under heroes and page heads */
.stitch-rule { margin: 0; border: 0; border-top: 2px dashed var(--stitch); }

/* Badges ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--chalk);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
}
.badge svg { width: 0.95em; height: 0.95em; }
.badge--verified { background: var(--pitch-tint); color: var(--pitch); }
.badge--pending { background: var(--amber-tint); color: var(--amber); }
.badge--stitch { background: var(--stitch-tint); color: var(--stitch-deep); }

/* Forms ------------------------------------------------------------------- */
.field { display: grid; gap: 0.35rem; align-content: start; }
.field > label, .field .label { font-weight: 600; font-size: var(--text-s); }
.field .hint { font-size: var(--text-xs); color: var(--ink-faint); }

.input, .select, .textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--paper);
  color: var(--ink);
}
.textarea { min-height: 6rem; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--ink);
}

.form-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.form-error { color: var(--stitch-deep); font-weight: 600; font-size: var(--text-s); }

/* Tabs -------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: var(--s-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.tab {
  margin-bottom: -1px;
  padding: 0.75rem 1rem;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--stitch); }

/* Empty state ------------------------------------------------------------- */
.empty {
  padding: var(--s-7) var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  text-align: center;
  color: var(--ink-soft);
}
.empty h3 { margin-bottom: var(--s-2); color: var(--ink); }

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