/* ============================================================
   STRATA — data notes on AI markets
   Monochrome. Hairlines. Mono metadata. No images.
   ============================================================ */

/* Default is black. `html.light` switches to the paper edition. */
:root {
  --paper: #0a0a0a;
  --ink: #f4f4f0;
  --body: #c4c4be;
  --mute: #97978f;
  --faint: #7a7a73;
  --rule: #242423;
  --rule-strong: #3c3c39;
  --tint: #151514;
  --mark: #d1553f;          /* the only non-grey: a live dot */
  --max: 1240px;
  --gut: 40px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color-scheme: dark;
}

html.light {
  --paper: #fafaf8;
  --ink: #0b0b0b;
  --body: #2b2b29;
  --mute: #6f6f6a;
  --faint: #9c9c96;
  --rule: #dcdbd5;
  --rule-strong: #b8b7b0;
  --tint: #f1f0eb;
  --mark: #af3a2c;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .35s ease, color .35s ease;
}

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

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ------------------------------------------------------------
   Masthead
   ------------------------------------------------------------ */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.mark {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink);
  padding-right: .34em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a, .nav button {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mute);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .2s;
}

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

.nav .sep {
  width: 1px;
  height: 11px;
  background: var(--rule-strong);
}

/* ------------------------------------------------------------
   Shared type
   ------------------------------------------------------------ */
.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0;
}

.label .idx { color: var(--faint); }

h1, h2, h3, h4 { color: var(--ink); font-weight: 500; margin: 0; }

.display {
  font-size: clamp(34px, 5.6vw, 68px);
  line-height: 1.06;
  letter-spacing: -.028em;
  font-weight: 500;
}

.dek {
  font-size: 16px;
  line-height: 1.72;
  color: var(--body);
  max-width: 60ch;
  margin: 0;
}

.small { font-size: 13px; line-height: 1.65; color: var(--mute); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  padding: 84px 0 56px;
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 64px;
  align-items: start;
}

.hero .display { max-width: 19ch; }

.hero-meta {
  border-left: 1px solid var(--rule);
  padding-left: 28px;
  display: grid;
  gap: 18px;
}

.meta-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  align-items: baseline;
}

.meta-row dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.meta-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ulink {
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color .2s;
}

.ulink:hover { border-color: var(--ink); }

/* ------------------------------------------------------------
   Reading strip (key figures)
   ------------------------------------------------------------ */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
}

.strip-cell {
  padding: 30px 26px 30px 0;
  border-right: 1px solid var(--rule);
}

.strip-cell:last-child { border-right: 0; padding-right: 0; }
.strip-cell:not(:first-child) { padding-left: 26px; }

.strip-cell .k { display: block; margin-bottom: 12px; }

.strip-cell .v {
  display: block;
  font-family: var(--mono);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.strip-cell .n {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--mute);
}

/* table scroll wrapper */
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; max-width: 100%; }
.scroller::-webkit-scrollbar { height: 4px; }
.scroller::-webkit-scrollbar-thumb { background: var(--rule-strong); }

/* grid children must be allowed to shrink below their content width,
   otherwise wide tables push the whole column past the viewport */
.doc, .doc-main, .sec, .hero-grid > *, .article-lede > *,
.block-head > *, .stats, .strip, .rules, .foot-grid > * { min-width: 0; }

/* ------------------------------------------------------------
   Section frame
   ------------------------------------------------------------ */
.block { padding: 76px 0; border-bottom: 1px solid var(--rule); }

.block-head {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 40px;
  align-items: baseline;
  margin-bottom: 34px;
}

.block-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.02em;
  line-height: 1.2;
}

/* ------------------------------------------------------------
   Column index table
   ------------------------------------------------------------ */
.idx-table { width: 100%; border-collapse: collapse; }

.idx-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  text-align: left;
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--rule-strong);
}

.idx-table td {
  padding: 20px 16px 20px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
  font-size: 14px;
}

.idx-table tr.row-live { cursor: pointer; }
.idx-table tr.row-live:hover td { background: var(--tint); }
.idx-table td:last-child, .idx-table th:last-child { padding-right: 0; text-align: right; }

.idx-no { font-family: var(--mono); font-size: 11px; color: var(--faint); width: 54px; }

.idx-name {
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
}

.idx-name .cn {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--faint);
  margin-left: 12px;
  vertical-align: 2px;
}

.idx-desc { color: var(--mute); font-size: 13px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  padding: 3px 8px;
  white-space: nowrap;
}

.tag .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--mark);
}

.tag.dim { color: var(--faint); border-color: var(--rule); }
.tag.dim .dot { background: var(--faint); }

.idx-date { font-family: var(--mono); font-size: 11px; color: var(--mute); }

/* ------------------------------------------------------------
   Rules / method
   ------------------------------------------------------------ */
.rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}

