/* =========================================================
   Poka Yoke — site styles
   Palette and type adapted from the app's style guide
   (#1a1a2e / #16213e / #0f3460 / #4A90D9) and the product
   deck (#1e2761, #f4f6fb, #d98a3d, Georgia headings).
   ========================================================= */

/* ---------- Brand wordmark face ----------
   Outfit 700, SIL Open Font License 1.1 (license text: /fonts/OFL.txt).
   Self-hosted, latin subset only — keeps the site free of third-party
   requests. "United Sans" (Telefónica) and Linotype "Octane" are commercial
   faces and are deliberately NOT bundled; they lead --font-brand so that a
   licensed @font-face added later takes over with no further change. */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/outfit-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Dark (app) palette */
    --bg: #1a1a2e;
    --bg-elevated: #16213e;
    --bg-deep: #1e2761;
    --bg-card: #2a3470;
    --bg-inset: #0f1a30;

    --border: #0f3460;
    --border-soft: rgba(159, 211, 255, 0.12);
    --border-strong: rgba(159, 211, 255, 0.28);

    --accent: #4a90d9;
    --accent-bright: #5b7fff;
    --accent-soft: #9fd3ff;
    --accent-muted: #7fb2ff;
    --highlight: #d98a3d;
    --ok: #27ae60;
    --bad: #e74c3c;

    --text: #eef2f7;
    --text-2: #c8d4e6;
    --text-muted: #8a96b0;

    /* Light section palette (from deck) */
    --light-bg: #f4f6fb;
    --light-bg-2: #e6ebf5;
    --light-text: #1a1f36;
    --light-text-2: #3b4261;
    --light-accent: #1e2761;

    /* Type */
    --font-heading: Georgia, 'Times New Roman', ui-serif, serif;
    --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* Brand wordmark only. Commercial faces lead; Outfit is the guaranteed
       render (see the @font-face above). */
    --font-brand: 'United Sans', 'Octane LT Std', 'Outfit', ui-sans-serif,
        system-ui, sans-serif;

    /* Layout */
    --max: 1120px;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 999px;

    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent-soft);
    text-decoration: none;
}

a:hover {
    color: #fff;
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 32px;
}

.wrap--narrow {
    max-width: 760px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

h3,
.h3 {
    font-size: clamp(1.15rem, 1.6vw, 1.35rem);
}

h1 em,
h2 em {
    font-style: italic;
    color: var(--accent-soft);
}

.section--light h1 em,
.section--light h2 em {
    color: var(--accent);
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin-bottom: 18px;
}

.eyebrow--dark {
    color: var(--accent);
}

.lede {
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    color: var(--text-2);
    max-width: 62ch;
    margin: 20px 0 0;
}

.section--light .lede {
    color: var(--light-text-2);
}

.prose {
    font-size: 1.05rem;
    color: var(--text-2);
    margin: 20px 0;
}

.section--light .prose {
    color: var(--light-text-2);
}

.prose strong {
    color: #fff;
}

.section--light .prose strong {
    color: var(--light-accent);
}

.prose--small {
    font-size: 0.95rem;
}

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.5px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: inline-flex;
    flex: 0 0 auto;
}

.brand-mark img {
    height: 64px;
    width: auto;
    aspect-ratio: 864 / 1213;
    border-radius: 6px;
}

.brand--footer {
    color: #fff;
    font-size: 1.25rem;
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--bg-card);
    color: var(--accent-soft);
    font-family: var(--font-body);
}

.pill-alpha {
    background: rgba(217, 138, 61, 0.18);
    color: var(--highlight);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    font-size: 14px;
}

.nav-links a {
    color: var(--text-2);
}

.nav-links a:hover {
    color: #fff;
}

.nav-cta {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff !important;
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--accent-bright);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-bright);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--accent-soft);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    color: #fff;
}

.btn-coffee {
    background: var(--highlight);
    color: #1a1206;
    margin-top: 16px;
}

.btn-coffee:hover {
    background: #e59a4f;
    color: #1a1206;
}

.section--light .btn-ghost {
    color: var(--light-accent);
    border-color: var(--light-accent);
}

