:root {
  --ink: #102631;
  --ink-soft: #3c515a;
  --muted: #76858b;
  --paper: #f4f0e8;
  --paper-deep: #e9e2d5;
  --white: #fffdf8;
  --lime: #d9e995;
  --lime-deep: #aabd68;
  --coral: #d66d55;
  --rust: #a84e40;
  --blue: #5d91ad;
  --blue-pale: #dbeaf0;
  --line: rgba(16, 38, 49, 0.14);
  --line-strong: rgba(16, 38, 49, 0.26);
  --shadow: 0 18px 55px rgba(36, 46, 44, 0.10);
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 87% 7%, rgba(217, 233, 149, 0.28), transparent 31rem),
    radial-gradient(circle at 7% 48%, rgba(93, 145, 173, 0.09), transparent 28rem),
    var(--paper);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.65rem 0.9rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-shell { overflow: hidden; }

.site-header,
main,
.site-footer {
  width: min(1270px, calc(100% - 72px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 0.8rem; }
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.22rem;
  letter-spacing: -0.04em;
}
.brand small {
  display: block;
  margin-top: -0.16rem;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  line-height: 1;
  text-transform: uppercase;
}
.brand-mark { display: inline-flex; align-items: end; gap: 3px; width: 28px; height: 28px; }
.brand-mark i { display: block; width: 6px; border-radius: 5px 5px 1px 1px; background: var(--ink); }
.brand-mark i:nth-child(1) { height: 13px; opacity: 0.52; }
.brand-mark i:nth-child(2) { height: 23px; background: var(--coral); }
.brand-mark i:nth-child(3) { height: 18px; background: var(--blue); }

.main-nav { display: flex; gap: 2rem; margin-left: auto; margin-right: 2.3rem; }
.main-nav a { position: relative; color: var(--ink-soft); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -0.45rem; height: 1px; background: var(--coral); transition: right 220ms ease; }
.main-nav a:hover::after, .main-nav a:focus-visible::after { right: 0; }
.release-stamp { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.61rem; letter-spacing: 0.13em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-deep); box-shadow: 0 0 0 4px rgba(170, 189, 104, 0.16); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(390px, 0.94fr);
  align-items: center;
  min-height: 535px;
  padding: 4.7rem 0 3.6rem;
}
.hero-copy { position: relative; z-index: 1; padding-left: clamp(0rem, 2.6vw, 2.7rem); }
.eyebrow, .section-kicker { margin: 0 0 1.15rem; color: var(--coral); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.eyebrow span { padding-inline: 0.36rem; color: var(--ink-soft); }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: -0.055em; }
h1 { max-width: 720px; font-size: clamp(3.7rem, 7.4vw, 7.1rem); line-height: 0.91; }
h1 em, h2 em { color: var(--rust); font-style: normal; }
.hero-lede { max-width: 540px; margin: 2rem 0 1.9rem; color: var(--ink-soft); font-family: var(--display); font-size: 1.12rem; line-height: 1.5; }
.hero-actions { display: flex; align-items: center; gap: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; min-height: 45px; padding: 0.7rem 1.15rem; border: 1px solid transparent; font-size: 0.71rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.button:hover, .button:focus-visible { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(16, 38, 49, 0.15); }
.button-dark { color: var(--white); background: var(--ink); }
.button-dark span { color: var(--lime); font-size: 1.1rem; }
.hero-note { display: flex; align-items: center; gap: 0.65rem; color: var(--muted); font-size: 0.67rem; }
.hero-note .line { display: block; width: 27px; height: 1px; background: var(--coral); }

.hero-ledger { position: relative; min-height: 390px; }
.ledger-top { position: absolute; top: 1.25rem; left: 8%; right: 7%; display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: 0.57rem; letter-spacing: 0.12em; }
.ledger-orbit { position: absolute; border: 1px solid rgba(16, 38, 49, 0.18); border-radius: 50%; }
.orbit-a { top: 17%; left: 17%; width: 68%; height: 49%; border-color: rgba(214, 109, 85, 0.45); transform: rotate(-24deg); }
.orbit-b { top: 11%; left: 30%; width: 42%; height: 75%; border-color: rgba(93, 145, 173, 0.48); transform: rotate(59deg); }
.hero-ledger::before { content: ""; position: absolute; top: 30%; left: 34%; width: 31%; height: 31%; border-radius: 50%; background: radial-gradient(circle at 32% 27%, #f7f6c5, var(--lime) 47%, #aabd68 100%); box-shadow: 0 24px 60px rgba(143, 164, 84, 0.29); }
.hero-ledger::after { content: ""; position: absolute; top: 36%; left: 41%; width: 17%; height: 17%; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 13px rgba(16, 38, 49, 0.07), 0 0 0 26px rgba(16, 38, 49, 0.035); }
.ledger-core { position: absolute; z-index: 2; top: 39%; left: 42%; width: 16%; text-align: center; color: var(--white); }
.ledger-core span { display: block; color: var(--lime); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase; }
.ledger-core strong { display: block; margin-top: 0.3rem; font-family: var(--display); font-size: clamp(1.8rem, 3.2vw, 3rem); font-weight: 400; line-height: 0.9; }
.ledger-core small { display: block; margin-top: 0.4rem; color: rgba(255, 253, 248, 0.68); font-family: var(--mono); font-size: 0.5rem; line-height: 1.3; }
.ledger-layer { position: absolute; z-index: 3; display: grid; grid-template-columns: auto auto; column-gap: 0.42rem; align-items: baseline; color: var(--ink); font-family: var(--mono); font-size: 0.56rem; line-height: 1.2; text-transform: uppercase; }
.ledger-layer b { color: var(--coral); font-weight: 500; }
.ledger-layer span { color: var(--ink-soft); }
.ledger-layer strong { grid-column: 2; margin-top: 0.22rem; color: var(--rust); font-family: var(--display); font-size: 1.4rem; font-weight: 400; letter-spacing: -0.06em; }
.layer-assoc { top: 16%; right: 4%; }
.layer-rcs { right: 7%; bottom: 16%; }
.layer-roc { bottom: 7%; left: 18%; }

.release-strip { display: grid; grid-template-columns: 1.42fr repeat(3, 1fr) 0.8fr; align-items: stretch; min-height: 100px; border-block: 1px solid var(--line); }
.strip-intro, .strip-stat, .strip-end { padding: 1.1rem 1.25rem; }
.strip-intro { display: flex; flex-direction: column; justify-content: center; }
.strip-intro span { color: var(--coral); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; }
.strip-intro strong { margin-top: 0.28rem; font-family: var(--display); font-size: 1.3rem; font-weight: 400; letter-spacing: -0.04em; }
.strip-stat { display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.strip-stat strong { font-family: var(--display); font-size: 2.2rem; font-weight: 400; letter-spacing: -0.06em; line-height: 1; }
.strip-stat span { margin-top: 0.35rem; color: var(--muted); font-size: 0.65rem; }
.strip-end { display: flex; align-items: center; justify-content: flex-end; gap: 0.55rem; border-left: 1px solid var(--line); color: var(--rust); font-family: var(--display); font-size: 1.7rem; line-height: 0.9; text-align: right; }
.strip-end small { color: var(--muted); font-family: var(--mono); font-size: 0.54rem; line-height: 1.35; text-transform: uppercase; }

.section { padding: 7.4rem 0 0; }
.section-kicker { padding-top: 0.25rem; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 3rem; margin-bottom: 2.35rem; }
.section-heading h2 { font-size: clamp(2.65rem, 5vw, 4.8rem); line-height: 0.95; }
.section-heading p { max-width: 425px; margin: 0 0 0.28rem; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.7; }
.scope-note { display: flex; gap: 0.65rem; margin: 0.45rem 0 0.22rem; color: var(--ink-soft); font-family: var(--mono); font-size: 0.59rem; line-height: 1.6; text-align: right; }
.scope-rule { display: block; width: 25px; height: 1px; margin-top: 0.55rem; background: var(--coral); }

.card-surface { border: 1px solid rgba(16, 38, 49, 0.13); background: rgba(255, 253, 248, 0.78); box-shadow: var(--shadow); }
.layer-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.layer-tab { display: inline-flex; align-items: center; gap: 0.65rem; padding: 0.85rem 1.1rem; border: 1px solid var(--line); color: var(--ink-soft); background: transparent; font-family: var(--mono); font-size: 0.69rem; transition: color 160ms ease, background 160ms ease, border 160ms ease, transform 160ms ease; }
.layer-tab span { color: var(--coral); font-size: 0.58rem; }
.layer-tab:hover, .layer-tab:focus-visible { border-color: var(--ink); transform: translateY(-1px); }
.layer-tab.active { color: var(--white); background: var(--ink); border-color: var(--ink); }
.layer-tab.active span { color: var(--lime); }

.control-deck { display: flex; align-items: end; gap: 0.8rem; padding: 0.95rem; }
.control-group { display: grid; gap: 0.3rem; }
.control-group label { color: var(--muted); font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase; }
.control-group select, .control-group input { min-height: 37px; padding: 0.5rem 0.65rem; border: 1px solid var(--line); outline: none; color: var(--ink); background: rgba(255, 253, 248, 0.72); font-size: 0.7rem; }
.control-group select:focus, .control-group input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(214, 109, 85, 0.12); }
.control-group select { min-width: 148px; }
.control-search { flex: 1; }
.control-search input { width: 100%; }
.control-page select { min-width: 68px; }
.export-button { min-height: 37px; margin-left: auto; padding: 0.5rem 0.75rem; border: 1px solid var(--coral); color: var(--rust); background: transparent; font-family: var(--mono); font-size: 0.61rem; white-space: nowrap; transition: color 160ms ease, background 160ms ease; }
.export-button:hover, .export-button:focus-visible { color: var(--white); background: var(--coral); }

.result-overview { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; }
.result-overview > div:first-child { display: flex; align-items: baseline; gap: 0.55rem; }
.result-overview strong { color: var(--rust); font-family: var(--display); font-size: 1.65rem; font-weight: 400; letter-spacing: -0.05em; }
.result-overview span { color: var(--muted); font-family: var(--mono); font-size: 0.6rem; }
.result-legend { color: var(--muted); font-family: var(--mono); font-size: 0.58rem; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin: 0 0.28rem 0 0.75rem; border-radius: 50%; vertical-align: 1px; }
.legend-dot:first-child { margin-left: 0; }
.legend-dot.coral { background: var(--coral); }
.legend-dot.blue { background: var(--blue); }

.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.result-table-shell { min-width: 0; overflow: hidden; }
.table-scroll { max-height: 690px; overflow: auto; scrollbar-color: var(--lime-deep) rgba(16, 38, 49, 0.08); }
.result-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.result-table th { position: sticky; z-index: 1; top: 0; padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--line-strong); color: var(--muted); background: #f8f5ed; font-family: var(--mono); font-size: 0.56rem; font-weight: 500; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.result-table td { padding: 0.8rem 0.75rem; border-top: 1px solid var(--line); font-size: 0.73rem; vertical-align: top; }
.result-table tbody tr { transition: background 150ms ease; }
.result-table tbody tr:hover { background: rgba(217, 233, 149, 0.18); }
.result-table tbody tr.is-significant { background: rgba(214, 109, 85, 0.055); }
.result-table tbody tr.is-significant:hover { background: rgba(214, 109, 85, 0.11); }
.database-cell { color: var(--coral); font-family: var(--mono); font-size: 0.62rem !important; font-weight: 700; white-space: nowrap; }
.main-cell { min-width: 155px; max-width: 230px; font-family: var(--display); font-size: 0.96rem !important; line-height: 1.1; }
.main-cell .sub-cell, .database-cell .sub-cell { display: block; }
.sub-cell { margin-top: 0.24rem; color: var(--muted); font-family: var(--body); font-size: 0.61rem; font-weight: 400; line-height: 1.35; }
.numeric { color: var(--ink-soft); font-family: var(--mono); font-size: 0.64rem !important; white-space: nowrap; }
.numeric.positive { color: var(--rust); }
.numeric.negative { color: var(--blue); }
.q-cell { color: var(--ink); }
.star { display: inline-block; margin-left: 0.25rem; color: var(--coral); font-size: 0.82rem; }
.frame-cell { min-width: 190px; max-width: 250px; color: var(--ink-soft); font-size: 0.66rem !important; line-height: 1.35; }
.frame-cell .sub-cell { font-size: 0.57rem; }
.empty-cell { padding: 2.8rem !important; color: var(--muted); text-align: center; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 55px; padding: 0.65rem 0.85rem; border-top: 1px solid var(--line); }
.pager-summary { color: var(--muted); font-family: var(--mono); font-size: 0.57rem; }
.pager-actions { display: flex; align-items: center; gap: 0.4rem; }
.pager button { min-width: 30px; min-height: 29px; padding: 0.2rem 0.45rem; border: 1px solid var(--line); color: var(--ink-soft); background: transparent; font-family: var(--mono); font-size: 0.62rem; }
.pager button:hover:not(:disabled), .pager button:focus-visible:not(:disabled) { border-color: var(--ink); color: var(--white); background: var(--ink); }
.pager button:disabled { cursor: not-allowed; opacity: 0.35; }
.pager-current { padding-inline: 0.35rem; color: var(--ink); font-family: var(--mono); font-size: 0.6rem; }

.result-rail { position: sticky; top: 1.3rem; padding: 1.2rem; background: var(--ink); color: var(--white); box-shadow: var(--shadow); }
.rail-kicker { color: var(--lime); font-family: var(--mono); font-size: 0.57rem; letter-spacing: 0.13em; text-transform: uppercase; }
.rail-title { margin: 1.55rem 0 0.4rem; font-family: var(--display); font-size: 2.25rem; font-weight: 400; letter-spacing: -0.06em; line-height: 0.95; }
.rail-copy { margin: 0 0 1.35rem; color: rgba(255, 253, 248, 0.68); font-size: 0.7rem; line-height: 1.55; }
.rail-total { display: flex; align-items: baseline; justify-content: space-between; padding: 0.75rem 0; border-block: 1px solid rgba(255, 253, 248, 0.19); }
.rail-total strong { color: var(--lime); font-family: var(--display); font-size: 1.8rem; font-weight: 400; letter-spacing: -0.05em; }
.rail-total span { color: rgba(255, 253, 248, 0.5); font-family: var(--mono); font-size: 0.55rem; text-transform: uppercase; }
.rail-bars { display: grid; gap: 0.78rem; padding-top: 1.1rem; }
.rail-bar { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 0.48rem; font-family: var(--mono); font-size: 0.56rem; }
.rail-bar-label { color: rgba(255, 253, 248, 0.7); }
.rail-track { height: 5px; background: rgba(255, 253, 248, 0.12); }
.rail-fill { height: 100%; background: var(--coral); }
.rail-bar-value { color: var(--lime); }
.rail-foot { display: block; margin-top: 1.15rem; color: rgba(255, 253, 248, 0.42); font-family: var(--mono); font-size: 0.54rem; line-height: 1.5; }

.reading-section { padding-bottom: 6.8rem; }
.reading-grid { display: grid; grid-template-columns: 1.1fr repeat(3, 1fr); gap: 0; border-block: 1px solid var(--line); }
.reading-lead, .reading-card { min-height: 220px; padding: 1.35rem 1.4rem 1.5rem; }
.reading-card { border-left: 1px solid var(--line); }
.reading-lead h2 { font-size: 3.4rem; line-height: 0.93; }
.reading-lead p { max-width: 270px; margin: 1.2rem 0 0; color: var(--ink-soft); font-size: 0.75rem; line-height: 1.6; }
.reading-card > span { color: var(--coral); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.12em; }
.reading-card h3 { margin: 2.6rem 0 0.6rem; font-size: 1.45rem; line-height: 1; }
.reading-card p { margin: 0; color: var(--ink-soft); font-size: 0.7rem; line-height: 1.55; }

.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 0.56rem; }
.site-footer strong { display: block; color: var(--ink); font-family: var(--display); font-size: 1rem; font-weight: 400; letter-spacing: -0.04em; }
.site-footer code { color: var(--ink-soft); }

.reveal { animation: rise 720ms cubic-bezier(.2,.7,.2,1) both; }
.delay-1 { animation-delay: 120ms; }
.delay-2 { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .site-header, main, .site-footer { width: min(100% - 44px, 900px); }
  .hero { grid-template-columns: 1fr; padding-top: 4rem; }
  .hero-ledger { min-height: 330px; margin-top: 1.8rem; }
  .release-strip { grid-template-columns: 1.2fr repeat(3, 1fr); }
  .strip-end { display: none; }
  .result-layout { grid-template-columns: 1fr; }
  .result-rail { position: static; }
  .rail-bars { grid-template-columns: repeat(4, 1fr); }
  .rail-foot { margin-top: 0.9rem; }
  .reading-grid { grid-template-columns: repeat(2, 1fr); }
  .reading-lead { grid-column: span 2; }
  .reading-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .reading-card:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .site-header, main, .site-footer { width: calc(100% - 28px); }
  .site-header { min-height: 70px; }
  .main-nav { display: none; }
  .release-stamp { font-size: 0.52rem; }
  .hero { min-height: 0; padding: 3.6rem 0 2.3rem; }
  .hero-copy { padding-left: 0; }
  h1 { font-size: clamp(3.25rem, 17vw, 5.25rem); }
  .hero-lede { font-size: 1rem; }
  .hero-actions { align-items: start; flex-direction: column; gap: 1.15rem; }
  .hero-ledger { min-height: 280px; transform: scale(0.91); transform-origin: center top; }
  .release-strip { grid-template-columns: repeat(3, 1fr); }
  .strip-intro { display: none; }
  .strip-stat { padding: 0.95rem 0.55rem; }
  .strip-stat:first-of-type { border-left: 0; }
  .strip-stat strong { font-size: 1.55rem; }
  .strip-stat span { font-size: 0.56rem; }
  .section { padding-top: 5.2rem; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 1rem; }
  .scope-note { margin-top: 1.25rem; text-align: left; }
  .layer-tabs { overflow-x: auto; }
  .layer-tab { flex: 1 0 auto; }
  .control-deck { display: grid; grid-template-columns: 1fr 1fr; }
  .control-group select { min-width: 0; width: 100%; }
  .control-search { grid-column: span 2; }
  .control-page { grid-column: span 1; }
  .export-button { margin-left: 0; }
  .result-overview { display: block; padding: 0.75rem 0; }
  .result-legend { margin-top: 0.45rem; }
  .table-scroll { max-height: 600px; }
  .rail-bars { grid-template-columns: repeat(2, 1fr); }
  .reading-grid { grid-template-columns: 1fr; }
  .reading-lead { grid-column: auto; }
  .reading-card, .reading-card:nth-child(3), .reading-card:nth-child(4) { min-height: 180px; border-top: 1px solid var(--line); border-left: 0; }
  .reading-lead { min-height: 190px; }
  .reading-card h3 { margin-top: 1.8rem; }
  .site-footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