.rule-item {
  padding: 26px 28px 26px 0;
  border-right: 1px solid var(--rule);
}

.rule-item:last-child { border-right: 0; padding-right: 0; }
.rule-item:not(:first-child) { padding-left: 28px; }

.rule-item h3 {
  font-size: 15px;
  letter-spacing: -.01em;
  margin: 14px 0 8px;
}

.rule-item p { margin: 0; font-size: 13.5px; color: var(--mute); line-height: 1.68; }

/* ------------------------------------------------------------
   Article (column page)
   ------------------------------------------------------------ */
.article-head {
  padding: 68px 0 44px;
  border-bottom: 1px solid var(--rule);
}

.article-head .label { margin-bottom: 22px; }

.article-title {
  font-size: clamp(52px, 8.6vw, 118px);
  line-height: .9;
  letter-spacing: -.05em;
  font-weight: 500;
  margin-bottom: 10px;
}

.article-cn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 30px;
}

.article-lede {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 64px;
  align-items: start;
  padding-top: 6px;
}

.article-lede .dek { font-size: 17px; }

/* layout: sticky index + content */
.doc {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.doc-rail {
  position: sticky;
  top: 88px;
  padding: 56px 0 0;
}

.rail-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }

.rail-list li { border-bottom: 1px solid var(--rule); }

.rail-list a {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0 11px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
  transition: color .2s, padding-left .25s;
}

.rail-list a .rn { color: var(--faint); font-size: 10px; min-width: 18px; transition: color .2s; }
.rail-list a:hover, .rail-list a.active { color: var(--ink); }
.rail-list a.active { padding-left: 10px; }
.rail-list a.active .rn { color: var(--mark); }
.rail-list a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 1px;
  background: var(--ink);
}

.rail-note {
  margin-top: 22px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
  max-width: 22ch;
}

.doc-main { padding: 56px 0 0; }

.sec { padding-bottom: 60px; margin-bottom: 60px; border-bottom: 1px solid var(--rule); scroll-margin-top: 90px; }
.sec:last-of-type { border-bottom: 0; }

.sec-head { margin-bottom: 24px; }

.sec-head .label { margin-bottom: 14px; }

.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -.03em;
  line-height: 1.14;
}

.sec-lede { font-size: 16px; line-height: 1.75; margin: 0 0 30px; max-width: 62ch; color: var(--body); }

.sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 34px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
}

/* stat grid */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
}

.stat {
  padding: 20px 24px 20px 0;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.stat:nth-child(odd) { padding-right: 24px; }
.stat:nth-child(even) { padding-left: 24px; border-right: 0; }

.stat .v {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat .v em { font-style: normal; font-size: 14px; color: var(--mute); margin-left: 4px; }

.stat .n { display: block; margin-top: 7px; font-size: 12.5px; color: var(--mute); line-height: 1.55; }

/* data table */
.dtable { width: 100%; border-collapse: collapse; margin-top: 4px; }

.dtable th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  text-align: left;
  padding: 0 14px 9px 0;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}

.dtable td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  vertical-align: baseline;
}

.dtable td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable td.k { color: var(--ink); }
.dtable td.dim { color: var(--mute); }
.dtable tbody tr:hover td { background: var(--tint); }

/* data sheet — the core component: dense rows, right-aligned numbers */
.sheet td, .sheet th { padding-top: 9px; padding-bottom: 9px; padding-right: 20px; }
.sheet th:last-child, .sheet td:last-child { padding-right: 0; }
.sheet td { font-size: 12.5px; }
.sheet th { font-size: 9px; }
.sheet .num { text-align: right; padding-right: 28px; }
.sheet .tcell { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--mute); white-space: nowrap; }
.sheet td.num:last-child, .sheet th.num:last-child { padding-right: 0; }
.sheet .idx-no { width: 36px; }
.dtable th.num { text-align: right; }

/* credibility tier chip */
.tier {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--rule-strong);
  padding: 0 5px;
  white-space: nowrap;
  vertical-align: 1.5px;
}
.tier.c { color: var(--ink); }
.tier.q { border-style: dashed; color: var(--faint); }

/* judgment block */
.judge {
  margin: 34px 0 0;
  padding: 2px 0 2px 20px;
  border-left: 1px solid var(--rule-strong);
  font-size: 14px;
  line-height: 1.75;
  color: var(--body);
  max-width: 62ch;
}

/* snapshot band */
.snap { padding-top: 44px; }
.snap .sheet td:nth-child(3),
.snap .sheet th:nth-child(3) { width: 124px; text-align: right; }
.snap .sheet td:nth-child(2),
.snap .sheet th:nth-child(2) { width: 210px; }

/* bar (hairline data viz) */
.bars { margin-top: 10px; }

.bar-row {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) 78px;
  gap: 16px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.bar-row .bl { font-size: 12.5px; color: var(--ink); }