.section--light .btn-ghost:hover {
    background: var(--light-accent);
    color: #fff;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

/* ---------- Hero ---------- */
.hero {
    background: var(--bg-deep);
    color: #fff;
    padding: 120px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% -10%, rgba(91, 127, 255, 0.22), transparent 60%),
        radial-gradient(ellipse at 10% 110%, rgba(217, 138, 61, 0.10), transparent 55%);
    pointer-events: none;
}

.hero .wrap {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: #fff;
    margin-bottom: 8px;
}

.hero h1 em {
    color: var(--accent-soft);
}

.hero .lede {
    color: #cbd9f2;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
}

.hero-note {
    margin-top: 26px;
    color: var(--text-muted);
    font-size: 13px;
}

.hero--doc {
    padding: 96px 0 72px;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    letter-spacing: 0.02em;
    color: var(--accent-soft);
    margin: 6px 0 24px;
}

/* ---------- Sections ---------- */
.section {
    padding: 96px 0;
}

.section--light {
    background: var(--light-bg);
    color: var(--light-text);
}

.section--light h1,
.section--light h2,
.section--light h3 {
    color: var(--light-accent);
}

.section--light a {
    color: var(--accent);
}

.section--dark {
    background: var(--bg);
}

.section--deep {
    background: var(--bg-deep);
}

/* ---------- Grids & cards ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    margin-top: 48px;
}

.grid-2--split {
    align-items: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.card {
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.card h3 {
    margin: 12px 0 10px;
    color: #fff;
}

.card p {
    color: var(--text-2);
    font-size: 15px;
}

.card--light {
    background: #fff;
    border-color: rgba(30, 39, 97, 0.10);
    box-shadow: 0 1px 2px rgba(30, 39, 97, 0.04);
}

.card--light h3 {
    color: var(--light-accent);
}

.card--light p {
    color: var(--light-text-2);
}

.card--dark {
    background: var(--bg-elevated);
}

.card--dark h3 {
    color: #fff;
}

.card-icon {
    font-size: 28px;
    color: var(--accent);
    font-family: var(--font-heading);
}

/* ---------- Flow diagram ---------- */
.flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 48px 0;
}

.flow-step {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    min-width: 128px;
    text-align: center;
}

.flow-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-soft);
}

.flow-body {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
}

.flow-step--accent {
    border-color: var(--accent);
}

.flow-step--deep {
    background: var(--bg-card);
    border-color: var(--accent);
}

.flow-step--outline {
    background: transparent;
    border-color: var(--accent-soft);
}

.flow-arrow {
    color: var(--accent);
    font-size: 22px;
}

/* ---------- Bullets ---------- */
.bullets {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bullets li {
    position: relative;
    padding-left: 22px;
    color: var(--text-2);
    font-size: 15px;
}

.bullets li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.bullets code {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--accent-soft);
}

/* ---------- Pullquote ---------- */
.pullquote {
    margin: 56px 0 0;
    padding: 28px 32px;
    border-left: 3px solid var(--accent);
    background: rgba(74, 144, 217, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pullquote p {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 1.5vw, 1.25rem);
    font-style: italic;
    color: var(--light-accent);
}

.section--dark .pullquote p,
.section--deep .pullquote p {
    color: #fff;
}

/* ---------- Donate box ---------- */
.donate-box {
    padding: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.donate-box h3 {
    color: #fff;
    margin: 6px 0 12px;
}

/* ---------- Contact form ---------- */
.contact-form {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--light-text-2);
}

.field span em {
    color: var(--text-muted);
    font-weight: 400;
    font-style: normal;
}

.field input,
.field textarea {
    font: inherit;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(30, 39, 97, 0.20);
    background: #fff;
    color: var(--light-text);
    transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.18);
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 8px;
}

.form-status {
    font-size: 14px;
    color: var(--light-text-2);
}

.form-status.ok {
    color: var(--ok);
}

.form-status.err {
    color: var(--bad);
}

/* ---------- T2D2 page ---------- */
.prose-wrap h2 {
    margin-bottom: 20px;
}

