/* ==========================================================================
   Peer-Relative Cash Flows and the Cross-Section of Stock Returns
   Editorial scrollytelling design system matching pr-profitability.anilcelik.com
   ========================================================================== */

:root {
  --bg: #fbfaf9;
  --panel: #f4f3f0;
  --surface: #ffffff;
  --ink: #0f121a;
  --fg: #14171f;
  --muted: #6c6660;
  --gray: #8f8a83;
  --line: #e3e1dd;
  --line-2: #c5c1b9;
  --blue: #103bc6;
  --blue-h: #0c2ea3;
  --blue-l: #7d97ff;
  --blue-soft: rgba(16, 59, 198, 0.085);
  --blue-tint: rgba(16, 59, 198, 0.14);
  --teal: #0e8f86;
  --teal-soft: rgba(14, 143, 134, 0.1);
  --hot: #d9480f;
  --hot-soft: rgba(217, 72, 15, 0.09);
  --shadow: 0 1px 2px rgba(15, 18, 26, 0.05), 0 16px 40px -18px rgba(15, 18, 26, 0.22);
  --shadow-sm: 0 1px 3px rgba(15, 18, 26, 0.06);

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1360px;
  --pad: max(20px, min(40px, 4vw));
  --r: 6px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Sticky Top Navigation
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(251, 250, 249, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand b {
  font-weight: 700;
}

.brand span {
  color: var(--muted);
  font-weight: 400;
}

.brand svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 180ms var(--ease);
}

.nav-links a:hover,
.nav-links a.on {
  color: var(--ink);
}

.nav-links a.on {
  font-weight: 600;
}

.nav-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.nav-dl:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 49;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 16px var(--pad) 22px;
  box-shadow: var(--shadow);
}

.drawer.open {
  display: block;
}

.drawer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-bottom: 14px;
}

.drawer-list a {
  text-decoration: none;
  font-size: 14px;
  color: var(--fg);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}

.prog-bar {
  width: 100%;
  height: 100%;
  background: var(--blue);
  transform-origin: left center;
  transform: scaleX(0);
}

/* ==========================================================================
   Hero / Cover Split (Matching pr-profitability.anilcelik.com)
   ========================================================================== */

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100svh - var(--nav-h));
}

.copy {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(40px, 6vh, 72px) clamp(24px, 4.5vw, 64px) clamp(44px, 6vh, 72px) var(--pad);
  background: var(--bg);
}

.copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(15, 18, 26, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.08) 70%, transparent 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.08) 70%, transparent 100%);
  pointer-events: none;
}

.copy-in {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
}

.wp-notice {
  margin-top: 14px;
  margin-bottom: 22px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--hot);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--fg);
}

.wp-notice strong {
  color: var(--ink);
  font-weight: 600;
}

h1, h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.03;
  text-wrap: balance;
}

h1 em, h2 em, .bigq em, .eq em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--blue);
  font-size: 1.07em;
  letter-spacing: -0.015em;
}

.hero h1 {
  font-size: clamp(42px, 5vw, 74px);
  margin-bottom: 20px;
}

.hero h1 .w {
  display: inline-block;
  animation: wordIn 650ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes wordIn {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.lede {
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.58;
  color: var(--muted);
  max-width: 34em;
}

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.trio > div {
  padding-right: 16px;
}

.trio > div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.trio .num {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.trio .lbl {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.45;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 160ms var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn.p {
  background: var(--blue);
  color: #ffffff;
}

.btn.p:hover {
  background: var(--blue-h);
}

.btn.o {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
}

.btn.o:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn.g {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn.g:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
}

.byline {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.byline strong {
  color: var(--ink);
  font-weight: 600;
}

.byline a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(16, 59, 198, 0.45);
  text-underline-offset: 3px;
}

.byline a:hover {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

.ack {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.scene0 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 6vh, 72px) clamp(24px, 5vw, 72px);
  background-color: var(--panel);
  background-image:
    linear-gradient(to right, rgba(15, 18, 26, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 18, 26, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  border-left: 1px solid var(--line);
}

.scene0-in {
  max-width: 540px;
}

.bigq {
  margin: 14px 0 24px;
  font-size: clamp(44px, 5.8vw, 94px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  color: var(--ink);
}

.hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line-2);
}

/* ==========================================================================
   Sticky Scrollytelling Scenes
   ========================================================================== */

.scene {
  position: relative;
  min-height: calc(var(--n, 3) * 58vh + 92vh);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.scene.alt {
  background: var(--panel);
}

.stage {
  position: sticky;
  top: var(--nav-h);
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
}

.stage-in {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(24px, 4vh, 44px) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4.2vw, 68px);
  align-items: center;
}

.st-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.st-head h2 {
  margin-top: 10px;
  font-size: clamp(28px, 3.2vw, 48px);
}

.steps2 {
  display: flex;
  flex-direction: column;
}

.step-item {
  border-top: 1px solid var(--line);
  padding: 12px 0 13px;
  cursor: pointer;
  position: relative;
  transition: opacity 220ms var(--ease);
}

.step-item:last-child {
  border-bottom: 1px solid var(--line);
}

.step-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.step-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
}

.step-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--ink);
}

.step-body {
  display: none;
  margin: 8px 0 2px 38px;
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--muted);
}

.step-item.is-past .step-title {
  color: var(--muted);
  font-weight: 400;
}

.step-item.is-past::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34px;
  height: 1.5px;
  background: var(--blue);
  opacity: 0.45;
}

