@font-face {
    font-family: 'DM Sans';
    src: url('/fonts/dm-sans-var-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('/fonts/ibm-plex-mono-600-latin.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --ground: #09100c;
    --ground-soft: #0d1711;
    --card: rgba(15, 26, 19, 0.88);
    --card-hover: rgba(19, 33, 24, 0.94);
    --ink: #edf1e9;
    --ink-soft: #c7d0c4;
    --muted: #89968a;
    --muted-deep: #5e6c61;
    --moss: #76f7a5;
    --moss-soft: rgba(118, 247, 165, 0.1);
    --tomato: #ff705f;
    --tomato-soft: rgba(255, 112, 95, 0.12);
    --gold: #d8bd79;
    --line: rgba(216, 232, 217, 0.13);
    --line-strong: rgba(216, 232, 217, 0.26);
    --sans: 'DM Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --page: min(1180px, calc(100vw - 48px));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--ground);
}

body {
    min-width: 300px;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 17% 9%, rgba(77, 130, 77, 0.12), transparent 28rem),
        radial-gradient(circle at 82% 27%, rgba(144, 88, 50, 0.08), transparent 24rem),
        var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--moss);
    outline-offset: 4px;
}

::selection {
    background: var(--moss);
    color: var(--ground);
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    transform: translateY(-180%);
    padding: 10px 14px;
    background: var(--ink);
    color: var(--ground);
    font-family: var(--mono);
    font-size: 0.75rem;
}

.skip-link:focus {
    transform: none;
}

.ambient-field {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.44;
}

.ambient-field::before {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(190, 220, 191, 0.16) 0.7px, transparent 0.8px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
    content: '';
}

.ambient-field span {
    position: absolute;
    width: 1px;
    height: 36vh;
    transform: rotate(28deg);
    transform-origin: bottom;
    background: linear-gradient(to top, rgba(118, 247, 165, 0.22), transparent);
}

.ambient-field span::after {
    position: absolute;
    top: 18%;
    left: -2px;
    width: 5px;
    height: 5px;
    border: 1px solid rgba(118, 247, 165, 0.35);
    border-radius: 50%;
    content: '';
}

.ambient-field span:nth-child(1) { bottom: -6vh; left: 8%; height: 42vh; }
.ambient-field span:nth-child(2) { bottom: -16vh; left: 27%; height: 56vh; transform: rotate(-18deg); }
.ambient-field span:nth-child(3) { bottom: -12vh; right: 30%; height: 48vh; transform: rotate(16deg); }
.ambient-field span:nth-child(4) { bottom: -2vh; right: 10%; height: 38vh; transform: rotate(-26deg); }
.ambient-field span:nth-child(5) { top: 8vh; right: 4%; height: 24vh; transform: rotate(76deg); }

.site-header {
    display: grid;
    position: relative;
    z-index: 10;
    width: var(--page);
    min-height: 72px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin: 0 auto;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.09em;
}

.home-link,
.saved-link {
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    text-decoration: none;
    transition: color 160ms ease;
}

.home-link:hover,
.saved-link:hover {
    color: var(--moss);
}

.site-coordinate {
    margin: 0;
    color: var(--muted-deep);
}

.saved-link {
    justify-self: end;
}

.saved-link span {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--ink-soft);
}

main,
footer {
    width: var(--page);
    margin: 0 auto;
}

.hero {
    display: grid;
    min-height: min(790px, calc(100svh - 72px));
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    grid-template-rows: 1fr auto;
    gap: 56px 10vw;
    align-items: center;
    padding: 92px 0 40px;
}

.eyebrow,
.trailhead-label,
.fact-meta,
.fact-state,
.results-line,
.specimen-count {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 24px;
    color: var(--moss);
}

.hero h1 {
    max-width: 800px;
    margin: 0;
    font-size: clamp(4.2rem, 10vw, 9.2rem);
    font-weight: 520;
    letter-spacing: -0.075em;
    line-height: 0.82;
}

.hero h1 em {
    display: block;
    margin-left: 0.34em;
    color: var(--ink-soft);
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
}

.hero-lede {
    max-width: 560px;
    margin: 42px 0 0;
    color: var(--ink-soft);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    margin-top: 34px;
}

.primary-action,
.trailhead button,
.empty-state button,
.research-empty button {
    border: 1px solid var(--moss);
    border-radius: 0;
    padding: 12px 16px;
    background: var(--moss);
    color: var(--ground);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.035em;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-action:hover,
.trailhead button:hover,
.empty-state button:hover,
.research-empty button:hover {
    transform: translateY(-2px);
    background: transparent;
    color: var(--moss);
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--line-strong);
    padding: 11px 2px 9px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.035em;
    text-decoration: none;
    transition: border-color 150ms ease, color 150ms ease;
}

