/* Project Keystone - bridge site stylesheet
   Implements Doc 32 section 4 tokens directly. One stylesheet, no framework (Doc 32 section 2).
   Mobile-first; breakpoints 640 / 960 / 1120 (Doc 32 section 8). */

/* ---------------------------------------------------------------------------
   PLACEHOLDER BLOCK - the only invented values in this file.
   Doc 32 section 4 marks --brand, --brand-deep and --accent as "from brand assets",
   and section 11 lists brand colour and the typeface pairing as outstanding.
   These three hex values sit inside the existing neutral ramp rather than
   introducing a hue that would amount to inventing the brand. Replace all three
   (and the two font stacks) when the brand assets land - nothing else changes.
   Links are underlined throughout, so colour is never load-bearing for meaning.
   --------------------------------------------------------------------------- */
:root {
  --brand:      #2A3442;  /* PLACEHOLDER - from brand assets */
  --brand-deep: #161C24;  /* PLACEHOLDER - darker brand step */
  --accent:     #2A3442;  /* PLACEHOLDER - no second hue invented; = --brand until supplied */

  /* PLACEHOLDER - Doc 32 describes roles, not families; no webfont licence cleared yet.
     System stacks render instantly, which also protects the LCP budget. */
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Doc 32 section 4 tokens (specified values, not placeholders) --- */
:root {
  --ink: #1A1D21;
  --ink-muted: #5A6270;
  --surface: #FFFFFF;
  --surface-alt: #F5F6F8;
  --border: #E2E5EA;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: 1.875rem;
  --step-3: 2.5rem;
  --measure: 68ch;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --container: 1120px;
  --container-text: 720px;
  --section: var(--s-8);          /* 64px mobile */
  --radius-card: 8px;
  --radius-input: 4px;
  --elevation: 0 1px 2px rgba(26,29,33,.05), 0 4px 16px rgba(26,29,33,.06);
  --header-h: 68px;               /* Doc 32 section 5a: 64-72px */
}

@media (min-width: 960px) {
  :root { --step-0: 1.125rem; --step-3: 3.25rem; --section: var(--s-9); }
}
@media (min-width: 1120px) {
  :root { --section: var(--s-10); }
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* --- type --- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; color: var(--ink); margin: 0 0 var(--s-4); font-weight: 600; }
h1 { font-size: var(--step-3); letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); margin-top: var(--s-8); letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); margin-top: var(--s-6); }
p, ul, ol, table, blockquote { margin: 0 0 var(--s-5); }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }
small, .small { font-size: var(--step--1); color: var(--ink-muted); }
blockquote {
  margin-left: 0; padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--border); background: var(--surface-alt);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}
blockquote p:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
th, td { text-align: left; padding: var(--s-3); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-alt); padding: 1px 4px; border-radius: 3px; }

/* --- layout --- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-5); }
.container--text { max-width: var(--container-text); }
.band { padding-block: var(--section); }
.band--alt { background: var(--surface-alt); }
.prose { max-width: var(--measure); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: var(--s-3) var(--s-4);
}
.skip-link:focus { left: var(--s-4); top: var(--s-4); }

/* --- header / nav (Doc 32 section 5a) --- */
.site-header {
  min-height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .container { display: flex; align-items: center; gap: var(--s-5); min-height: var(--header-h); }
.wordmark {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em; margin-right: auto;
}
.wordmark:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: var(--s-5); }
.nav a { color: var(--ink); text-decoration: none; font-size: var(--step--1); padding: var(--s-3) 0; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; }

/* Mobile: labelled disclosure, Guides reachable in one tap (Doc 32 section 5a) */
.nav-toggle { display: none; }
@media (max-width: 639px) {
  .site-header .container { flex-wrap: wrap; padding-block: var(--s-3); }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--s-2);
    background: none; border: 1px solid var(--border); border-radius: var(--radius-input);
    font: inherit; font-size: var(--step--1); color: var(--ink);
    padding: var(--s-2) var(--s-3); cursor: pointer; min-height: 44px;
  }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: var(--s-3); }
  .nav a { padding: var(--s-3) 0; min-height: 44px; display: flex; align-items: center; border-top: 1px solid var(--border); }
  .site-header[data-open="true"] .nav { display: flex; }
}

