/* FUCK PW: case-file design system: PW-brand blue dissolves into dither, receipts stamped red */

:root {
  color-scheme: dark;
  --bg: #06070c;
  --panel: #0a0d16;
  --ink: #f4f5f9;
  --muted: #8b91a8;
  --blue: #2e6cff;        /* PW's own blue, repurposed */
  --blue-deep: #0a2fb8;
  --red: #ff4d3d;         /* stamp red */
  --hair: rgba(244, 245, 249, .09);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --disp: "Anton", var(--sans);
}

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

html, body { overflow-x: clip; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  /* static fallback if canvas never paints: PW blue glow into black */
  background-image: radial-gradient(120% 80% at 80% -10%, rgba(10, 47, 184, .55) 0%, transparent 60%);
  color: var(--ink);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue-deep); color: var(--ink); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

#dither {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------- chrome ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(6, 7, 12, .82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
}

.brand {
  font: 600 15px var(--mono);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .02em;
}
.brand span { color: var(--red); }

.top nav { display: flex; gap: 20px; margin-inline: auto; }
.top nav a {
  font: 500 13px var(--mono);
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.top nav a:hover { color: var(--ink); }
.top nav a.active { color: var(--ink); border-bottom-color: var(--red); }

.mode {
  font: 500 12px var(--mono);
  color: var(--muted);
  background: none;
  border: 1px solid var(--hair);
  padding: 6px 10px;
  cursor: pointer;
}
.mode:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- hero ---------- */

#hero {
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
}

.hero-inner {
  max-width: 1200px;
  margin-inline: auto;
  padding: 48px 32px 64px;
  width: 100%;
}

h1 {
  font: 400 clamp(4.5rem, 17vw, 14rem)/0.85 var(--disp);
  letter-spacing: .01em;
  text-transform: uppercase;
}

/* the anatomy of the headline: sweat on top right of FUCK, PW bleeding red */
h1 .fuck { position: relative; display: inline-block; }
h1 .sweat {
  position: absolute;
  top: -0.14em;
  right: -0.4em;
  font-size: .48em;
  transform: rotate(14deg);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  filter: saturate(1.25);
}
h1 .pw { color: var(--red); }

.stamp {
  display: inline-block;
  margin-top: 18px;
  font: 600 14px var(--mono);
  color: var(--red);
  border: 2px solid var(--red);
  padding: 5px 12px;
  letter-spacing: .12em;
  transform: rotate(-2deg);
}

.lede {
  margin-top: 28px;
  max-width: 44ch;
  font: 400 19px/1.6 var(--sans);
  color: var(--ink);
}

.cue {
  margin-top: 40px;
  font: 400 12px var(--mono);
  color: var(--muted);
}

/* ---------- ticker ---------- */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  background: rgba(10, 13, 22, .65);
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding: 10px 0;
  animation: tick 42s linear infinite;
}

.ticker-track span {
  font: 500 12px var(--mono);
  color: var(--muted);
  margin-right: 3ch;
}
.ticker-track span::after { content: " ·"; color: var(--red); margin-left: 3ch; }

@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- sections ---------- */

section {
  padding: clamp(64px, 9vw, 110px) 32px;
  border-top: 1px solid var(--hair);
}

section > h2, section > .note, section > .triad, section > .timeline, section > .verdict, section > .demands {
  max-width: 1100px;
  margin-inline: auto;
}

.marker {
  font: 600 12px var(--mono);
  color: var(--red);
  letter-spacing: .1em;
  text-transform: lowercase;
  max-width: 1100px;
  margin: 0 auto 14px;
}

h2 {
  font: 400 clamp(2.2rem, 5vw, 3.4rem)/1.05 var(--disp);
  text-transform: uppercase;
  letter-spacing: .01em;
  margin-bottom: 20px;
}

.note { color: var(--muted); max-width: 68ch; }
.note em { color: var(--ink); font-style: normal; border-bottom: 1px dashed var(--muted); }

/* three ruled columns, no card kit */
.triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--hair);
  margin-top: 34px;
}
.triad .col {
  padding: 28px 26px;
  border-right: 1px solid var(--hair);
}
.triad .col:last-child { border-right: 0; }
.triad h3 {
  font: 600 15px var(--mono);
  color: var(--blue);
  margin-bottom: 12px;
}
.triad p { font-size: 15.5px; color: var(--ink); }