.step-item.is-active {
  border-bottom: 1.5px solid var(--blue);
}

.step-item.is-active .step-body {
  display: block;
}

.step-item.is-future {
  opacity: 0.48;
}

.step-item.is-future:hover {
  opacity: 0.85;
}

.step-item.is-future .step-title {
  font-weight: 400;
  color: var(--muted);
}

/* Right Visual Column */
.st-vis {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.fig-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.fig-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.ctrl-lbl {
  font-size: 12.5px;
  color: var(--muted);
}

.seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  gap: 2px;
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.seg button:hover {
  color: var(--ink);
}

.seg button.on {
  background: var(--ink);
  color: #ffffff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.lg-i {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lg-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

.plate {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(18px, 2.5vw, 28px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.plate svg {
  display: block;
  width: 100%;
  height: auto;
}

.fig-cap {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

.fig-cap strong {
  color: var(--ink);
  font-weight: 600;
}

/* Inline glossary term button */
.term {
  display: inline;
  padding: 0 2px;
  border: 0;
  border-bottom: 1.5px dotted var(--blue);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: help;
  border-radius: 3px;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

.term:hover,
.term:focus-visible {
  color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

/* ==========================================================================
   Formula Tiles & Interactive Sandbox
   ========================================================================== */

.eq-grid {
  display: grid;
  gap: 14px;
}

.eq-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  background: var(--bg);
}

.eq-card.hl {
  border-color: rgba(16, 59, 198, 0.35);
  background: var(--blue-soft);
}

.eq-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.eq-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.eq-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ink);
}

.eq-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  font-size: 13.5px;
  line-height: 1.25;
}

.eq-frac .num {
  padding: 0 6px 3px;
  border-bottom: 1px solid var(--ink);
}

.eq-frac .den {
  padding: 3px 6px 0;
}

.eq-sym {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  color: var(--blue);
}

.eq-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.sandbox-grid {
  display: grid;
  gap: 16px;
}

.sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.sl-group label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--fg);
  margin-bottom: 6px;
}

.sl-group .val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--line-2);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 18, 26, 0.22);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
  cursor: pointer;
}

