/* RiskBias landing — evidence theme.
   Canon: docs/DESIGN_RISKBIAS_V3_20261104.md §9 and docs/BRAND.md.
   One palette, both modes. Ground / ink / muted / hairline / faint are
   monochrome. Green = checked-and-clean, red = listed. Brand red / white /
   blue is only --lb-wordmark and the hero glow.
   Palette selected by [data-lb-theme] on <html>. */

/* ── Dark ─────────────────────────────────────────────────────────────── */
:root,
:root[data-lb-theme="dark"] {
    color-scheme: dark;

    --lb-bg: #0A0A0A;
    --lb-surface: #141414;
    --lb-surface-raised: #1C1C1C;
    --lb-ink: #FAFAF8;
    --lb-muted: #A3A3A0;
    /* Faint (BRAND.md). Name kept: the one reader is tertiary hash text. */
    --lb-dim: #6E6E6A;
    --lb-hairline: #262626;

    /* Verdict hues — Answer-band meaning only. Already the evidence pair. */
    --lb-good: #4CC38A;
    --lb-bad: #F26D6D;

    /* Ceremonial splash. Not chrome, not data, not a button. */
    --lb-wordmark: linear-gradient(90deg, #F4EDDF 0%, #C5D0DC 38%, #8FA4B8 62%, #B22234 100%);
    --lb-glow-red: rgba(178, 34, 52, 0.30);
    --lb-glow-blue: rgba(60, 59, 110, 0.42);
    --lb-glow-gold: rgba(143, 164, 184, 0.12);

    --lb-glass-border: var(--lb-hairline);
    --lb-glass-fill: rgba(250, 250, 248, 0.04);

    /* Ground at 92%. Footer band is the raised token (BRAND.md). */
    --lb-nav-bg: rgba(10, 10, 10, 0.92);
    --lb-footer-bg: var(--lb-surface-raised);

    /* No code-bg token in BRAND.md. Ink at low alpha, same family as glass-fill. */
    --lb-code-bg: rgba(250, 250, 248, 0.08);
    --lb-card-shadow: rgba(0, 0, 0, 0.40);

    --lb-grain-opacity: 0.04;
    --lb-grain-blend: normal;

    --lb-scroll-thumb: var(--lb-dim);

    scrollbar-width: thin;
    scrollbar-color: var(--lb-scroll-thumb) var(--lb-bg);
}

/* ── Light ────────────────────────────────────────────────────────────── */
:root[data-lb-theme="light"] {
    color-scheme: light;

    --lb-bg: #FFFFFF;
    --lb-surface: #FFFFFF;
    --lb-surface-raised: #F6F6F4;
    --lb-ink: #0B0B0C;
    --lb-muted: #5C5C5E;
    --lb-dim: #8A8A86;
    --lb-hairline: #E5E5E1;

    --lb-good: #146C2E;
    --lb-bad: #C81E1E;

    --lb-wordmark: linear-gradient(90deg, #111A2E 0%, #4A5D73 46%, #A81C30 100%);
    --lb-glow-red: rgba(168, 28, 48, 0.10);
    --lb-glow-blue: rgba(46, 45, 92, 0.10);
    --lb-glow-gold: rgba(74, 93, 115, 0.10);

    --lb-glass-border: var(--lb-hairline);
    --lb-glass-fill: rgba(11, 11, 12, 0.03);

    --lb-nav-bg: rgba(255, 255, 255, 0.92);
    --lb-footer-bg: var(--lb-surface-raised);

    --lb-code-bg: rgba(11, 11, 12, 0.06);
    --lb-card-shadow: rgba(11, 11, 12, 0.08);

    --lb-grain-opacity: 0.05;
    --lb-grain-blend: multiply;

    --lb-scroll-thumb: var(--lb-dim);

    scrollbar-width: thin;
    scrollbar-color: var(--lb-scroll-thumb) var(--lb-bg);
}

html, body, #app {
    background: var(--lb-bg);
    color: var(--lb-ink);
}

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

/* --- Shell + atmosphere --- */
.landing-shell {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--lb-bg);
}

/* Grain overlay — analog, letterpress texture. Lightens on dark like film,
   multiplies on light like paper tooth. */
