/* ============================================================
   THE TEN-YEAR NOTE
   Design system for software-dev-and-consulting (2026–2036)
   ------------------------------------------------------------
   A research note on ledger paper. The name is the argument:
   a ten-year instrument, priced in 2026 and re-priced as
   evidence arrives. Generation is the cheap leg; verification
   is the expensive leg — so the one strong accent belongs to
   the verifier (ledger green). Amber marks revision; slate
   marks post-2030 speculation. Frozen spec: design.html (root),
   token record: specs/design.md.
   House rules:
   - tokens on :root, dark variant re-declares them under .dark
   - reading surface never pure white, ink never pure black
   - one strong accent; further accents carry meaning
   ============================================================ */

:root {
  /* surfaces & ink: warm oatmeal ledger paper */
  --c-bg: #F4F0E6;          /* paper — never pure white */
  --c-surface: #ECE6D6;     /* panels, term sheets */
  --c-ink: #242820;         /* warm ink — never pure black */
  --c-muted: #5C6152;       /* captions, meta */
  --c-rule: #D9D2BD;        /* hairlines, ledger ruling */
  /* THE accent: ledger green — the verifier's color.
     Marks verification, HOLDS verdicts, checked numbers. */
  --c-accent: #1B6B4E;
  --c-accent-soft: #145039;
  /* semantic secondaries — meaning, not decoration */
  --c-revise: #A8721F;      /* REVISE verdicts, hedged vendor figures */
  --c-spec: #5D6488;        /* post-2030 speculation, ranges, WATCH */
  /* type */
  --font-display: "Besley", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-ui: "Libre Franklin", system-ui, sans-serif;
  /* layout */
  --measure: 68ch;          /* broadsheet measure */
  --page: 72rem;
}

html.dark {
  /* the same ledger, lamp-lit after hours — re-lit, not inverted */
  --c-bg: #151913;
  --c-surface: #1C221B;
  --c-ink: #E6E1D0;
  --c-muted: #9BA18D;
  --c-rule: #2E342A;
  --c-accent: #4DAE85;
  --c-accent-soft: #6DC49E;
  --c-revise: #CE9A42;
  --c-spec: #99A2CC;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-accent-soft); }

code, pre, .data { font-family: var(--font-mono); font-size: 0.9em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--c-accent); color: var(--c-bg); padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0; z-index: 10; }

/* ---------- masthead ---------- */

.masthead { border-bottom: 1px solid var(--c-rule); }

.masthead__inner {
  max-width: var(--page); margin: 0 auto; padding: 0.9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.brand { text-decoration: none; color: var(--c-ink); }
.brand__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }

.masthead__links { display: flex; align-items: center; gap: 1.1rem; }

.navlink {
  font-family: var(--font-ui); font-size: 0.95rem;
  color: var(--c-ink); text-decoration: none;
}
.navlink:hover { color: var(--c-accent); }

.masthead__burger { display: none; }

.theme-toggle {
  background: none; border: 1px solid var(--c-rule); border-radius: 999px;
  width: 2.1rem; height: 2.1rem; padding: 0.35rem; cursor: pointer; color: var(--c-ink);
}
.theme-toggle svg { width: 100%; height: 100%; }
.theme-toggle__moon { display: none; }
html.dark .theme-toggle__sun { display: none; }
html.dark .theme-toggle__moon { display: block; }

@media (max-width: 40rem) {
  .masthead__burger {
    display: flex; flex-direction: column; gap: 4px;
    background: none; border: none; padding: 0.4rem; cursor: pointer;
  }
  .masthead__burger span { width: 20px; height: 2px; background: var(--c-ink); }
  .masthead__links {
    display: none; position: absolute; right: 1rem; top: 3.4rem;
    flex-direction: column; align-items: flex-end; gap: 0.8rem;
    background: var(--c-surface); border: 1px solid var(--c-rule);
    border-radius: 6px; padding: 1rem 1.25rem; z-index: 20;
  }
  .masthead__links.is-open { display: flex; }
}

/* ---------- content ---------- */

.hero { max-width: var(--measure); margin: 3.5rem auto 1rem; padding: 0 1.25rem; }
.hero__title { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 0.5rem; }
.hero__dek { color: var(--c-muted); font-size: 1.15rem; margin: 0; }

