/* ==========================================================================
   LABEL — Shared stylesheet for the whole site (no page ID: it serves every page)
   What this file does: holds the site's design system ONCE — colours, type
   scale, spacing scale, radius family — so every page looks like one site.
   Map: site/CODE-MAP.md ("assets/"). Design source: D01 — Site Design Sheet,
   SUPERSEDED in look by the BANK RESTYLE (Nov 11, 2026, Lucky's direct
   order: "make this look like a bank — the brand is power and change and
   law"): deep institutional navy + restrained brass on neutral off-white,
   serif display type, hairline rules, squared geometry, navy footer.
   The D01 spacing scale and type scale are unchanged.
   Rule: a change here is a change to EVERY page — record it in site/CHANGELOG.md
   and update the CODE-MAP in the same change (Code Labeling System, Rule 3).
   ========================================================================== */

:root {
  /* Bank colour: neutral off-white paper, deep institutional navy ink,
     ONE accent (restrained brass, dark enough to read as text) */
  --paper: #F8F8F5;
  --paper-2: #ECEEF1;
  --ink: #0F1E38;
  --ink-soft: #33445E;
  --grey: #5F6B7A;
  --grey-light: #98A1AD;
  --line: #D9DCE1;
  --accent: #8A6D1F;
  --accent-dark: #6E5716;
  --frame-bg: #FFFFFF;

  /* D01 type scale (~1.25 ratio) */
  --t-12: 12px; --t-14: 14px; --t-16: 16px; --t-18: 18px; --t-20: 20px;
  --t-24: 24px; --t-30: 30px; --t-36: 36px; --t-48: 48px;

  /* D01 spacing scale — the only spacing values allowed */
  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-24: 24px;
  --s-32: 32px; --s-48: 48px; --s-64: 64px; --s-96: 96px; --s-128: 128px;

  /* Radius family — squared under the bank restyle (Nov 11, 2026) */
  --r-btn: 2px; --r-frame: 2px;

  --font-body: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-24); }
.reading { max-width: 680px; }

/* ————— Header ————— */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-16); min-height: 64px; flex-wrap: wrap;
}
.wordmark { font-weight: 700; font-size: var(--t-16); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.site-header .brand { font-family: var(--font-display); font-weight: 700; font-size: var(--t-18); color: var(--ink); letter-spacing: .01em; }
.site-header nav { display: flex; align-items: center; gap: var(--s-24); flex-wrap: wrap; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--t-16); }
.site-header nav a:hover { color: var(--accent-dark); }
.site-header nav a.btn-primary { color: #fff; }
.main-nav { display: flex; align-items: center; gap: var(--s-24); flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--t-16); }
.main-nav a:hover { color: var(--accent-dark); }

/* ————— Buttons ————— */
.btn {
  display: inline-block; min-height: 48px; padding: var(--s-12) var(--s-24);
  border-radius: var(--r-btn); font-size: var(--t-16); font-weight: 600;
  text-decoration: none; text-align: center; border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: #fff; }
.main-nav a.btn-primary { color: #fff; } /* the nav link rule above would otherwise override the button's white text (found in the Nov 11, 2026 tool test pass) */
.btn-primary:hover { background: #243A5E; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--paper-2); }

/* ————— Sections —————
   Section padding (Nov 11, 2026, spacing research pass, Lucky's order):
   the seam between two stacked sections is bottom + top padding, so the
   old 64/96 per side read as 128px (phone) / 192px (desktop) of empty
   space at every boundary — about twice what document-style design
   systems use, and a false-floor risk with this site's hairlines
   (NN/g). Now: 32/32 phone (64px seam), 48/48 desktop (96px seam);
   hero and the closing CTA keep extra air by their own rules, and the
   proof strip runs tighter as a short strip. */
section { padding: var(--s-32) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
@media (min-width: 900px) { section { padding: var(--s-48) 0; } }
section.final-cta { padding: var(--s-48) 0; }
@media (min-width: 900px) { section.final-cta { padding: var(--s-64) 0; } }

.eyebrow {
  font-size: var(--t-12); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s-16);
}
h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--s-24); }
h1 { font-size: var(--t-36); }
@media (min-width: 900px) { h1 { font-size: var(--t-48); } }
h2 { font-size: var(--t-30); }
h3 { font-family: var(--font-display); font-size: var(--t-20); line-height: 1.3; margin: var(--s-32) 0 var(--s-8); }
p { margin: 0 0 var(--s-16); max-width: 65ch; }
.lede { font-size: var(--t-20); color: var(--ink-soft); }
.small { font-size: var(--t-14); color: var(--grey); }

/* ————— Hero + framed tool ————— */
.hero { padding-top: var(--s-48); }
.hero-grid { display: grid; gap: var(--s-48); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; align-items: start; } }
@media (min-width: 900px) { .hero { padding-top: 72px; } }
.cta-row { display: flex; gap: var(--s-16); flex-wrap: wrap; margin: var(--s-32) 0 var(--s-16); }
.cta-note { font-size: var(--t-14); color: var(--grey); }

