/* ==========================================================================
   CurtailCast — /why page. Loaded after style.css; reuses its tokens,
   .nav, .btn, .label, .section, .stats, .cta, .footer and .reveal.
   Only page-specific components live here. No new colours: everything
   is a token or a white/accent alpha already used by the homepage.
   ========================================================================== */

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

/* Tables that may be wider than a phone scroll inside their own box */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tscroll table { min-width: 100%; }

/* --------------------------------------------------------------------------
   Intro
   -------------------------------------------------------------------------- */
.why-hero {
  padding: clamp(56px, 8vw, 120px) 0 clamp(40px, 5vw, 72px);
  background: linear-gradient(180deg, var(--bg-deep), var(--bg) 70%);
}
.why-hero .label { margin-bottom: 22px; }
.why-hero__title {
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  max-width: 20ch;
  text-wrap: balance;
}
.why-hero__intro {
  margin-top: 24px;
  max-width: 60ch;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-soft);
}
.why-hero__intro em { font-style: normal; color: var(--text); font-weight: 600; }

.section .label + .section__title { margin-top: 18px; }

/* --------------------------------------------------------------------------
   Problem — chart
   -------------------------------------------------------------------------- */
.chart {
  margin-top: clamp(36px, 5vw, 64px);
  padding: 24px clamp(16px, 2.5vw, 28px) 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
}
.chart__head { display: flex; flex-direction: column; gap: 6px; }
.chart__title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.chart__sub { font-size: 14px; color: var(--muted); max-width: 70ch; }

.chart__legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin-top: 18px;
  font-size: 13.5px; color: var(--text-soft);
}
.chart__key { display: inline-flex; align-items: center; gap: 8px; }
.chart__key::before { content: ""; display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--text-soft); }
.chart__key--absorb::before { border-top-style: dashed; border-top-color: var(--muted); }
.chart__key--curt::before {
  height: 10px; border: 0; border-radius: 2px;
  background: repeating-linear-gradient(135deg, rgba(255,140,66,.75) 0 2px, rgba(255,140,66,.25) 2px 5px);
}