.principles,
.guardrail-list,
.ceremony-list {
    padding-left: 22px;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.principles li,
.guardrail-list li,
.ceremony-list li {
    color: var(--light-text-2);
    font-size: 1.02rem;
}

.section--dark .principles li,
.section--dark .guardrail-list li,
.section--dark .ceremony-list li,
.section--deep .principles li,
.section--deep .guardrail-list li,
.section--deep .ceremony-list li {
    color: var(--text-2);
}

.principles strong,
.guardrail-list strong,
.ceremony-list strong {
    color: var(--light-accent);
}

.section--dark .principles strong,
.section--dark .guardrail-list strong,
.section--dark .ceremony-list strong,
.section--deep .principles strong,
.section--deep .guardrail-list strong,
.section--deep .ceremony-list strong {
    color: #fff;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 40px;
}

.phase h3 {
    color: var(--accent-soft);
    margin-bottom: 16px;
}



/* ---------- Footer ---------- */
.footer {
    background: #0a0f1f;
    border-top: 1px solid var(--border);
    padding: 48px 0;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-note {
    font-size: 13px;
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 22px;
    font-size: 14px;
}

.footer-links a {
    color: var(--text-2);
}

.footer-links a:hover {
    color: #fff;
}

.footer-legal {
    font-size: 12px;
    width: 100%;
    margin-top: 8px;
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .wrap {
        padding: 0 20px;
    }

    .hero {
        padding: 88px 0 72px;
    }

    .section {
        padding: 72px 0;
    }

    .grid-2,
    .grid-3,
    .phase-grid {
        grid-template-columns: 1fr;
    }

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

    .nav-links {
        display: none;
    }

    .nav-inner {
        padding: 0 32px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        padding: 20px 32px;
        border-bottom: 1px solid var(--border);
    }

    .flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============ T2D2 depth-page components ============ */

/* ---- Sub-navigation (below main nav on T2D2 pages) ---- */
.t2d2-subnav {
    position: sticky;
    top: 64px;
    z-index: 40;
    background: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.t2d2-subnav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.t2d2-subnav-inner::-webkit-scrollbar {
    display: none;
}

.t2d2-subnav a {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.t2d2-subnav a:hover {
    color: #fff;
}

.t2d2-subnav a.active {
    color: var(--accent-soft);
    border-bottom-color: var(--accent);
}

/* ---- Depth cards (two doors) ---- */
.depth-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.depth-card {
    padding: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, transform 0.15s;
}

a.depth-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.depth-card .eyebrow {
    margin-bottom: 0;
}

.depth-card h3 {
    color: #fff;
    margin: 0;
    font-size: 1.35rem;
}

.depth-card p {
    color: var(--text-2);
    font-size: 15px;
    flex: 1;
    margin: 0;
}

.depth-card .arrow {
    color: var(--accent-soft);
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
}

/* ---- Callouts ---- */
/* ---- Callouts ---- */
.callout {
    margin-top: 40px;
    padding: 24px 28px;
    border-radius: var(--radius);
    background: rgba(74, 144, 217, 0.08);
    border: 1px solid var(--border-strong);
}

.callout p {
    color: var(--text-2);
    margin: 0;
}

.callout p+p {
    margin-top: 12px;
}

.callout-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin-bottom: 12px;
}

.callout--warning {
    background: rgba(217, 138, 61, 0.06);
    border-color: rgba(217, 138, 61, 0.30);
}

.callout--note {
    background: rgba(74, 144, 217, 0.06);
    border-color: var(--border-strong);
}

/* Light-section: dark text on light background */
.section--light .callout {
    border-color: rgba(30, 39, 97, 0.15);
}

.section--light .callout-eyebrow {
    color: var(--light-accent);
    /* #1e2761 — dark navy on light bg */
}

.section--light .callout p {
    color: var(--light-text-2);
    /* #3b4261 — dark gray-blue on light bg */
}

.section--light .callout--note {
    background: rgba(74, 144, 217, 0.07);
    border-color: rgba(74, 144, 217, 0.30);
}

.section--light .callout--warning {
    background: rgba(217, 138, 61, 0.10);
    border-color: rgba(217, 138, 61, 0.40);
}

/* ---- Stat row ---- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
}

.stat-item {
    padding: 28px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    line-height: 1;
    color: var(--accent-soft);
    margin-bottom: 12px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ---- Value / guardrail lists ---- */
.value-list {
    list-style: none;
    padding: 0;
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.value-item {
    padding: 24px 28px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    background: rgba(74, 144, 217, 0.05);
}

.value-item h3 {
    color: var(--light-accent);
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.value-item p {
    color: var(--light-text-2);
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
}

.section--dark .value-item,
.section--deep .value-item {
    background: rgba(74, 144, 217, 0.08);
}

.section--dark .value-item h3,
.section--deep .value-item h3 {
    color: var(--accent-soft);
}

.section--dark .value-item p,
.section--deep .value-item p {
    color: var(--text-2);
}

/* ---- Guardrails ---- */
.guardrail-list {
    list-style: none;
    padding: 0;
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    counter-reset: gr;
}

.guardrail-item {
    padding: 24px 28px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--highlight);
    background: rgba(217, 138, 61, 0.08);
    counter-increment: gr;
}

.guardrail-item::before {
    content: counter(gr, decimal-leading-zero);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--highlight);
    display: block;
    margin-bottom: 6px;
}

.guardrail-item h3 {
    color: var(--highlight);
    /* orange on dark navy — was var(--light-accent) */
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.guardrail-item p {
    color: var(--text-2);
    /* light gray on dark navy — was var(--light-text-2) */
    font-size: 15px;
    margin: 0;
    line-height: 1.55;
}

/* Light-section exception — kept in place for future use */
.section--light .guardrail-item {
    background: rgba(217, 138, 61, 0.10);
}

.section--light .guardrail-item h3 {
    color: var(--light-accent);
}

.section--light .guardrail-item p {
    color: var(--light-text-2);
}

/* ---- Problem class cards ---- */
.problem-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 40px 0;
}

.problem-card {
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.problem-card .num {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--accent-soft);
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 10px;
}

.problem-card h3 {
    color: #fff;
    margin: 0 0 14px;
    font-size: 1.25rem;
}

.problem-card p {
    color: var(--text-2);
    font-size: 15px;
    margin: 0 0 14px;
    line-height: 1.6;
}

.problem-card p:last-of-type {
    margin-bottom: 0;
}

.problem-card .evidence {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.problem-card .evidence strong {
    color: var(--accent-soft);
    font-weight: 600;
}

/* ---- Lineage / origins grid ---- */
.lineage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 48px 0;
}

.lineage-column {
    padding: 28px;
    border-radius: var(--radius);
    background: rgba(74, 144, 217, 0.04);
    border: 1px solid var(--border);
}

.lineage-column .era {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin-bottom: 8px;
    display: block;
}

.lineage-column h3 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.lineage-item {
    margin-bottom: 18px;
}

.lineage-item:last-child {
    margin-bottom: 0;
}

.lineage-item strong {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
}

.lineage-item p {
    color: var(--text-2);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

/* ---- References list ---- */
.references {
    padding-left: 20px;
    margin: 32px 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-muted);
}

.references li {
    margin-bottom: 10px;
}

.references li strong {
    color: var(--text-2);
}

/* ---- Table of contents in-page ---- */
.toc-inline {
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    background: rgba(74, 144, 217, 0.05);
    border: 1px solid var(--border);
    margin: 40px 0;
    font-size: 14px;
}

.toc-inline strong {
    display: block;
    color: var(--accent-soft);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.toc-inline ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-2);
    line-height: 1.9;
}

.toc-inline a {
    color: var(--text-2);
}

.toc-inline a:hover {
    color: #fff;
}

/* ---- Responsive tweaks for sub-pages ---- */
@media (max-width: 900px) {

    .depth-grid,
    .stat-row,
    .lineage {
        grid-template-columns: 1fr;
    }

    .t2d2-subnav {
        top: 56px;
    }

    .t2d2-subnav-inner {
        padding: 0 20px;
    }
}


/* ============================================================================
   DECK — self-contained 11-slide presenter
   Rebuilt from the Poka-yoke deck. No dependencies. Fits the site's palette.
   ========================================================================== */

.deck-wrap {
    margin: 48px 0 0;
}

.deck {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.deck-stage {
    position: absolute;
    inset: 0;
}

.deck-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3%;
    padding: clamp(24px, 5vw, 64px) clamp(20px, 6vw, 80px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s var(--ease-out), visibility 0.45s;
    overflow: hidden;
}

.deck-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Slide modes match the deck's dark/light alternation */
.deck-slide--dark {
    background: var(--bg-deep);
    color: #f4f6fb;
}

.deck-slide--light {
    background: #f4f6fb;
    color: #1a1f36;
}

.deck-slide h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(22px, 3.2vw, 40px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin: 0;
}

.deck-slide h4 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(14px, 1.6vw, 20px);
    line-height: 1.25;
    margin: 0;
}

.deck-slide p {
    font-family: var(--font-body);
    font-size: clamp(12px, 1.4vw, 16px);
    line-height: 1.5;
    margin: 0;
}

.deck-slide .deck-eyebrow {
    font-family: var(--font-body);
    font-size: clamp(9px, 1vw, 11px);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9db4ff;
    margin: 0;
}

.deck-slide--light .deck-eyebrow {
    color: #4a7fbf;
}

/* --- Grids used inside slides --- */
.deck-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 3vw, 40px);
}

.deck-rows {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.4vw, 16px);
}