.landing-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: var(--lb-grain-opacity);
    mix-blend-mode: var(--lb-grain-blend);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.landing-inner {
    position: relative;
    z-index: 2;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

@media (min-width: 900px) {
    .landing-inner { padding: 0 2.25rem 3.5rem; }
}

/* --- Nav --- */
.lb-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: var(--lb-nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--lb-glass-border);
}

@media (min-width: 900px) {
    .lb-nav { padding: 0.85rem 2.25rem; }
}

.lb-nav-brand { display: flex; flex-direction: column; gap: 0.1rem; }
.lb-nav-tag, .lb-footer-tag { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lb-muted); opacity: 0.78; }
.lb-nav-links { display: flex; align-items: center; gap: 1.4rem; font-size: 0.92rem; color: var(--lb-ink); }
.lb-nav-links a { opacity: 0.78; transition: opacity 0.2s, color 0.2s; }
.lb-nav-links a:hover { opacity: 1; color: var(--lb-ink); }

/* Palette toggle — ink on a hairline, deliberately quiet. */
.lb-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--lb-muted);
    background: transparent;
    border: 1px solid var(--lb-glass-border);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lb-theme-toggle:hover {
    color: var(--lb-ink);
    border-color: var(--lb-ink);
    background: var(--lb-glass-fill);
}

.lb-wordmark {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.14em;
    background: var(--lb-wordmark);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.lb-nav-mark { font-size: 1.05rem; }

/* --- Hero --- */
.lb-hero {
    position: relative;
    padding: 4.5rem 0 3.5rem;
    overflow: hidden;
}

/* Hero glow — ceremonial red / blue / steel wash. The only brand
   color on the page besides the wordmark. */
.lb-hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 78% 88%, var(--lb-glow-red) 0%, transparent 60%),
        radial-gradient(46% 34% at 12% 8%, var(--lb-glow-blue) 0%, transparent 62%),
        radial-gradient(38% 26% at 62% 52%, var(--lb-glow-gold) 0%, transparent 70%);
    z-index: 0;
}

.lb-hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 900px) {
    .lb-hero-grid { grid-template-columns: 1.4fr 0.9fr; gap: 3rem; }
}

.lb-hero-copy { max-width: 38rem; }
.lb-hero-wordmark { margin-bottom: 1.1rem; }
.lb-hero-wordmark .lb-wordmark { font-size: 1.6rem; }

/* The motto — italic serif, evoking the Star-Spangled Banner / John Paul Jones. */
.lb-hero-motto {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--lb-muted);
    opacity: 0.88;
    margin-bottom: 1.4rem;
    letter-spacing: 0.01em;
}

.lb-hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    line-height: 1.06;
    color: var(--lb-ink);
    margin-bottom: 1.3rem;
}

.lb-accent-ember { color: var(--lb-ink); }
.lb-accent { color: var(--lb-ink); font-weight: 650; }

.lb-hero-sub {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--lb-ink);
    opacity: 0.86;
    margin-bottom: 1.8rem;
}

.lb-hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.lb-hero-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.9rem; color: var(--lb-muted); margin-bottom: 1.4rem; }
.lb-legend-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; margin-left: 0.5rem; }
.lb-legend-dot:first-child { margin-left: 0; }
.lb-legend-dot--good { background: var(--lb-good); } .lb-legend-dot--bad { background: var(--lb-bad); }

.lb-btn-primary, .lb-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.3rem;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.96rem;
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
/* Primary action = ink (black on light, white on dark). Label is ground. */
.lb-btn-primary {
    background: var(--lb-ink);
    color: var(--lb-bg);
    border: 1px solid var(--lb-ink);
    box-shadow: none;
}
.lb-btn-primary:hover {
    background: var(--lb-ink);
    border-color: var(--lb-muted);
    box-shadow: none;
}
.lb-btn-secondary {
    background: transparent;
    color: var(--lb-ink);
    border: 1px solid var(--lb-glass-border);
}
.lb-btn-secondary:hover { border-color: var(--lb-ink); color: var(--lb-ink); }