.secondary-action:hover {
    border-color: var(--tomato);
    color: var(--tomato);
}

.specimen-count {
    color: var(--muted-deep);
}

.trailhead {
    position: relative;
    align-self: center;
    border-top: 1px solid var(--tomato);
    border-bottom: 1px solid var(--line);
    padding: 24px 4px 28px;
}

.trailhead::before {
    position: absolute;
    top: -4px;
    right: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tomato);
    box-shadow: 0 0 18px rgba(255, 112, 95, 0.7);
    content: '';
}

.trailhead-label {
    margin: 0 0 44px;
    color: var(--tomato);
}

.trailhead-kicker {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.86rem;
}

.trailhead blockquote {
    margin: 0;
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.6rem, 3vw, 2.45rem);
    font-weight: 400;
    line-height: 1.23;
}

.trailhead button {
    margin-top: 34px;
    border-color: var(--line-strong);
    background: transparent;
    color: var(--ink-soft);
}

.trailhead button:hover {
    border-color: var(--tomato);
    color: var(--tomato);
}

.hero-footnote {
    grid-column: 1 / -1;
    max-width: 670px;
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.65;
}

.hero-footnote span {
    margin-right: 14px;
    color: var(--moss);
    font-family: var(--mono);
    font-size: 0.65rem;
}

.collection {
    padding: 112px 0 120px;
    border-top: 1px solid var(--line);
}

.collection-heading {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 0.55fr);
    gap: 10vw;
    align-items: end;
}

.collection-heading h2,
.paper-trail-heading h2,
.framing-note h2 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2.7rem, 6vw, 5.5rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.collection-heading > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.7;
}

.library-tools {
    display: grid;
    gap: 24px;
    margin-top: 72px;
}

.search-field {
    display: grid;
    position: relative;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--line-strong);
    padding: 0 0 12px;
}

