/* ==========================================================================
   Earth Models — editorial / scientific identity
   - Serif (Instrument Serif): display headlines, accents in italic
   - Sans (Inter Tight):       body & UI
   - Mono (JetBrains Mono):    HUD, labels, tabular metadata
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--ink); color: var(--paper); }

:root {
    /* Earth-toned, low-saturation palette */
    --paper:        #f3efe6;       /* page base */
    --paper-warm:   #ece6d6;       /* alt section */
    --ink:          #15140f;       /* primary text */
    --ink-soft:     #3a382f;
    --ink-mute:     #6a665b;
    --rule:         #221f17;
    --hairline:     rgba(21, 20, 15, 0.18);
    --moss:         #2c3a1d;
    --moss-bright:  #6e7f3b;
    --rust:         #b04a2b;
    --paper-tint:   rgba(243, 239, 230, 0.92);

    /* Typography */
    --serif: "Instrument Serif", "Times New Roman", serif;
    --sans:  "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --pad-x: clamp(1.25rem, 4vw, 4rem);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-weight: 400;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Mono utility classes ─────────────────────────────────────────────── */
.mono     { font-family: var(--mono); font-weight: 400; font-feature-settings: "ss01"; }
.mono-xs  {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ============================================================
   1. SPLAT BACKGROUND  (kept full-viewport, fixed, behind all)
   ============================================================ */
/* The hero splat is fixed-fullscreen behind the page; inline splats live in
   normal flow inside sections. Both use the same .splat-stage class so the
   JS mounter doesn't have to special-case them. */
.splat-stage {
    position: relative;
    overflow: hidden;
    background: var(--paper-warm);
}
.splat-stage canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    opacity: 1;
}
.splat-stage-fixed {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: auto;
    background:
        radial-gradient(120% 90% at 50% 35%, #fffaf0 0%, var(--paper) 55%, var(--paper-warm) 100%);
}
.splat-stage-inline {
    margin: 0;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--hairline);
}
.splat-stage-inline figcaption {
    position: absolute;
    bottom: 0.6rem;
    left: 0.75rem;
    color: var(--ink-mute);
    z-index: 4;
    pointer-events: none;
}

.splat-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--ink);
    z-index: 5;
}
.loading-spinner {
    width: 28px; height: 28px;
    border: 1.5px solid var(--hairline);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   2. TOP BAR
   ============================================================ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    backdrop-filter: blur(8px) saturate(1.1);
    background: rgba(243, 239, 230, 0.78);
    border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    padding: 14px var(--pad-x);
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}
.brand-mark {
    font-size: 12px;
    color: var(--rust);
    transform: translateY(-1px);
}
.brand-name {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    line-height: 1;
    letter-spacing: -0.01em;
}
.brand-tag { color: var(--ink-mute); }

.topnav {
    display: flex;
    gap: 1.25rem;
    flex-wrap: nowrap;
}
.topnav a {
    color: var(--ink-mute);
    text-decoration: none;
    transition: color 0.18s ease;
    white-space: nowrap;
}
.topnav a:hover { color: var(--ink); }

.topbar-meta {
    justify-self: end;
    color: var(--ink-mute);
}

@media (max-width: 1080px) {
    .topnav { display: none; }
    .topbar-inner { grid-template-columns: 1fr auto; }
}

/* ============================================================
   4. HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: calc(56px + var(--pad-x)) var(--pad-x) calc(var(--pad-x) * 1.5);
    z-index: 2;
    pointer-events: none;
}
.hero > * { pointer-events: auto; }

.hero-marginalia {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--ink-mute);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 0.5rem 0;
    margin-top: clamp(0.5rem, 2vw, 1.25rem);
}

.hero-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 1100px;
    padding: clamp(2rem, 8vh, 5rem) 0;
}

.kicker {
    color: var(--ink-soft);
}

.display {
    font-family: var(--serif);
    font-weight: 400;
    font-style: normal;
    line-height: 0.92;
    letter-spacing: -0.025em;
    color: var(--ink);
    font-size: clamp(4.5rem, 14vw, 12rem);
    margin-left: -0.05em;
}
.display-line { display: block; }
.display em {
    font-style: italic;
    color: var(--moss);
}
.display-fade {
    color: var(--ink-mute);
    font-style: italic;
}

.lede {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.25rem, 2.4vw, 1.85rem);
    line-height: 1.45;
    color: var(--ink-soft);
    max-width: 38ch;
    margin-top: 0.5rem;
}
.lede strong {
    font-style: normal;
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.005em;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.hero-scrolltip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink-mute);
    align-self: flex-end;
}
.hero-scrolltip-line {
    display: inline-block;
    width: 3rem;
    height: 1px;
    background: linear-gradient(90deg, var(--ink-mute), transparent);
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.4rem;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.005em;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    will-change: transform;
}
.btn-primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.btn-primary:hover {
    background: var(--moss);
    border-color: var(--moss);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}
.btn-ghost:hover {
    background: var(--ink);
    color: var(--paper);
}
.btn-large { font-size: 18px; padding: 1.1rem 1.8rem; }

/* ============================================================
   6. SECTION SCAFFOLDING
   ============================================================ */
