/*
 * THE ONLY PLACE COLOURS ARE DEFINED. Every other stylesheet uses var(--...) only
 * (tests/build-check.mjs fails on any colour literal outside this file).
 *
 * Structure ported from _work/reference/spiritguide-home.html (Direction A, "The Guided Day").
 * Hexes: Spirit-Guide-Route _work/audits/colour-palette-extraction-2026-11-11.md (Route master 78d0305)
 * wherever Route has the colour ("Route ..." comments). Where Route has no equivalent, the reference's own
 * hex is kept and marked "ref". Dark = Route bare :root, Light = Route light theme. Route "Sun" is not used.
 *
 * Text/surface pairs listed in tests/contrast-pairs.json must meet 4.5:1 in both themes.
 */

:root {
  color-scheme: dark light;

  /* Surfaces */
  --bg: #000000;              /* Route --bg */
  --surface: #141414;         /* Route --surface (cards) */
  --raised: #242424;          /* Route --slate-chip-bg (ref --raised #242424) */
  --mock-bg: #0b0b0b;         /* ref */
  --line: #1f1f1f;            /* ref (hairlines) */
  --line-strong: #2e2e36;     /* ref */

  /* Text */
  --text: #f2f2f2;            /* Route --text (ref #ececec) */
  --text-strong: #ffffff;     /* ref */
  --text-soft: #c4c4d0;       /* ref */
  --text-dim: #a6a6a6;        /* Route --text-dim (ref --text-muted #a2a2b8) */
  --slate: #8888b3;           /* Route --slate-chip-text */

  /* Brand and actions */
  --teal: #2ccbc2;            /* Route --teal-text (ref #2dd4bf) */
  --on-teal: #06201f;         /* Route --ramp-teal-on */
  --teal-bg: #182e30;         /* Route --teal-bg */
  --gold: #ffe08e;            /* Route --logo-gold */
  --orange: #fea637;          /* Route --logo-orange */
  --focus: #ffe08e;           /* Route --logo-gold (ref focus = gold) */
  --fit: #c96a4d;             /* Route --ramp-rust-edge ("ember rust") */
  --on-fit: #170804;          /* ref */
  --fit-text: #e8997f;        /* Route --ramp-rust-text (Fit rust used as text) */

  /* Day ramp: gray, plum, rust, copper, ochre, teal (brief order). Bars = Route ramp EDGE,
     section-marker labels = Route ramp TEXT (readable at 4.5:1). */
  --ramp-1: #808080;  --ramp-1-text: #c4c4c4;   /* Route gray */
  --ramp-2: #b26b9a;  --ramp-2-text: #d9a3c9;   /* Route plum */
  --ramp-3: #c96a4d;  --ramp-3-text: #e8997f;   /* Route rust */
  --ramp-4: #bf7436;  --ramp-4-text: #e6b383;   /* Route copper */
  --ramp-5: #d0a043;  --ramp-5-text: #dcb565;   /* Route ochre */
  --ramp-6: #2ccbc2;  --ramp-6-text: #2ccbc2;   /* Route teal */

  /* Brand line: Route --gradient-muted, left to right */
  --grad-1: #b9768f;
  --grad-2: #c97c72;
  --grad-3: #d4966a;
  --grad-4: #d9b37a;

  /* Fit mock tiles */
  --hr: #e9a3c9;              /* Route --act-pink-text */
  --cad: #ffe08e;             /* Route --logo-gold */
  --zone: #2ccbc2;            /* Route --teal-text */

  /* Contact band */
  --contact-end: #031a17;     /* ref (Route --teal-bg #182e30 read too light against the reference) */
  --contact-line: #12332e;    /* ref */

  /* Header: charcoal in BOTH themes (ADDENDUM 3); never overridden in the light block. */
  --header-bg: #1c1c1c;          /* Route dark --surface-2 */
  --header-text: #f2f2f2;        /* Route --strip-text (all modes) */
  --header-text-dim: #a6a6a6;    /* Route dark --text-dim */
  --header-link-hover: #2ccbc2;  /* Route dark --teal-text */
  --header-focus: #ffe08e;       /* Route dark --logo-gold */
  --header-btn: #2ccbc2;         /* Route dark --teal-text (Hire Me button) */
  --header-on-btn: #06201f;      /* Route --ramp-teal-on */

  /* Draft placeholders (Day ramp Ochre text on Ochre soft) */
  --placeholder-text: #dcb565;      /* Route --ramp-ochre-text */
  --placeholder-bg: #2a2417;        /* Route --ramp-ochre-soft */
  --placeholder-edge: #d0a043;      /* Route --ramp-ochre-edge */
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f5ee;
    --surface: #ffffff;
    --raised: #eeeae0;          /* Route light --surface-2 (ref #efeadf) */
    --mock-bg: #f2eee5;         /* ref */
    --line: #e4ded1;            /* ref */
    --line-strong: #d3ccbd;     /* ref */

    --text: #151515;
    --text-strong: #111114;     /* ref */
    --text-soft: #3e3e4a;       /* ref */
    --text-dim: #4a4a4a;
    --slate: #4a4e7a;

    --teal: #0a6b64;            /* Route light --teal-text (ref #0f766e) */
    --on-teal: #ffffff;
    --teal-bg: #d8f2ef;
    --gold: #7a5600;
    --orange: #964800;
    --focus: #7a5600;
    --fit: #a8472f;             /* Route light --ramp-rust-edge */
    --on-fit: #ffffff;
    --fit-text: #8f3a24;

    --ramp-1: #5c5c5c;  --ramp-1-text: #3a3a3a;
    --ramp-2: #7d3f6c;  --ramp-2-text: #6f2f5e;
    --ramp-3: #a8472f;  --ramp-3-text: #8f3a24;
    --ramp-4: #9c5a22;  --ramp-4-text: #7a4010;
    --ramp-5: #9a7418;  --ramp-5-text: #6e4d00;
    --ramp-6: #0f8c84;  --ramp-6-text: #0a6b64;

    /* --gradient-muted is the same in Dark and Light */

    --hr: #8f1f5c;              /* Route light --act-pink-text */
    --cad: #7a5600;
    --zone: #0a6b64;

    --contact-end: #dff3ee;     /* ref */
    --contact-line: #bfe3da;    /* ref */

    --placeholder-text: #6e4d00;
    --placeholder-bg: #f3e9cf;
    --placeholder-edge: #9a7418;
  }
}