.prose { max-width: var(--measure); margin: 2rem auto 4rem; padding: 0 1.25rem; }
.prose h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.prose img { max-width: 100%; height: auto; }
.prose blockquote {
  margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--c-accent); color: var(--c-muted); font-style: italic;
}
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border-bottom: 1px solid var(--c-rule); padding: 0.4rem 0.6rem; text-align: left; }
.prose th { font-family: var(--font-ui); font-size: 0.85rem; }

/* ---------- colophon ---------- */

.colophon { border-top: 1px solid var(--c-rule); margin-top: 2rem; }
.colophon__inner {
  max-width: var(--page); margin: 0 auto; padding: 2rem 1.25rem 2.5rem;
  font-family: var(--font-ui); font-size: 0.9rem; color: var(--c-muted);
}
.colophon__title { font-family: var(--font-display); color: var(--c-ink); margin: 0 0 0.5rem; }
.colophon__links { display: flex; flex-wrap: wrap; gap: 1rem; }
.colophon__links a { color: var(--c-muted); }
.colophon__foot { margin-top: 1.25rem; }

/* ============================================================
   The Ten-Year Note — device layer (from design.html, the
   frozen visual spec). Kickers, term sheets, scenario cards,
   trigger markers, verdict badges, panels, claims, timeline.
   ============================================================ */

/* ---------- kicker ---------- */

.kicker {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--c-accent);
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0 0 0.6rem;
}
.kicker::after { content: ""; height: 1px; flex: 1; background: var(--c-rule); }

/* ---------- hero (home) ---------- */

.note-hero { max-width: var(--page); margin: 0 auto; padding: 3.2rem 1.25rem 1.5rem; }
.note-hero__title {
  font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08;
  letter-spacing: -0.012em; max-width: 24ch; margin: 0.6rem 0 1.2rem;
}
.note-hero__title em { font-style: italic; font-weight: 600; color: var(--c-accent); }
.note-hero__standfirst { font-size: 1.14rem; line-height: 1.6; max-width: 58ch; margin: 0; }
.note-hero__nuance {
  margin: 0.9rem 0 0; max-width: 58ch;
  font-size: 0.95rem; color: var(--c-muted);
  border-left: 3px solid var(--c-revise); padding-left: 0.9rem;
}

/* ---------- timeline spine ---------- */

.timeline { max-width: var(--page); margin: 1.5rem auto 0; padding: 0 1.25rem; overflow-x: auto; }
.timeline svg { display: block; min-width: 640px; width: 100%; height: auto; }
.tl-axis { stroke: var(--c-ink); stroke-width: 2; }
.tl-tick { stroke: var(--c-muted); stroke-width: 1; }
.tl-year { font-family: var(--font-mono); font-size: 11px; fill: var(--c-muted); }
.tl-node { fill: var(--c-accent); }
.tl-node-spec { fill: none; stroke: var(--c-spec); stroke-width: 2; stroke-dasharray: 3 3; }
.tl-phase { font-family: var(--font-ui); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; fill: var(--c-ink); text-transform: uppercase; }
.tl-sub { font-family: var(--font-body); font-style: italic; font-size: 12.5px; fill: var(--c-muted); }
.tl-range { stroke: var(--c-spec); stroke-width: 6; opacity: 0.35; }
.timeline a:hover .tl-phase { fill: var(--c-accent); }
.timeline a { text-decoration: none; }
.timeline__hint {
  display: none;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--c-muted);
  margin: 0.3rem 0 0; text-align: right;
}
@media (max-width: 700px) { .timeline__hint { display: block; } }

/* ---------- chapter cards (home) ---------- */

.chapter-cards {
  max-width: var(--page); margin: 2rem auto 3.5rem; padding: 0 1.25rem;
  display: grid; gap: 1px; background: var(--c-rule);
  border: 1.5px solid var(--c-ink);
}
@media (min-width: 760px) { .chapter-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .chapter-cards { grid-template-columns: repeat(4, 1fr); } }
.chapter-card { background: var(--c-bg); padding: 1.1rem 1.15rem 1.3rem; text-decoration: none; color: var(--c-ink); display: block; }
.chapter-card:hover { background: var(--c-surface); color: var(--c-ink); }
.chapter-card__no { font-family: var(--font-mono); font-size: 0.72rem; color: var(--c-accent); letter-spacing: 0.1em; text-transform: uppercase; }
.chapter-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.3; margin: 0.35rem 0 0.4rem; }
.chapter-card__dek { font-size: 0.88rem; color: var(--c-muted); line-height: 1.5; margin: 0; }
.home-more { max-width: var(--page); margin: 0 auto 3.5rem; padding: 0 1.25rem; font-family: var(--font-ui); font-size: 0.95rem; }
.home-more a { margin-right: 1.4rem; }

