:root {
  --paper: #E3E8EA;
  --paper-2: #D5DCDF;
  --surface: #EEF2F3;
  --ink: #14202A;
  --slate: #4C5A67;
  --rule: #C3CCD1;
  --accent: #0B6B63;
  --accent-rgb: 11, 107, 99;
  --accent-tint: #C6DFDB;
  --rust: #A8431C;
  --rust-tint: #EBD2C6;

  --bg-base: var(--paper);
  --bg-surface: var(--paper);
  --bg-card: var(--surface);
  --bg-card-hover: #F3F6F7;
  --bg-inset: var(--paper-2);
  --bg-elevated: #D6E6E3;

  --border-subtle: var(--rule);
  --border-mid: #AEBAC1;
  --border-gold: var(--accent);

  --gold: var(--accent);
  --gold-dim: var(--accent);
  --gold-glow: rgba(11, 107, 99, 0.08);
  --gold-glow-md: rgba(11, 107, 99, 0.16);

  --text-primary: var(--ink);
  --text-secondary: #3F4D59;
  --text-muted: var(--slate);
  --text-gold: var(--accent);

  --bullish: var(--accent);
  --bullish-dim: var(--accent-tint);
  --bullish-glow: var(--accent-tint);
  --bullish-text: var(--accent);

  --bearish: var(--rust);
  --bearish-dim: var(--rust-tint);
  --bearish-glow: var(--rust-tint);
  --bearish-text: var(--rust);

  --neutral: var(--rule);
  --neutral-dim: var(--paper-2);
  --neutral-text: var(--slate);

  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: auto; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--paper);
  background-image: none;
  color: var(--ink);
}
body::before { display: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
h3 { font-size: 1.2rem; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 8px; }

.container { max-width: 1120px; padding: 0 32px; }
main { padding: 3rem 0 2rem; }
section { margin-bottom: 4.5rem; }

nav {
  background: rgba(227, 232, 234, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
nav .container { height: 60px; }
.logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.logo::before { display: none; }
nav a {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  height: 60px;
  padding: 0 16px;
  color: var(--slate);
}
nav a::after { height: 2px; left: 16px; right: 16px; background: var(--accent); }
nav a:hover { color: var(--ink); }
nav a.active { color: var(--ink); }

.reveal { opacity: 1; transform: none; transition: none; }

.hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 0;
  overflow: visible;
}
.hero::before { display: none; }
.hero-statement {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -0.02em;
  max-width: 24em;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.hero-fallback {
  margin-top: 1.25rem;
  max-width: 40em;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.hero-gauge { margin-top: 3.5rem; }
.hg-track {
  position: relative;
  height: 132px;
  font-variant-numeric: lining-nums tabular-nums;
}
.hg-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 66px;
  height: 1px;
  background: var(--border-mid);
}
.hg-band {
  position: absolute;
  top: 48px;
  height: 36px;
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  transform-origin: center;
  animation: draw-band 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hg-today {
  position: absolute;
  top: 38px;
  height: 56px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}
.hg-edge {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  animation: fade-in 0.5s 0.7s both;
}
.hg-now {
  position: absolute;
  top: 98px;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--slate);
  white-space: nowrap;
}
.hero-gauge figcaption {
  margin-top: 1.5rem;
  max-width: 44em;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

@keyframes draw-band {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hg-band, .hg-edge { animation: none; }
  html { scroll-behavior: auto; }
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4.5rem;
}
.sb-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.5rem 1.5rem 1.5rem 0;
}
.sb-item + .sb-item {
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}
.sb-label { font-size: 0.95rem; font-weight: 500; color: var(--slate); }
.sb-value {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
}
.sb-item:nth-child(3) .sb-value { color: var(--ink); }
.sb-value.sb-muted { color: var(--slate); }
.sb-note { font-size: 0.95rem; color: var(--text-secondary); max-width: 26ch; }
.sb-link {
  align-self: center;
  padding: 0 0 0 1.5rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}
.scoreboard-compact { margin-bottom: 2.5rem; }
.scoreboard-compact .sb-value { font-size: 2.3rem; }

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0;
  border-bottom: 0;
}
h2, .section-header h2 {
  font-size: 1.9rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.section-meta {
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--slate);
  margin: 0;
}
.section-note {
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--text-secondary);
  max-width: 70ch;
  margin: 1rem 0 2rem;
  line-height: 1.65;
}
.data-source {
  display: block;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--slate);
  max-width: 70ch;
  margin-top: 1.25rem;
}
.data-source::before { content: none; }

