/* ============================================================
   PWCA — Pitch Deck · "Civic Editorial"
   A warm data-journalism identity rendered as a slide deck.
   Paper pages floating on deep ink. Big Space-Grotesk figures,
   mono kicker labels, signal red + civic green, FIG. framed shots.
   Fixed 1280×720 stage, JS-scaled to fit; prints 1 slide / page.
   ============================================================ */
@import url("fonts.css");

:root {
  /* palette — mirrors the product's light Civic-Editorial tokens */
  --paper: #f7f4ee;
  --paper-2: #fbfaf6;
  --ink: #1a1a1a;
  --ink-soft: #2a2820;
  --card: #ffffff;
  --red: #d83a2c;
  --red-2: #ef5b4c;
  --green: #1f6f54;
  --green-2: #2f9e74;
  --amber: #b8750a;
  --orange: #e0792a;
  --blue: #2b6cb0;
  --violet: #6b4ea8;
  --faint: #a39a87;
  --muted: #6b6b6b;
  --border: #e7e2d8;
  --border-2: #ddd6c8;
  --secondary: #f1ece1;
  --accent: #efe9dc;
  --glow: rgba(216, 58, 44, 0.06);

  /* deep warm ink backdrop the paper pages float on */
  --stage-backdrop: #14130f;

  --display: "Space Grotesk", ui-sans-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--stage-backdrop);
  background-image:
    radial-gradient(1200px 700px at 50% -20%, rgba(216,58,44,0.10), transparent 60%),
    radial-gradient(900px 600px at 110% 120%, rgba(31,111,84,0.10), transparent 60%);
  overflow: hidden;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Stage & scaling ------------------------------------- */
#deck { position: fixed; inset: 0; display: grid; place-items: center; }
.stage {
  position: relative;
  width: 1280px;
  height: 720px;
  transform: scale(var(--s, 1));
  transform-origin: center center;
}

.slide {
  position: absolute;
  inset: 0;
  background: var(--paper);
  background-image: radial-gradient(900px 420px at 6% -12%, var(--glow), transparent 62%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.25);
  padding: 52px 64px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.995);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .5s ease, transform .5s ease;
  z-index: 2;
}
/* paper grain — barely-there warm texture */
.slide::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/></svg>");
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ---- Editorial primitives -------------------------------- */
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  width: 26px; height: 2px; background: var(--red); display: inline-block;
}
.kicker.green { color: var(--green); }
.kicker.green::before { background: var(--green); }
.kicker.ink { color: var(--ink-soft); }
.kicker.ink::before { background: var(--ink-soft); }

h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.02; font-weight: 600; }
.display-xl { font-size: 74px; font-weight: 700; line-height: .98; letter-spacing: -.03em; }
.display-l  { font-size: 52px; font-weight: 600; line-height: 1.0; }
.display-m  { font-size: 38px; font-weight: 600; }
.headline   { font-size: 44px; font-weight: 600; line-height: 1.04; letter-spacing: -.025em; }
.lead { font-size: 19px; line-height: 1.5; color: var(--muted); max-width: 60ch; font-weight: 400; }
.body { font-size: 16px; line-height: 1.55; color: #43413a; }
.tnum { font-variant-numeric: tabular-nums; }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
em.mark { font-style: normal; color: var(--red); }
em.markg { font-style: normal; color: var(--green); }

.rule { height: 1px; background: var(--border); border: 0; width: 100%; }
.vrule { width: 1px; background: var(--border); align-self: stretch; }

/* slide header (kicker + section index) */
.s-head { display: flex; align-items: baseline; justify-content: space-between; }
.s-index { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--faint); }