.section {
    position: relative;
    z-index: 2;
    background: var(--paper);
    border-top: 1px solid var(--hairline);
    padding: clamp(4rem, 9vw, 8rem) var(--pad-x) clamp(4rem, 9vw, 8rem);
    display: grid;
    grid-template-columns: minmax(140px, 18%) 1fr;
    gap: clamp(1.5rem, 4vw, 4rem);
}

.section-paper { background: var(--paper); }
.section-ink {
    background: #14130d;
    color: #ece6d6;
}
.section-ink .section-rail { color: rgba(236, 230, 214, 0.55); }
.section-ink .rail-title  { color: rgba(236, 230, 214, 0.85); }
.section-ink h2,
.section-ink h3,
.section-ink h4 { color: #f3efe6; }
.section-ink p,
.section-ink li { color: rgba(236, 230, 214, 0.78); }
.section-ink strong,
.section-ink em { color: #f3efe6; }
.section-ink .data-table th,
.section-ink .data-table td { border-color: rgba(236, 230, 214, 0.18); }
.section-ink .data-table thead th { color: rgba(236, 230, 214, 0.6); }
.section-ink .pull-quote { color: rgba(236, 230, 214, 0.92); }
.section-ink .pull-quote::before { color: var(--moss-bright); }

.section-rail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: sticky;
    top: 90px;
    align-self: start;
    color: var(--ink-mute);
}
.rail-num {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
    letter-spacing: 0.16em;
}
.rail-title {
    font-size: 11px;
    color: var(--ink-soft);
}
.section-rail::before {
    content: "";
    display: block;
    height: 1px;
    width: 60px;
    background: var(--ink);
    margin-bottom: 0.6rem;
}

.section-body {
    max-width: 880px;
}
/* Used on .section-body to centre the contact section across the full page,
   not just inside its grid track. Spans both columns of the parent .section
   grid and centres each child block (headline / lead / button) horizontally. */
.section-body-center {
    grid-column: 1 / -1;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.section-body-center .display-sm,
.section-body-center .prose-lead {
    max-width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 800px) {
    .section { grid-template-columns: 1fr; }
    .section-rail { position: static; }
}

/* ============================================================
   7. DISPLAY TYPOGRAPHY (in-section)
   ============================================================ */
.display-sm {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 1.5rem;
    max-width: 22ch;
}
.section-ink .display-sm { color: #f3efe6; }

.prose-lead {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 56ch;
    margin-bottom: 2.5rem;
}
.prose-lead em { color: var(--moss); }

.section-ink .prose-lead { color: rgba(236, 230, 214, 0.85); }
.section-ink .prose-lead em { color: var(--moss-bright); }

/* ============================================================
   8. ABSTRACT
   ============================================================ */
/* Two-column abstract: prose + inline plate II splat. Falls back to single
   column under 760px where the splat moves below the text. */
.abstract-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
    margin-bottom: 3rem;
}
@media (max-width: 760px) {
    .abstract-layout { grid-template-columns: 1fr; }
}

.abstract-text {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1.45;
    color: var(--ink);
    max-width: 36ch;
    letter-spacing: -0.005em;
    margin-bottom: 0;
}
.abstract-text strong {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--ink);
    color: var(--paper);
    padding: 0.05em 0.45em;
    margin: 0 0.1em;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem 2rem;
    border-top: 1px solid var(--hairline);
    padding-top: 1.5rem;
}
.meta-grid dt {
    color: var(--ink-mute);
    margin-bottom: 0.35rem;
}
.meta-grid dd {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    color: var(--ink);
    letter-spacing: -0.005em;
    text-transform: none;
}

/* footnote refs */
.footnote-ref {
    font-family: var(--mono);
    font-size: 0.6em;
    vertical-align: super;
    color: var(--rust);
    margin-left: 0.1em;
    text-decoration: none;
}

/* ============================================================
   9. VISION — pillar grid
   ============================================================ */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    margin-top: 2rem;
    background: var(--hairline);
    border: 1px solid var(--hairline);
}
.pillar {
    background: var(--paper);
    padding: 2rem 1.75rem;
    transition: background 0.25s ease;
}
.pillar:hover { background: var(--paper-warm); }
.pillar-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    color: var(--ink);
}
.pillar-head span:first-child { color: var(--rust); }
.pillar h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.65rem;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
}
.pillar p {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================================
   10. METHOD — numbered steps + table
   ============================================================ */
.method-list {
    list-style: none;
    counter-reset: method;
}
.method-step {
    border-top: 1px solid rgba(236, 230, 214, 0.15);
    padding: 2.5rem 0;
}
.method-step:last-child { border-bottom: 1px solid rgba(236, 230, 214, 0.15); }

.method-head {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.method-num {
    color: var(--moss-bright);
    font-weight: 500;
}
.method-step h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.method-step p {
    max-width: 60ch;
    margin-bottom: 1rem;
}
.method-bullets {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.4rem 1.5rem;
    margin-top: 1rem;
}
.method-bullets li {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    font-size: 14px;
}

.method-coda {
    margin-top: 3rem;
    max-width: 56ch;
}

/* Data table */
.data-table {
    width: 100%;
    margin-top: 3rem;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table caption {
    text-align: left;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--moss-bright);
    padding-bottom: 0.75rem;
}
.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(236, 230, 214, 0.15);
    text-align: left;
    vertical-align: top;
}
.data-table thead th {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(236, 230, 214, 0.6);
    border-bottom: 1px solid rgba(236, 230, 214, 0.3);
}
.data-table tbody th {
    font-family: var(--sans);
    font-weight: 500;
    color: rgba(236, 230, 214, 0.85);
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    width: 30%;
}
.data-table tbody td {
    color: rgba(236, 230, 214, 0.85);
    font-family: var(--mono);
    font-size: 13px;
}

/* ============================================================
   11. YIELD — benefit grid
   ============================================================ */
.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.5rem;
    margin-top: 2rem;
}
.benefit {
    padding: 2rem 1.5rem 2rem 1.5rem;
    border-top: 1px solid var(--ink);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: background 0.2s ease;
}
.benefit:hover { background: var(--paper-warm); }
.benefit > .mono-xs {
    color: var(--rust);
}
.benefit h4 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.benefit p { color: var(--ink-soft); font-size: 15px; }