/* --- hero (Doc 32 section 5a, centered composition) --- */
.hero { text-align: center; padding-block: var(--s-9) var(--section); position: relative; overflow: hidden; }
.hero__media {
  position: absolute; inset: 0; z-index: 0;
  /* PLACEHOLDER - no licensed hero image supplied. Doc 32 section 5 requires a scrim over a
     photo, never a lightened photo; this neutral wash stands in and keeps AA contrast. */
  background:
    linear-gradient(180deg, rgba(26,29,33,.04), rgba(26,29,33,.10)),
    linear-gradient(135deg, var(--surface-alt) 0%, #ECEFF3 55%, var(--surface-alt) 100%);
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { max-width: 20ch; margin-inline: auto; }   /* Doc 32 section 5a: 16-20ch per line */
.hero__sub { font-size: var(--step-0); color: var(--ink-muted); max-width: 54ch; margin: 0 auto var(--s-6); }
.hero__unofficial { margin-top: var(--s-6); }

/* --- email capture --- */
.capture { max-width: 30rem; margin-inline: auto; text-align: left; }
.capture__label { display: block; font-size: var(--step--1); font-weight: 600; margin-bottom: var(--s-2); }
.capture__row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.capture input[type="email"] {
  flex: 1 1 14rem; min-width: 0; min-height: 44px;
  padding: var(--s-3); font: inherit; font-size: var(--step--1);
  border: 1px solid var(--border); border-radius: var(--radius-input);
  background: var(--surface); color: var(--ink);
}
.capture input:focus-visible { border-color: var(--brand); }
.btn {
  min-height: 44px; padding: var(--s-3) var(--s-5);
  font: inherit; font-size: var(--step--1); font-weight: 600;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: var(--radius-input); cursor: pointer;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.capture__note { font-size: var(--step--1); color: var(--ink-muted); margin: var(--s-3) 0 0; }
.capture__status { font-size: var(--step--1); margin: var(--s-3) 0 0; min-height: 1.4em; }
.capture__status[data-state="ok"] { color: var(--brand-deep); font-weight: 600; }
.capture__status[data-state="error"] { color: #8A2B20; font-weight: 600; }

/* --- guide cards (the depth proof, Doc 32 section 5a) --- */
.cards { display: grid; gap: var(--s-5); grid-template-columns: 1fr; padding: 0; margin: 0; list-style: none; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.card h2, .card h3 { margin: 0; margin-top: 0; font-size: var(--step-1); }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card p { margin: 0; font-size: var(--step--1); color: var(--ink-muted); }
.card__pillar { font-size: var(--step--1); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }

/* --- article --- */
.breadcrumb { font-size: var(--step--1); color: var(--ink-muted); margin-bottom: var(--s-4); }
.breadcrumb a { color: var(--ink-muted); }
.byline {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding-block: var(--s-4); margin-bottom: var(--s-7); font-size: var(--step--1);
}
.byline__name { font-weight: 600; color: var(--ink); }
.byline__creds, .byline__verified { color: var(--ink-muted); display: block; margin-top: var(--s-1); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink); }

/* --- disclosure banner (Doc 10: above the first affiliate link) --- */
.disclosure {
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  background: var(--surface-alt); border-radius: var(--radius-card);
  padding: var(--s-4); margin-bottom: var(--s-6); font-size: var(--step--1);
}
.disclosure p { margin: 0; }

/* --- footer --- */
.site-footer {
  background: var(--surface-alt); border-top: 1px solid var(--border);
  padding-block: var(--s-8); margin-top: var(--section); font-size: var(--step--1);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin-bottom: var(--s-5); }
.site-footer a { color: var(--ink); }
.unofficial { color: var(--ink-muted); max-width: var(--measure); margin: 0 0 var(--s-3); }
.copyright { color: var(--ink-muted); margin: 0; }

/* --- motion --- */
@media (prefers-reduced-motion: no-preference) {
  .hero > .container { animation: fade-up .5s ease-out both; }
}
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- unresolved verification tokens -------------------------------------
   Drafts carry {{TOKEN}} placeholders for volatile facts the operator must
   verify (Doc 24 section 3). Rendering them loudly makes it impossible to ship
   a page with one still in it, which Doc 33 section 4 treats as an instant fail. */
.token {
  background: #FFF3CD; color: #6B4E00; border: 1px dashed #C9A227;
  border-radius: 3px; padding: 0 4px; font-size: .9em; font-weight: 600;
  white-space: nowrap;
}

/* --- wide tables scroll rather than break the measure --- */
.table-wrap { overflow-x: auto; margin: 0 0 var(--s-5); }
.table-wrap table { min-width: 34rem; margin: 0; }
