/* walkforward research — site styles */

:root {
  --paper:      #E9ECEB;
  --card:       #FFFFFF;
  --card-tint:  #DBE2E5;
  --deep:       #1B262A;
  --deep-2:     #223036;
  --ink:        #17211F;
  --ink-on-deep:#EEF1F0;
  --muted:      #5C6A6C;
  --muted-deep: #9FAEB1;
  --faint:      #8A979A;
  --line:       #C3CBCC;
  --line-strong:#9FAAAC;
  --line-deep:  #33454B;
  --accent:     #21645A;
  --accent-lift:#2E8474;
  --block:      #A6B2B6;
  --tile-bg:    #223036;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #121A1D;
    --card:       #1A2427;
    --card-tint:  #233137;
    --deep:       #090F11;
    --deep-2:     #162327;
    --ink:        #E6EAE9;
    --ink-on-deep:#EEF1F0;
    --muted:      #97A5A7;
    --muted-deep: #9FAEB1;
    --faint:      #6C7A7D;
    --line:       #2B3A3E;
    --line-strong:#3D5157;
    --line-deep:  #23343A;
    --accent:     #4FAD97;
    --accent-lift:#63C3AC;
    --block:      #4B5D63;
    --tile-bg:    #162327;
  }
}
:root[data-theme="dark"] {
  --paper:      #121A1D;
  --card:       #1A2427;
  --card-tint:  #233137;
  --deep:       #090F11;
  --deep-2:     #162327;
  --ink:        #E6EAE9;
  --ink-on-deep:#EEF1F0;
  --muted:      #97A5A7;
  --muted-deep: #9FAEB1;
  --faint:      #6C7A7D;
  --line:       #2B3A3E;
  --line-strong:#3D5157;
  --line-deep:  #23343A;
  --accent:     #4FAD97;
  --accent-lift:#63C3AC;
  --block:      #4B5D63;
  --tile-bg:    #162327;
}

* { 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(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.62;
}

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: 40rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-lift); }
:focus-visible { outline: 2px solid var(--accent-lift); outline-offset: 3px; }

/* ---------- shared type ---------- */
h1, h2, h3 {
  font-family: "Spectral", Georgia, serif;
  line-height: 1.15;
  text-wrap: balance;
  letter-spacing: -0.015em;
  margin: 0;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.1rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 1.95rem); font-weight: 600; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0.75rem 0; }
.lede { font-size: 1.14rem; color: var(--muted); }

