/* ==========================================================================
   LIE-TIMES — Merged public stylesheet (PRD v1.2 ONLY).
   Merged 19 Nov 2026 from:
     - lie-times-visual-design/styles.css (DESIGN SYSTEM — WINS on palette,
       typography, tokens, status colours, focus, dark theme)
     - lie-times-public-core/styles.css (PUBLIC CORE — WINS on template
       layout / component classes for the 14 templates' structure)
   Rules: one file, mobile-first, system fonts only, no external fonts,
   no JS framework. Where both files defined the same selector, the
   design-system rule was kept and the public-core duplicate dropped
   (see docs/pages.md for the dropped-duplicate list). Public-core rules
   kept below had hardcoded colours remapped onto design tokens.
   Source templates: public/templates/*.html
   ========================================================================== */
/* ==========================================================================
   LIE-TIMES — Visual Design System stylesheet
   Based on PRD v1.2 only (19 Nov 2026). See DESIGN.md for the full system:
   palette with contrast ratios, type scale, and component rules.
   Mobile-first. System fonts only — no webfonts, no framework.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */
:root {
  --paper: #fbfaf6;
  --surface: #ffffff;
  --surface-muted: #f1efe7;
  --ink: #171a21;
  --ink-secondary: #4b5563;
  --ink-muted: #5b6470;
  --line: #d8d2c4;
  --line-strong: #9a9382;
  --accent: #1d4a6b;
  --accent-dark: #14364e;
  --accent-soft: #e4edf3;
  --ochre: #7a5a00;
  --focus: #1d4a6b;
  --on-accent: #ffffff;
  /* Status text colours (light) — always paired with a word + shape. */
  --status-kept: #1e5b3e;
  --status-broken: #8a2a1d;
  --status-amber: #7a4a00;
  --status-slate: #3d4a5c;
  --status-neutral: #5b6470;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 4px;
  --content-reading: 720px;
  --content-wide: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12151b;
    --surface: #1a1e26;
    --surface-muted: #232833;
    --ink: #edebe3;
    --ink-secondary: #b9bec9;
    --ink-muted: #9aa1af;
    --line: #333a47;
    --line-strong: #4a5261;
    --accent: #9cc3e0;
    --accent-dark: #bcd8ec;
    --accent-soft: #1e3245;
    --ochre: #e8c47a;
    --focus: #9cc3e0;
    --on-accent: #12151b;
    --status-kept: #7ac79a;
    --status-broken: #e89a8a;
    --status-amber: #e8c47a;
    --status-slate: #b9bec9;
    --status-neutral: #b9bec9;
  }
}

html[data-theme="dark"] {
  --paper: #12151b;
  --surface: #1a1e26;
  --surface-muted: #232833;
  --ink: #edebe3;
  --ink-secondary: #b9bec9;
  --ink-muted: #9aa1af;
  --line: #333a47;
  --line-strong: #4a5261;
  --accent: #9cc3e0;
  --accent-dark: #bcd8ec;
  --accent-soft: #1e3245;
  --ochre: #e8c47a;
  --focus: #9cc3e0;
  --on-accent: #12151b;
  --status-kept: #7ac79a;
  --status-broken: #e89a8a;
  --status-amber: #e8c47a;
  --status-slate: #b9bec9;
  --status-neutral: #b9bec9;
}

/* --- 2. Base ------------------------------------------------------------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; font-family: var(--sans); font-weight: 700; line-height: 1.3; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
code, .mono { font-family: var(--mono); font-size: 0.9em; }

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

@media (min-width: 720px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  h3 { font-size: 19px; }
}

.wrap { max-width: var(--content-wide); margin: 0 auto; padding: 0 16px; }
.wrap--reading { max-width: var(--content-reading); }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

/* Eyebrow / caption — 12px uppercase, never a paragraph. */
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.meta { font-size: 14px; color: var(--ink-secondary); }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; }