/* --- Hero sample plate --- */
.lb-hero-brand-plate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}
/* --- Narrative sections --- */
.lb-section {
    padding: 3.2rem 0 2.6rem;
    border-top: 1px solid var(--lb-hairline);
}
.lb-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.05rem);
    line-height: 1.18;
    color: var(--lb-ink);
    margin-bottom: 1rem;
}
.lb-section-lede {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.12rem;
    line-height: 1.6;
    color: var(--lb-muted);
    margin-bottom: 1.6rem;
    max-width: 44rem;
}
.lb-section-body {
    font-size: 1rem;
    line-height: 1.78;
    color: var(--lb-ink);
    opacity: 0.88;
}
.lb-section-body p { margin-bottom: 1.1rem; }
.lb-section-body p:last-child { margin-bottom: 0; }

/* --- Footer --- */
.lb-footer {
    border-top: 1px solid var(--lb-glass-border);
    padding: 2.2rem 1.5rem;
    background: var(--lb-footer-bg);
}
.lb-container { max-width: 1120px; margin: 0 auto; }
.lb-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}
.lb-footer-brand { display: flex; flex-direction: column; gap: 0.1rem; }
.lb-footer-mark { font-size: 1rem; }
.lb-footer-links { display: flex; gap: 1.2rem; font-size: 0.9rem; color: var(--lb-ink); }
.lb-footer-links a { opacity: 0.82; }
.lb-footer-links a:hover { opacity: 1; }
.lb-footer-meta {
    font-size: 0.78rem;
    color: var(--lb-muted);
    width: 100%;
    text-align: center;
    margin-top: 0.6rem;
}

/* Notes moved to rb2-notes (app2.css). The lb-blog-* rules are deleted. */
.lb-tier {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lb-muted);
    margin-left: 0.35rem;
}
.lb-class-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
@media (max-width: 640px) {
    .lb-class-cards { grid-template-columns: 1fr; }
}
.lb-class-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid var(--lb-hairline);
    padding: 0.75rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    min-width: 0;
}
.lb-desk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.lb-desk-table th {
    text-align: left;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lb-muted);
    padding: 0.25rem 0.45rem 0.4rem 0;
}
.lb-desk-table td { padding: 0.28rem 0.45rem 0.28rem 0; border-top: 1px solid var(--lb-hairline); }

/* ---- Print ----
   Ink on paper, whatever the screen theme. Landing buttons and the
   palette toggle stay off the sheet; tables keep their heads. */