.mono, .kicker, .chip, .stat-label, .legend, .foot, nav.site-nav a, table, .note-date {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mono, table { font-variant-numeric: tabular-nums; }

.kicker {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.9rem;
}
.chip {
  display: inline-block;
  background: var(--deep);
  color: var(--ink-on-deep);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
}

/* ---------- header ---------- */
header.site { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-bar {
  display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap;
  padding: 1rem 0;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand svg { display: block; }
.wordmark { font-family: "Spectral", Georgia, serif; font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; }
.wordmark .fwd { color: var(--accent); }
.wordmark .co {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 400; font-size: 0.6rem; letter-spacing: 0.3em;
  color: var(--faint); margin-left: 0.55rem; text-transform: uppercase;
}
nav.site-nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
nav.site-nav a {
  font-size: 0.78rem; letter-spacing: 0.06em; text-decoration: none;
  color: var(--muted); padding: 0.15rem 0; border-bottom: 2px solid transparent;
}
nav.site-nav a:hover { color: var(--ink); }
nav.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- dark hero ---------- */
.hero { background: var(--deep); color: var(--ink-on-deep); padding: 4.5rem 0 0; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 3rem; align-items: start;
}
.hero .kicker { color: var(--accent-lift); }
.hero h1 { color: #fff; }
.hero .lede { color: var(--muted-deep); max-width: 34rem; margin-top: 1.5rem; }
.hero-mark { justify-self: end; width: 100%; max-width: 23rem; }
.hero-mark svg { display: block; width: 100%; height: auto; }
.hero-mark .legend { color: var(--muted-deep); margin-top: 0.4rem; }
.hero-mark .key.train { background: #97A4A8; }
.hero-mark .key.test { background: #3E9C89; }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem; margin: 3.5rem 0 0; padding-bottom: 3.5rem;
}
.stat { background: var(--tile-bg); border: 1px solid var(--line-deep); padding: 1.05rem 1.15rem; }
.stat .v {
  font-family: "Spectral", Georgia, serif; font-weight: 600;
  font-size: 1.5rem; color: #fff; line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.63rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-deep); margin-top: 0.5rem; line-height: 1.45;
}

/* ---------- page head (inner pages) ---------- */
.page-head { padding: 3.2rem 0 0; }
.page-head .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap-reverse; }
.page-head h1 { margin-top: 1.4rem; }
.page-head .lede { margin-top: 1rem; max-width: 40rem; }

/* ---------- sections ---------- */
section.band { padding: 3.4rem 0; }
section.band + section.band { padding-top: 0; }
.page-head + section.band { padding-top: 2.4rem; }
section.band .panel:first-child { margin-top: 0; }
.section-head { max-width: 42rem; margin-bottom: 1.9rem; }
.section-head h2 + p { margin-top: 0.7rem; color: var(--muted); }

/* ---------- cards ---------- */
.cards { display: grid; gap: 1.1rem; }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.1rem; align-items: stretch; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.35rem 1.4rem 1.5rem;
}
.card.tint { background: var(--card-tint); border-color: var(--line-strong); }
.card h3 { margin-bottom: 0.7rem; }
.card > :last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.card.tint p { color: var(--ink); }

ul.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
ul.ticks li { position: relative; padding-left: 1.15rem; font-size: 0.97rem; color: var(--ink); }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 0.4rem; height: 0.4rem; background: var(--accent);
}

/* ---------- call-out panels: full border ---------- */
.panel {
  background: var(--card-tint);
  border: 1px solid var(--line-strong);
  padding: 1.3rem 1.45rem;
  margin: 2rem 0;
}
.panel > :last-child { margin-bottom: 0; }
.panel .kicker { color: var(--muted); margin-bottom: 0.6rem; }
.panel.invert {
  background: var(--deep);
  border-color: var(--line-deep);
  color: var(--ink-on-deep);
}
.panel.invert .kicker { color: var(--accent-lift); }
.panel.invert h3 { color: #fff; margin-bottom: 1rem; }
.panel.invert a { color: var(--accent-lift); }
.panel.invert ul.ticks li { color: var(--muted-deep); }
.panel.invert ul.ticks li::before { background: var(--accent-lift); }

/* ---------- diagram ---------- */
.diagram-card { padding: 1.5rem 1.5rem 1.3rem; }
.diagram-card svg { display: block; width: 100%; height: auto; }
.legend { display: grid; gap: 0.5rem; margin-top: 1.1rem; font-size: 0.74rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.6rem; }
.key { width: 1.5rem; height: 0.75rem; display: inline-block; flex: none; }
.key.train { background: var(--block); }
.key.test { background: var(--accent); }
.caption { font-size: 0.88rem; color: var(--muted); font-style: italic; margin-top: 1rem; }

/* stair animation */
.stair rect { opacity: 0; animation: step-in 0.55s ease-out forwards; }
.stair rect:nth-child(1) { animation-delay: 0.05s; }
.stair rect:nth-child(2) { animation-delay: 0.20s; }
.stair rect:nth-child(3) { animation-delay: 0.35s; }
.stair rect:nth-child(4) { animation-delay: 0.55s; }
.stair rect:nth-child(5) { animation-delay: 0.70s; }
.stair rect:nth-child(6) { animation-delay: 0.85s; }
.stair rect:nth-child(7) { animation-delay: 0.70s; }
.stair rect:nth-child(8) { animation-delay: 0.85s; }
.stair rect:nth-child(9) { animation-delay: 1.00s; }
@keyframes step-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .stair rect { opacity: 1; animation: none; }
}

/* ---------- table ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th {
  font-weight: 500; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.09em; font-size: 0.66rem; background: var(--card-tint);
  border-bottom-color: var(--line-strong);
}
tr:last-child td { border-bottom: none; }
td.empty {
  white-space: normal; color: var(--muted);
  font-family: "Source Serif 4", Georgia, serif; font-size: 0.97rem;
  padding: 1.4rem 1.1rem; line-height: 1.6;
}

/* ---------- notes ---------- */
.note-date { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.note-card h2 { margin: 0.85rem 0 0.4rem; font-size: 1.55rem; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); margin-top: 4.5rem; }
.foot-rule { height: 2px; background: var(--line); position: relative; }
.foot-rule::after { content: ""; position: absolute; right: 0; top: 0; width: 9rem; height: 2px; background: var(--accent); }
.foot {
  padding: 1.5rem 0 2.6rem; font-size: 0.7rem; letter-spacing: 0.09em;
  color: var(--faint); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.foot a { color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .hero-mark { justify-self: start; max-width: 24rem; }
  .split, .cards.c3, .cards.c2 { grid-template-columns: 1fr; }
}
@media (max-width: 34rem) {
  .stats { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  .foot { flex-direction: column; gap: 0.4rem; }
}

/* ================= ledger components ================= */



.record-summary {
  font-size: 0.82rem; letter-spacing: 0.04em; color: var(--muted);
  margin: 0 0 0.9rem; padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

/* ledger table */
table.ledger { font-size: 0.78rem; }
table.ledger th { white-space: nowrap; }
table.ledger td { vertical-align: top; }
table.ledger td.claim {
  white-space: normal; min-width: 17rem;
  font-family: "Source Serif 4", Georgia, serif; font-size: 0.95rem; line-height: 1.45;
}
table.ledger td.claim a { color: var(--ink); text-decoration-color: var(--line-strong); }
table.ledger td.claim a:hover { color: var(--accent); }
table.ledger td.bench { white-space: normal; min-width: 11rem; color: var(--muted); }
table.ledger td.num { white-space: nowrap; }
table.ledger .sched { color: var(--faint); }

.status { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.status .glyph { width: 21px; height: 16px; flex: none; }
.status.s-withdrawn > span:last-child { color: var(--muted); }

/* the four series */
.series { display: grid; gap: 0; border-top: 1px solid var(--line); }
.series-row {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.4rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.series-row h3 { font-size: 1.08rem; }
.series-row p { margin: 0; color: var(--muted); font-size: 0.97rem; }

.band h2 { margin-bottom: 1.3rem; }
.panel { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }


@media (max-width: 46rem) {
  .series-row { grid-template-columns: 1fr; gap: 0.3rem; }
  }

/* ledger table — fit six columns without horizontal scroll on desktop */
table.ledger { font-size: 0.75rem; }
table.ledger th, table.ledger td { padding: 0.7rem 0.7rem; }
table.ledger th:first-child, table.ledger td:first-child { padding-left: 1rem; }
table.ledger th:last-child, table.ledger td:last-child { padding-right: 1rem; }
table.ledger td.claim { min-width: 13rem; font-size: 0.92rem; }
table.ledger td.bench { min-width: 7.5rem; font-size: 0.72rem; }
table.ledger td:nth-child(2) { white-space: normal; min-width: 5.5rem; }
table.ledger td.num, table.ledger th:nth-child(4), table.ledger th:nth-child(5) { font-size: 0.72rem; }
table.ledger .sched { display: block; }
.status { gap: 0.4rem; }

/* full-site ledger tweaks */
.wrap { max-width: 64rem; }
.record-summary { font-size: 0.82rem; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.9rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.statuses { display: grid; gap: 0.7rem; margin: 0.4rem 0 1rem; }
.statuses .status { gap: 0.7rem; white-space: normal; }
.statuses .status > span:last-child { font-size: 0.95rem; }
.hero h1 { max-width: 15ch; }

/* long mono addresses must wrap inside their card */
.card a.mono, .card .mono { font-size: 0.83rem; overflow-wrap: anywhere; }
/* centre the mark against the headline block */
.hero-grid { align-items: center; }