/* --- 3. Header / footer -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  z-index: 10;
}
.site-header__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark__tagline {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
  margin-top: 2px;
}
.wordmark-rule { border: 0; border-top: 3px solid var(--ink); margin: 0; }
.wordmark-rule--ochre { border: 0; border-top: 1px solid var(--ochre); margin: 0 0 4px; }
.site-header__spacer { flex: 1; }
.icon-btn {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ink); font-size: 18px; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-muted); }
.site-nav { display: none; }
.site-nav a {
  display: inline-block; padding: 12px 12px 10px; color: var(--ink);
  text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent;
}
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.you-are-here { font-size: 12px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
@media (min-width: 1024px) {
  .site-nav { display: flex; gap: 4px; }
}

.site-footer {
  background: var(--surface-muted);
  border-top: 2px solid var(--ink);
  margin-top: 48px;
  padding: 32px 0;
  font-size: 14px;
}
.site-footer a { color: var(--ink); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; padding: 0; list-style: none; }

/* --- 4. Buttons / forms / chips ------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 16px;
  border-radius: var(--radius); font-size: 16px; font-weight: 700;
  font-family: var(--sans); cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-block { width: 100%; }

label { display: block; font-weight: 600; margin: 0 0 4px; }
input[type="search"], input[type="text"], input[type="email"], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
input:focus, textarea:focus, select:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

.chip {
  display: inline-block; padding: 4px 8px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-secondary); background: var(--surface);
}
.chip--selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip--flag { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.chip--ochre { border-color: var(--ochre); color: var(--ochre); font-weight: 700; }

/* --- 5. Cards (shared) ---------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
@media (min-width: 720px) { .card { padding: 20px; } }
.card h3 { margin-bottom: 4px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.rule--strong { border-top: 2px solid var(--ink); }

/* --- 6. Status + timeliness (word + shape + colour, never colour alone) --- */
.status-line { font-size: 15px; font-weight: 700; margin: 8px 0 4px; }
.status-kept { color: var(--status-kept); }
.status-broken { color: var(--status-broken); }
.status-amber { color: var(--status-amber); }
.status-slate { color: var(--status-slate); }
.status-neutral { color: var(--status-neutral); }
.status-accent { color: var(--accent); }
.timeliness { font-weight: 400; color: var(--ink-secondary); }
.deadline-basis { font-size: 14px; color: var(--ink-muted); margin: 4px 0; }

/* --- 7. Promise card / clock card ----------------------------------------- */
.promise-card .promise-summary { font-size: 17px; }
.countdown { margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.countdown__number { font-size: 32px; font-weight: 700; line-height: 1.1; }
.countdown__label { font-size: 14px; color: var(--ink-secondary); }
@media (min-width: 720px) { .countdown__number { font-size: 40px; } }
.clock-card .countdown { margin-top: 8px; }
.clock-card--resolved { border-top: 2px solid var(--ink); }
.clock-card--resolved .countdown__number { font-size: 20px; }

/* Verbatim quote block — largest text on Promise Detail. */
.quote-block {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 16px;
  margin: 16px 0;
}
@media (min-width: 720px) { .quote-block { font-size: 24px; } }
.pidgin-line { font-size: 16px; color: var(--ink-secondary); }
.pidgin-line .pidgin-label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-muted);
}

/* --- 8. Evidence ---------------------------------------------------------- */
.evidence-list { list-style: none; margin: 0; padding: 0; }
.evidence-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 12px; background: var(--surface);
}
.evidence-item--grade-a { border-left: 2px solid var(--accent); }
.evidence-grade {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700; color: var(--ink);
}

/* --- 9. Chain block -------------------------------------------------------- */
.chain { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line-strong); }
.chain li { margin: 0 0 20px; position: relative; }
.chain li::before {
  content: ""; position: absolute; left: -26px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink);
}
.chain__relation { font-weight: 700; }

/* --- 10. Scorecard --------------------------------------------------------- */
.scorecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.scorecard table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scorecard th, .scorecard td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.scorecard th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.scorecard td:last-child, .scorecard th:last-child { text-align: right; }
.scorecard__denominator { font-weight: 700; margin: 0 0 12px; }

/* --- 11. Leader / project -------------------------------------------------- */
.person-initials {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-muted); border: 1px solid var(--line);
  font-family: var(--serif); font-size: 24px; font-weight: 700; border-radius: var(--radius);
}
.milestones { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line-strong); }
.milestones li { margin: 0 0 12px; }
.milestones .milestone-date { font-family: var(--mono); font-size: 14px; color: var(--ink-secondary); }

/* --- 12. Share card (1200 x 630, scaled to fit) ---------------------------- */
.share-card {
  width: 100%; max-width: 630px; aspect-ratio: 1200 / 630;
  background: var(--paper); border: 1px solid var(--line-strong);
  padding: 24px; display: flex; flex-direction: column; overflow: hidden;
}
.share-card__wordmark { font-family: var(--serif); font-weight: 700; font-size: 20px; }
.share-card__tagline { font-size: 12px; color: var(--ink-muted); }
.share-card__rule { border: 0; border-top: 3px solid var(--ink); margin: 8px 0 2px; }
.share-card__rule--ochre { border: 0; border-top: 1px solid var(--ochre); margin: 0 0 12px; }
.share-card__quote { font-family: var(--serif); font-size: clamp(18px, 4vw, 28px); line-height: 1.3; margin: 0 0 8px; }
.share-card__status { font-size: clamp(14px, 2.5vw, 20px); font-weight: 700; margin: 8px 0 4px; }
.share-card__footer {
  margin-top: auto; background: var(--surface-muted); padding: 8px 12px;
  font-size: 12px; color: var(--ink-secondary);
}
.share-card__url { font-family: var(--mono); font-size: 12px; color: var(--ink); }