@media (max-width: 860px) {
  .triad { grid-template-columns: 1fr; }
  .triad .col { border-right: 0; border-bottom: 1px solid var(--hair); }
  .triad .col:last-child { border-bottom: 0; }
  .top nav { display: none; }
}

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

.timeline {
  list-style: none;
  margin-top: 40px;
  border-left: 1px solid var(--hair);
}

.timeline li {
  position: relative;
  padding: 18px 0 18px 32px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 29px;
  width: 7px;
  height: 7px;
  background: var(--red);
}

.timeline .when {
  font: 600 12px var(--mono);
  color: var(--red);
  letter-spacing: .1em;
  text-transform: lowercase;
}

.timeline p { margin-top: 6px; max-width: 62ch; }
.timeline strong { color: var(--ink); }
.timeline p { color: var(--muted); }

.verdict {
  margin-top: 44px;
  padding: 26px 28px;
  border: 1px solid var(--red);
  color: var(--ink);
  font-size: 18px;
  max-width: 1100px;
}

.verdict em { font-style: normal; color: var(--red); }

/* the extortion callout, in red, above the receipt trail */
.extort {
  max-width: 1100px;
  margin: 34px auto 30px;
  color: var(--red);
  font: 400 clamp(1.5rem, 3.6vw, 2.5rem)/1.15 var(--disp);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.extort small {
  display: block;
  margin-top: 10px;
  font: 400 15px/1.5 var(--sans);
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- demands ---------- */

.demands {
  list-style: none;
  margin-top: 34px;
  max-width: 780px;
}
.demands li {
  padding: 20px 0;
  border-bottom: 1px solid var(--hair);
}
.demands li:first-child { border-top: 1px solid var(--hair); }
.demands strong { color: var(--ink); }
.demands p, .demands { color: var(--muted); }

/* ---------- data: cards, tables, charts ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  margin-top: 40px;
}
.card {
  background: var(--bg);
  padding: 26px 24px;
}
.card .big {
  display: block;
  font: 500 clamp(1.6rem, 3vw, 2.2rem)/1 var(--mono);
  color: var(--ink);
}
.card .small {
  display: block;
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

figure.chart {
  max-width: 760px;
  margin: 56px auto 0;
}
.chart figcaption {
  font: 500 13px var(--mono);
  color: var(--muted);
  margin-bottom: 12px;
}
.chart svg { width: 100%; height: auto; display: block; }
.bars-g rect { fill: var(--red); opacity: .45; }
.bars-g rect.hot { opacity: 1; }
svg .lbl text {
  font: 500 15px var(--mono);
  fill: var(--muted);
}
svg .lbl text.bad { fill: var(--red); }
svg .lbl text.good { fill: var(--blue); }
svg .lbl text.neutral { fill: var(--ink); }
svg .sparkline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-dasharray: 1000;
}
svg use {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  fill: none;
}
.chart-note {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
section > .chart-note { max-width: 1100px; margin-inline: auto; }

.tablewrap { max-width: 760px; margin: 56px auto 0; overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
caption {
  font: 500 13px var(--mono);
  color: var(--muted);
  text-align: left;
  margin-bottom: 12px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  vertical-align: top;
}
th {
  font: 600 12px var(--mono);
  color: var(--blue);
  text-transform: none;
}
td { color: var(--ink); }
td a { color: var(--blue); text-decoration: none; }
td a:hover { text-decoration: underline; }

/* ---------- quotes & exhibits ---------- */

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--hair);
  margin-top: 40px;
}
.quote {
  padding: 28px;
  border-top: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
}
.quote:nth-child(odd) { border-right: 0; border-left: 0; }
.quote:nth-child(odd) + .quote { border-left: 1px solid var(--hair); }
.quote:nth-child(2) { border-top: 0; }
.quote:nth-child(even) { border-top: 1px solid var(--hair); }
.quote blockquote {
  font-size: 16px;
  color: var(--ink);
  border-left: 3px solid var(--blue);
  padding-left: 16px;
  line-height: 1.6;
}
.quote.balance blockquote { border-left-color: #46b478; }
.quote figcaption {
  margin-top: 14px;
  font: 400 12.5px var(--mono);
  color: var(--muted);
  line-height: 1.55;
}
.quote a { color: var(--blue); text-decoration: none; }
.quote a:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .quote-grid { grid-template-columns: 1fr; }
  .quote { border-right: 0 !important; border-left: 0 !important; }
  .quote:nth-child(2) { border-top: 1px solid var(--hair); }
}