/* ---------- chapter pages ---------- */

.chapter { max-width: var(--page); margin: 2.4rem auto 4rem; padding: 0 1.25rem; }
.chapter__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12;
  max-width: 26ch; margin: 0 0 0.4rem;
}
.chapter .prose { margin: 1.6rem 0 0; padding: 0; }
.chapter .prose > p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 800;
  font-size: 3.1em; line-height: 0.85;
  float: left; padding: 0.07em 0.12em 0 0;
  color: var(--c-accent);
}
.chapter h2 {
  font-size: 1.45rem; margin: 2.2rem 0 0.9rem;
}
.chapter h2 .sec {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.78rem; color: var(--c-accent);
  vertical-align: 0.35em; margin-right: 0.5rem;
}
.cite {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--c-muted);
}
/* the dotted underline is the LINK affordance — plain spans (nothing to cite
   yet) must not wear it */
a.cite { text-decoration: none; border-bottom: 1px dotted var(--c-muted); }
a.cite:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.sources .metric { scroll-margin-top: 4.5rem; }
.sources .metric:target {
  box-shadow: inset 3px 0 0 var(--c-accent);
  padding-left: 0.9rem;
}

/* ---------- cite popover (JS enhancement; links work without it) ---------- */

.cite-pop {
  position: absolute; z-index: 40;
  display: none;
  max-width: 26rem;
  border: 1.5px solid var(--c-ink);
  background: var(--c-surface);
  padding: 0.8rem 1rem 0.9rem;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--c-ink) 14%, transparent);
  pointer-events: none;
}
.cite-pop.is-open { display: block; }
.cite-pop__label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--c-accent); margin: 0 0 0.35rem; }
.cite-pop__detail { font-size: 0.85rem; line-height: 1.5; margin: 0 0 0.35rem; }
.cite-pop__note { font-size: 0.82rem; line-height: 1.5; color: var(--c-muted); margin: 0; }
.prose blockquote footer {
  font-style: normal; font-family: var(--font-mono);
  font-size: 0.74rem; color: var(--c-muted); margin-top: 0.4rem;
}

/* ---------- image lightbox (JS enhancement; images render inline without it) ---------- */

img.lightbox-target { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: none;
  align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border: 1.5px solid var(--c-ink);
  background: var(--c-surface);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--c-ink) 14%, transparent);
}

/* ---------- term sheet ---------- */

.term-sheet {
  max-width: var(--measure);
  margin: 1.6rem 0 0;
  border: 1.5px solid var(--c-ink);
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 27px, var(--c-rule) 27px, var(--c-rule) 28px),
    var(--c-surface);
  padding: 1.1rem 1.3rem 1.2rem;
}
.term-sheet__label {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--c-muted); margin: 0 0 0.7rem;
}
.term-sheet dl {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.8rem 1.6rem; margin: 0;
  font-family: var(--font-mono); font-size: 0.8rem;
  font-feature-settings: "tnum";
}
.term-sheet dt { color: var(--c-muted); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.term-sheet dd { color: var(--c-ink); margin: 0.15rem 0 0; }
.term-sheet dd .chip { color: var(--c-accent); font-weight: 500; }

/* ---------- chips & badges ---------- */

.chip { font-family: var(--font-mono); font-size: 0.78rem; font-feature-settings: "tnum"; }
.badge {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 2px;
  display: inline-block; line-height: 1.4;
}
.badge--holds { color: var(--c-bg); background: var(--c-accent); }
.badge--revise { color: var(--c-bg); background: var(--c-revise); }
.badge--spec, .badge--watch { color: var(--c-bg); background: var(--c-spec); }

/* ---------- scenario cards ---------- */

.scenarios {
  display: grid; gap: 1px;
  background: var(--c-rule);
  border: 1.5px solid var(--c-ink);
  margin: 1.6rem 0 2rem;
}
@media (min-width: 760px) { .scenarios { grid-template-columns: 1fr 1fr 1fr; } }
.scenario { background: var(--c-bg); padding: 1.1rem 1.15rem 1.25rem; }
.scenario--base { background: var(--c-surface); }
.scenario h3 {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 0.55rem;
}
.scenario h3 .chip { font-size: 0.95rem; color: var(--c-accent); }
.scenario p { font-size: 0.92rem; line-height: 1.55; margin: 0; }

/* ---------- trigger marker ---------- */

.trigger {
  max-width: var(--measure);
  margin: 1.6rem 0;
  padding: 0.85rem 1.1rem;
  border: 1px dashed var(--c-spec);
  font-size: 0.9rem;
  display: flex; gap: 0.8rem; align-items: baseline;
}
.trigger__tag {
  font-family: var(--font-ui); font-weight: 700; font-size: 0.64rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-spec);
  white-space: nowrap;
}