/* --- Slide 2 flow diagram --- */
.deck-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: clamp(6px, 1vw, 14px);
}

.deck-flow-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 1.6vw, 20px);
    border-radius: 10px;
    font-size: clamp(11px, 1.4vw, 15px);
    text-align: center;
    border: 2px solid transparent;
    line-height: 1.3;
}

.deck-flow-cell--neutral {
    background: #e6e9f2;
    border-color: #8a93b8;
    color: #1a1f36;
}

.deck-flow-cell--accent {
    background: #e1e8ff;
    border-color: #1e2761;
    color: #1a1f36;
}

.deck-flow-cell--deep {
    background: #1e2761;
    color: #f4f6fb;
}

.deck-flow-cell--outline {
    background: #fff;
    border-color: #5b7fff;
    color: #1a1f36;
}

.deck-flow-arrow {
    display: flex;
    align-items: center;
    font-size: clamp(18px, 2vw, 26px);
    color: #5b7fff;
}

/* --- Slide 4 two cards --- */
.deck-card {
    padding: clamp(14px, 2.4vw, 28px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deck-slide--light .deck-card {
    background: #fff;
    border-color: rgba(30, 39, 97, 0.10);
    box-shadow: 0 1px 2px rgba(30, 39, 97, 0.04);
}

/* --- Slide 5 & 6: illustration + bullets --- */
.deck-illustrated {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(16px, 3vw, 48px);
    align-items: center;
}

.deck-illustrated svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Slide 7: comparison rows --- */
.deck-compare {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.6vw, 18px);
}

.deck-compare-row {
    display: grid;
    grid-template-columns: clamp(80px, 10vw, 140px) 1fr;
    align-items: center;
    gap: clamp(8px, 1.4vw, 18px);
}

.deck-compare-label {
    font-weight: 700;
    font-size: clamp(11px, 1.3vw, 14px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.deck-compare-label--search {
    color: #a86217;
}

.deck-compare-label--graph {
    color: #1e2761;
}

.deck-chip-row {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.8vw, 10px);
    flex-wrap: wrap;
}

.deck-chip {
    padding: clamp(6px, 1vw, 12px) clamp(8px, 1.4vw, 18px);
    border-radius: 10px;
    font-size: clamp(10px, 1.2vw, 13px);
    text-align: center;
    border: 2px solid transparent;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}

.deck-chip--search {
    background: #fbe9d2;
    border-color: #d98a3d;
    color: #1a1f36;
}

.deck-chip--graph {
    background: #e1e8ff;
    border-color: #1e2761;
    color: #1a1f36;
}

.deck-chip-arrow {
    color: #5b7fff;
    font-size: clamp(14px, 1.6vw, 18px);
    flex-shrink: 0;
}

/* --- Slide 8: comparison table --- */
.deck-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: clamp(10px, 1.15vw, 13px);
    line-height: 1.35;
}

.deck-table th,
.deck-table td {
    text-align: left;
    padding: clamp(6px, 1vw, 12px) clamp(6px, 1.2vw, 14px);
    border-bottom: 1px solid rgba(20, 20, 19, 0.10);
    vertical-align: top;
}

.deck-table th {
    background: rgba(20, 20, 19, 0.05);
    font-size: clamp(9px, 1vw, 11px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3b4261;
}

.deck-table td:first-child {
    font-weight: 600;
    color: #1e2761;
}

/* --- Slide 9: bar chart --- */
.deck-chart {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Slide 10: plan / build / diff flow --- */
.deck-steps {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: clamp(6px, 1vw, 14px);
    align-items: stretch;
}

.deck-step {
    padding: clamp(10px, 1.6vw, 20px);
    border-radius: 10px;
    background: #e1e8ff;
    border: 2px solid #1e2761;
    text-align: center;
    font-size: clamp(11px, 1.3vw, 14px);
    color: #1a1f36;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.deck-step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e2761;
    font-size: clamp(14px, 1.6vw, 20px);
}

.deck-diff {
    font-family: var(--font-mono);
    font-size: clamp(10px, 1.15vw, 13px);
    line-height: 1.55;
    padding: clamp(10px, 1.4vw, 16px);
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(30, 39, 97, 0.12);
}

.deck-diff-line {
    display: block;
}

.deck-diff-line--add {
    color: #1f8a5f;
}

.deck-diff-line--rem {
    color: #b85042;
}

.deck-diff-line--same {
    color: #3b4261;
}

/* --- Controls --- */
.deck-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 4px 0;
}

.deck-progress {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.deck-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(159, 211, 255, 0.25);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.deck-progress-dot:hover {
    background: rgba(159, 211, 255, 0.55);
}

.deck-progress-dot.active {
    background: var(--accent-soft);
    transform: scale(1.25);
}

.deck-progress-dot:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 3px;
}

.deck-buttons {
    display: flex;
    gap: 8px;
}

.deck-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(159, 211, 255, 0.10);
    border: 1px solid var(--border-strong);
    color: var(--accent-soft);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.deck-nav:hover {
    background: rgba(159, 211, 255, 0.20);
    border-color: var(--accent);
    color: #fff;
}

.deck-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.deck-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 720px) {
    .deck {
        aspect-ratio: 4 / 5;
    }

    .deck-slide {
        gap: 14px;
        padding: 24px 20px;
    }

    .deck-cols,
    .deck-illustrated {
        grid-template-columns: 1fr;
    }

    .deck-flow,
    .deck-steps {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .deck-flow-arrow,
    .deck-step-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }

    .deck-compare-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .deck-compare-label {
        font-size: 10px;
    }

    .deck-table {
        font-size: 10px;
    }

    .deck-table th,
    .deck-table td {
        padding: 4px 6px;
    }

    .deck-progress-dot {
        width: 6px;
        height: 6px;
    }

    .deck-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .deck-slide {
        transition: none;
    }

    .deck-progress-dot,
    .deck-nav {
        transition: none;
    }
}

/* ==========================================================================
   Hero rotating banner + hero screenshot + audience split
   Appended as one delimited block. Nothing above was modified.
   ========================================================================== */

.hero-rotator {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin: 26px 0 0;
}

.hero-rotator-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(1rem, 1.35vw, 1.15rem);
    /* Reserved height: lines are absolutely positioned, so nothing below
       shifts as the banner rotates. This is what prevents CLS. */
    min-height: 6em;
}