@media print {
    @page {
        margin: 18mm 14mm 20mm;
    }
    :root {
        color-scheme: light;
    }
    body {
        background: #FFFFFF !important;
        color: #0B0B0C !important;
        font-size: 10.5pt;
        line-height: 1.45;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    #app {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    /* Buttons and the palette toggle are screen controls. */
    .lb-btn-primary,
    .lb-btn-secondary,
    .lb-theme-toggle {
        display: none !important;
    }
    details > summary {
        list-style: none;
    }
    details > summary::-webkit-details-marker {
        display: none;
    }
    table {
        break-inside: auto;
    }
    thead {
        display: table-header-group;
    }
    tr {
        break-inside: avoid;
    }
    a {
        color: #0B0B0C !important;
        text-decoration: none !important;
    }
    code {
        font-size: 0.92em;
        overflow-wrap: anywhere;
    }
}

/* Shared type and surface tokens. Landing class cards, buttons, the
   anatomy table, and sample captions still read these. */
:root {
    --lbx-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --lbx-mono: 'JetBrains Mono', ui-monospace, monospace;
    --lbx-panel: var(--lb-surface);
    --lbx-line-strong: var(--lb-glass-border);
    --lbx-radius: 6px;
}
.lb-class-card { border-radius: var(--lbx-radius); background: var(--lb-bg); padding: 0.65rem 0.75rem; }
.lb-class-card:hover { border-color: var(--lb-ink); }
.lb-btn-primary, .lb-btn-secondary { font-family: var(--lbx-font); font-weight: 600; font-size: 0.82rem; border-radius: 4px; }

/* — Tables: dense, mono numerics, sticky heads, hover — */
.lb-desk-table { font-size: 0.8rem; }
.lb-desk-table th {
    font-family: var(--lbx-mono); font-size: 0.58rem; letter-spacing: 0.14em;
    padding: 0.35rem 0.5rem 0.4rem 0; border-bottom: 1px solid var(--lbx-line-strong);
    position: sticky; top: 0; background: var(--lbx-panel); z-index: 1;
}
.lb-desk-table td { padding: 0.34rem 0.5rem 0.34rem 0; font-variant-numeric: tabular-nums; }
.lb-desk-table tbody tr:hover td { background: var(--lb-glass-fill); }
.lb-desk-table code { font-family: var(--lbx-mono); font-size: 0.76rem; }
.lbx-caption { font-size: 0.74rem; color: var(--lb-muted); line-height: 1.5; margin-top: 0.45rem; }

/* Grant card moved to the shared modal frame (rb2-grant, app2.css).
   The lb-link-* rules are deleted. */

/* Overhaul 2026-10-23 — flat landing: KPI strip, sample plates, class cards,
   anatomy grid, receipt list, legal pages. Folds/academy chrome retired. */
.lb-hero-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2.2rem;
}
@media (max-width: 900px) {
    .lb-hero-kpis { grid-template-columns: repeat(2, 1fr); }
}
.lbx-sample {
    margin: 0;
    padding: 1rem 1.1rem 0.9rem;
    border: 1px solid var(--lb-hairline);
    border-radius: 12px;
    background: var(--lb-surface-raised);
}
.lbx-sample-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lb-muted);
    margin-bottom: 0.7rem;
}
.lb-anatomy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 1.4rem;
}
@media (max-width: 900px) {
    .lb-anatomy-grid { grid-template-columns: 1fr; }
}
#landing-shell .lb-class-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin: 1.4rem 0;
}
@media (max-width: 900px) {
    #landing-shell .lb-class-cards { grid-template-columns: 1fr; }
}
#landing-shell .lb-class-card {
    margin: 0;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--lb-hairline);
    border-radius: 12px;
}
#landing-shell .lb-class-card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
#landing-shell .lb-class-card p { margin: 0 0 0.5rem; color: var(--lb-muted); }
#landing-shell .lb-class-card-meta { font-size: 0.8rem; }
#landing-shell .lb-tier {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border: 1px solid var(--lb-hairline);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lb-muted);
}
.lb-receipt { margin: 0; }
.lb-receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid var(--lb-hairline);
}
.lb-receipt-row:last-child { border-bottom: none; }
.lb-receipt dt { color: var(--lb-muted); }
.lb-receipt dd { margin: 0; font-family: "JetBrains Mono", monospace; }
/* Legal moved to rb2-prose (app2.css). The lb-legal-* rules are deleted. */
.lb-sealed {
    border: 1px solid var(--lb-ink);
    border-radius: 14px;
    padding-left: 1.4rem;
    padding-right: 1.4rem;
}
/* Activity moved to the shared Heatmap primitive (inline theme-token
   styles). The lbx-heat-* rules are deleted. */

/* Layout that used to sit under the landing-shell repaint. The repaint
   itself is gone: :root is the evidence palette. */
#landing-shell .lb-hero-legend { line-height: 1.7; }
/* Hero sample sizing: the flow figure needs its three 150px columns;
   squeezed into a narrow plate the cards overlap and clip (seen on
   both desktop and phone, 2026-10-26). Desktop gives the plate a
   full share; on phones the sample retires and the KPIs carry the
   proof. */
@media (min-width: 900px) {
    #landing-shell .lb-hero-grid { grid-template-columns: 1.05fr 1fr; }
    #landing-shell .lbx-sample { width: 100%; }
}
@media (max-width: 767px) {
    #landing-shell .lb-hero-grid { grid-template-columns: minmax(0, 1fr); }
    #landing-shell .lb-hero-copy { min-width: 0; }
    #landing-shell .lb-hero-brand-plate { display: none; }
}

/* Compact (≤767px): touch floors for landing controls, a two-column
   KPI grid, and the page gutter. */
@media (max-width: 767px) {
    .lb-desk-table th { font-size: 0.68rem; }
    .lb-theme-toggle { width: 44px; height: 44px; flex: none; }
    .lb-btn-primary, .lb-btn-secondary { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
    .lb-class-card { min-height: 44px; }
    .lb-nav-links a, .lb-footer-links a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.4rem; }

    /* KPI grid stays two columns on a phone. */
    .lb-hero-kpis { grid-template-columns: repeat(2, 1fr); }

    /* Gutters: one 1rem page gutter on compact */
    .landing-inner { padding: 0 1rem 2.5rem; }
    .lb-hero { padding: 3rem 0 2.5rem; }
    .lb-blog { padding: 2rem 1rem 3rem; }
    .lb-nav { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
    .lb-nav-tag { display: none; }
}