.tool-frame {
  background: var(--frame-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-frame);
  box-shadow: 0 1px 3px rgba(15, 30, 56, .08);
  padding: var(--s-24);
}
.tool-frame h3 { margin-top: 0; }
.tool-frame label { display: block; font-size: var(--t-14); font-weight: 600; margin: var(--s-16) 0 var(--s-4); }
.tool-frame input {
  width: 100%; min-height: 48px; font-size: var(--t-16);
  padding: var(--s-8) var(--s-12); border: 1px solid var(--grey-light); border-radius: var(--r-btn);
}
.tool-results { margin-top: var(--s-24); border-top: 1px solid var(--line); padding-top: var(--s-16); }
.tool-results .row { display: flex; justify-content: space-between; gap: var(--s-16); padding: var(--s-4) 0; font-size: var(--t-16); }
.tool-results .row strong { font-variant-numeric: tabular-nums; }

/* Workbook rendering (spreadsheet engine) — the actual spreadsheet on the
   page: sheet tabs, grid hairlines, yellow INPUT cells, green result cells. */
.wb-tabs { display: flex; gap: var(--s-8); flex-wrap: wrap; margin-bottom: var(--s-16); }
.wb-tab {
  min-height: 48px; padding: var(--s-8) var(--s-16); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-btn);
  background: var(--paper-2); color: var(--ink-soft);
  font-family: var(--font-body); font-size: var(--t-14); font-weight: 600;
}
.wb-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.wb-scroll { overflow-x: auto; }
.wb-table { border-collapse: collapse; width: 100%; font-size: var(--t-14); line-height: 1.45; }
.wb-table td { border-bottom: 1px solid var(--line); padding: var(--s-8) var(--s-12); vertical-align: top; }
.wb-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wb-table td.wb-span { white-space: normal; }
.wb-table td.wb-title { font-family: var(--font-display); font-size: var(--t-20); font-weight: 600; }
.wb-table td.wb-head { font-weight: 700; padding-top: var(--s-16); }
.wb-input {
  background: #FFF6CC; border: 1px solid var(--grey-light); border-radius: 2px;
  width: 112px; min-height: 40px; padding: var(--s-4) var(--s-8);
  font-size: var(--t-14); text-align: right; font-variant-numeric: tabular-nums;
}
/* Hero preview card rows (Nov 11, 2026 — the homepage hero carries a static
   preview of the solver's own sample outputs; the live workbook lives on
   its own page). */