.hero-rotator-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding-left: 16px;
    border-left: 2px solid var(--accent);
    font-size: inherit;
    line-height: 1.45;
    font-weight: 500;
    color: #e8eefc;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out),
        visibility 0.5s;
}

.hero-rotator-line.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.hero-rotator-line::before {
    content: attr(data-tag);
    display: block;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin-bottom: 7px;
}

.hero-rotator-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.hero-rotator-toggle:hover {
    color: #fff;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
}

.hero-rotator-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Pause glyph: two bars. Play glyph: triangle, driven by aria-pressed. */
.hero-rotator-icon {
    position: relative;
    width: 10px;
    height: 11px;
    flex: 0 0 auto;
}

.hero-rotator-icon::before,
.hero-rotator-icon::after {
    content: "";
    position: absolute;
    top: 0;
    width: 3px;
    height: 11px;
    background: currentColor;
    border-radius: 1px;
}

.hero-rotator-icon::before {
    left: 0;
}

.hero-rotator-icon::after {
    right: 0;
}

.hero-rotator-toggle[aria-pressed="true"] .hero-rotator-icon::after {
    opacity: 0;
}

.hero-rotator-toggle[aria-pressed="true"] .hero-rotator-icon::before {
    left: 1px;
    width: 0;
    height: 0;
    background: transparent;
    border-top: 5.5px solid transparent;
    border-bottom: 5.5px solid transparent;
    border-left: 9px solid currentColor;
}

