/* ============================================================
   Unkillable Window — site-specific styles
   Requires tokens.css + components.css. Status-board motif:
   dark hero on the homepage, mono accents, amber for warnings.
   ============================================================ */

/* ---- Dark hero (homepage) ---- */
.hero-dark {
  background: linear-gradient(180deg, var(--ink-950), var(--ink-900));
  color: #fff;
  overflow: clip;
  position: relative;
}
.hero-dark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40rem 22rem at 88% -10%, rgb(21 128 61 / 0.35), transparent 62%),
    radial-gradient(24rem 16rem at 6% 12%, rgb(245 158 11 / 0.10), transparent 60%);
}
.hero-dark > .container { position: relative; }
.hero-dark .hero-title { color: #fff; font-weight: 700; }
.hero-dark .lead { color: rgb(255 255 255 / 0.74); }
.hero-dark .eyebrow { color: #7ddf9d; }
.hero-dark .eyebrow::before { background: #7ddf9d; }
.hero-proof--dark li { color: rgb(255 255 255 / 0.66); }
.hero-proof--dark li::before { color: #7ddf9d; }

/* Pulsing status dot in the hero eyebrow area */
.status-dot {
  display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / 0.22);
  margin-right: 0.5rem; vertical-align: 0.05rem;
}
.hero-dark .btn-secondary { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.28); }
.hero-dark .btn-secondary:hover { border-color: rgb(255 255 255 / 0.6); color: #fff; }

/* Nines ticker under the hero copy */
.nines-ticker {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3);
  margin-top: var(--s8); padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: var(--text-small);
}
.nines-ticker li {
  border: 1px solid rgb(255 255 255 / 0.16); border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem; color: rgb(255 255 255 / 0.78); background: rgb(255 255 255 / 0.05);
}
.nines-ticker strong { color: #7ddf9d; font-weight: 600; }

/* ---- Article pages ---- */
.article-hero { padding-bottom: var(--s8); }
.breadcrumbs { font-size: var(--text-small); color: var(--ink-500); margin-bottom: var(--s4); }
.breadcrumbs a { color: var(--ink-500); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-700); text-decoration: underline; }

.article { padding-bottom: var(--s16); }
.article > section { margin-top: var(--s12); }
.article h2 { font-size: var(--text-h2); margin: 0 0 var(--s4); }
.article h3 { font-size: var(--text-h3); margin: var(--s8) 0 var(--s2); }
.article ul, .article ol { padding-left: 1.4rem; }
.article li { margin-bottom: var(--s2); }
.article .lede { color: var(--ink-500); margin-bottom: var(--s8); }
.article .kicker {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--text-caption);
  font-weight: 700; color: var(--brand-700); margin-bottom: var(--s2);
}

/* Formula + example callouts */
.formula, .example {
  background: var(--brand-50);
  border: 1px solid var(--line); border-left: 4px solid var(--brand-600);
  border-radius: var(--radius-sm); padding: var(--s4) var(--s6); margin: var(--s6) 0;
}
.example { background: var(--paper-2); border-left-color: var(--accent-500); }
.formula code, .example code {
  font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink-900);
}
.example p:first-child { margin-top: 0; }
.example p:last-child, .formula p:last-child { margin-bottom: 0; }