/* ---- Stat blocks ----------------------------------------- */
.stat .v { font-family: var(--display); font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.stat .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.statgrid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.statgrid > .cell { background: var(--card); padding: 18px 20px; }
.statgrid .v { font-size: 30px; }

/* generic card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.card.tint-red { background: linear-gradient(180deg,#fff,#fdf3f1); border-color: #f0d8d3; }
.card.tint-green { background: linear-gradient(180deg,#fff,#f1f8f4); border-color: #cfe7da; }
.card.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card.ink .l { color: rgba(247,244,238,.55); }

/* chips / pills */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  padding: 6px 11px; border-radius: 999px;
  background: var(--secondary); color: var(--ink-soft); border: 1px solid var(--border);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.chip.g .dot { background: var(--green); } .chip.b .dot { background: var(--blue); }
.chip.a .dot { background: var(--amber); } .chip.v .dot { background: var(--violet); }

/* ---- Browser frame for screenshots ("FIG.") -------------- */
figure.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.browser {
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 30px 60px -28px rgba(26,26,26,.45), 0 2px 0 rgba(255,255,255,.6) inset;
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.browser .bar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; background: var(--paper-2); border-bottom: 1px solid var(--border);
}
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: #e0dac9; display: block; }
.browser .bar i:nth-child(1){ background:#e07b6e; } .browser .bar i:nth-child(2){ background:#e8c06a; } .browser .bar i:nth-child(3){ background:#8fc7a6; }
.browser .url {
  margin-left: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--card); border: 1px solid var(--border); border-radius: 7px;
  padding: 4px 12px; flex: 1; max-width: 460px;
}
.browser img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; min-height: 0; }
figcaption { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
figcaption b { color: var(--red); font-weight: 600; }

/* ---- Layout helpers -------------------------------------- */
.fill { flex: 1; min-height: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.split.wide-r { grid-template-columns: .82fr 1.18fr; }
.split.wide-l { grid-template-columns: 1.15fr .85fr; }
.col { display: flex; flex-direction: column; min-height: 0; }
.row { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-s { gap: 10px; } .gap-m { gap: 16px; } .gap-l { gap: 26px; }
.mt-a { margin-top: auto; }

/* pipeline node row (spine diagram on solution slide) */
.spine-big { display: flex; align-items: stretch; gap: 0; }
.spine-big .node {
  flex: 1; padding: 16px 16px 16px 20px; position: relative;
  border: 1px solid var(--border); background: var(--card);
}
.spine-big .node:not(:last-child) { border-right: 0; }
.spine-big .node:first-child { border-radius: 12px 0 0 12px; }
.spine-big .node:last-child { border-radius: 0 12px 12px 0; }
.spine-big .node .n { font-family: var(--mono); font-size: 11px; color: var(--red); letter-spacing: .1em; }
.spine-big .node h3 { font-size: 21px; margin-top: 6px; }
.spine-big .node p { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.spine-big .node .verb { color: var(--red); font-weight: 600; }

/* numbered list / steps */
.steps { display: flex; flex-direction: column; gap: 14px; }
.steps .item { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.steps .item .ix { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--red); line-height: 1; }
.steps .item h4 { font-family: var(--display); font-size: 16.5px; font-weight: 600; }
.steps .item p { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }

/* approaches columns */
.approach { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); }
.approach.dim { opacity: .82; }
.approach.win { border-color: var(--green); background: linear-gradient(180deg,#fff,#f1f8f4); box-shadow: 0 24px 50px -34px rgba(31,111,84,.6); }
.approach .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.approach.win .tag { color: var(--green); }
.approach h3 { font-size: 22px; }
.approach .verdict { font-family: var(--mono); font-size: 12px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); }
.approach.win .verdict { color: var(--green); }
/* large outline glyph filling the card's middle — anchors each option */
.approach .approach-icon { flex: 1; display: grid; place-items: center; color: var(--faint); }
.approach .approach-icon svg { width: 66px; height: 66px; opacity: .42; }
.approach.win .approach-icon { color: var(--green); }
.approach.win .approach-icon svg { opacity: .9; }

/* timeline (future) */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); align-content: center; gap: 0; }
.timeline .ph { padding: 4px 26px; border-left: 2px solid var(--border); position: relative;
  display: flex; flex-direction: column; gap: 2px; }
.timeline .ph.now { border-left-color: var(--green); }
.timeline .ph:first-child { padding-left: 0; border-left: 0; }
.timeline .ph .when { display: inline-flex; align-items: center; gap: 9px; }
.timeline .ph .when::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(216,58,44,.12); }
.timeline .ph.now .when::before { background: var(--green); box-shadow: 0 0 0 4px rgba(31,111,84,.14); }
.timeline .ph .when { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--red); text-transform: uppercase; }
.timeline .ph.now .when { color: var(--green); }
.timeline .ph h4 { font-family: var(--display); font-size: 18px; margin: 8px 0 10px; }
.timeline .ph li { font-size: 13px; color: var(--muted); line-height: 1.5; list-style: none; padding-left: 16px; position: relative; }
.timeline .ph li::before { content: "→"; position: absolute; left: 0; color: var(--faint); }