/*
 * Layout and type, ported from _work/reference/spiritguide-home.html (Direction A, "The Guided Day").
 * Colours: var(--token) only (tokens.css). Differences from the reference are listed in _work/BATON.md
 * (HANDOFF PORT): header (ADDENDUM 3), per-figure dates, no inline styles (CSP), placeholders.
 */

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

/* Author display rules (e.g. main { display: block }) must never un-hide [hidden] elements. */
[hidden] { display: none !important; }

/* Metric-matched fallback for Inter (Lighthouse: the Inter swap moved the whole page, CLS 0.259).
   Local Arial / Helvetica resized to Inter's metrics, so the swap barely moves text. No download (local()). */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Helvetica Neue");
  size-adjust: 107.06%;
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
}
:root {
  --sans: Inter, "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
main { display: block; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--teal); }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: clamp(20px, 4vw, 32px); }
h1, h2, h3 { color: var(--text-strong); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 16px;
  background: var(--teal);
  color: var(--on-teal);
  border-radius: 8px;
  z-index: 50;
}
.skip-link:focus { top: 16px; }

/* ---------- Draft banner ---------- */
.draft-banner {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--placeholder-text);
  background: var(--placeholder-bg);
  border-bottom: 1px solid var(--placeholder-edge);
}

/* ---------- Buttons (min 44 px tall: brief section 2) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 12px;
  font-weight: 700; text-decoration: none; font-size: 16px; text-align: center;
}
.btn-teal { background: var(--teal); color: var(--on-teal); }
.btn-teal:hover { filter: brightness(1.08); }
.btn-gold { border: 1.5px solid var(--gold); color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.btn-fit { background: var(--fit); color: var(--on-fit); }
.btn-fit:hover { filter: brightness(1.08); }

/* ---------- Header (ADDENDUM 3: charcoal in BOTH themes, icon tile + wordmark image + byline) ---------- */
.site-header { background: var(--header-bg); color: var(--header-text); position: relative; }
.header-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-block: 14px;
}
.brand-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand picture { display: block; flex: none; }
.brand-icon { display: block; width: 44px; height: 44px; border-radius: 22%; }
.brand-wordmark { display: block; width: 173px; height: 24px; flex: none; }
.byline { color: var(--header-text-dim); font-size: 14px; font-weight: 600; white-space: nowrap; }
.site-header a:focus-visible { outline-color: var(--header-focus); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px; font-size: 15px; }
.site-nav a:not(.btn) { color: var(--header-text); text-decoration: none; padding-block: 10px; }
.site-nav a:not(.btn):hover { color: var(--header-link-hover); }
.site-nav .btn { min-height: 44px; padding: 10px 20px; border-radius: 10px; font-size: 15px; background: var(--header-btn); color: var(--header-on-btn); }
.brand-rule { height: 2px; background: linear-gradient(90deg, var(--grad-1), var(--grad-2), var(--grad-3), var(--grad-4)); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(64px, 10vw, 104px) 64px; }
.hero h1 { font-size: clamp(38px, 6vw, 76px); line-height: 1.04; font-weight: 800; letter-spacing: -0.03em; max-width: 15ch; }
.hero .lede { margin-top: 26px; max-width: 58ch; font-size: clamp(17px, 2vw, 20px); color: var(--text-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .actions { margin-top: 36px; }

.ramp { margin-top: clamp(56px, 8vw, 88px); }
.ramp-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; height: 10px; }
.ramp-bar span:nth-child(1) { background: var(--ramp-1); border-radius: 6px 0 0 6px; }
.ramp-bar span:nth-child(2) { background: var(--ramp-2); }
.ramp-bar span:nth-child(3) { background: var(--ramp-3); }
.ramp-bar span:nth-child(4) { background: var(--ramp-4); }
.ramp-bar span:nth-child(5) { background: var(--ramp-5); }
.ramp-bar span:nth-child(6) { background: var(--ramp-6); border-radius: 0 6px 6px 0; }
.ramp-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 14px; color: var(--text-dim); }
.ramp-caption .done { color: var(--teal); font-weight: 600; }
@media (max-width: 600px) { .ramp-caption .mid { display: none; } }