/* ---------- infographic panel ---------- */

.panel { max-width: var(--measure); margin: 2rem 0; }
.panel__frame {
  border: 1.5px solid var(--c-ink);
  background: var(--c-surface);
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  color: var(--c-muted);
}
.panel__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.panel__ph { text-align: center; font-family: var(--font-mono); font-size: 0.78rem; padding: 1rem; margin: 0; }
.panel figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--c-muted);
  display: flex; gap: 0.6rem; align-items: baseline;
}
.panel figcaption::before {
  content: "AI"; font-family: var(--font-ui); font-weight: 700;
  font-size: 0.6rem; letter-spacing: 0.1em;
  border: 1px solid var(--c-muted); border-radius: 2px;
  padding: 0.05rem 0.3rem; flex-shrink: 0;
}

/* ---------- pager (prev/next) ---------- */

.pager {
  max-width: var(--measure); margin: 3rem 0 0;
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 2px solid var(--c-ink); padding-top: 1rem;
  font-family: var(--font-ui); font-size: 0.9rem;
}
.pager a { text-decoration: none; max-width: 45%; }
.pager__dir { display: block; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-muted); }

/* ---------- claims audit ---------- */

.audit { max-width: 60rem; margin: 2.4rem auto 4rem; padding: 0 1.25rem; }
.audit__title { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; max-width: 26ch; margin: 0 0 1.6rem; }
.claims { border-top: 2px solid var(--c-ink); }
.claim {
  display: grid; gap: 0.5rem 1.6rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--c-rule);
}
@media (min-width: 760px) { .claim { grid-template-columns: 7rem 1fr; } }
.claim__verdict { padding-top: 0.15rem; }
.claim h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.06rem; line-height: 1.35; margin: 0;
}
.claim p { font-size: 0.92rem; color: var(--c-muted); margin: 0.3rem 0 0; max-width: 66ch; }
.claim p .cite { font-size: 0.68rem; }

/* ---------- dashboard metrics ---------- */

.metrics { border-top: 2px solid var(--c-ink); }
.metric {
  display: grid; gap: 0.5rem 1.6rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--c-rule);
}
@media (min-width: 760px) { .metric { grid-template-columns: 1fr 2fr; } }
.metric h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; line-height: 1.35; margin: 0; }
.metric__now { font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-accent); margin: 0.35rem 0 0; font-feature-settings: "tnum"; }
.metric__body p { font-size: 0.92rem; color: var(--c-muted); margin: 0 0 0.3rem; max-width: 66ch; }
.metric__body .cite { font-size: 0.68rem; }

/* ---------- signed AI note (about) ---------- */

.model-note {
  max-width: var(--measure);
  margin: 2rem 0;
  border: 1.5px solid var(--c-accent);
  padding: 1.1rem 1.3rem 1.2rem;
  background: var(--c-surface);
}
.model-note__label {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--c-accent); margin: 0 0 0.6rem;
}
.model-note p { font-size: 0.95rem; margin: 0 0 0.8rem; }
.model-note__sig { font-family: var(--font-mono); font-size: 0.74rem; color: var(--c-muted); margin: 0; }

/* ---------- motion & print floor (non-negotiable) ---------- */

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

@media print {
  .masthead, .colophon, .theme-toggle, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