/* ============================================================
   12. SUBJECTS — taxonomic cards
   ============================================================ */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.5rem;
    margin-top: 2rem;
}
.subject {
    border: 1px solid var(--ink);
    padding: 2rem;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.subject-head {
    display: flex;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hairline);
}
.subject-tag { color: var(--ink-mute); }
.subject-tag-primary {
    color: var(--paper);
    background: var(--ink);
    padding: 0.15rem 0.5rem;
}
.subject h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.85rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.subject-common {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-top: -0.5rem;
}
.subject p { color: var(--ink-soft); font-size: 15px; }
.subject-data {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--hairline);
    padding-top: 1rem;
    gap: 0.5rem;
}
.subject-data dt { color: var(--ink-mute); margin-bottom: 0.25rem; }
.subject-data dd {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
}

/* ============================================================
   13. FUTURE — capability cards
   ============================================================ */
.future-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    margin-top: 2rem;
    background: rgba(236, 230, 214, 0.15);
    border: 1px solid rgba(236, 230, 214, 0.15);
}
.future-card {
    background: #14130d;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: background 0.25s ease;
}
.future-card:hover { background: #1c1b14; }
.future-card > .mono-xs { color: var(--moss-bright); }
.future-card h4 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.15;
    color: #f3efe6;
}
.future-card p { color: rgba(236, 230, 214, 0.78); font-size: 14px; }

.pull-quote {
    margin-top: 4rem;
    padding: 0 0 0 2rem;
    border-left: 2px solid var(--moss-bright);
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.3;
    color: #f3efe6;
    max-width: 36ch;
}
.pull-quote em { font-style: normal; color: var(--moss-bright); }

/* ============================================================
   14. FOOTNOTES + FOOTER
   ============================================================ */
.footnotes .section-body { max-width: 880px; }
.footnote-list {
    list-style: none;
    border-top: 1px solid var(--hairline);
    padding-top: 1.5rem;
}
.footnote-list li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.75rem 1rem;
    padding: 0.5rem 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.55;
}
.footnote-list li > .mono-xs { color: var(--rust); padding-top: 2px; }
.footnote-list .footnote-body { display: block; }
.footnote-list a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.footnote-list a:hover { color: var(--moss); }

.footer {
    background: #14130d;
    color: rgba(236, 230, 214, 0.7);
    padding: clamp(3rem, 6vw, 5rem) var(--pad-x) 2.5rem;
    border-top: 1px solid rgba(236, 230, 214, 0.15);
    position: relative;
    z-index: 2;
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}
.footer-block > .mono-xs {
    color: rgba(236, 230, 214, 0.55);
    margin-bottom: 0.85rem;
    display: block;
}
.footer-block p {
    color: rgba(236, 230, 214, 0.78);
    font-size: 14px;
    line-height: 1.55;
}
.footer-block ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.footer-block a {
    color: rgba(236, 230, 214, 0.85);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}
.footer-block a:hover { color: #fff; }

/* ============================================================
   15. ENTRANCE ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.1, 1),
                transform 0.8s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   16. RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
    .hero-marginalia { font-size: 10px; }
    .display { font-size: clamp(3.5rem, 16vw, 6rem); }
    .meta-grid { grid-template-columns: 1fr 1fr; }
    .subject-data { grid-template-columns: 1fr; }
}