/* ---------- Proof strip (each figure carries its own date: brief section 5) ---------- */
.proof { border-block: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 45%, var(--bg)); }
.proof .wrap { padding-block: 32px; }
.proof dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 24px 40px; }
.proof dt { font-family: var(--mono); font-weight: 600; font-size: clamp(26px, 3vw, 34px); color: var(--text-strong); }
.proof dd { margin: 0; font-size: 15px; color: var(--text-dim); }
.asof { display: block; margin-top: 4px; font-size: 13px; color: var(--slate); }

/* ---------- Sections and day-ramp markers ---------- */
.section { padding-block: clamp(72px, 9vw, 104px) 24px; }
.m-ramp-2 { --m: var(--ramp-2); --m-text: var(--ramp-2-text); }
.m-ramp-3 { --m: var(--ramp-3); --m-text: var(--ramp-3-text); }
.m-ramp-4 { --m: var(--ramp-4); --m-text: var(--ramp-4-text); }
.m-ramp-5 { --m: var(--ramp-5); --m-text: var(--ramp-5-text); }
.m-ramp-6 { --m: var(--ramp-6); --m-text: var(--ramp-6-text); }
.m-teal { --m: var(--teal); --m-text: var(--teal); }
.marker { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--m-text); }
.marker::before { content: ""; width: 28px; height: 4px; border-radius: 2px; background: var(--m); }
.section h2 { margin-top: 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 800; max-width: 22ch; }
.section .intro { margin-top: 14px; max-width: 62ch; color: var(--text-soft); }

/* ---------- Accents ---------- */
.accent-teal { --accent: var(--teal); }
.accent-fit { --accent: var(--fit); }
.accent-plum { --accent: var(--ramp-2); }
.tool-icon { flex: none; color: var(--accent); }