.sidefile {
  max-width: 1100px;
  margin: 44px auto 0;
  padding: 24px 28px;
  border: 1px solid var(--hair);
  background: rgba(10, 13, 22, .5);
}
.sidefile h3 {
  font: 600 14px var(--mono);
  color: var(--red);
  letter-spacing: .06em;
  text-transform: lowercase;
  margin-bottom: 12px;
}
.sidefile.altmath h3, .sidefile.defense h3 { color: var(--blue); }
.sidefile p, .sidefile li {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
}
.sidefile p strong, .sidefile li strong { color: var(--ink); }
.parrow { list-style: none; }
.parrow li { padding: 8px 0 8px 20px; position: relative; }
.parrow li::before { content: "·"; position: absolute; left: 4px; color: var(--red); }

.leadq {
  max-width: 1100px;
  margin: 36px auto 0;
  font: 400 clamp(1.25rem, 2.6vw, 1.7rem)/1.5 var(--sans);
  color: var(--ink);
  border: none;
}
.leadq strong { color: var(--blue); }

/* ---------- footer sources ---------- */

.sources {
  margin-top: 28px !important;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  font-size: 13px !important;
  line-height: 1.8;
}
.sources a { color: var(--blue); text-decoration: none; }
.sources a:hover { text-decoration: underline; }
.sources strong { color: var(--ink); }
.sources span {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  position: relative;
  top: -2px;
}

sup a { color: var(--blue); text-decoration: none; font-size: .62em; }
sup a:hover { text-decoration: underline; }

/* ---------- tip line ---------- */

#tipline .note { margin-bottom: 34px; }

.tipform {
  max-width: 780px;
  margin-inline: auto;
  display: grid;
  gap: 18px;
}
.tipform .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.tipform label {
  display: block;
  font: 500 13px var(--mono);
  color: var(--ink);
}
.tipform label input, .tipform label select, .tipform label textarea { margin-top: 8px; width: 100%; box-sizing: border-box; }
.tipform .req { color: var(--red); font-style: normal; }
.tipform input, .tipform select, .tipform textarea {
  font: 400 15px var(--sans);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hair);
  padding: 12px 14px;
  border-radius: 0;
}
.tipform input:focus-visible, .tipform select:focus-visible, .tipform textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 0;
  border-color: transparent;
}
.tipform textarea { resize: vertical; min-height: 120px; }
.tipform .check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font: 400 13.5px var(--mono);
  color: var(--muted);
}
.tipform .check input { width: 16px; height: 16px; accent-color: var(--red); margin-top: 2px; }
.tipform button {
  justify-self: start;
  font: 600 15px var(--mono);
  color: var(--red);
  background: none;
  border: 2px solid var(--red);
  padding: 12px 22px;
  cursor: pointer;
}
.tipform button:hover { background: var(--red); color: var(--bg); }
.tipform .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}
.tipform .ok { color: #46b478; font: 500 14px var(--mono); }
.tipform .warn { color: var(--muted); font: 500 13px var(--mono); }

/* the email-code verify step */
.verifyrow {
  border: 1px solid var(--hair);
  background: var(--panel);
  padding: 20px;
}
.verifyrow .vhead {
  font: 500 13px var(--mono);
  color: var(--ink);
  margin-bottom: 12px;
}
.verifyrow .vline { display: flex; gap: 12px; }
.verifyrow #vcode {
  font: 600 20px var(--mono);
  letter-spacing: .35em;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hair);
  padding: 10px 14px;
  width: 13ch;
}
.verifyrow #doverify {
  font: 600 14px var(--mono);
  color: var(--red);
  background: none;
  border: 2px solid var(--red);
  padding: 10px 18px;
  cursor: pointer;
}
.verifyrow #doverify:hover { background: var(--red); color: var(--bg); }
.verifyrow #vmsg { margin-top: 10px; font: 500 13px var(--mono); color: var(--muted); }

.mailnote {
  max-width: 780px;
  margin: 26px auto 0;
  font-size: 15px;
  color: var(--muted);
}
.mailnote strong a { color: var(--red); text-decoration: none; border-bottom: 1px dashed var(--red); }
.mailnote strong a:hover { color: var(--ink); }
@media (max-width: 720px) { .tipform .row { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--hair);
  background: rgba(6, 7, 12, .9);
  padding: 56px 32px 64px;
}
footer p {
  max-width: 1100px;
  margin-inline: auto;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}