/* Reduced motion: no rotation at all. Every line renders statically and the
   pause control is removed, since there is nothing left to pause. */
.hero-rotator--static .hero-rotator-stage {
    position: static;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-rotator--static .hero-rotator-line {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
}

.hero-rotator--static .hero-rotator-toggle {
    display: none;
}

/* Hero screenshot. Framing matches .deck exactly so it reads as part of the
   same design system. */
.hero-shot {
    margin: 56px 0 0;
}

.hero-shot picture {
    display: block;
}

.hero-shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    background: var(--bg-deep);
}

/* Reusable screenshot caption. Any figure using .hero-shot (or a future
   .shot) can carry one, so new screenshots drop in with the same
   caption + evidence-mapping treatment. */
.shot-caption {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 74ch;
}

.shot-caption strong {
    color: var(--text);
    font-weight: 600;
}

.shot-caption-note {
    display: inline-block;
    margin-left: 4px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-soft);
}

.audience-link {
    margin: 22px 0 0;
    font-size: 15px;
}

.audience-link a {
    font-weight: 600;
}

@media (max-width: 900px) {
    .hero-rotator {
        flex-direction: column;
        gap: 16px;
    }

    .hero-rotator-stage {
        min-height: 8.5em;
    }

    .hero-shot {
        margin-top: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-rotator-line {
        transition: none;
        transform: none;
    }
}

/* ============================================================
   HOW bridge line, availability block, and "coming soon" state
   Appended as one delimited block. Nothing above this line was
   modified.
   ============================================================ */

/* HOW: the single sentence that replaced the two bullet columns,
   which duplicated deck slides 2, 6, 7 and 9. */
.how-bridge {
    max-width: 68ch;
    margin-top: 32px;
}

.how-bridge a {
    color: var(--accent-soft);
}

.how-bridge a:hover {
    color: #fff;
}

/* "Coming soon" — a status, not a control. Deliberately not an <a>
   or a <button>, so it is not focusable and cannot be activated
   into a 404. */
.soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 0;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px dashed var(--border-strong);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

/* --- Buy Me a Coffee QR (donate-box) ------------------------------------- */
/* Sits under the coffee button. The white padding supplies the quiet zone the */
/* branded QR lacks, which is what makes it scan on a dark section.            */
.qr-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.qr-img {
    flex: none;
    width: 84px;
    height: 84px;
    padding: 6px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
}

.qr-note {
    margin: 0;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
}

.soon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--highlight);
    flex: none;
}