/* ---------- Tool cards ---------- */
.tools { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 24px; }
.tool { flex: 1 1 320px; min-width: 0; background: var(--surface); border: 1px solid var(--raised); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.tool-stripe { height: 4px; background: var(--accent); }
.tool-mock { margin: 24px 24px 0; background: var(--mock-bg); border: 1px solid var(--raised); border-radius: 14px; padding: 16px; font-size: 14px; }
.mock-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.mock-head strong { color: var(--text-strong); min-width: 0; }
.mock-head small { font-family: var(--mono); font-size: 12px; color: var(--slate); white-space: nowrap; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stop { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 10px; padding: 9px 12px; border: 1px solid transparent; }
.stop .n { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.stop .name { flex: 1; min-width: 0; color: var(--text-soft); }
.stop .t { font-family: var(--mono); color: var(--slate); white-space: nowrap; }
.stop.done .n { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.stop.done .name { text-decoration: line-through; color: var(--text-dim); }
.stop.now { border-color: var(--teal); background: var(--raised); }
.stop.now .n { border-color: var(--teal); color: var(--teal); }
.stop.now .name { color: var(--text-strong); font-weight: 600; }
.stop.now .t { color: var(--gold); }
.stop .name.strong { color: var(--text-strong); font-weight: 600; }
.dots { display: flex; gap: 5px; flex: none; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); }
.dots i.on { background: var(--teal); border-color: var(--teal); }
.sold { font-size: 13px; font-weight: 600; color: var(--teal); }
.stop .photos { color: var(--orange); font-weight: 500; }

.boss { height: 12px; background: var(--raised); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.boss span { display: block; height: 100%; width: 38%; background: var(--fit); }
.js .boss span { width: 100%; transition: width 1.6s cubic-bezier(.3, .7, .2, 1) .2s; }
.js .boss.drained span { width: 38%; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.tile small { display: block; font-size: 11px; color: var(--text-dim); }
.tile b { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.tone-hr { color: var(--hr); }
.tone-cad { color: var(--cad); }
.tone-zone { color: var(--zone); }
.tone-strong { color: var(--text-strong); }

.tool-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tool-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tool-title h3 { font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); }
.chip-live { background: var(--teal); color: var(--on-teal); border-color: var(--teal); font-weight: 700; }
.chip-daily { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, transparent); background: color-mix(in srgb, var(--teal) 8%, transparent); }
.tool p { color: var(--text-soft); }
.tool-actions { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.tool-actions .note { font-size: 14px; color: var(--text-dim); }

/* ---------- Featured work ---------- */
.facts { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 18px; }
.fact { background: var(--surface); border-radius: 16px; padding: 24px; min-width: 0; }
.fact h3 { font-size: 15px; font-weight: 600; color: var(--slate); letter-spacing: 0; margin-bottom: 8px; }
.fact p { color: var(--text-soft); font-size: 16px; }
.num { font-family: var(--mono); font-weight: 600; }
.fact .num { color: var(--text-strong); }
.dated > .asof { margin-top: 14px; }
.teaser { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--text-dim); }
.teaser a { color: var(--fit-text); font-weight: 600; text-decoration: none; }
.teaser a:hover { text-decoration: underline; }

/* ---------- Services ---------- */
.services { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 24px; }
.svc-group { flex: 1 1 320px; min-width: 0; background: var(--surface); border-radius: 20px; padding: 28px; }
.svc-group h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: 0; }
.svc-group h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.svc-group h3 small { font-weight: 400; font-size: 14px; color: var(--slate); }
.svc-group ul { list-style: none; margin: 16px 0 0; padding: 0; }
.svc-group li { padding-block: 13px; border-top: 1px solid var(--raised); }
.svc-group li strong { display: block; color: var(--text-strong); font-weight: 600; }
.svc-group li span { font-size: 15px; color: var(--text-dim); }

/* ---------- How I work ---------- */
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; counter-reset: step; }
.steps li { border-top: 2px solid var(--line-strong); padding-top: 16px; counter-increment: step; }
.steps li::before { content: "Step " counter(step); font-family: var(--mono); font-size: 14px; color: var(--slate); }
.steps li:last-child { border-top-color: var(--teal); }
.steps li:last-child::before { color: var(--teal); }
.steps strong { display: block; margin: 4px 0 6px; font-size: 19px; color: var(--text-strong); }
.steps span { font-size: 15px; color: var(--text-dim); }

/* ---------- About ---------- */
.about { display: flex; flex-wrap: wrap; gap: 44px; align-items: center; }
.portrait { flex: 0 1 280px; aspect-ratio: 4 / 5; min-height: 260px; border-radius: 20px; background: var(--surface); border: 1px dashed var(--line-strong); display: grid; place-items: center; padding: 16px; text-align: center; color: var(--slate); font-size: 14px; }
.about-text { flex: 1 1 440px; min-width: 0; }
.about-text p { margin-top: 16px; max-width: 60ch; color: var(--text-soft); }

/* ---------- Contact ---------- */
.contact { margin-top: 72px; background: linear-gradient(180deg, var(--bg), var(--contact-end)); border-top: 1px solid var(--contact-line); }
.contact .wrap { padding-block: clamp(72px, 10vw, 104px) clamp(80px, 10vw, 112px); }
.contact h2 { margin-top: 12px; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; max-width: 18ch; }
.contact p { margin-top: 14px; color: var(--text-soft); }
.contact .actions { margin-top: 32px; }
.contact .mail { font-family: var(--mono); }
.todo-notes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: 26px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px; font-size: 14px; color: var(--text-dim); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--text-soft); }

/* ---------- Draft placeholders ---------- */
.placeholder {
  display: inline;
  padding: 0 4px;
  color: var(--placeholder-text);
  background: var(--placeholder-bg);
  outline: 1px dashed var(--placeholder-edge);
  border-radius: 4px;
  font-style: italic;
}
.placeholder-block { color: var(--placeholder-text); background: var(--placeholder-bg); border-color: var(--placeholder-edge); font-style: italic; }

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  .hero .actions .btn, .contact .actions .btn { flex: 1 1 100%; }
  .site-nav { width: 100%; justify-content: space-between; gap: 4px 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-mock { margin: 18px 18px 0; }
  .tool-body { padding: 20px 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .boss span, .js .boss.drained span { transition: none; width: 38%; }
}