.verdict {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid rgba(16, 59, 198, 0.35);
  background: var(--blue-soft);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.verdict .v-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.verdict .v-v {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.verdict .v-v.pos {
  color: var(--blue);
}

.verdict .v-v.neg {
  color: var(--hot);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 11px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

/* ==========================================================================
   Historical 10-K Peer Explorer
   ========================================================================== */

.peer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.peer-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 10px;
  background: var(--bg);
  text-align: center;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.peer-card.delisted {
  border-color: rgba(217, 72, 15, 0.35);
  background: var(--hot-soft);
}

.peer-rank {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.peer-tkr {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.peer-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.peer-card.delisted .peer-sub {
  color: var(--hot);
  font-weight: 500;
}

.peer-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pt-col {
  padding: 10px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.pt-col.on {
  background: var(--blue-soft);
  border-color: rgba(16, 59, 198, 0.3);
}

.pt-yr {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.pt-col.on .pt-yr {
  color: var(--blue);
}

.pt-list {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.meta-strip {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

.meta-strip b {
  color: var(--ink);
}

/* ==========================================================================
   Accounting Illusion Cards & Portfolio Mixer
   ========================================================================== */

.illus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.illus-box {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}

.illus-box .ik {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.illus-box .iv {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.illus-box .id {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* 28-yr summary cards */
.wealth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.w-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  background: var(--bg);
}

.w-card.hl {
  border-color: rgba(16, 59, 198, 0.4);
  background: var(--blue-soft);
}

.w-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.w-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.w-mult {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.w-stats {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.w-stats b {
  color: var(--ink);
}

/* ==========================================================================
   SVG Chart Typography & Gridlines
   ========================================================================== */

.gl {
  stroke: var(--line);
  stroke-width: 1;
}

.gl-zero {
  stroke: var(--line-2);
  stroke-width: 1.25;
}

.tm {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  fill: var(--muted);
  text-transform: uppercase;
}

.tk {
  font-family: var(--sans);
  font-size: 11.5px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tk-b {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  fill: var(--ink);
}

.tv {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}

.tv-blue {
  fill: var(--blue);
}

.tv-hot {
  fill: var(--hot);
}

.bar-hit {
  cursor: pointer;
  transition: opacity 160ms var(--ease);
}

.bar-hit:hover {
  opacity: 0.85;
}

/* ==========================================================================
   Conclusion Dark Band
   ========================================================================== */

.final {
  position: relative;
  overflow: hidden;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  color: #ffffff;
  padding: clamp(64px, 10vh, 112px) 0;
}

.final::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(52, 96, 255, 0.45) 0%, rgba(16, 59, 198, 0.12) 45%, transparent 72%);
  pointer-events: none;
}

.final-in {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.final .mono {
  color: rgba(255, 255, 255, 0.58);
}

.final h2 {
  margin-top: 12px;
  color: #ffffff;
  font-size: clamp(32px, 4vw, 56px);
}

.final h2 em {
  color: #ffffff;
}

.final p {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  line-height: 1.65;
  max-width: 54ch;
}

.final-note {
  margin-top: 20px;
  padding: 12px 15px;
  border-left: 3px solid var(--hot);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13.5px;
  line-height: 1.52;
  color: rgba(255, 255, 255, 0.88);
  max-width: 54ch;
}

.cite {
  padding: 24px;
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(8px);
}

.cite-text {
  margin: 12px 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.cite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Appendix Collapsible Tables
   ========================================================================== */

.appx {
  background: var(--bg);
  padding: clamp(56px, 8vh, 88px) 0;
  border-bottom: 1px solid var(--line);
}

.appx-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.appx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 36px;
  margin-bottom: 32px;
}

.appx-head h2 {
  margin-top: 8px;
  font-size: clamp(30px, 3.4vw, 46px);
}

.appx-head p {
  margin: 0;
  max-width: 44ch;
  font-size: 14.5px;
  color: var(--muted);
}

.tbl-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1160px;
}

details.tbl {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

details.tbl summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  user-select: none;
}

details.tbl summary::-webkit-details-marker {
  display: none;
}

details.tbl summary .sum-left::before {
  content: "▸";
  font-size: 12px;
  color: var(--muted);
  margin-right: 10px;
  display: inline-block;
  transition: transform 180ms var(--ease);
}

details.tbl[open] summary .sum-left::before {
  transform: rotate(90deg);
  color: var(--blue);
}

.sum-left {
  display: flex;
  align-items: center;
}

.sum-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
}

.tbl-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

table.data th {
  text-align: right;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data th:first-child,
table.data td:first-child {
  text-align: left;
  padding-left: 20px;
}

table.data th:last-child,
table.data td:last-child {
  padding-right: 20px;
}

table.data td {
  text-align: right;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  white-space: nowrap;
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data tr.hl td {
  background: var(--blue-soft);
  font-weight: 600;
  color: var(--ink);
}

table.data tr.fail td {
  color: var(--muted);
}

table.data tr.subhead td {
  background: var(--bg);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 12px;
  padding-bottom: 8px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background: var(--panel);
  padding: 48px 0 36px;
}

.foot-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.fcols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.fcols p {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.fcols a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(16, 59, 198, 0.45);
  text-underline-offset: 3px;
}

.fcols a:hover {
  color: var(--blue);
}

.fine {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ==========================================================================
   Floating Presentation Deck Pill, Tooltip & Glossary Popover
   ========================================================================== */

.deck {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: rgba(15, 18, 26, 0.92);
  color: #ffffff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.deck-lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.deck-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.deck button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms var(--ease);
}

.deck button:hover {
  background: var(--blue);
}

.tip {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(15, 18, 26, 0.95);
  color: #ffffff;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: var(--shadow);
  transition: opacity 120ms var(--ease);
}

.tip.on {
  opacity: 1;
}

.tip b {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}

.tip .tm-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: #b7c6ff;
}

.gloss {
  position: fixed;
  z-index: 75;
  display: none;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg);
}

.gloss.on {
  display: block;
}

.gloss-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gloss-top strong {
  color: var(--ink);
  font-size: 14px;
}

.gloss-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1120px) {
  .nav-links {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 960px) {
  .cover {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .copy {
    justify-content: flex-start;
  }
  .scene0 {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 48px var(--pad);
    justify-content: flex-start;
  }
  .scene {
    min-height: auto;
  }
  .stage {
    position: relative;
    top: 0;
    min-height: auto;
  }
  .stage-in {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 44px var(--pad);
  }
  .step-item.is-future {
    opacity: 0.72;
  }
  .final-in {
    grid-template-columns: 1fr;
  }
  .fcols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-in {
    gap: 10px;
  }
  .brand span {
    display: none;
  }
  .nav-dl {
    padding: 6px 9px;
    font-size: 12px;
  }
  .nav-dl span {
    display: none;
  }
  .seg {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .seg button {
    padding: 5px 9px;
    font-size: 12px;
  }
  .trio {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .trio > div + div {
    padding-left: 0;
    border-left: 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .sliders,
  .verdict,
  .illus-grid,
  .wealth-grid {
    grid-template-columns: 1fr;
  }
  .peer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .peer-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .deck {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero h1 .w {
    animation: none;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