.v2-notice {
  border: 1px solid var(--accent);
  background: var(--accent-tint);
  color: var(--ink);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.ledger { border-top: 2px solid var(--ink); }
.ledger-head,
.mrow > summary {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(110px, 0.8fr) minmax(280px, 2.6fr) minmax(130px, 1fr) 20px;
  column-gap: 1.75rem;
  align-items: center;
}
.ledger-head {
  padding: 0.7rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate);
  border-bottom: 1px solid var(--rule);
}
.lh-gauge { display: flex; justify-content: space-between; }
.mrow { border-bottom: 1px solid var(--rule); }
.mrow > summary {
  padding: 1.15rem 0;
  cursor: pointer;
  list-style: none;
}
.mrow > summary::-webkit-details-marker { display: none; }
.mrow > summary:hover { background: var(--surface); }
.m-title { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 500; line-height: 1.2; }
.m-unit { display: block; font-size: 0.9rem; color: var(--slate); margin-top: 0.15rem; }
.m-price { font-variant-numeric: lining-nums tabular-nums; }
.m-value { display: block; font-size: 1.5rem; font-weight: 500; line-height: 1.2; }
.m-delta { display: block; font-size: 0.9rem; color: var(--slate); margin-top: 0.15rem; }
.m-gauge { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.m-none { color: var(--slate); }
.g-track { position: relative; display: block; height: 14px; }
.g-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border-mid);
}
.g-zero {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}
.g-band {
  position: absolute;
  top: 2px;
  height: 10px;
  background: var(--accent);
  border-radius: 1px;
}
.g-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 1rem; font-variant-numeric: lining-nums tabular-nums; }
.g-range { font-size: 1.05rem; font-weight: 500; color: var(--ink); }
.g-pct { font-size: 0.9rem; color: var(--slate); }
.m-backtest { display: flex; flex-direction: column; font-size: 0.9rem; color: var(--slate); font-variant-numeric: lining-nums tabular-nums; }
.m-toggle {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--slate);
  border-bottom: 2px solid var(--slate);
  transform: rotate(45deg);
  justify-self: end;
  margin-right: 4px;
  transition: transform 0.2s ease;
}
.mrow[open] .m-toggle { transform: rotate(-135deg); }
.m-detail { padding: 0 0 1.75rem; }
.m-chart { position: relative; height: 230px; }
.m-note { margin-top: 1rem; max-width: 62ch; font-size: 0.98rem; color: var(--text-secondary); }

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}
.how-grid h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.how-grid p { color: var(--text-secondary); max-width: 38ch; }
.text-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cta-section {
  background: transparent;
  border: 0;
  border-top: 2px solid var(--ink);
  border-radius: 0;
  padding: 3rem 0 1rem;
  text-align: left;
  overflow: visible;
}
.cta-section::before { display: none; }
.cta-section h2 { font-size: 2rem; max-width: 22em; margin-bottom: 0.75rem; }
.cta-section p { color: var(--text-secondary); max-width: 52ch; margin-bottom: 1.75rem; font-weight: 400; }
.cta-button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
}
.cta-button::before { display: none; }
.cta-button:hover { background: #084F49; border-color: #084F49; color: #fff; box-shadow: none; }

.page-header { margin-top: 1.5rem; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.page-header h1 { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 500; color: var(--ink); }
.page-subtitle { color: var(--text-secondary); font-size: 1.1rem; font-weight: 400; max-width: 60ch; }
.divider { background: var(--rule); }

.tr-explain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
.tr-explain h3 { font-size: 1.35rem; color: var(--ink); margin-bottom: 0.5rem; }
.tr-explain p { color: var(--text-secondary); font-size: 1rem; font-weight: 400; line-height: 1.7; max-width: 60ch; }
.method-list { color: var(--text-secondary); font-size: 1rem; font-weight: 400; line-height: 1.7; max-width: 70ch; padding-left: 1.2rem; }
.method-list li { margin-bottom: 0.8rem; }
.method-list strong { color: var(--ink); font-weight: 600; }
.method-section a { color: var(--accent); }
.method-section p { max-width: 70ch; }

.dp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; margin-bottom: 2.5rem; }
.dp-figure h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.dotplot { width: 100%; height: auto; display: block; overflow: visible; }
.dotplot text { font-family: var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.dp-name { font-size: 14px; fill: var(--ink); }
.dp-tick { font-size: 12px; fill: var(--slate); }
.dp-value { font-size: 14px; fill: var(--ink); font-weight: 500; }
.dp-grid { stroke: var(--rule); stroke-width: 1; }
.dp-ref { stroke: var(--ink); stroke-width: 2; }
.dp-margin { stroke: rgba(var(--accent-rgb), 0.25); stroke-width: 10; stroke-linecap: round; }
.dp-dot { fill: var(--accent); }
.dp-trend .dp-dot { fill: var(--ink); }
.dp-trend .dp-margin { stroke: rgba(20, 32, 42, 0.16); }
.dp-other { fill: var(--paper); stroke: var(--slate); stroke-width: 2; }
.dp-legend { margin-top: 0.5rem; font-size: 0.95rem; color: var(--slate); max-width: 52ch; }

.tr-filters { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; }
.tr-filters label { display: flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0; color: var(--slate); }
.tr-filters select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.tbl-wrap { border: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); border-radius: 0; margin-bottom: 1.5rem; }
.tbl { font-size: 0.95rem; font-variant-numeric: lining-nums tabular-nums; }
.tbl th {
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--slate);
  background: transparent;
  border-bottom: 1px solid var(--rule);
}
.tbl td { color: var(--text-secondary); border-bottom: 1px solid var(--rule); }
.tbl tbody tr:hover td { background: var(--surface); }
.tbl td.warn { color: var(--rust); font-weight: 500; }
.tbl td.good { color: var(--accent); font-weight: 500; }
.tbl code { font-family: var(--sans); color: var(--ink); background: var(--paper-2); padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.pill {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0.1rem 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--text-secondary);
}
.pill.hit { background: var(--accent-tint); color: var(--accent); }
.pill.miss { background: var(--rust-tint); color: var(--rust); }
.pill.pending { background: transparent; color: var(--slate); box-shadow: inset 0 0 0 1px var(--border-mid); }
.pill.live { background: var(--ink); color: #fff; }
.more-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
}
.more-btn:hover { background: var(--ink); color: #fff; }

footer { background: var(--paper-2); border-top: 1px solid var(--rule); margin-top: 4rem; text-align: left; }
.footer-logo { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.footer-tagline { color: var(--text-secondary); font-size: 0.95rem; font-weight: 400; }
.footer-col-label { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.footer-col a { font-size: 0.95rem; color: var(--text-secondary); }
.footer-col a:hover { color: var(--accent); }
.footer-linkedin { font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0; color: var(--accent); }
.footer-linkedin:hover { color: #084F49; }
.footer-top { border-bottom: 1px solid var(--rule); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; padding-top: 1.25rem; font-size: 0.9rem; color: var(--slate); }
.footer-copy, .footer-disclaimer { color: var(--slate); font-size: 0.9rem; font-family: var(--sans); letter-spacing: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; }
.footer-legal-link { color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal-link:hover { color: var(--accent); }

@media (max-width: 1000px) {
  .ledger-head { display: none; }
  .mrow > summary {
    grid-template-columns: minmax(0, 1fr) auto 20px;
    grid-template-areas:
      "name price toggle"
      "gauge gauge gauge"
      "backtest backtest backtest";
    row-gap: 0.9rem;
    column-gap: 1rem;
    align-items: start;
  }
  .m-name { grid-area: name; }
  .m-price { grid-area: price; text-align: right; }
  .m-gauge { grid-area: gauge; }
  .m-backtest { grid-area: backtest; flex-direction: row; gap: 1.5rem; }
  .m-toggle { grid-area: toggle; margin-top: 0.6rem; }
  .how-grid { grid-template-columns: 1fr; gap: 2rem; }
  .dp-pair, .tr-explain { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 820px) {
  .scoreboard { grid-template-columns: 1fr; }
  .sb-item, .sb-item + .sb-item { padding: 1.1rem 0; border-left: 0; }
  .sb-item + .sb-item { border-top: 1px solid var(--rule); }
  .sb-link { padding: 1rem 0; border-top: 1px solid var(--rule); }
  .sb-note { max-width: none; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  main { padding: 2rem 0 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero-gauge { margin-top: 2.25rem; }
  .hg-edge { font-size: 1.15rem; }
  .hg-track { height: 120px; }
  nav .container { height: auto; padding: 0.6rem 20px 0; }
  nav a { height: 44px; padding: 0 2px; font-size: 0.9rem; }
  nav a::after { left: 2px; right: 2px; }
  nav ul { flex-wrap: wrap; justify-content: flex-start; gap: 0 1.1rem; }
  h2, .section-header h2 { font-size: 1.6rem; }
}

h1, h2, h3 { text-wrap: balance; }
footer p, .footer-tagline, .footer-legal-link, .footer-copy, .footer-disclaimer {
  font-family: var(--sans);
  letter-spacing: 0;
  font-size: 0.95rem;
  font-weight: 400;
}
.footer-legal-link, .footer-copy a { font-size: 0.9rem; }

.hero-gauge figcaption { margin-top: 2rem; }
@media (max-width: 768px) {
  nav ul { gap: 0 0.9rem; flex-wrap: nowrap; }
  nav a { font-size: 0.85rem; white-space: nowrap; }
}

.method-section h2 { margin-bottom: 1rem; }
@media (max-width: 480px) {
  nav ul { gap: 0 0.65rem; }
  nav a { font-size: 0.8rem; }
  .logo { font-size: 1.2rem; }
}