/* Data table */
.table-scroll { max-width: 100%; overflow-x: auto; margin: var(--s6) 0; }
.table-scroll:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 3px; }
.data-table { border-collapse: collapse; width: 100%; margin: 0; font-size: 0.9375rem; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 0.65rem 0.9rem; text-align: left; }
.data-table thead th { background: var(--ink-950); color: #fff; font-weight: 600; }
.data-table tbody th { font-family: var(--font-mono); font-weight: 600; }
.data-table tbody tr:nth-child(even) { background: var(--paper-2); }
.data-table td:nth-child(n+2), .data-table th:nth-child(n+2) { font-family: var(--font-mono); }

/* Panels (assumptions / FAQ) */
.panel { border-top: 2px solid var(--line); margin-top: var(--s12); padding-top: var(--s4); }
.panel h2 { font-size: var(--text-h3); }
.prepared { font-size: var(--text-small); color: var(--ink-500); margin-top: var(--s12); border-top: 1px solid var(--line); padding-top: var(--s4); }

/* ---- Calculator widget ---- */
.calc {
  background: var(--ink-950); color: #fff;
  border-radius: var(--radius-lg); padding: clamp(1.75rem, 1.25rem + 3vw, 3rem);
  position: relative; overflow: clip;
}
.calc::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(30rem 16rem at 90% -20%, rgb(21 128 61 / 0.4), transparent 65%);
}
.calc > * { position: relative; }
.calc h2 { color: #fff; margin: 0 0 var(--s2); }
.calc .calc-sub { color: rgb(255 255 255 / 0.7); font-size: var(--text-small); margin: 0 0 var(--s6); }
.calc-grid { display: grid; gap: var(--s6); }
@media (min-width: 56rem) { .calc-grid { grid-template-columns: 1fr 1.25fr; gap: var(--s12); align-items: start; } }

.calc-field label { display: block; font-size: var(--text-small); font-weight: 600; color: rgb(255 255 255 / 0.85); margin-bottom: var(--s2); }
.calc-input-row { display: flex; gap: var(--s3); align-items: stretch; }
.calc-input {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600;
  background: rgb(255 255 255 / 0.07); color: #fff;
  border: 1px solid rgb(255 255 255 / 0.22); border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.calc-input:focus { outline: none; border-color: #7ddf9d; box-shadow: 0 0 0 3px rgb(125 223 157 / 0.25); }
.calc-presets { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.calc-preset {
  font-family: var(--font-mono); font-size: var(--text-small);
  background: rgb(255 255 255 / 0.07); color: #7ddf9d;
  border: 1px solid rgb(255 255 255 / 0.16); border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem; cursor: pointer;
  transition: background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.calc-preset:hover { background: rgb(255 255 255 / 0.14); transform: translateY(-1px); }
.calc-preset[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.calc-results { display: grid; gap: var(--s4); }
.calc-result {
  background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius-md); padding: var(--s4) var(--s6);
}
.calc-result .calc-num {
  font-family: var(--font-mono); font-size: clamp(1.5rem, 1.1rem + 2.4vw, 2.25rem);
  font-weight: 600; color: #7ddf9d; line-height: 1.15;
}
.calc-result .calc-label { font-size: var(--text-caption); text-transform: uppercase; letter-spacing: 0.09em; color: rgb(255 255 255 / 0.55); margin-top: var(--s1); }
.calc-note { font-size: var(--text-small); color: rgb(255 255 255 / 0.55); margin: var(--s2) 0 0; }
.calc-error { color: #fbbf24; font-size: var(--text-small); min-height: 1.4em; margin: var(--s2) 0 0; }

/* ---- Guide cards ---- */
.guide-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.guide-card:hover { color: inherit; }
.guide-card .card-kicker {
  font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 500;
  color: var(--brand-700); letter-spacing: 0.06em; margin-bottom: var(--s2);
}
.guide-card .card-cta { margin-top: auto; padding-top: var(--s4); font-weight: 650; font-size: var(--text-small); color: var(--brand-600); }
.guide-card:hover .card-cta { color: var(--brand-700); text-decoration: underline; }

/* ---- Related strip ---- */
.related { margin-top: var(--s16); }
.related-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; margin-top: var(--s6); }
@media (min-width: 56rem) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- CTA band on dark article footers ---- */
.cta-wrap { margin-top: var(--s16); }

/* ---- Footer ---- */
.footer .brandline { color: var(--ink-900); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s2); }
.footer .brandline .status-dot { margin-right: 0; box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2); }

/* ---- Brandmark ---- */
.brandmark { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 1.0625rem; color: var(--ink-950); text-decoration: none; }
.brandmark-mark {
  width: 2rem; height: 2rem; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--ink-950), var(--brand-700));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600;
}

/* Nav tweaks for this site */
.nav-links a[aria-current="page"] { color: var(--brand-700); font-weight: 700; }

.skip{position:absolute;top:-80px;left:0}
.skip:focus{top:0;background:#fff;color:#111;padding:10px;z-index:100}

section[id], h2[id] { scroll-margin-top: 96px; }

/* ============================================================
   Site 8 additions — The Ladder (Concept A as cured).
   ============================================================ */

/* Brand mark: window-frame glyph tile (replaces the letter tile) */
.brandmark-mark {
  background: var(--ink-950);
  border-radius: var(--radius-sm);
}
.brandmark-mark svg { width: 1.3rem; height: 1.3rem; display: block; }

/* Homepage calculator section frame (from quick-calculator.css) */
#calculator { max-width: 1180px; margin: var(--s12) auto; padding-inline: 1.25rem; }
#calculator .calc { box-shadow: var(--shadow-lg); }

/* ---- The Ladder (D1, Conditions 1–3) ----
   Ordinal preset ladder: five rungs at UNIFORM geometry with the
   step multipliers printed (÷10 · ÷2 · ÷5 · ÷10). No proportional
   or logarithmic spacing claim is made by the geometry — the
   multipliers carry the ratios, in words and figures. Reference
   only: it never displays an observed result (Condition 2).
   Signal green appears only on this dark slate (ink-950,
   slate-800-or-darker), and only for the selected preset rung. */
.ladder {
  list-style: none; margin: var(--s8) 0 0; padding: 0;
  display: grid; gap: var(--s2); grid-auto-rows: 1fr;
}
@media (min-width: 48rem) {
  .ladder { grid-template-columns: repeat(5, 1fr); }
}
.ladder-rung {
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: var(--radius-md);
  padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s1);
  height: 100%;
}
button.ladder-rung {
  font: inherit; text-align: left; color: #fff; cursor: pointer; width: 100%;
  transition: background var(--dur) var(--ease-out), border-color var(--dur);
}
button.ladder-rung:hover { background: rgb(255 255 255 / 0.11); }
button.ladder-rung[aria-pressed="true"] {
  border-color: var(--signal);
  background: rgb(34 197 94 / 0.10);
}
button.ladder-rung[aria-pressed="true"] .ladder-pct { color: var(--signal); }
.ladder-pct { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; color: #fff; line-height: 1.2; }
.ladder-month { font-weight: 650; color: #fff; }
.ladder-per { font-size: var(--text-caption); text-transform: uppercase; letter-spacing: 0.09em; color: rgb(255 255 255 / 0.55); }
.ladder-mult {
  margin-top: auto; padding-top: var(--s2);
  font-family: var(--font-mono); font-size: var(--text-small); color: var(--ink-400);
}
.ladder-note { font-size: var(--text-small); color: rgb(255 255 255 / 0.55); margin: var(--s3) 0 0; }

/* Guide plate: the same ladder on a dark slate panel (light page) */
.ladder-plate {
  background: var(--ink-950); color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 1rem + 2vw, 2rem);
  margin: var(--s8) 0; position: relative; overflow: clip;
}
.ladder-plate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(30rem 16rem at 90% -20%, rgb(21 128 61 / 0.4), transparent 65%);
}
.ladder-plate > * { position: relative; }
.ladder-plate h2 { color: #fff; margin: 0 0 var(--s2); font-size: var(--text-h3); }
.ladder-plate .ladder { margin-top: var(--s6); }
.ladder-plate .ladder-note { color: rgb(255 255 255 / 0.55); }

/* ============================================================
   Print contract (Condition 5) — the record card prints as the
   plain-text download reads: inputs first, then the result,
   black on white, zero green, site chrome hidden.
   ============================================================ */
@media print {
  .nav, .site-head, .site-foot, .footer, .skip, .announce,
  .actions, .cta-wrap, .related, .breadcrumbs { display: none !important; }
  body, main, .prose, .tool, .record-card, output {
    background: #fff !important; color: #000 !important;
  }
  * { box-shadow: none !important; text-shadow: none !important; }
  a { color: #000 !important; text-decoration: none; }
  .tool { border: 0; padding: 0; }
  .record-card { border: 1.5px solid #000; break-inside: avoid; }
  .record-kicker { color: #000 !important; }
  .record-card output { color: #000 !important; }
  .record-limits { color: #000 !important; }
  input, textarea { border: 1px solid #888 !important; color: #000 !important; background: #fff !important; }
  .print-note { display: block !important; }
  h1 { font-size: 28px !important; }
}
