/* The Trading Index - data-terminal index board. Light theme. Chivo + Chivo Mono. */

:root {
  /* Cool near-white surface, near-black ink */
  --bg: oklch(0.981 0.004 250);
  --surface: oklch(1 0 0);
  --panel: oklch(0.965 0.006 250);
  --panel-2: oklch(0.945 0.008 250);
  --ink: oklch(0.22 0.02 262);
  --ink-2: oklch(0.42 0.02 262);
  --ink-3: oklch(0.56 0.02 262);
  --line: oklch(0.905 0.008 255);
  --line-strong: oklch(0.84 0.01 255);
  --accent: oklch(0.55 0.20 250);
  --accent-ink: oklch(0.485 0.20 255);
  --accent-soft: oklch(0.55 0.20 250 / 0.10);
  --pos: oklch(0.62 0.16 155);
  --pos-deep: oklch(0.42 0.10 155);
  --pos-soft: oklch(0.62 0.16 155 / 0.12);

  --mono: "Chivo Mono", ui-monospace, monospace;
  --sans: "Chivo", system-ui, -apple-system, sans-serif;

  --wrap: 1200px;
  --r: 10px;
  --r-sm: 6px;

  --z-sticky: 100;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* fine grid texture, terminal feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, oklch(0.5 0.02 255 / 0.035) 1px, transparent 1px);
  background-size: 64px 100%;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.25rem); }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.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;
}

.skip {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 0 0 var(--r-sm) 0;
  font-family: var(--mono); font-size: 0.8rem;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- Monogram chips ---------- */
.chip {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; flex: 0 0 auto;
  background: var(--ink); color: var(--surface);
  border-radius: var(--r-sm);
  font-family: var(--mono); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.02em; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12);
}
.chip--lead { background: var(--pos-deep); color: oklch(0.97 0.03 155); }
.chip--lg { width: 3rem; height: 3rem; font-size: 1rem; border-radius: var(--r); }

/* ---------- Sticky board strip ---------- */
.board {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: oklch(0.20 0.02 262);
  color: oklch(0.96 0.005 255);
  border-bottom: 1px solid oklch(1 0 0 / 0.10);
}
.board__row {
  display: flex; align-items: stretch; gap: 0;
  min-height: 52px;
}
.board__id {
  display: flex; align-items: center; gap: 0.6rem;
  padding-right: 1.25rem; margin-right: 1.25rem;
  border-right: 1px solid oklch(1 0 0 / 0.12);
  flex: 0 0 auto;
}
.board__mark {
  display: inline-flex; align-items: flex-end; gap: 2px; height: 18px;
}
.board__mark i {
  display: block; width: 4px; border-radius: 1px; background: oklch(0.96 0.005 255 / 0.6);
}
.board__mark i:nth-child(1) { height: 8px; }
.board__mark i:nth-child(2) { height: 13px; }
.board__mark i:nth-child(3) { height: 18px; background: var(--pos); }
.board__name { font-family: var(--mono); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em; white-space: nowrap; }
.board__name b { color: oklch(0.96 0.005 255); }
.board__name span { color: oklch(0.72 0.01 255); }