.foot-brand {
  font: 600 15px var(--mono) !important;
  color: var(--ink);
}
.foot-brand span { color: var(--red); }

/* ---------- round 7: the operator's X post, parked at an odd spot ---------- */
.xcon {
  position: fixed;
  right: 14px;
  top: 58%;
  z-index: 30;
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 9px 10px 8px;
  background: rgba(10, 13, 22, .78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hair);
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.xcon svg { display: block; color: var(--muted); }
.xcon span { font: 500 10.5px var(--mono); letter-spacing: .04em; color: var(--muted); }
.xcon:hover { border-color: var(--red); }
.xcon:hover svg, .xcon:hover span { color: var(--ink); }
@media (max-width: 720px) {
  .xcon { display: none; }
  .xnav {
    display: grid;
    gap: 2px;
    justify-items: center;
    padding: 5px 7px 4px;
    background: rgba(10, 13, 22, .78);
    border: 1px solid var(--hair);
    color: var(--muted);
    text-decoration: none;
    font: 500 9px var(--mono);
    letter-spacing: .04em;
  }
  .xnav svg { display: block; color: var(--muted); }
}
@media (min-width: 721px) { .xnav { display: none; } }
.sidefile.ask { border-color: rgba(255, 77, 61, .5); }
.sidefile.ask h3 { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .xcon { transition: none; } }

/* ---------- round 6: hero art ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.art { display: block; width: min(96%, 1150px); height: auto; }
@media (max-width: 720px) { .art { width: 100%; } }

/* ---------- round 5: motion-comfort, reading windows, skeletons ---------- */

html { scroll-padding-top: 72px; }

/* reading progress: one red hairline under the topbar */
.prog {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 77, 61, .6);
  z-index: 60;
  pointer-events: none;
}

/* sections arrive quietly */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.rv.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* skeleton pulse while the tip line is thinking */
.tipform button.sending { color: transparent; pointer-events: none; position: relative; }
.tipform button.sending::after, .verifyrow #doverify.sending::after {
  content: "";
  position: absolute;
  inset: 8px 14px;
  background: linear-gradient(100deg, rgba(255, 77, 61, .10) 30%, rgba(255, 77, 61, .55) 50%, rgba(255, 77, 61, .10) 70%);
  background-size: 300% 100%;
  animation: skel 1.1s linear infinite;
}
@keyframes skel { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) {
  .tipform button.sending::after, .verifyrow #doverify.sending::after { background: rgba(255, 77, 61, .25); animation: none; }
}

/* desktop reading windows over the drift: panel fills + a soft text halo.
   mobile reads fine without them, so the artwork stays bare below 900px */
@media (min-width: 900px) {
  .triad { background: rgba(6, 7, 12, .82); }
  .card { background: rgba(6, 7, 12, .88); }
  .sidefile { background: rgba(10, 13, 22, .88); }
  .quote { background: rgba(8, 10, 18, .8); }
  .timeline li { background: rgba(6, 7, 12, .58); }
  .ticker { background: rgba(10, 13, 22, .92); }
  footer { background: rgba(6, 7, 12, .97); }
  section > h2, .note, .triad p, .triad h3, .timeline p, .timeline .when, .verdict,
  .demands li, .leadq, .chart figcaption, .chart-note, .quote blockquote, .quote figcaption,
  .sidefile p, .sidefile li, footer p, .extort, .extort small, .mailnote, .tipform label,
  .sources, td, th, .card .small, .card .big, .stamp, .lede, .cue {
    text-shadow: 0 1px 16px rgba(4, 5, 10, .95), 0 0 7px rgba(4, 5, 10, .9);
  }
}

/* ---------- round 9: printable case file ---------- */
@media print {
  canvas, .ticker, .xcon, .xnav, .prog, .cue, .skeleton { display: none !important; }
  body, main, section, .sidefile, .quote, .timeline li, .sources, footer,
  .tablewrap table, td, th, .card, .stamp, .mailnote {
    background: #fff !important;
    color: #000 !important;
  }
  a { color: #06c; text-decoration: underline; }
  .art { filter: contrast(1.1); }
}

/* ---------- round 11: stat cards stamp in when revealed ---------- */
@keyframes bigin {
  from { opacity: 0; transform: scale(1.07) rotate(-.6deg); }
  to { opacity: 1; transform: none; }
}
.rv .card .big, .reveal .card .big, .card.rv .big { animation: bigin .5s cubic-bezier(.2, .9, .3, 1) both; }