.bar-row .bt { height: 9px; background: var(--tint); position: relative; }
.bar-row .bf { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.bar-row .bv { font-family: var(--mono); font-size: 11px; color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }

/* list */
.list { list-style: none; margin: 0; padding: 0; }

.list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.68;
}

.list li .ln { font-family: var(--mono); font-size: 10px; color: var(--faint); padding-top: 5px; }
.list li b { font-weight: 500; color: var(--ink); }

/* citation */
sup.cite {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  vertical-align: super;
  line-height: 0;
  margin-left: 2px;
  letter-spacing: 0;
}
sup.cite a { border-bottom: 0; }

/* notes */
.notes { padding: 0 0 70px; }

.notes ol { margin: 0; padding: 0 0 0 0; list-style: none; counter-reset: n; }

.notes li {
  counter-increment: n;
  position: relative;
  padding: 9px 0 9px 34px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.6;
  color: var(--mute);
}

.notes li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 9px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}

.notes li a { color: var(--mute); border-bottom: 1px solid var(--rule-strong); }
.notes li a:hover { color: var(--ink); }

/* footer */
.foot { border-top: 1px solid var(--rule); padding: 40px 0 64px; }

.foot-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
}

.foot p { margin: 0; font-size: 12px; color: var(--faint); line-height: 1.7; }
.foot .fmark { font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--ink); }

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

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 980px) {
  :root { --gut: 26px; }
  .hero-grid, .article-lede { grid-template-columns: 1fr; gap: 32px; }
  .hero-meta { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 22px; grid-template-columns: 1fr 1fr; }
  .doc { grid-template-columns: 1fr; gap: 0; }
  .doc-rail { position: static; padding: 34px 0 0; }
  .rail-note { display: none; }
  .rail-list { display: flex; flex-wrap: wrap; border-top: 0; gap: 0 18px; }
  .rail-list li { border-bottom: 0; }
  .doc-main { padding-top: 12px; }
  .block-head { grid-template-columns: 1fr; gap: 14px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip-cell:nth-child(2) { border-right: 0; }
  .strip-cell:nth-child(1), .strip-cell:nth-child(2) { border-bottom: 1px solid var(--rule); }
  .strip-cell:nth-child(3) { padding-left: 0; }
  .rules { grid-template-columns: 1fr; }
  .rule-item { border-right: 0; border-bottom: 1px solid var(--rule); padding: 22px 0; }
  .rule-item:not(:first-child) { padding-left: 0; }
}

@media (max-width: 620px) {
  .nav { gap: 15px; }
  .idx-table .col-desc, .idx-table .col-count { display: none; }
  .idx-table th:last-child, .idx-table td:last-child { display: none; }
  .idx-table { min-width: 380px; }
  .idx-table td, .idx-table th { padding-right: 12px; }
  .dtable { min-width: 440px; }
  .sheet { min-width: 620px; }
  /* five-column sheets need more room than the viewport gives them,
     otherwise the flexible column collapses into vertical text */
  .sheet.wide { min-width: 800px; }
  .sheet.xl { min-width: 1060px; }

  /* snapshot becomes a stacked list on phones instead of a wide sheet */
  .snap .sheet { min-width: 0; display: block; }
  .snap .sheet thead { display: none; }
  .snap .sheet tbody { display: block; }
  .snap .sheet tr { display: block; padding: 13px 0; border-bottom: 1px solid var(--rule); }
  .snap .sheet td { display: block; border: 0; padding: 0; font-size: 12px; }
  .snap .sheet td.idx-no { display: inline; width: auto; font-size: 10px; color: var(--faint); margin-right: 8px; }
  .snap .sheet td:nth-child(2) { display: inline; width: auto; font-size: 13px; }
  .snap .sheet td:nth-child(3) { width: auto; text-align: left; font-size: 21px; line-height: 1.2; margin: 6px 0 3px; }
  .snap .sheet td:nth-child(4) { font-size: 11.5px; color: var(--mute); line-height: 1.5; }
  .snap .sheet td:nth-child(5) { display: none; }
  .scroller {
    margin-right: -26px;
    padding-right: 26px;
    -webkit-mask-image: linear-gradient(to right, #000 84%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, #000 84%, rgba(0,0,0,0) 100%);
  }
  .hero { padding: 54px 0 40px; }
  .hero-meta { grid-template-columns: 1fr; }
  .strip-cell { padding: 22px 16px 22px 0; }
  .strip-cell:not(:first-child) { padding-left: 16px; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; padding-left: 0 !important; }
  .bar-row { grid-template-columns: 84px minmax(0, 1fr) 60px; gap: 10px; }
  .bar-row .bl { font-size: 11.5px; }
  .foot-grid { grid-template-columns: 1fr; align-items: start; }
}