@media (prefers-reduced-motion: no-preference) {
    .soon-dot {
        animation: soonPulse 2.4s var(--ease-out) infinite;
    }
}

@keyframes soonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

/* =========================================================
   Hero screenshot — "open full size" affordance
   The link wraps the responsive <picture>; the badge is
   always visible (not hover-only) so it is discoverable on
   touch devices, and pointer-events:none lets the click fall
   through to the link.
   ========================================================= */
.hero-shot-link {
    position: relative;
    display: block;
    border-radius: var(--radius);
    outline-offset: 4px;
}

.hero-shot-link:focus-visible {
    outline: 2px solid var(--accent-bright);
}

.hero-shot-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    background: rgba(14, 21, 41, 0.78);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    pointer-events: none;
    transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out),
        transform 160ms var(--ease-out);
}

.hero-shot-zoom svg {
    flex: 0 0 auto;
}

.hero-shot-link:hover .hero-shot-zoom,
.hero-shot-link:focus-visible .hero-shot-zoom {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    transform: translateY(-1px);
}

/* Larger wordmark needs room on narrow screens: the nav row
   holds logo + wordmark + alpha pill + toggle. */
@media (max-width: 480px) {
    .brand {
        font-size: 1.3rem;
        gap: 8px;
    }

    .nav-inner {
        padding: 5px 32px;
    }

    .brand-mark img {
        height: 52px;
    }

    .hero-shot-zoom {
        top: 10px;
        right: 10px;
        padding: 6px 11px;
        font-size: 11.5px;
    }
}