.pv-rows { margin: var(--s-16) 0; }
.pv-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-16); padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.pv-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-row .kind { font-style: normal; color: var(--muted); font-size: var(--t-12); letter-spacing: .04em; }
.wb-input.wb-text { width: auto; text-align: left; } /* text inputs size to their content (renderer sets size); the fixed 112px clipped long labels (Nov 11, 2026 test pass) */
.wb-out { background: #E4F0E6; border-radius: 2px; padding: 2px var(--s-8); font-variant-numeric: tabular-nums; }
.wb-chart { border-top: 1px solid var(--line); padding: 16px 4px 4px; }
.wb-chart-title { font-weight: 700; margin: 0 0 8px; }
.wb-chart-legend { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* ————— Proof strip ————— */
.proof-strip { background: var(--paper-2); }
.proof-grid { display: grid; gap: var(--s-24); }
@media (min-width: 900px) { .proof-grid { grid-template-columns: repeat(4, 1fr); } }
.proof-grid .fact strong { display: block; font-family: var(--font-display); font-size: var(--t-30); }
.proof-grid .fact span { font-size: var(--t-14); color: var(--ink-soft); }

/* ————— Steps, values, phases ————— */
.steps { counter-reset: step; list-style: none; padding: 0; margin: var(--s-24) 0; }
.steps li { padding: var(--s-12) 0 var(--s-12) var(--s-48); position: relative; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: none; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: var(--s-12);
  font-family: var(--font-display); font-size: var(--t-24); color: var(--accent);
}
.value-block, .phase-block { padding: var(--s-24) 0; border-bottom: 1px solid var(--line); }
.value-block:last-child, .phase-block:last-child { border-bottom: none; }
.price-line { font-weight: 700; }

/* ————— Tool cards ————— */
.card-grid { display: grid; gap: var(--s-24); margin-top: var(--s-32); }
@media (min-width: 900px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-card { background: var(--frame-bg); border: 1px solid var(--line); border-radius: var(--r-frame); padding: var(--s-24); }
.tool-card h3 { margin-top: 0; }
.tool-card .meta { font-size: var(--t-14); color: var(--grey); margin-top: var(--s-16); }
.tool-card a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* ————— Footer ————— */
.site-footer { padding: var(--s-48) 0; background: var(--ink); border-top: 3px solid var(--accent); }
.site-footer p { font-size: var(--t-14); color: #D8DCE3; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .main-nav a { transition: background-color .15s ease, color .15s ease; }
}

/* ==========================================================================
   MOBILE PRESENTATION — workbook tools (Nov 10, 2026, Lucky's ruling:
   a mobile version and a desktop version of every tool, one codebase,
   same numbers). Desktop rendering is untouched: everything below lives
   inside a max-width media query. On phones the sheet keeps its real
   table (comparisons stay side-by-side), the label column sticks while
   the year columns scroll, inputs become full tap targets, and a
   summary strip (.m-summary, populated by the tool page's own script
   from the same formula engine) puts the results first.
   ========================================================================== */
.m-summary { display: none; }
@media (max-width: 700px) {
  .wb-scroll { box-shadow: inset -14px 0 14px -14px rgba(27,42,65,.45); }
  .wb-table { min-width: 620px; }
  .wb-table td:first-child:not(.wb-span) {
    position: sticky; left: 0; z-index: 1;
    background: var(--paper); max-width: 200px;
    box-shadow: 1px 0 0 var(--line);
  }
  .wb-input { min-height: 44px; font-size: 16px; }
  .wb-chart { overflow-x: auto; }
  .m-summary {
    display: block; background: var(--frame-bg);
    border: 1px solid var(--line); border-radius: var(--r-frame);
    padding: var(--s-12) var(--s-16); margin-bottom: var(--s-16);
  }
  .m-summary h3 { margin: 0 0 var(--s-8); font-size: var(--t-16); }
  .m-summary table { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
  .m-summary td { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
  .m-summary tr:last-child td { border-bottom: none; }
  .m-summary td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .m-summary .sub { color: var(--grey); font-size: var(--t-12); }
}

/* Identity block (Nov 11, 2026 — Lucky's order: name + photo on the site so
   people he meets can connect the face to the name). Pure furniture: photo,
   name, role line, connect links. */
.id-block { display: flex; gap: var(--s-24); align-items: center; flex-wrap: wrap; margin: var(--s-24) 0; }
.id-block img { border-radius: 2px; display: block; }
.id-block .id-name { font-family: var(--font-display); font-size: var(--t-30); font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink); }
.id-block .id-role { color: var(--ink-soft); margin: var(--s-4) 0 var(--s-8); }
.id-block .id-links { margin: 0; }

.id-photos { display: flex; gap: var(--s-16); }
.id-block figure { margin: 0; }
.id-block figcaption { font-size: var(--t-13); color: var(--ink-soft); text-align: center; margin-top: var(--s-4); }

/* Operator section (Nov 11, 2026 — suit portrait leads, beside the
   credential text): photo column + text column at desktop width; stacks
   with the photo first on phones. */
.op-grid { display: grid; gap: var(--s-24); }
.op-grid img { border-radius: 2px; display: block; width: 100%; max-width: 320px; height: auto; }
.op-photo .id-name { font-family: var(--font-display); font-size: var(--t-24); font-weight: 600; line-height: 1.15; margin: var(--s-16) 0 0; color: var(--ink); }
.op-photo .id-role { color: var(--ink-soft); margin: var(--s-4) 0 var(--s-8); }
.op-photo .id-links { margin: 0; }
@media (min-width: 900px) { .op-grid { grid-template-columns: 320px 1fr; gap: var(--s-48); align-items: start; } }

/* Tools bucket grid (Nov 11, 2026 — all fourteen tools on the homepage,
   grouped in three buckets): one bordered column per bucket, link list. */
.bucket-grid { display: grid; gap: var(--s-24); margin-top: var(--s-32); }
@media (min-width: 900px) { .bucket-grid { grid-template-columns: repeat(3, 1fr); } }
.bucket { background: var(--frame-bg); border: 1px solid var(--line); border-radius: var(--r-frame); padding: var(--s-24); }
.bucket h3 { margin-top: 0; }
.bucket ul { list-style: none; padding: 0; margin: var(--s-16) 0 0; }
.bucket li { padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.bucket li:last-child { border-bottom: none; }
.bucket a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.bucket .tool-note { font-size: var(--t-14); color: var(--grey); display: block; margin-top: 2px; }