/* divergence bars (twin race) */
.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-row .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.bar-row .name { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bar-row .amt { font-family: var(--display); font-weight: 600; font-size: 26px; }
.track { height: 16px; border-radius: 999px; background: var(--secondary); overflow: hidden; border: 1px solid var(--border); }
.track > span { display: block; height: 100%; border-radius: 999px; width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.slide.active .track > span { width: var(--w); }
.fill-red { background: linear-gradient(90deg,#e88a7e,#d83a2c); }
.fill-green { background: linear-gradient(90deg,#54b489,#1f6f54); }
.fill-faint { background: repeating-linear-gradient(90deg,#cfc7b6,#cfc7b6 6px,#ded7c8 6px,#ded7c8 12px); }

/* bill line items */
.lines { display: flex; flex-direction: column; }
.lines .li { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.lines .li .lbl { color: #43413a; }
.lines .li .amt { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.lines .li.total { border-bottom: 0; padding-top: 14px; }
.lines .li.total .lbl { font-family: var(--display); font-weight: 600; font-size: 16px; }
.lines .li.total .amt { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--red); }

/* ---- Chrome: footer spine + progress + page no ----------- */
.chrome { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; pointer-events: none; }
.chrome .wm { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .02em; color: var(--ink); }
.chrome .wm span { color: var(--red); }
.spine { display: flex; align-items: center; gap: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.spine .seg { display: flex; align-items: center; gap: 9px; }
.spine .seg + .seg::before { content: "›"; color: var(--border-2); margin: 0 9px; }
.spine .seg.on { color: var(--red); font-weight: 600; }
.spine .seg .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); }
.spine .seg.on .pip { background: var(--red); box-shadow: 0 0 0 3px rgba(216,58,44,.15); }
.chrome .pageno { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--faint); }
.chrome .pageno b { color: var(--ink); font-weight: 600; }

/* progress bar hugging the bottom edge of the stage */
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(0,0,0,.06); z-index: 31; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,var(--red),var(--red-2)); transition: width .5s cubic-bezier(.2,.7,.2,1); }

/* bare chrome on cover/close — hide the whole footer */
.stage.bare .chrome { opacity: 0; }

/* nav hint (cover) */
.hint { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); }
.hint kbd { font-family: var(--mono); background: var(--secondary); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ink-soft); font-size: 10.5px; }

/* ---- Reveal animation ------------------------------------ */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.slide .reveal { opacity: 0; }
.slide.active .reveal { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0s); }

/* big faint section numeral watermark */
.wmnum { position: absolute; right: 40px; top: 30px; font-family: var(--display); font-weight: 700;
  font-size: 150px; line-height: 1; color: var(--ink); opacity: .04; letter-spacing: -.04em; user-select: none; }

/* ---- Cover specifics ------------------------------------- */
.wordmark { font-family: var(--display); font-weight: 700; letter-spacing: -.04em; line-height: .9; }
.wordmark em { font-style: normal; color: var(--red); }
#cover { justify-content: center; }
#cover .wordmark { font-size: 120px; }

/* causal-chain flow (Price slide) */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.flow .fnode {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em;
  padding: 8px 12px; border-radius: 8px; background: var(--card);
  border: 1px solid var(--border); color: var(--ink-soft); white-space: nowrap;
}
.flow .fnode.red { background: linear-gradient(180deg,#fff,#fdf3f1); border-color: #f0d8d3; color: var(--red); font-weight: 600; }
.flow .farr { color: var(--faint); font-size: 13px; }
.spine-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.spine-pills .sp { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 15px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--ink-soft); }
.spine-pills .sp b { color: var(--red); }
.spine-pills .arrow { display: flex; align-items: center; color: var(--faint); }

/* close slide */
#close { justify-content: center; align-items: center; text-align: center; background: var(--ink); }
#close::after { opacity: .5; }
#close .wordmark { color: var(--paper); }
#close .spine-pills .sp { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); color: var(--paper); }
#close .lead { color: rgba(247,244,238,.7); }

/* misc */
.tagrow { display: flex; flex-wrap: wrap; gap: 9px; }
ul.ticks { list-style: none; display: flex; flex-direction: column; gap: 11px; }
ul.ticks li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.45; color: #3c3a33; }
ul.ticks li::before { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 3px;
  background: var(--green); box-shadow: 0 0 0 3px rgba(31,111,84,.12); }
ul.ticks li b { font-weight: 600; color: var(--ink); }
ul.ticks.red li::before { background: var(--red); box-shadow: 0 0 0 3px rgba(216,58,44,.12); }

.note { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--faint); }
.bignum { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; line-height: 1; }

/* ---- Overlays: overview grid (O) + help (?) -------------- */
.ov-grid {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,19,15,.92);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  padding: 40px; align-content: center; backdrop-filter: blur(3px);
}
.ov-cell {
  aspect-ratio: 16 / 9; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  background: var(--paper); color: var(--ink); cursor: pointer; text-align: left;
  padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--display); transition: transform .15s ease, border-color .15s ease;
}
.ov-cell:hover { transform: translateY(-3px); border-color: var(--red); }
.ov-cell .ov-n { font-family: var(--mono); font-size: 12px; color: var(--red); letter-spacing: .1em; }
.ov-cell .ov-t { font-size: 15px; font-weight: 600; line-height: 1.1; }
.help-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(20,19,15,.78); backdrop-filter: blur(3px); }
.help-card { background: var(--paper); border-radius: 14px; padding: 28px 34px; max-width: 520px; box-shadow: 0 30px 70px -20px #000; }
.help-card h4 { font-family: var(--display); font-size: 20px; margin-bottom: 14px; }
.help-card p { font-size: 14px; color: #3c3a33; margin: 8px 0; line-height: 1.7; }
.help-card p.dim { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.help-card kbd { font-family: var(--mono); background: var(--secondary); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; font-size: 11px; }

/* ---- Print: one slide per page --------------------------- */
@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { overflow: visible; background: #fff; height: auto; }
  #deck { position: static; display: block; }
  .stage { position: static; transform: none !important; width: 1280px; height: auto; }
  .slide {
    position: relative; inset: auto; opacity: 1 !important; visibility: visible !important;
    transform: none !important; border-radius: 0; box-shadow: none;
    width: 1280px; height: 720px; page-break-after: always; break-after: page;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .slide .reveal { opacity: 1 !important; animation: none !important; }
  .track > span { width: var(--w) !important; transition: none !important; }
  /* shared chrome can't repeat per printed page — drop it for clean full-bleed slides */
  .progress, .help-overlay, .ov-grid, .chrome { display: none !important; }
}