.search-field > span {
    color: var(--moss);
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.search-field input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.search-field input::placeholder {
    color: var(--muted-deep);
}

.search-field button {
    border: 0;
    padding: 2px 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.15rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.65rem;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.filter-button:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.filter-button.active {
    border-color: rgba(118, 247, 165, 0.5);
    background: var(--moss-soft);
    color: var(--moss);
}

.results-line {
    display: flex;
    justify-content: space-between;
    margin: 30px 0 14px;
    color: var(--muted-deep);
}

.results-line p {
    margin: 0;
}

.key-hint {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    margin-right: 5px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.ledger-shell {
    border-top: 1px solid var(--line-strong);
}

.ledger-shell[hidden] {
    display: none;
}

.fact-ledger {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.fact-ledger caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.hook-column { width: 34%; }
.observation-column { width: 48%; }
.field-column { width: 18%; }

.fact-ledger th {
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 1px solid var(--line-strong);
    padding: 12px 20px;
    background: rgba(9, 16, 12, 0.96);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.fact-ledger th + th,
.fact-row td + td {
    border-left: 1px solid var(--line);
}

.fact-ledger th span {
    margin-right: 8px;
    color: var(--moss);
}

.fact-row td {
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    padding: 28px 24px 30px;
    background: var(--card);
    transition: background 160ms ease;
}

.fact-row:hover td,
.fact-row.open td {
    background: var(--card-hover);
}

.fact-row.saved .hook-cell {
    box-shadow: inset 3px 0 var(--gold);
}

.fact-row.spotlight td {
    animation: spotlight 1.5s ease;
}

.hook-cell {
    background:
        linear-gradient(115deg, rgba(255, 112, 95, 0.08), transparent 65%),
        var(--card) !important;
}

.fact-row:hover .hook-cell,
.fact-row.open .hook-cell {
    background:
        linear-gradient(115deg, rgba(255, 112, 95, 0.12), transparent 72%),
        var(--card-hover) !important;
}

.hook-lens,
.detail-label {
    margin: 0;
    color: var(--tomato);
    font-family: var(--mono);
    font-size: 0.61rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hook-question {
    max-width: 25ch;
    margin: 18px 0 0;
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.35;
}

.hook-derived .hook-lens {
    color: var(--muted-deep);
}

.hook-derived .hook-question {
    color: var(--muted);
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.fact-meta {
    margin: 0;
    color: var(--moss);
}

.observation-cell h3 {
    max-width: 26ch;
    margin: 17px 0 13px;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    font-weight: 540;
    letter-spacing: -0.035em;
    line-height: 1.14;
}

.fact-summary {
    max-width: 62ch;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.91rem;
    line-height: 1.66;
}

.field-cell {
    font-family: var(--mono);
}

.field-status {
    display: grid;
    gap: 9px;
}

.fact-state,
.fact-read {
    display: block;
    color: var(--muted-deep);
    font-size: 0.59rem;
    letter-spacing: 0.05em;
    line-height: 1.45;
    text-transform: uppercase;
}

.fact-state.sourced {
    color: var(--moss);
}

.fact-state.hypothesis {
    color: var(--gold);
}

.field-actions {
    display: grid;
    gap: 9px;
    margin-top: 42px;
}

.save-button,
.row-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    width: 100%;
    border: 1px solid var(--line);
    padding: 9px 10px;
    background: transparent;
    color: var(--muted-deep);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.61rem;
    letter-spacing: 0.07em;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.save-button:hover,
.save-button[aria-pressed="true"] {
    border-color: rgba(216, 189, 121, 0.45);
    color: var(--gold);
}

.row-open-button:hover,
.row-open-button[aria-expanded="true"] {
    border-color: rgba(255, 112, 95, 0.48);
    background: var(--tomato-soft);
    color: var(--tomato);
}

.fact-toggle {
    font-size: 0.85rem;
    transition: color 150ms ease, transform 180ms ease;
}

.row-open-button[aria-expanded="true"] .fact-toggle {
    transform: rotate(45deg);
}

.fact-detail-row[hidden] {
    display: none;
}

.fact-detail-cell {
    border-bottom: 1px solid var(--line-strong);
    padding: 0;
    background: rgba(6, 12, 8, 0.9);
}

.fact-detail-panel {
    display: grid;
    grid-template-columns: 34% 66%;
}

.detail-marker {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--line);
    padding: 28px 24px;
    background: linear-gradient(145deg, rgba(118, 247, 165, 0.06), transparent 70%);
    color: var(--muted-deep);
    font-family: var(--mono);
    font-size: 0.59rem;
    letter-spacing: 0.07em;
}

.detail-marker span:last-child {
    color: var(--moss);
}

.detail-copy {
    max-width: 760px;
    padding: 30px 32px 34px;
}

.detail-label {
    margin-bottom: 17px;
    color: var(--moss);
}

.fact-detail-copy,
.fact-project,
.fact-quote {
    margin: 0;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.75;
}

.fact-project {
    margin-top: 18px;
    border-left: 2px solid var(--moss);
    padding-left: 13px;
}

.fact-quote {
    margin-bottom: 20px;
    border-left: 2px solid var(--tomato);
    padding-left: 14px;
    color: var(--ink-soft);
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
}

.source-link,
.source-label {
    display: inline-block;
    margin-top: 20px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.67rem;
    line-height: 1.5;
}

.source-link {
    text-decoration-color: var(--line-strong);
    text-underline-offset: 4px;
}

.source-link:hover {
    color: var(--moss);
}

.empty-state {
    padding: 90px 20px;
    border: 1px solid var(--line);
    text-align: center;
}

.empty-state[hidden] {
    display: none;
}

.empty-glyph {
    margin: 0;
    color: var(--moss);
    font-size: 2.4rem;
}

.empty-state h3 {
    margin: 18px 0 8px;
    font-size: 1.5rem;
}

.empty-state p:not(.empty-glyph) {
    margin: 0;
    color: var(--muted);
}

.empty-state button {
    margin-top: 26px;
}

.paper-trail {
    padding: 112px 0 120px;
    border-top: 1px solid var(--line);
}

.paper-trail-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.62fr);
    gap: 9vw;
    align-items: end;
}

.paper-trail-heading h2 {
    max-width: 760px;
}

.paper-trail-intro p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.72;
}

.paper-trail-intro a {
    display: inline-flex;
    gap: 8px;
    margin-top: 22px;
    color: var(--moss);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.045em;
    text-decoration-color: rgba(118, 247, 165, 0.35);
    text-underline-offset: 5px;
}

.paper-trail-intro a:hover {
    color: var(--ink);
}

.paper-trail-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 68px;
    padding: 16px 0;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line);
}

.paper-trail-tools > p {
    margin: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

.research-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.research-filter {
    border: 0;
    border-bottom: 1px solid transparent;
    padding: 5px 2px;
    background: transparent;
    color: var(--muted-deep);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

.research-filter:hover {
    color: var(--ink-soft);
}

.research-filter.active {
    border-color: var(--tomato);
    color: var(--tomato);
}

.research-ledger-shell {
    border-bottom: 1px solid var(--line-strong);
}

.research-ledger,
.research-ledger tbody {
    width: 100%;
}

.research-ledger {
    border-collapse: collapse;
    table-layout: fixed;
}

.research-ledger[hidden],
.research-empty[hidden] {
    display: none;
}

.research-ledger caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.research-hook-column { width: 28%; }
.research-model-column { width: 30%; }
.research-check-column { width: 30%; }
.research-state-column { width: 12%; }

.research-ledger th {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-strong);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.59rem;
    font-weight: 400;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

.research-ledger th + th,
.research-row td + td {
    border-left: 1px solid var(--line);
}

.research-ledger th span {
    margin-right: 7px;
    color: var(--tomato);
}

.research-row td {
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    padding: 28px 20px 30px;
    background: rgba(13, 23, 17, 0.8);
    transition: background 150ms ease, opacity 150ms ease;
}

.research-row:hover td {
    background: rgba(19, 33, 24, 0.94);
}

.research-row.review-checked td {
    opacity: 0.66;
}

.research-row.review-checked:hover td,
.research-row.review-checked .research-state-cell {
    opacity: 1;
}

.research-hook-cell {
    background:
        linear-gradient(120deg, rgba(255, 112, 95, 0.1), transparent 72%),
        rgba(13, 23, 17, 0.8) !important;
}

.research-row:hover .research-hook-cell {
    background:
        linear-gradient(120deg, rgba(255, 112, 95, 0.14), transparent 76%),
        rgba(19, 33, 24, 0.94) !important;
}

.research-lens,
.research-index,
.research-check-label {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.59rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.research-lens {
    color: var(--tomato);
}

.research-question {
    max-width: 25ch;
    margin: 17px 0 0;
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.12rem, 1.65vw, 1.42rem);
    line-height: 1.38;
}

.research-index {
    color: var(--gold);
    line-height: 1.45;
}

.research-model-cell h3 {
    margin: 16px 0 12px;
    color: var(--ink);
    font-size: clamp(1.1rem, 1.8vw, 1.42rem);
    font-weight: 540;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.research-observation,
.research-check-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.68;
}

.research-check-label {
    color: var(--moss);
}

.research-check-copy {
    margin-top: 15px;
    color: var(--ink-soft);
}

.research-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 22px;
}

.research-source {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.61rem;
    line-height: 1.45;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 4px;
}

.research-source:hover {
    color: var(--moss);
}

.research-state-cell {
    text-align: center;
}

.review-button {
    width: 100%;
    border: 1px solid var(--line);
    padding: 10px 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.57rem;
    letter-spacing: 0.055em;
    line-height: 1.35;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.review-button:hover,
.review-button.checking {
    border-color: rgba(216, 189, 121, 0.52);
    background: rgba(216, 189, 121, 0.08);
    color: var(--gold);
}

.review-button.checked {
    border-color: rgba(118, 247, 165, 0.5);
    background: var(--moss-soft);
    color: var(--moss);
}

.research-empty {
    padding: 64px 20px;
    text-align: center;
}

.research-empty p {
    margin: 0;
    color: var(--muted);
}

.research-empty button {
    margin-top: 22px;
}

.paper-trail-note {
    display: grid;
    grid-template-columns: minmax(120px, 0.28fr) 1fr;
    gap: 28px;
    max-width: 900px;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.68;
}

.paper-trail-note span {
    color: var(--tomato);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
}

.framing-note {
    display: grid;
    grid-template-columns: minmax(180px, 0.4fr) 1fr;
    gap: 8vw;
    padding: 110px 0 120px;
    border-top: 1px solid var(--line);
}

.framing-note h2 {
    max-width: 780px;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.framing-note div p {
    max-width: 690px;
    margin: 30px 0 0;
    color: var(--ink-soft);
    font-size: 1.03rem;
    line-height: 1.75;
}

.framing-note div p + p {
    margin-top: 16px;
    color: var(--muted);
}

footer {
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: var(--muted-deep);
    font-family: var(--mono);
    font-size: 0.63rem;
    letter-spacing: 0.07em;
}

footer p {
    margin: 0;
}

footer p span {
    margin: 0 8px;
}

footer a {
    text-decoration: none;
}

footer a:hover {
    color: var(--moss);
}

@keyframes spotlight {
    0%, 100% { box-shadow: none; }
    25% { box-shadow: inset 0 0 0 2px var(--tomato), 0 0 36px rgba(255, 112, 95, 0.1); }
}

@media (max-width: 860px) {
    :root {
        --page: min(100% - 32px, 680px);
    }

    .site-header {
        grid-template-columns: 1fr 1fr;
    }

    .site-coordinate {
        display: none;
    }

    .hero {
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 70px;
        padding: 88px 0 38px;
    }

    .hero h1 {
        font-size: clamp(4.2rem, 18vw, 7.4rem);
    }

    .hero h1 em {
        margin-left: 0.18em;
    }

    .hero-footnote {
        grid-column: 1;
    }

    .collection {
        padding: 90px 0;
    }

    .collection-heading,
    .paper-trail-heading,
    .framing-note {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .collection-heading > p {
        max-width: 560px;
    }

    .paper-trail {
        padding: 90px 0;
    }

    .paper-trail-intro {
        max-width: 590px;
    }

    .paper-trail-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .research-filters {
        justify-content: flex-start;
    }

    .research-ledger,
    .research-ledger tbody {
        display: block;
    }

    .research-ledger colgroup,
    .research-ledger thead {
        display: none;
    }

    .research-row {
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        margin-top: 14px;
        border: 1px solid var(--line);
    }

    .research-row td {
        display: block;
        border: 0;
    }

    .research-row td + td {
        border-left: 0;
    }

    .research-hook-cell {
        border-right: 1px solid var(--line) !important;
    }

    .research-check-cell {
        grid-column: 1 / -1;
        border-top: 1px solid var(--line) !important;
    }

    .research-state-cell {
        grid-column: 1 / -1;
        border-top: 1px solid var(--line) !important;
        padding: 14px 18px !important;
        text-align: left;
    }

    .review-button {
        width: auto;
        min-width: 112px;
    }

    .ledger-shell {
        border-top: 0;
    }

    .fact-ledger,
    .fact-ledger tbody {
        display: block;
    }

    .fact-ledger colgroup,
    .fact-ledger thead {
        display: none;
    }

    .fact-row {
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        margin-top: 14px;
        border: 1px solid var(--line);
    }

    .fact-row td {
        display: block;
        border: 0;
        border-bottom: 1px solid var(--line);
    }

    .fact-row td + td {
        border-left: 0;
    }

    .hook-cell {
        border-right: 1px solid var(--line) !important;
    }

    .field-cell {
        display: grid !important;
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 20px;
        border-bottom: 0 !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }

    .field-status {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
    }

    .field-actions {
        display: flex;
        margin-top: 0;
    }

    .save-button,
    .row-open-button {
        width: auto;
        min-width: 96px;
    }

    .fact-detail-row {
        display: block;
        border: 1px solid var(--line);
        border-top: 0;
    }

    .fact-detail-row[hidden] {
        display: none;
    }

    .fact-detail-cell {
        display: block;
        border-bottom: 0;
    }

    .fact-detail-panel {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    }
}

@media (max-width: 520px) {
    :root {
        --page: calc(100% - 24px);
    }

    .site-header {
        min-height: 62px;
    }

    .hero {
        padding-top: 68px;
    }

    .hero h1 {
        font-size: clamp(3.6rem, 21vw, 6rem);
    }

    .hero-lede {
        margin-top: 30px;
    }

    .hero-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .paper-trail-tools {
        margin-top: 46px;
    }

    .trailhead-label {
        margin-bottom: 34px;
    }

    .collection-heading h2,
    .paper-trail-heading h2,
    .framing-note h2 {
        font-size: clamp(2.45rem, 13vw, 4rem);
    }

    .library-tools {
        margin-top: 50px;
    }

    .search-field {
        grid-template-columns: 1fr auto;
    }

    .search-field > span {
        grid-column: 1 / -1;
    }

    .results-line p:last-child {
        display: none;
    }

    .fact-row {
        display: block;
    }

    .fact-row td {
        padding: 23px 20px;
    }

    .hook-cell {
        border-right: 0 !important;
    }

    .hook-question,
    .hook-derived .hook-question {
        max-width: 30ch;
        font-size: 1.35rem;
    }

    .field-cell {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .field-actions {
        width: 100%;
    }

    .save-button,
    .row-open-button {
        width: auto;
        min-width: 0;
        flex: 1;
    }

    .fact-detail-panel {
        grid-template-columns: 1fr;
    }

    .detail-marker {
        min-height: 0;
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 18px 20px;
    }

    .detail-copy {
        padding: 24px 20px 28px;
    }

    .research-row {
        display: block;
    }

    .research-hook-cell {
        border-right: 0 !important;
        border-bottom: 1px solid var(--line) !important;
    }

    .research-row td {
        padding: 24px 20px;
    }

    .paper-trail-note {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .framing-note {
        padding: 82px 0 90px;
    }

    footer {
        min-height: 120px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