.chart__stage { position: relative; margin-top: 16px; }
.chart__svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart__svg text { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.chart__svg .grid { stroke: rgba(255,255,255,.08); stroke-width: 1; }
.chart__svg .axis { stroke: rgba(255,255,255,.16); stroke-width: 1; }
.chart__svg .line-prod { fill: none; stroke: var(--text-soft); stroke-width: 2; stroke-linejoin: round; }
.chart__svg .line-absorb { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; stroke-linejoin: round; }
.chart__svg .area-curt { fill: url(#curt-hatch); stroke: var(--accent); stroke-width: 1; }
.chart__svg .dlabel { font-weight: 600; fill: var(--text-soft); }
.chart__svg .dlabel--curt { fill: var(--accent); }
.chart__svg .xhair { stroke: rgba(255,255,255,.28); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__svg .dot { fill: var(--bg); stroke-width: 2; }
.chart__svg .hit { fill: transparent; cursor: crosshair; }

.chart__tip {
  position: absolute; z-index: 2;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(7, 11, 21, .92);
  font-size: 13px; line-height: 1.5; color: var(--text-soft);
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.chart__tip strong { color: var(--text); display: block; margin-bottom: 4px; }
.chart__tip .curt { color: var(--accent); font-weight: 700; }
.chart__tip b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.chart__table { margin-top: 16px; font-size: 14px; }
.chart__table summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.chart__table summary:hover { color: var(--text); }
.chart__table table { border-collapse: collapse; margin-top: 8px; }
.chart__table th, .chart__table td { padding: 6px 12px 6px 0; text-align: left; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.chart__table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.chart__table td { color: var(--text-soft); }

.problem__stats { margin-top: clamp(48px, 6vw, 80px); }
.problem .stats__foot { margin-top: 28px; max-width: 90ch; line-height: 1.6; }
/* Source links in the figures footnote: readable without shouting */
.stats__foot a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; }
.stats__foot a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Solution — the e-mail as it lands in the inbox
   -------------------------------------------------------------------------- */
.mail {
  margin: clamp(40px, 5vw, 64px) auto 0;
  max-width: 720px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden;
}
.mail__chrome {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 18px clamp(18px, 3vw, 28px) 0;
}
.mail__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #0A0F1E;
  font-weight: 800; font-size: 18px;
}
.mail__meta { min-width: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.mail__from strong { color: var(--text); font-size: 15px; }
.mail__addr { color: var(--muted); overflow-wrap: anywhere; }
.mail__time { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; align-self: start; padding-top: 2px; }
.mail__subject {
  margin: 14px clamp(18px, 3vw, 28px) 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 700; letter-spacing: -0.01em; line-height: 1.35;
  color: var(--text);
}
.mail__body {
  padding: 20px clamp(18px, 3vw, 28px) 24px;
  font-size: 15px; line-height: 1.6; color: var(--text-soft);
}
.mail__body > * + * { margin-top: 14px; }
.mail__body h4 { margin-top: 26px; font-size: 16px; font-weight: 700; color: var(--text); }
.mail__body h4:first-of-type { margin-top: 18px; }
.mail__body strong { color: var(--text); font-weight: 700; }
.mail__stamp, .mail__note, .mail__more { font-size: 13px; color: var(--muted); }
.mail__note { font-style: italic; }
.mail__more { margin-top: 6px !important; }
.mail__foot {
  margin-top: 26px !important; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
}
.mail__foot em { font-style: italic; }
.mail__badge {
  margin: 0; padding: 12px clamp(18px, 3vw, 28px);
  border-top: 1px dashed var(--border-strong);
  background: var(--bg-deep);
  font-size: 12.5px; color: var(--muted);
}

.mail__table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; line-height: 1.4;
}
.mail__table th, .mail__table td {
  padding: 8px 10px 8px 0; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mail__table th { font-size: 12px; font-weight: 600; color: var(--muted); }
.mail__table td { color: var(--text-soft); }
.mail__table td:first-child { color: var(--text); font-weight: 600; white-space: normal; min-width: 9ch; }
.mail__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mail__table--compact td:last-child { white-space: normal; }

/* Risk tiers: text + glyph, never colour alone */
.tier {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--text-soft); white-space: nowrap;
}
.tier::before { content: "●"; font-size: 9px; line-height: 1; color: var(--muted-2); }
.tier--mod::before { content: "◐"; color: var(--text-soft); }
.tier--high { color: var(--accent); border-color: var(--accent-line); }
.tier--high::before { content: "▲"; color: var(--accent); }
.tier--severe { color: #0A0F1E; background: var(--accent); border-color: var(--accent); }
.tier--severe::before { content: "▲▲"; letter-spacing: -2px; color: #0A0F1E; }

/* --------------------------------------------------------------------------
   Gains — five modules
   -------------------------------------------------------------------------- */
.modules {
  margin-top: clamp(36px, 5vw, 64px);
  display: grid; gap: 20px;
}
.module {
  padding: 26px clamp(18px, 2.5vw, 30px) 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}
.module--full { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-cool)); border-color: var(--border-strong); }
.module--min { background: transparent; }
.module .label { color: var(--muted); }
.module--full .label { color: var(--accent); }
.module__title { margin-top: 16px; font-size: clamp(20px, 2.2vw, 24px); letter-spacing: -0.02em; line-height: 1.25; }
.module__body { margin-top: 10px; font-size: 16px; line-height: 1.6; max-width: 56ch; }
.module__src { margin-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

.ptable { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 14.5px; }
.ptable th, .ptable td { padding: 9px 12px 9px 0; text-align: left; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable th { font-size: 12px; font-weight: 600; color: var(--muted); }
.ptable td { color: var(--text-soft); }
.ptable td:first-child { color: var(--text); font-weight: 600; }
.ptable .num { text-align: right; }
.ptable .is-fold td { color: var(--muted); font-size: 13px; }
.ptable .is-hot td { color: var(--text); font-weight: 700; }
.ptable .is-hot td:first-child { position: relative; padding-left: 18px; color: var(--accent); }
.ptable .is-hot td:first-child::before { content: "▲"; position: absolute; left: 0; font-size: 10px; top: 50%; transform: translateY(-50%); }

.tiers { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.tiers li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tiers__desc { font-variant-numeric: tabular-nums; }

.zones { margin-top: 22px; display: grid; gap: 10px; }
.zones__row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.zones__name { color: var(--text-soft); font-weight: 600; }
.zones__bar { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.zones__bar > span { display: block; height: 100%; width: var(--w, 0%); border-radius: 3px; background: var(--text-soft); }
.zones__val { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 640px) {
  .zones__row { grid-template-columns: minmax(0, 1.3fr) minmax(120px, 1fr) auto; align-items: center; gap: 16px; }
}
@media (min-width: 900px) {
  .modules { grid-template-columns: repeat(6, 1fr); }
  .module--full { grid-column: span 3; }
  .module--min { grid-column: span 2; }
}

/* --------------------------------------------------------------------------
   Audience & honesty — typography-first rows
   -------------------------------------------------------------------------- */
.two-col { display: grid; gap: 40px; }
@media (min-width: 900px) {
  .two-col { grid-template-columns: 1fr 1.4fr; gap: 80px; align-items: start; }
  .two-col__side { position: sticky; top: calc(var(--nav-h) + 40px); }
}
.rows { border-top: 1px solid var(--border); counter-reset: none; }
.rows__item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 26px 0; border-bottom: 1px solid var(--border);
}
.rows__num { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .06em; padding-top: 6px; font-variant-numeric: tabular-nums; }
.rows--plain .rows__num { color: var(--muted-2); }
.rows__title { font-size: clamp(19px, 2vw, 22px); letter-spacing: -0.02em; line-height: 1.3; }
.rows__body { margin-top: 8px; font-size: 16px; line-height: 1.65; max-width: 58ch; }

/* --------------------------------------------------------------------------
   Roadmap — planned, dashed, clearly not live
   -------------------------------------------------------------------------- */
.plans { margin-top: clamp(36px, 5vw, 56px); display: grid; gap: 16px; }
.plan {
  padding: 22px 24px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
}
.plan__tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px dashed var(--muted-2);
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.plan__title { margin-top: 14px; font-size: 18px; letter-spacing: -0.015em; line-height: 1.3; color: var(--text-soft); }
.plan__body { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--muted); }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .plans { grid-template-columns: repeat(3, 1fr); } }

/* CTA on this page has no request form; keep the label spacing */
.cta .label { margin-bottom: 20px; }

@media (prefers-reduced-motion: reduce) {
  .chart__svg * { transition: none !important; animation: none !important; }
}

/* Chart on narrow screens: the SVG scales down, so type and strokes are
   set in viewBox units large enough to stay legible at 320–640 px. */
.chart__svg .line-prod, .chart__svg .line-absorb, .chart__svg .area-curt,
.chart__svg .grid, .chart__svg .axis, .chart__svg .xhair { vector-effect: non-scaling-stroke; }
@media (max-width: 640px) {
  .chart__svg text { font-size: 22px; }
  .chart__svg .dlabel { font-size: 24px; }
  .chart__tip { min-width: 0; font-size: 12px; padding: 8px 10px; }
  .chart__tip b, .chart__tip .curt { white-space: nowrap; }
}