.board__ticker {
  flex: 1 1 auto; overflow: hidden; position: relative;
  display: flex; align-items: center;
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
.ticker__track {
  display: flex; gap: 0; white-space: nowrap; flex: 0 0 auto;
  animation: ticker 34s linear infinite;
}
.ticker__item {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.01em;
  padding-inline: 1.15rem; color: oklch(0.78 0.01 255);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.ticker__item b { color: oklch(0.96 0.005 255); font-weight: 500; }
.ticker__item .up { color: var(--pos); }
.ticker__item .val { color: oklch(0.72 0.14 250); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .board__ticker { mask-image: none; -webkit-mask-image: none; }
}

.board__updated {
  flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem;
  padding-left: 1.25rem; margin-left: 1.25rem;
  border-left: 1px solid oklch(1 0 0 / 0.12);
  font-family: var(--mono); font-size: 0.72rem; color: oklch(0.78 0.01 255);
}
.board__updated .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }

@media (max-width: 860px) {
  .board__ticker { display: none; }
  .board__id { border-right: 0; margin-right: auto; padding-right: 0; }
}

/* ---------- Hero ---------- */
.hero { position: relative; z-index: 1; padding: clamp(2.75rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.hero__kicker {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem;
}
.hero__kicker::before { content: ""; width: 1.75rem; height: 2px; background: var(--accent); }
.hero__title {
  font-size: clamp(2.35rem, 6.2vw, 4.5rem);
  letter-spacing: -0.035em; max-width: 15ch;
}
.hero__title em { font-style: normal; color: var(--accent-ink); }
.hero__lede {
  margin-top: 1.35rem; max-width: 62ch; font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--ink-2); text-wrap: pretty; line-height: 1.6;
}

.hero__stats {
  margin-top: 2.25rem; display: grid; gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.stat { background: var(--surface); padding: 1rem 1.15rem; }
.stat dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.stat dd { margin: 0.35rem 0 0; font-family: var(--mono); font-weight: 700; font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: -0.02em; }
.stat dd span { font-size: 0.9rem; color: var(--ink-3); font-weight: 400; }
.stat--lead dd { color: var(--pos-deep); }
@media (max-width: 680px) { .hero__stats { grid-template-columns: repeat(2, 1fr); } }

.hero__note {
  margin-top: 1.35rem; font-family: var(--mono); font-size: 0.74rem; line-height: 1.55;
  color: var(--ink-3); max-width: 74ch;
}

/* ---------- Section frame ---------- */
section { position: relative; z-index: 1; }
.sec { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.sec__head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.sec__tag { font-family: var(--mono); font-size: 0.74rem; color: var(--accent-ink); letter-spacing: 0.04em; }
.section-h { font-size: clamp(1.55rem, 3.4vw, 2.25rem); letter-spacing: -0.03em; }
.sec__lede { color: var(--ink-2); max-width: 68ch; margin-top: 0.85rem; text-wrap: pretty; }

/* ---------- Ranked data table ---------- */
.table-wrap {
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.board-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.board-table caption { text-align: left; }

.board-table thead th {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; text-align: left;
  padding: 0.75rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.board-table th.r, .board-table td.r { text-align: right; }
.board-table tbody td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-table tbody tr:hover td { background: var(--panel); }
.board-table tbody tr.lead td { background: var(--pos-soft); }
.board-table tbody tr.lead:hover td { background: oklch(0.62 0.16 155 / 0.16); }

.rank { font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--ink-3); }
.lead .rank { color: var(--pos-deep); }
.rank .badge {
  display: block; margin-top: 0.2rem; font-size: 0.6rem; letter-spacing: 0.06em;
  color: var(--pos-deep); font-weight: 700;
}

.co { display: flex; align-items: center; gap: 0.7rem; }
.co__name { font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.co__name a { color: inherit; }
.lead .co__name { font-size: 1.02rem; }

.cell-sub { color: var(--ink-2); font-size: 0.92rem; }
.reg { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; }
.instr { font-family: var(--mono); font-size: 0.85rem; }

/* score + meter (signature component) */
.scorecell { display: flex; align-items: center; gap: 0.7rem; justify-content: flex-end; min-width: 168px; }
.meter {
  position: relative; width: 92px; height: 8px; border-radius: 99px;
  background: var(--panel-2); overflow: hidden; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px var(--line);
}
.meter > i {
  position: absolute; inset: 0 auto 0 0; height: 100%; width: var(--v);
  border-radius: 99px; background: var(--accent);
  transform: scaleX(1); transform-origin: left center;
  animation: meter-grow 1.05s var(--ease) both; animation-delay: var(--d, 0s);
}
.meter--lead > i { background: linear-gradient(90deg, var(--pos), oklch(0.68 0.17 150)); }
@keyframes meter-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .meter > i { animation: none; transform: scaleX(1); } }

.score { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; min-width: 2.6ch; text-align: right; }
.score--lead { color: var(--pos-deep); }
.score small { font-size: 0.68rem; color: var(--ink-3); font-weight: 400; }

.table-foot { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); margin-top: 1rem; line-height: 1.55; }

/* ---------- Methodology ---------- */
.method__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 820px) { .method__grid { grid-template-columns: 1fr; } }
.method__intro p { color: var(--ink-2); margin-top: 0.9rem; text-wrap: pretty; }
.method__intro p + p { margin-top: 0.9rem; }
.weights { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.weights li { padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.weights li:last-child { border-bottom: 0; }
.weights__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.weights__top b { font-weight: 700; letter-spacing: -0.01em; }
.weights__pct { font-family: var(--mono); font-weight: 700; color: var(--accent-ink); font-size: 1.05rem; }
.weights li p { margin-top: 0.4rem; color: var(--ink-2); font-size: 0.92rem; }
.wbar { margin-top: 0.7rem; height: 6px; border-radius: 99px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.wbar > i { display: block; height: 100%; width: var(--v); background: var(--accent); border-radius: 99px; transform-origin: left; animation: meter-grow 1s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .wbar > i { animation: none; } }

/* ---------- Reviews ---------- */
.reviews { display: grid; gap: 1.1rem; }
.entry {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.entry--lead { border-color: var(--pos); box-shadow: 0 0 0 1px var(--pos), 0 12px 32px oklch(0.62 0.16 155 / 0.10); }
.entry__head { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.entry__rankno { font-family: var(--mono); font-weight: 700; font-size: 0.8rem; color: var(--ink-3); padding: 0.2rem 0.5rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.entry--lead .entry__rankno { color: var(--pos-deep); border-color: var(--pos); }
.entry__title { display: flex; flex-direction: column; gap: 0.15rem; margin-right: auto; }
.entry__title h3 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); letter-spacing: -0.02em; }
.entry__for { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-2); letter-spacing: 0.01em; }
.entry__score { text-align: right; }
.entry__score b { font-family: var(--mono); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.03em; display: block; }
.entry--lead .entry__score b { color: var(--pos-deep); }
.entry__score span { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); }

.entry__body { margin-top: 1.15rem; color: var(--ink-2); text-wrap: pretty; max-width: 74ch; }
.entry__body p + p { margin-top: 0.85rem; }
.entry__body strong { color: var(--ink); }

.entry__cols { margin-top: 1.35rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.35rem; }
@media (max-width: 640px) { .entry__cols { grid-template-columns: 1fr; } }
.entry__cols h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.6rem; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ledger li { position: relative; padding-left: 1.4rem; font-size: 0.92rem; color: var(--ink-2); line-height: 1.5; }
.ledger li::before { position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 0.8rem; font-weight: 700; }
.ledger--plus li::before { content: "+"; color: var(--pos-deep); }
.ledger--note li::before { content: "!"; color: var(--accent-ink); }

/* scorecard */
.scorecard { margin-top: 1.5rem; padding-top: 1.35rem; border-top: 1px solid var(--line); display: grid; gap: 0.65rem; }
.scorecard--compact { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.65rem 1.5rem; }
.metric { display: grid; grid-template-columns: 1fr 92px 2.6ch; align-items: center; gap: 0.7rem; }
.metric > span { font-size: 0.85rem; color: var(--ink-2); }
.metric > b { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; text-align: right; }

.cta {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 500;
  padding: 0.7rem 1.1rem; border-radius: var(--r-sm);
  background: var(--ink); color: var(--surface);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.cta:hover { text-decoration: none; background: var(--accent); transform: translateY(-1px); }
.entry--lead .cta { background: var(--pos-deep); }
.entry--lead .cta:hover { background: var(--pos); }
.cta span { transition: transform 0.2s var(--ease); }
.cta:hover span { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .cta, .cta span { transition: none; } }

/* ---------- FAQ ---------- */
.faq__list { display: grid; gap: 0.6rem; }
.faq__list details {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 0 1.15rem;
}
.faq__list summary {
  cursor: pointer; list-style: none; padding: 1.05rem 0; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "+"; font-family: var(--mono); font-weight: 700; color: var(--accent-ink); font-size: 1.2rem; flex: 0 0 auto;
}
.faq__list details[open] summary::after { content: "\2212"; }
.faq__list details p { padding: 0 0 1.15rem; color: var(--ink-2); max-width: 74ch; text-wrap: pretty; margin-top: -0.2rem; }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 1; margin-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--line-strong); background: var(--panel); }
.foot__in { padding: clamp(2rem, 5vw, 3rem) 0; }
.foot__disc { font-size: 0.86rem; color: var(--ink-2); max-width: 90ch; line-height: 1.6; text-wrap: pretty; }
.foot__disc strong { color: var(--ink); }
.foot__meta { margin-top: 1.15rem; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.01em; }