/* --- 13. Layout helpers for the demo --------------------------------------- */
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.demo-section { margin: 32px 0; }
.demo-section > h2 { border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.swatch { display: inline-block; width: 16px; height: 16px; border: 1px solid var(--line-strong); vertical-align: -2px; margin-right: 6px; }
.type-sample { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; background: var(--surface); }
.empty-state { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; color: var(--ink-secondary); }

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

/* --- Public-core layout / component rules (unique selectors only) --- */

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

h1, h2, h3, h4 {
  line-height: 1.25; margin: 0 0 0.5rem;
}

ul, ol {
  margin: 0 0 0.75rem; padding-left: 1.25rem;
}

li {
  margin-bottom: 0.25rem;
}

small {
  font-size: 0.875rem;
}

a:visited {
  color: var(--accent-dark);
}

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem; color: var(--surface);
}

main {
  padding: 1rem 0 2rem;
}

section {
  margin-bottom: 2rem;
}

.section-head {
  margin-bottom: 0.75rem;
}

.section-note {
  color: var(--ink-secondary); font-size: 0.9375rem;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0 0.25rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: underline;
}

.tagline {
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  margin: 0;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.site-nav .nav-sub {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-secondary);
}

.site-nav [aria-current="page"] {
  text-decoration-thickness: 3px;
  text-underline-offset: 0.25em;
}

.search-form {
  display: flex; gap: 0.5rem; align-items: center;
}

.search-form label {
  font-weight: 600;
}

.search-form input[type="search"] {
  font: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.625rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  width: 100%;
  max-width: 18rem;
}

.button,
button {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.button {
  display: inline-block;
  padding: 0.625rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
}

.button:hover {
  background: #333333;
}

.button:visited {
  color: var(--surface);
}

.button--secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

.button--secondary:visited {
  color: var(--accent);
}

.button--secondary:hover {
  background: #e8f0fa;
}

.button--block {
  display: block; width: 100%;
}

.card--muted {
  background: var(--surface-muted); border-color: var(--ink-muted);
}

.card h2, .card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-list {
  list-style: none; margin: 0; padding: 0;
}

.card-list > li {
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat {
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 1rem;
}

.stat__number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat__label {
  font-weight: 700;
}

.stat__basis {
  color: var(--ink-secondary); font-size: 0.9375rem;
}

.stat a {
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.125rem 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  margin-right: 0.375rem;
  margin-bottom: 0.25rem;
  background: var(--surface);
  color: var(--ink);
}

.status--kept {
  border-style: solid; background: #e6f2e6;
}

.status--partially-kept {
  border-style: dashed; background: #fff4d6;
}

.status--broken,
.status--abandoned,
.status--expired {
  border-style: dotted; background: #fbe8e8;
}

.status--open {
  border-style: solid; background: #e8f0fa;
}

.status--unverified {
  border-style: dashed; background: var(--surface-muted);
}

.flag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.125rem 0.5rem;
  border: 2px dashed var(--ink-muted);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--ink);
  margin-right: 0.375rem;
  margin-bottom: 0.25rem;
}

.verification-flag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.125rem 0.5rem;
  border: 2px solid #7a4a00;
  border-radius: 4px;
  background: #fff4d6;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.meta dt {
  font-weight: 700; color: var(--ink);
}

.meta dd {
  margin: 0 0 0.5rem;
}

.empty-state p:last-child {
  margin-bottom: 0;
}

.clock-group {
  margin-bottom: 2rem;
}

.clock-group > h2 .group-count {
  font-weight: 700;
}

.breadcrumbs {
  font-size: 0.9375rem; margin: 0.75rem 0 0;
}

.breadcrumbs ol {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem;
}

.breadcrumbs li + li::before {
  content: "/"; margin-right: 0.25rem; color: var(--ink-secondary);
}

.intro-strip {
  border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.5rem;
}

.kv {
  margin: 0;
}

.kv > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid #d9d9d9;
}

.kv > div:last-child {
  border-bottom: 0;
}

.kv dt {
  font-weight: 700;
}

.kv dd {
  margin: 0;
}

.site-footer h2 {
  font-size: 1.125rem;
}

.site-footer ul {
  list-style: none; margin: 0 0 1rem; padding: 0;
}

.site-footer li {
  margin-bottom: 0.25rem;
}

.footer-columns {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}

.footer-about {
  font-size: 0.9375rem;
}

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

@media (min-width: 40rem) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-columns { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 60rem) {
  h1 { font-size: 2.25rem; }
  .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
  }
  .footer-columns { grid-template-columns: 1fr 1fr 1fr; }
  .site-nav ul { gap: 0.25rem 1.5rem; }
}
