/* ============================================================================
   Functional Prescienceâ„¢
   Stylesheet v1.0
   ----------------------------------------------------------------------------
   Palette: black / antique gold / ivory + restrained stress accents
   Type:    Cinzel (display) Â· EB Garamond (headings) Â· Inter (body) Â·
            IBM Plex Mono (technical)
   Aesthetic register: austere doctrine. Void-dominant.
============================================================================ */
/* ---------------------------------------------------------------------------
   1. RESET / BASE
---------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
dl,
figure,
blockquote {
    margin: 0;
    padding: 0;
}

ul,
ol {
    list-style: none;
}

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

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

::selection {
    background: rgba(166, 136, 76, 0.35);
    color: #E2D6BC;
}

/* ---------------------------------------------------------------------------
   2. CUSTOM PROPERTIES â€” palette, type, spacing, layout
---------------------------------------------------------------------------- */
:root {
    /* Palette â€” primary darks */
    --c-black-absolute: #030302;
    --c-black-void: #070604;
    --c-black-carbon: #0B0906;
    --c-graphite: #11100C;

    /* Palette â€” gold / brass */
    --c-bronze-shadow: #0B0703;
    --c-bronze-deep: #3A2A12;
    --c-brass-muted: #7F6A3A;
    --c-gold-antique: #A6884C;
    --c-gold-highlight: #D9B86A;

    /* Palette â€” ivory / parchment */
    --c-parchment: #C8B89A;
    --c-ivory-soft: #E2D6BC;
    --c-ivory-muted: #B8AA8A;

    /* Palette â€” optional stress */
    --c-ember: #7A3A1F;
    --c-rust: #5A2B18;
    --c-ash: #6D675B;

    /* Semantic */
    --c-bg: var(--c-black-void);
    --c-bg-deep: var(--c-black-absolute);
    --c-bg-panel: var(--c-graphite);
    --c-text: var(--c-ivory-soft);
    --c-text-muted: var(--c-ivory-muted);
    --c-text-soft: var(--c-parchment);
    --c-rule: var(--c-gold-antique);
    --c-rule-faint: rgba(166, 136, 76, 0.25);
    --c-rule-soft: rgba(166, 136, 76, 0.45);
    --c-accent: var(--c-gold-antique);
    --c-accent-bright: var(--c-gold-highlight);

    /* Typography */
    --ff-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
    --ff-heading: "EB Garamond", "Cormorant Garamond", Georgia, serif;
    --ff-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                Roboto, "Helvetica Neue", Arial, sans-serif;
    --ff-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
    --fs-eyebrow: 0.75rem;
    --fs-body: 1.0625rem;

    /* 17px */
    --fs-body-lg: 1.1875rem;

    /* 19px */
    --fs-lede: 1.375rem;

    /* 22px */
    --fs-lede-lg: 1.625rem;

    /* 26px */
    --fs-h3: 1.375rem;
    --fs-h2: 1.875rem;
    --fs-h1: 2.5rem;
    --fs-hero: 3.5rem;
    --fs-hero-lg: 4.5rem;
    --lh-tight: 1.15;
    --lh-snug: 1.3;
    --lh-base: 1.6;
    --lh-prose: 1.7;

    /* Spacing scale (modular) */
    --s-0: 0.25rem;
    --s-1: 0.5rem;
    --s-2: 0.75rem;
    --s-3: 1rem;
    --s-4: 1.5rem;
    --s-5: 2rem;
    --s-6: 3rem;
    --s-7: 4rem;
    --s-8: 6rem;
    --s-9: 8rem;
    --s-10: 12rem;

    /* Layout */
    --w-container: 72rem;

    /* 1152px */
    --w-container-narrow: 52rem;

    /* 832px â€” prose column */
    --w-container-wide: 84rem;

    /* 1344px â€” wide hero, grids */
    --w-content: 38rem;

    /* 608px â€” reading measure */
    /* Borders */
    --bd-rule: 1px solid var(--c-rule-faint);
    --bd-rule-strong: 1px solid var(--c-rule-soft);
    --bd-gold: 1px solid var(--c-gold-antique);

    /* Transitions */
    --t-fast: 120ms ease-out;
    --t-base: 200ms ease-out;
    --t-slow: 320ms ease-out;
}

/* ---------------------------------------------------------------------------
   3. BODY / GLOBAL SUBSTRATE
---------------------------------------------------------------------------- */
html,
body {
    background: var(--c-bg);
}

body {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    line-height: var(--lh-prose);
    color: var(--c-text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--c-black-void);
    background-image: url("../img/void-field-sparse.png");
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Optional secondary substrate layer applied per page via body class */
body.bg-distributed {
    background-image: url("../img/void-field-distributed.png");
}

body.bg-streak {
    background-image: url("../img/void-field-streak.png");
}

body.bg-sparse {
    background-image: url("../img/void-field-sparse.png");
}

/* ---------------------------------------------------------------------------
   4. TYPOGRAPHY HIERARCHY
---------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--ff-heading);
    font-weight: 500;
    color: var(--c-ivory-soft);
    line-height: var(--lh-tight);
    letter-spacing: -0.005em;
}

h1 {
    font-family: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: var(--fs-h1);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #d0b88c;
}

h2 {
    font-family: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: var(--fs-h2);
    font-weight: 500;
    margin-top: var(--s-5);
    margin-bottom: var(--s-4);
    color: #d0b88c;
}

main h1:hover,
main h2:hover {
    color: #c4a574;
    text-decoration-line: underline;
    text-decoration-color: #c4a574;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

h3 {
    font-size: var(--fs-h3);
    font-weight: 500;
    margin-top: var(--s-5);
    margin-bottom: var(--s-3);
    color: var(--c-parchment);
}

p {
    margin: 0 0 var(--s-4);
    max-width: 46rem;
}

p:last-child {
    margin-bottom: 0;
}

main p {
    font-weight: 500;
    letter-spacing: 0.025em;
}

.eyebrow {
    display: inline-block;
    font-family: var(--ff-body);
    font-size: var(--fs-eyebrow);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    font-weight: 500;
    margin-bottom: var(--s-3);
}

.lede {
    font-family: var(--ff-heading);
    font-size: var(--fs-lede);
    line-height: var(--lh-snug);
    color: var(--c-parchment);
    font-weight: 400;
    font-style: italic;
    max-width: var(--w-content);
    margin-bottom: var(--s-4);
}

.lede-marketing {
    font-family: var(--ff-heading);
    line-height: 1.45;
    color: var(--c-ivory-soft);
    font-weight: 400;
    font-style: normal;
    max-width: 40rem;
    margin: var(--s-4) 0;
    font-size: 1.1rem;
}

.tagline {
    font-family: var(--ff-heading);
    font-size: var(--fs-body-lg);
    font-style: italic;
    color: var(--c-parchment);
}

.tm {
    font-family: var(--ff-body);
    font-size: 0.6em;
    font-weight: 500;
    vertical-align: super;
    letter-spacing: 0;
    margin-left: 0.05em;
    color: inherit;
}

strong,
b {
    color: var(--c-ivory-soft);
    font-weight: 600;
}

em,
i {
    font-style: italic;
}

code,
kbd,
samp,
.mono {
    font-family: var(--ff-mono);
    font-size: 0.9em;
    color: var(--c-parchment);
}

/* ---------------------------------------------------------------------------
   5. LAYOUT â€” containers, sections, grid
---------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--w-container);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--s-4);
    padding-right: var(--s-4);
}

.container-narrow {
    max-width: var(--w-container-narrow);
    vertical-align: text-top;
}

.container-wide {
    max-width: var(--w-container-wide);
}

section {
    padding-top: var(--s-3);
    padding-bottom: var(--s-4);
    position: relative;
}

section + section {
    padding-top: var(--s-4);
}

.section-divider {
    border-top: var(--bd-rule);
    margin: var(--s-7) auto;
    max-width: 4rem;
}

.section-block + .section-block {
    margin-top: var(--s-6);
    padding-top: var(--s-6);
    border-top: var(--bd-rule);
}

/* Two-column hero grid */
.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: var(--s-7);
    align-items: center;
    padding-top: var(--s-7);
    padding-bottom: var(--s-7);
}

.hero-grid > div:first-child {
    min-width: 0;
}

.hero-cover {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-cover img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.86),
              0 12px 36px rgba(0, 0, 0, 0.68);
    border: 2px solid rgba(166, 136, 76, 0.32);
}

.home-hero-cover {
    transform: translateY(-3rem);
}

.book-cover-hero {
    justify-content: flex-start;
    position: relative;
    z-index: 0;
}

.book-cover-hero img {
    width: 144%;
    max-width: none;
    max-height: 84vh;
    transform: translateX(-16%);
}

.hero-grid > div:first-child {
    position: relative;
    z-index: 1;
}

/* About hero — clean video set inside the ornamental frame image.
   The frame PNG supplies the gold border + Omega; the video is inset just
   inside the gold lines so the two black starfields blend seamlessly. */
.hero-media {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.hero-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1672 / 941;
    background: url("../img/Function_P_About_video_frame.png") center / 100% 100% no-repeat;
}

.hero-video {
    position: absolute;
    top: 12%;
    left: 13.5%;
    width: 73%;
    height: 73%;
    display: block;
    object-fit: cover;
    /* Feather the edges so the video's starfield dissolves into the frame's,
       leaving the gold border and the Omega clearly visible with space. */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
                        linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
                        linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
            mask-composite: intersect;
}

/* Darkening overlay so the bright video blends with the page rather than
   contrasting against it: a slight overall veil plus an edge vignette,
   feathered to the same footprint as the video. */
.hero-video-frame::after {
    content: "";
    position: absolute;
    top: 12%;
    left: 13.5%;
    width: 73%;
    height: 73%;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0) 42%,
            rgba(0, 0, 0, 0.5) 100%),
        rgba(0, 0, 0, 0.15);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
                        linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
                        linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
            mask-composite: intersect;
}

/* Replay control — bottom-right of the frame; spins once clockwise on click */
.hero-replay {
    position: absolute;
    right: 10%;
    bottom: 13%;
    width: 8%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity var(--t-base);
    z-index: 2;
}

.hero-replay img {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-replay:hover,
.hero-replay:focus {
    opacity: 1;
    outline: none;
}

.hero-replay.is-spinning {
    animation: hero-replay-spin 0.6s ease-in-out;
}

@keyframes hero-replay-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* About hero: narrow left column (button width) + wide right column so the
   16:9 video can grow. Heading + text block 1 and the buttons stack on the
   left; the video and text block 2 stack on the right. Desktop only —
   mobile keeps the single-column stack from the ≤1024px breakpoint. */
@media (min-width: 1025px) {
    .hero--about .hero-grid {
        grid-template-columns: minmax(20rem, 30rem) minmax(0, 1fr);
        grid-template-areas:
            "intro   video"
            "actions block2";
        align-items: start;
        column-gap: var(--s-7);
        row-gap: var(--s-5);
    }

    .hero--about .hero-intro { grid-area: intro; }
    .hero--about .hero-media { grid-area: video; }
    .hero--about .hero-actions { grid-area: actions; }

    .hero--about .hero-block2 {
        grid-area: block2;
        max-width: var(--w-content);
        /* Align the paragraph's left edge with the video frame's gold border
           (the frame fills this column; its border sits 7.66% in). */
        margin: 0 0 0 7.66%;
    }

    /* Buttons sit at the top of the row, level with text block 2 — drop the
       stack's default top margin so the two row-2 blocks align. */
    .hero--about .hero-actions .book-hero-cta-stack {
        margin-top: 0;
    }
}

/* ---------------------------------------------------------------------------
   6. SITE HEADER / NAVIGATION
---------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(3, 3, 2, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(166, 136, 76, 0.18);
}

.site-header > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding-top: var(--s-3);
    padding-bottom: var(--s-3);
    max-width: var(--w-container-wide);
}

.brand {
    font-family: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 1.275rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #d0b88c;
    white-space: nowrap;
    transition: color var(--t-base);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    right: 10px;
}

.brand:hover {
    color: var(--c-gold-highlight);
}

.brand .tm {
    font-size: 0.72em;
    color: #d0b88c;
}

.brand-text {
    display: inline-block;
    transform: scale(1.25);
    transform-origin: left center;
}

.brand-logo {
    height: 1.1em;
    transform: scale(1.875);
    width: auto;
    opacity: 0.85;
    flex-shrink: 0;
}

/* Desktop nav */
.nav {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    justify-content: flex-end;
    font-family: var(--ff-body);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    position: relative;
    left: 50px;
    top: 10px;
}

.nav a {
    color: var(--c-text-muted);
    padding: var(--s-1) var(--s-1);
    transition: color var(--t-base);
    white-space: nowrap;
    border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a:focus {
    color: var(--c-gold-highlight);
    border-bottom-color: var(--c-gold-antique);
    outline: none;
}

.nav a[aria-current="page"] {
    color: var(--c-ivory-soft);
    border-bottom-color: var(--c-gold-antique);
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    font-family: var(--ff-body);
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    padding: var(--s-1) var(--s-2);
    border: 1px solid var(--c-rule-faint);
    transition: color var(--t-base), border-color var(--t-base);
}

.nav-toggle:hover {
    color: var(--c-gold-highlight);
    border-color: var(--c-gold-antique);
}

.nav-toggle[aria-expanded="true"] {
    color: var(--c-gold-highlight);
    border-color: var(--c-gold-antique);
}

/* Mobile drawer */
.nav-group-label {
    display: none;
}

/* ---------------------------------------------------------------------------
   7. BUTTONS / CTAs â€” restrained, administrative
---------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-family: var(--ff-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-ivory-soft);
    background: transparent;
    border: 1px solid var(--c-gold-antique);
    transition: background var(--t-base), color var(--t-base),
              border-color var(--t-base);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover,
.btn:focus {
    background: rgba(166, 136, 76, 0.12);
    border-color: var(--c-gold-highlight);
    color: var(--c-gold-highlight);
    outline: none;
}

.btn-primary {
    background: var(--c-gold-antique);
    color: var(--c-black-absolute);
    border-color: var(--c-gold-antique);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--c-gold-highlight);
    border-color: var(--c-gold-highlight);
    color: var(--c-black-absolute);
}

.btn-ghost {
    background: transparent;
    border-color: var(--c-rule-faint);
    color: var(--c-text-muted);
}

.btn-ghost:hover,
.btn-ghost:focus {
    border-color: var(--c-gold-antique);
    color: var(--c-ivory-soft);
}

.btn-tba-disabled {
    color: var(--c-text-muted);
    border-color: var(--c-rule-soft);
    border-width: 2px;
    background: rgba(7, 6, 4, 0.24);
    opacity: 0.58;
    cursor: default;
    pointer-events: none;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-5);
}

.hero-cta--journey {
    display: grid;
    gap: var(--s-2);
    width: min(100%, 40rem);
}

.hero-cta--journey .hero-cta-row {
    display: grid;
    gap: var(--s-2);
}

.hero-cta-row--single {
    grid-template-columns: minmax(10rem, 12rem);
}

.hero-cta-row--two {
    grid-template-columns: minmax(20rem, 2.35fr) minmax(8rem, 0.8fr);
}

.hero-cta-row--three {
    grid-template-columns: minmax(14.75rem, 1.4fr) minmax(14.75rem, 1.4fr) minmax(8rem, 0.8fr);
}

.hero-cta--journey .btn {
    width: 100%;
    min-height: 3.25rem;
    padding-inline: 0.95rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.hero-cta--journey .btn-cta-wide {
    min-width: 14.75rem;
}

.hero-cta--journey .btn-cta-compact {
    min-width: 8rem;
}

.book-hero-cta-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-2);
    width: min(100%, 30rem);
    margin-top: var(--s-5);
}

.book-hero-cta-stack .btn {
    width: 100%;
}

.book-hero-cta-stack .btn-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--c-black-absolute);
    border-color: transparent;
    color: var(--c-black-absolute);
}

.book-hero-cta-stack .btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--c-gold-antique);
    clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
    transition: background var(--t-base);
}

.book-hero-cta-stack .btn-primary:hover,
.book-hero-cta-stack .btn-primary:focus {
    background: var(--c-black-absolute);
    border-color: transparent;
    color: var(--c-black-absolute);
}

.book-hero-cta-stack .btn-primary:hover::before,
.book-hero-cta-stack .btn-primary:focus::before {
    background: var(--c-gold-highlight);
}

.book-intro-note {
    padding-top: 0;
}

.about-founder-note,
.about-founder-note .container,
.about-founder-note .about-founder-columns,
.about-founder-note .about-founder-column,
.about-founder-note .about-founder-portrait {
    background: transparent;
}

.about-founder-note .about-founder-columns {
    display: grid;
    grid-template-columns: minmax(0, calc(34rem + 50px)) 400px minmax(0, calc(34rem + 50px));
    column-gap: 0;
    justify-content: center;
}

.about-founder-note h2 {
    text-align: center;
    font-size: calc(var(--fs-h2) * 1.32);
    transform: translateY(calc(-5rem + 10px));
}

.about-founder-note .about-founder-column {
    min-width: 0;
}

.about-founder-note .about-founder-portrait {
    min-width: 0;
}

.about-founder-note .about-founder-portrait img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 1024px) {
    .about-founder-note .about-founder-columns {
        grid-template-columns: 1fr;
        gap: var(--s-4);
    }
}

@media (max-width: 1180px) and (min-width: 761px) {
    .hero-cta--journey {
        width: min(100%, 38rem);
    }

    .hero-cta-row--two,
    .hero-cta-row--three {
        grid-template-columns: 1fr 1fr;
    }

    .hero-cta-row--three .btn:last-child {
        grid-column: 1 / -1;
        justify-self: start;
        width: min(100%, 13rem);
    }
}

/* Book reading preview */
.book-preview-section {
    border-top: 1px solid var(--c-rule-faint);
}

.book-preview-grid {
    display: grid;
    grid-template-columns: 6rem minmax(15rem, 18rem) minmax(0, 1fr);
    gap: var(--s-6) var(--s-3);
    align-items: start;
    position: relative;
    margin-left: -10rem;
}

.book-preview-logo {
    position: sticky;
    top: 96px;
    align-self: flex-start;
    width: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s ease, opacity 0.35s ease;
    pointer-events: none;
}

.book-preview-logo img {
    width: 100%;
    opacity: 0.85;

}

.book-bookmarks {
    position: sticky;
    top: 96px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow: visible;
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(7, 6, 4, 0.46);
}

.proof-bookmarks {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-rule-soft) rgba(7, 6, 4, 0.28);
}

.glossary-tree {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-rule-soft) rgba(7, 6, 4, 0.28);
}

.glossary-tree details {
    margin-top: var(--s-2);
}

.glossary-category-children {
    position: relative;
    margin: var(--s-2) 0 0 var(--s-3);
    padding-left: var(--s-3);
}

.glossary-category-children::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: var(--s-4);
    border-left: 1px solid rgba(166, 136, 76, 0.42);
}

.glossary-category-children > details {
    position: relative;
}

.glossary-category-children > details::before {
    content: "";
    position: absolute;
    left: calc(var(--s-3) * -1);
    top: 2rem;
    width: var(--s-3);
    border-top: 1px solid rgba(166, 136, 76, 0.42);
}

.glossary-tree summary.book-bookmark-card {
    position: relative;
    padding-right: 3rem;
    cursor: pointer;
    list-style: none;
}

.glossary-tree summary.book-bookmark-card::-webkit-details-marker {
    display: none;
}

.glossary-tree summary.book-bookmark-card::after {
    content: "v";
    position: absolute;
    right: var(--s-3);
    top: 50%;
    color: var(--c-gold-highlight);
    font-family: var(--ff-mono);
    font-size: 0.875rem;
    line-height: 1;
    transform: translateY(-50%);
}

.glossary-tree details[open] > summary.book-bookmark-card::after {
    content: "^";
}

.glossary-letter-children {
    position: relative;
    margin: var(--s-2) 0 0 var(--s-4);
    padding-left: var(--s-3);
}

.glossary-letter-children::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: var(--s-4);
    border-left: 1px solid var(--c-rule-soft);
}

.glossary-letter-children .book-bookmark-card {
    position: relative;
}

.glossary-letter-children .book-bookmark-card::before {
    content: "";
    position: absolute;
    left: calc(var(--s-3) * -1);
    top: 50%;
    width: var(--s-3);
    border-top: 1px solid var(--c-rule-soft);
}

.glossary-category-card .book-bookmark-marker {
    border-color: rgba(217, 184, 106, 0.56);
    color: var(--c-gold-highlight);
}

.glossary-entry-card .book-bookmark-marker {
    font-family: var(--ff-mono);
    font-size: 0.72rem;
}

.glossary-source-flag {
    display: inline-flex;
    align-items: center;
    margin-left: var(--s-2);
    padding: 0.12rem 0.36rem;
    border: 1px solid var(--c-rule-faint);
    color: var(--c-gold-antique);
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

.glossary-expression-text {
    display: grid;
    gap: var(--s-2);
    width: min(100%, 62rem);
    margin: var(--s-4) 0;
    padding: var(--s-3) var(--s-4);
    border-left: 2px solid rgba(217, 184, 106, 0.5);
    background: rgba(7, 6, 4, 0.34);
    color: var(--c-text-muted);
}

.glossary-expression-text strong {
    color: var(--c-gold-antique);
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.glossary-expression-text span {
    color: var(--c-ivory-soft);
    font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.glossary-equation {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.32rem;
    width: min(100%, 68rem);
    max-width: 100%;
    margin: var(--s-4) 0;
    padding: var(--s-4);
    border-top: 1px solid var(--c-rule-faint);
    border-bottom: 1px solid var(--c-rule-faint);
    color: var(--c-ivory-soft);
    background: rgba(7, 6, 4, 0.34);
    font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
    font-size: clamp(1.05rem, 2vw, 1.42rem);
    line-height: 1.7;
    text-align: center;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-rule-soft) rgba(7, 6, 4, 0.28);
}

.glossary-cross-references {
    position: relative;
    width: min(100%, 68rem);
    margin-top: var(--s-4);
    padding-top: 0;
}

.glossary-cross-references h3 {
    margin: 0 0 var(--s-3);
    color: var(--c-gold-antique);
    font-family: var(--ff-mono);
    font-size: 0.86rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.glossary-cross-ref-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.glossary-cross-ref {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 0.55rem 0.72rem;
    border: 1px solid rgba(166, 136, 76, 0.42);
    color: var(--c-ivory-soft);
    background: rgba(7, 6, 4, 0.52);
    text-align: left;
    transition: border-color var(--t-base), background var(--t-base), color var(--t-base);
}

.glossary-cross-ref:hover,
.glossary-cross-ref:focus {
    border-color: var(--c-gold-antique);
    background: rgba(166, 136, 76, 0.12);
    outline: none;
}

.glossary-cross-ref-term {
    font-family: var(--ff-heading);
    font-size: 1.1rem;
    line-height: 1.2;
}

.glossary-cross-ref .glossary-source-flag {
    margin-left: 0;
    font-size: 0.7rem;
}

.glossary-tooltip-rail {
    width: 100%;
    margin-top: 0.35rem;
    border-top: 3px solid rgba(166, 136, 76, 0.48);
}

.glossary-tooltip {
    position: relative;
    z-index: 20;
    display: grid;
    gap: var(--s-2);
    width: fit-content;
    min-width: min(18rem, 100%);
    max-width: min(42rem, 100%);
    margin-top: -1px;
    padding: var(--s-3);
    border: 1px solid var(--c-gold-antique);
    border-top-width: 3px;
    color: var(--c-text);
    background: transparent;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.25rem);
    transition: opacity var(--t-base), transform var(--t-base);
}

.glossary-tooltip[hidden] {
    display: none;
}

.glossary-tooltip strong {
    color: var(--c-gold-highlight);
    font-family: var(--ff-heading);
    font-size: 1.2rem;
    line-height: 1.2;
}

.glossary-tooltip span {
    color: var(--c-text-muted);
    font-size: 1.06rem;
    line-height: var(--lh-snug);
}

.glossary-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.glossary-equation .mi {
    font-style: italic;
}

.glossary-equation .mtext {
    font-family: var(--ff-body);
    font-size: 0.78em;
    letter-spacing: 0.01em;
}

.glossary-equation .mo {
    padding: 0 0.18em;
}

.glossary-equation sub,
.glossary-equation sup {
    font-size: 0.62em;
    line-height: 0;
}

.mstack {
    display: inline-grid;
    gap: 0.35rem;
    justify-items: start;
    min-width: max-content;
}

.mline {
    display: block;
    white-space: nowrap;
}

.mline-indent {
    padding-left: 2.35em;
}

.mfrac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1.25;
}

.mfrac .mnum {
    display: block;
    padding: 0 0.3em 0.12em;
    border-bottom: 1px solid currentColor;
}

.mfrac .mden {
    display: block;
    padding: 0.12em 0.3em 0;
}

.msum {
    position: relative;
    display: inline-grid;
    min-width: 1.8em;
    margin: 0 0.18em;
    place-items: center;
    vertical-align: middle;
}

.msum .sum-symbol {
    font-size: 1.45em;
    line-height: 1;
}

.msum .sum-upper,
.msum .sum-lower {
    font-size: 0.52em;
    line-height: 1;
}

.msum .sum-upper {
    margin-bottom: -0.15em;
}

.msum .sum-lower {
    margin-top: -0.15em;
}

.book-bookmark-card {
    display: block;
    width: 100%;
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(7, 6, 4, 0.34);
    color: var(--c-text-muted);
    text-align: left;
    transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
}

.book-bookmark-card + .book-bookmark-card {
    margin-top: var(--s-2);
}

.book-bookmark-card:hover,
.book-bookmark-card:focus,
.book-bookmark-card.is-active {
    color: var(--c-ivory-soft);
    border-color: var(--c-gold-antique);
    background: rgba(166, 136, 76, 0.08);
    outline: none;
}

.book-bookmark-head {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
}

.book-bookmark-marker {
    display: grid;
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border: 1px solid var(--c-rule-soft);
    color: var(--c-gold-highlight);
    background: rgba(166, 136, 76, 0.08);
    font-family: var(--ff-heading);
    font-size: 0.875rem;
    line-height: 1;
}

.book-bookmark-label {
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
}

.book-bookmark-card strong {
    display: block;
    color: var(--c-ivory-soft);
    font-family: var(--ff-heading);
    font-size: 1rem;
    line-height: 1.25;
}

.book-bookmark-head strong {
    min-width: 0;
}

.book-bookmark-card span:last-child {
    display: block;
    margin-top: var(--s-2);
    color: var(--c-text-muted);
    font-size: 0.875rem;
    line-height: var(--lh-snug);
}

.book-reading-body {
    border-top: 1px solid var(--c-rule-faint);
    border-bottom: 1px solid var(--c-rule-faint);
    background: rgba(7, 6, 4, 0.26);
    padding: var(--s-5);
    margin-left: 5rem;
}

.book-reading-body[data-glossary-panels] {
    position: relative;
    border-bottom: 0;
    padding-bottom: calc(var(--s-5) + clamp(2.5rem, 4vw, 3.5rem));
}

.book-reading-body[data-glossary-panels]::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0.35rem;
    left: 0;
    height: clamp(3.6rem, 5.76vw, 5.04rem);
    background-image: url("../img/aip-divider-standard-content-master-size 160.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.82;
    pointer-events: none;
}

.book-reading-panel {
    display: none;
}

.book-reading-panel.is-active {
    display: block;
}

.book-reading-body.view-all .book-reading-panel {
    display: block;
}

.book-reading-body.view-all .book-reading-panel + .book-reading-panel {
    margin-top: var(--s-7);
    padding-top: var(--s-7);
    border-top: 1px solid var(--c-rule-faint);
}

.book-reading-body[data-glossary-panels].view-all .book-reading-panel + .book-reading-panel {
    position: relative;
    border-top: 0;
    padding-top: calc(var(--s-7) + clamp(2.5rem, 4vw, 3.5rem));
}

.book-reading-body[data-glossary-panels].view-all .book-reading-panel + .book-reading-panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: -2%;
    left: -2%;
    height: clamp(3.6rem, 5.76vw, 5.04rem);
    background-image: url("../img/aip-divider-standard-content-master-size 160.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.82;
    pointer-events: none;
}

.book-reading-panel h2 {
    margin-top: 0;
}

.book-reading-panel p {
    max-width: var(--w-content);
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-4);
}

/* ---------------------------------------------------------------------------
   8. GOLD-BORDER FRAMED BLOCK
---------------------------------------------------------------------------- */
.bordered-block {
    position: relative;
    padding: var(--s-6) var(--s-5);
    margin: var(--s-5) 0;
}

.bordered-block::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-top: 1px solid var(--c-gold-antique);
    border-bottom: 1px solid var(--c-gold-antique);
}

.bordered-block::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-left: 1px solid var(--c-gold-antique);
    border-right: 1px solid var(--c-gold-antique);

    /* Tick marks via box-shadow trickery handled inline in markup if needed */
}

/* ---------------------------------------------------------------------------
   9. CARDS â€” domain cards, case cards, generic
---------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: var(--s-3);
    margin-top: var(--s-5);
}

.card {
    display: block;
    padding: var(--s-4) var(--s-4);
    background: rgba(11, 9, 6, 0.6);
    border: 1px solid var(--c-rule-faint);
    color: var(--c-text);
    transition: border-color var(--t-base), background var(--t-base),
              transform var(--t-base);
    text-decoration: none;
}

.card:hover,
.card:focus {
    border-color: var(--c-gold-antique);
    background: rgba(11, 9, 6, 0.85);
    outline: none;
}

.card h3 {
    font-family: var(--ff-heading);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--c-ivory-soft);
    margin: 0;
    line-height: 1.3;
}

.card p {
    font-size: 0.9375rem;
    color: var(--c-text-muted);
    margin-top: var(--s-2);
    margin-bottom: 0;
}

/* Domain card variant */
.domain-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 7rem;
}

.domain-card .card-mark {
    margin-top: var(--s-3);
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    color: var(--c-gold-antique);
    text-transform: uppercase;
}

.domain-examples-section {
    border-top: 1px solid var(--c-rule-faint);
}

.domain-examples-intro {
    text-align: center;
}

.domain-examples-intro h2 {
    margin-left: auto;
    margin-right: auto;
}

.domain-examples-intro p {
    max-width: 58rem;
    margin-left: auto;
    margin-right: auto;
    color: var(--c-parchment);
}

.domain-example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: var(--s-5);
    border-top: 1px solid var(--c-rule-faint);
    border-bottom: 1px solid var(--c-rule-faint);
}

.domain-example {
    position: relative;
    padding: var(--s-4);
    border-bottom: 1px solid var(--c-rule-faint);
    background: rgba(7, 6, 4, 0.34);
}

.domain-example:nth-child(odd) {
    border-right: 1px solid var(--c-rule-faint);
}

.domain-example:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.domain-example-head {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
}

.domain-example-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--c-rule-soft);
    color: var(--c-gold-highlight);
    background: rgba(166, 136, 76, 0.08);
    font-family: var(--ff-heading);
    font-size: 1rem;
    line-height: 1;
}

.domain-example-icon--placeholder {
    color: transparent;
    border-color: rgba(166, 136, 76, 0.18);
    background: transparent;
}

.domain-example-number {
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
}

.domain-example h3 {
    margin-top: 0;
    margin-bottom: var(--s-2);
    color: var(--c-ivory-soft);
}

.domain-example p {
    max-width: none;
    margin-bottom: 0;
    color: var(--c-text-muted);
    font-size: 0.98rem;
}

.domain-examples-close {
    margin: var(--s-4) auto 0;
    max-width: 46rem;
    text-align: center;
    color: var(--c-parchment);
}

@media (max-width: 760px) {
    .domain-example-grid {
        grid-template-columns: 1fr;
    }

    .domain-example,
    .domain-example:nth-child(odd),
    .domain-example:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--c-rule-faint);
    }

    .domain-example:last-child {
        border-bottom: 0;
    }
}

/* ---------------------------------------------------------------------------
   10. PROOF GATE LEDGER
---------------------------------------------------------------------------- */
.gate-ledger {
    margin-top: var(--s-5);
    border-top: 1px solid var(--c-rule-soft);
}

.gate {
    display: grid;
    grid-template-columns: 5rem 1fr 9rem;
    gap: var(--s-4);
    padding: var(--s-4) 0;
    border-bottom: 1px solid var(--c-rule-faint);
    align-items: baseline;
}

.gate-number {
    font-family: var(--ff-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--c-gold-antique);
    text-transform: uppercase;
}

.gate-body h3 {
    font-family: var(--ff-heading);
    font-size: 1.125rem;
    margin: 0 0 var(--s-1) 0;
    color: var(--c-ivory-soft);
}

.gate-body p {
    font-size: 0.9375rem;
    color: var(--c-text-muted);
    margin: 0;
    max-width: none;
}

.gate-status {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-parchment);
    text-align: right;
    justify-self: end;
}

.gate-status[data-status="survived"] {
    color: var(--c-gold-antique);
}

.gate-status[data-status="extended"] {
    color: var(--c-gold-highlight);
}

.gate-status[data-status="open"] {
    color: var(--c-ash);
}

.gate.gate-radical {
    background: rgba(166, 136, 76, 0.05);
    padding-left: var(--s-3);
    padding-right: var(--s-3);
    border-bottom-color: var(--c-rule-soft);
}

.gate.gate-radical .gate-number {
    color: var(--c-gold-highlight);
}

/* ---------------------------------------------------------------------------
   11. HISTORICAL FAILURE â€” case cards + archive table
---------------------------------------------------------------------------- */
.failure-group {
    margin-top: var(--s-7);
}

.failure-group-header {
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    margin-bottom: var(--s-3);
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--c-rule-soft);
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: var(--s-3);
}

.case-card {
    padding: var(--s-4);
    background: rgba(7, 6, 4, 0.7);
    border: 1px solid var(--c-rule-faint);
    position: relative;
}

.case-card h3 {
    font-family: var(--ff-heading);
    font-size: 1.0625rem;
    margin: 0 0 var(--s-2) 0;
    color: var(--c-ivory-soft);
}

.case-card dl {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    row-gap: var(--s-1);
    column-gap: var(--s-2);
    font-size: 0.875rem;
    line-height: 1.45;
}

.case-card dt {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    padding-top: 0.2em;
}

.case-card dd {
    margin: 0;
    color: var(--c-text);
}

/* Archive table */
.archive-table {
    width: 100%;
    margin-top: var(--s-6);
    font-size: 0.8125rem;
    font-family: var(--ff-body);
    border-top: 1px solid var(--c-rule-soft);
    border-bottom: 1px solid var(--c-rule-soft);
}

.archive-table thead th {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    text-align: left;
    padding: var(--s-3) var(--s-2);
    border-bottom: 1px solid var(--c-rule-soft);
    vertical-align: bottom;
    font-weight: 500;
}

.archive-table td {
    padding: var(--s-3) var(--s-2);
    border-bottom: 1px solid var(--c-rule-faint);
    vertical-align: top;
    color: var(--c-text-muted);
}

.archive-table tbody tr:hover td {
    background: rgba(166, 136, 76, 0.04);
    color: var(--c-text);
}

.archive-table td:first-child {
    color: var(--c-ivory-soft);
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
   12. DOMAIN PAGE â€” motif banner
---------------------------------------------------------------------------- */
.domain-banner {
    width: 100%;
    height: 9rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-top: 1px solid var(--c-rule-faint);
    border-bottom: 1px solid var(--c-rule-faint);
    margin-top: 0;
}

.domain-banner[data-motif="sovereign"] {
    background-image: url("../img/motifs/motif-sovereign.jpg");
}

.domain-banner[data-motif="ai"] {
    background-image: url("../img/motifs/motif-ai-platforms.png");
}

.domain-banner[data-motif="enterprise"] {
    background-image: url("../img/motifs/motif-enterprise.jpg");
}

.domain-banner[data-motif="government"] {
    background-image: url("../img/motifs/motif-government.png");
}

.domain-banner[data-motif="medicine"] {
    background-image: url("../img/motifs/motif-medicine.png");
}

.domain-banner[data-motif="finance"] {
    background-image: url("../img/motifs/motif-finance.png");
}

.domain-banner[data-motif="media"] {
    background-image: url("../img/motifs/motif-media.png");
}

/* ---------------------------------------------------------------------------
   13. FORMS
---------------------------------------------------------------------------- */
.form-block {
    margin-top: var(--s-5);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-rule-soft);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-3) var(--s-4);
    max-width: 44rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    font-weight: 500;
}

.field .field-note {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    font-family: var(--ff-body);
    letter-spacing: 0;
    text-transform: none;
    margin-top: 0.1rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
    background: rgba(7, 6, 4, 0.7);
    border: 1px solid var(--c-rule-faint);
    color: var(--c-ivory-soft);
    font-family: var(--ff-body);
    font-size: 0.9375rem;
    padding: var(--s-2) var(--s-3);
    transition: border-color var(--t-base), background var(--t-base);
    width: 100%;
}

.field textarea {
    min-height: 7rem;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--c-gold-antique);
    background: rgba(11, 9, 6, 0.9);
    outline: none;
}

.field-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    font-size: 0.875rem;
    color: var(--c-text);
    cursor: pointer;
    line-height: 1.45;
}

.field-checkbox input[type="checkbox"] {
    margin-top: 0.25em;
    width: 1rem;
    height: 1rem;
    accent-color: var(--c-gold-antique);
    flex-shrink: 0;
}

.form-actions {
    margin-top: var(--s-4);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.form-message {
    font-size: 0.875rem;
    color: var(--c-text-muted);
    font-family: var(--ff-body);
}

.form-message.is-success {
    color: var(--c-gold-highlight);
    font-family: var(--ff-heading);
    font-size: var(--fs-body-lg);
    font-style: italic;
}

.form-message.is-error {
    color: var(--c-ember);
}

/* ---------------------------------------------------------------------------
   14. STICKY IN-PAGE TOC (desktop)
---------------------------------------------------------------------------- */
.page-with-toc {
    display: grid;
    grid-template-columns: 14rem 1fr;
    gap: var(--s-7);
    align-items: start;
    max-width: var(--w-container-wide);
    margin: 0 auto;
    padding: var(--s-5) var(--s-4);
}

.toc {
    position: sticky;
    top: 5rem;
    border-left: 1px solid var(--c-rule-faint);
    padding-left: var(--s-3);
    font-size: 0.8125rem;
    font-family: var(--ff-body);
    line-height: 1.5;
}

.toc-label {
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    margin-bottom: var(--s-2);
    display: block;
}

.toc ol {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.toc a {
    display: block;
    color: var(--c-text-muted);
    padding: var(--s-0) 0;
    border-left: 2px solid transparent;
    padding-left: var(--s-2);
    margin-left: -1rem;
    transition: color var(--t-base), border-color var(--t-base);
}

.toc a:hover {
    color: var(--c-ivory-soft);
}

.toc a.is-active {
    color: var(--c-gold-antique);
    border-left-color: var(--c-gold-antique);
}

/* Mobile jump menu */
.jump-menu {
    display: none;
    margin-bottom: var(--s-4);
}

.jump-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--s-2) var(--s-3);
    background: rgba(11, 9, 6, 0.7);
    border: 1px solid var(--c-rule-faint);
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
}

.jump-menu-list {
    display: none;
    margin-top: var(--s-2);
    padding: var(--s-3);
    background: rgba(7, 6, 4, 0.95);
    border: 1px solid var(--c-rule-faint);
}

.jump-menu.is-open .jump-menu-list {
    display: block;
}

.jump-menu-list ol {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.jump-menu-list a {
    display: block;
    padding: var(--s-1) 0;
    color: var(--c-text-muted);
    font-size: 0.875rem;
}

.jump-menu-list a:hover {
    color: var(--c-ivory-soft);
}

/* ---------------------------------------------------------------------------
   15. PAGE INTRO
---------------------------------------------------------------------------- */
.page-intro {
    padding-top: var(--s-7);
    padding-bottom: var(--s-6);
}

.page-intro .lede {
    margin-top: var(--s-3);
    font-size: var(--fs-lede);
}

/* ---------------------------------------------------------------------------
   16. FOOTER
---------------------------------------------------------------------------- */
.site-footer {
    background: var(--c-black-absolute);
    background-image: url("../img/void-field-streak.png");
    background-size: cover;
    background-position: center bottom;
    background-blend-mode: overlay;
    border-top: 1px solid var(--c-rule-soft);
    padding: var(--s-7) 0 var(--s-5) 0;
    margin-top: var(--s-9);
    color: var(--c-text-muted);
    font-size: 0.875rem;
}

.site-footer .container {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    max-width: var(--w-container-wide);
}

.footer-mark {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-family: var(--ff-heading);
    font-style: italic;
    font-size: 1.0625rem;
    color: var(--c-parchment);
}

.footer-mark img {
    width: 1.75rem;
    height: 1.75rem;
    opacity: 0.85;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-5);
}

.footer-col h4 {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    margin-bottom: var(--s-3);
    font-weight: 500;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.footer-col a {
    color: var(--c-text-muted);
    transition: color var(--t-base);
    font-size: 0.9375rem;
}

.footer-col a:hover {
    color: var(--c-gold-highlight);
}

.footer-legal {
    font-size: 0.75rem;
    color: var(--c-ivory-muted);
    border-top: 1px solid var(--c-rule-faint);
    padding-top: var(--s-4);
    max-width: var(--w-content);
    line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   17. UTILITIES
---------------------------------------------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--c-text-muted);
}

.text-soft {
    color: var(--c-parchment);
}

.text-gold {
    color: var(--c-gold-antique);
}

.text-mono {
    font-family: var(--ff-mono);
}

.no-margin {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Pull-quote / gravity line */
.pull-quote {
    font-family: var(--ff-heading);
    font-size: var(--fs-lede);
    line-height: 1.45;
    font-style: italic;
    color: var(--c-parchment);
    border-left: 1px solid var(--c-gold-antique);
    padding-left: var(--s-4);
    margin: var(--s-5) 0;
    max-width: var(--w-content);
}

/* Boundary statement (used on domain / medicine / finance pages) */
.boundary-note {
    font-family: var(--ff-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--c-parchment);
    border: 1px solid var(--c-rule-faint);
    padding: var(--s-3) var(--s-4);
    background: rgba(11, 9, 6, 0.4);
    margin: var(--s-4) 0;
}

.boundary-note strong {
    color: var(--c-gold-antique);
    font-family: var(--ff-mono);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.6875rem;
    display: block;
    margin-bottom: var(--s-1);
}

/* Gift of Sight equation readability */
.gift-page .boundary-note strong {
    color: var(--c-gold-highlight);
}

.gift-page .glossary-equation {
    width: 100%;
    max-width: none;
    flex-wrap: nowrap;
    gap: 0.55rem;
    color: #fff8e8;
    font-size: clamp(1.18rem, 1.8vw, 1.72rem);
}

.gift-page .glossary-equation .mfrac {
    min-width: max-content;
}

.gift-page .glossary-equation .mnum,
.gift-page .glossary-equation .mden {
    white-space: nowrap;
}

.gift-page #gift-expanded-form .boundary-note {
    width: min(100%, 76rem);
    max-width: none;
}

.gift-page #gift-expanded-form .glossary-equation {
    font-size: clamp(1.18rem, 1.55vw, 1.56rem);
}

.gift-page #gift-expanded-form .glossary-equation .mfrac {
    min-width: min-content;
}

.gift-page #gift-candidates .archive-table {
    font-size: clamp(1rem, 1vw, 1.08rem);
    line-height: 1.58;
}

.gift-page #gift-candidates .archive-table thead th {
    color: var(--c-gold-highlight);
    font-size: 0.76rem;
    letter-spacing: 0.13em;
}

.gift-page #gift-candidates .archive-table td {
    padding: var(--s-4) var(--s-3);
    color: #eee3cb;
}

.gift-page #gift-candidates .archive-table td:first-child {
    color: #fff8e8;
    font-weight: 600;
}

.gift-page #gift-candidates .archive-table td:nth-child(2) {
    color: #ddcca7;
}

.gift-page .gift-myth-opening {
    padding-top: calc(2rem + 5px);
}

.gift-page .hero-intro > [role="tabpanel"][data-gift-hero-panel="theorem"] {
    margin-top: 2rem;
}

.gift-page .gift-myth-scene-stack {
    display: none;
}

.gift-page .gift-myth-panorama img {
    display: block;
    width: 100%;
    height: auto;
}

@media (min-width: 1281px) {
    .gift-page .hero--about .hero-intro {
        width: 125%;
        margin-left: -25%;
    }

    .gift-page .hero--about .hero-actions {
        width: 125%;
        margin-left: -25%;
    }

    .gift-page .hero--about .hero-actions .book-hero-cta-stack {
        margin-left: auto;
        margin-right: auto;
    }

    .gift-page .hero--about .hero-media {
        display: flex;
        justify-content: center;
        align-self: center;
        align-items: center;
    }

    .gift-page .hero--about .hero-video-frame {
        width: 118%;
        max-width: 54rem;
        flex: 0 0 auto;
    }

    body.gift-page[data-gift-hero-mode="theorem"] .hero--about .hero-block2 {
        margin-top: calc(var(--gift-theorem-block-offset, 0px) + 2rem);
    }

    body.gift-page[data-gift-hero-mode="myth"] .hero--about .hero-media {
        align-self: start;
        margin-top: calc(var(--gift-myth-video-offset, 0px) - 11rem - 20px);
    }

    body.gift-page[data-gift-hero-mode="myth"] .hero--about .hero-actions {
        display: none;
    }

    body.gift-page[data-gift-hero-mode="myth"] .hero--about .gift-myth-scene-stack {
        display: block;
        position: absolute;
        top: var(--gift-myth-scene-offset, 0px);
        left: 50%;
        width: 118%;
        max-width: 54rem;
        transform: translateX(-50%);
    }

    body.gift-page[data-gift-hero-mode="myth"] .hero--about .gift-myth-scene {
        display: block;
        width: 100%;
        height: auto;
    }

    body.gift-page[data-gift-hero-mode="myth"] .hero--about .gift-myth-scene + .gift-myth-scene {
        margin-top: -1rem;
    }

    body.gift-page[data-gift-hero-mode="myth"] .hero--about .gift-myth-panorama {
        grid-column: 1 / -1;
        width: calc(100% + 26.4rem);
        margin: -7rem 0 0 -13.2rem;
        position: relative;
        z-index: 1;
    }

    .gift-page .book-preview-grid {
        grid-template-columns: 6rem minmax(13rem, 15rem) minmax(0, 1fr);
        gap: var(--s-5) var(--s-3);
    }
}

@media (min-width: 1281px) {
    body.gift-page[data-gift-hero-mode="theorem"] .hero--about .hero-grid {
        grid-template-areas:
            "intro video"
            "intro block2"
            "intro actions";
    }

    body.gift-page[data-gift-hero-mode="theorem"] .hero--about .hero-media {
        align-self: start;
        margin-top: 8.9rem;
    }

    body.gift-page[data-gift-hero-mode="theorem"] .hero--about .hero-actions {
        justify-self: center;
        width: 118%;
        max-width: 54rem;
        margin-left: 0;
        margin-top: calc(-3rem - 20px);
    }

    body.gift-page[data-gift-hero-mode="theorem"] .hero--about .hero-block2 {
        width: 142.5%;
        max-width: 42.75rem;
        transform: translateX(-30px);
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .gift-page .hero--about .hero-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "intro"
            "video"
            "block2"
            "actions";
        gap: var(--s-5);
        align-items: start;
    }

    .gift-page .hero--about .hero-intro,
    .gift-page .hero--about .hero-actions {
        width: 100%;
        margin-left: 0;
    }

    .gift-page .hero--about .hero-video-frame {
        width: 100%;
    }

    .gift-page .hero--about .hero-block2 {
        margin: 0;
    }
}

@media (min-width: 761px) {
    .gift-page #gift-expanded-form .boundary-note {
        width: calc(100% + 8rem);
        margin-left: -4rem;
        margin-right: -4rem;
    }
}

/* ---------------------------------------------------------------------------
   18. RESPONSIVE â€” tablet (â‰¤ 1024px)
---------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    :root {
        --fs-hero: 2.75rem;
        --fs-hero-lg: 3.5rem;
        --fs-h1: 2.125rem;
        --fs-h2: 1.625rem;
    }

    /* Collapse nav to drawer */
    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(3, 3, 2, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--c-rule-soft);
        flex-direction: column;
        align-items: stretch;
        padding: var(--s-4);
        gap: 0;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }

    .nav.is-open {
        display: flex;
    }

    .nav a {
        padding: var(--s-2) 0;
        border-bottom: 1px solid var(--c-rule-faint);
        font-size: 0.9375rem;
        color: var(--c-text);
    }

    .nav a:hover,
    .nav a:focus {
        border-bottom-color: var(--c-rule-faint);
        color: var(--c-gold-highlight);
    }

    .nav-group-label {
        display: block;
        font-family: var(--ff-mono);
        font-size: 0.6875rem;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--c-gold-antique);
        padding-top: var(--s-4);
        padding-bottom: var(--s-2);
        border-bottom: 0;
    }

    .nav-group-label:first-child {
        padding-top: 0;
    }

    /* Hero stacks: cover above text on tablet/mobile */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--s-5);
        text-align: left;
        padding-top: var(--s-5);
    }

    .hero-cover {
        order: -1;
        max-width: 18rem;
        margin: 0;
    }

    .hero-cover img {
        max-height: 50vh;
    }

    /* TOC stacks above content */
    .page-with-toc {
        grid-template-columns: 1fr;
        gap: var(--s-4);
    }

    .toc {
        display: none;
    }

    .book-preview-grid {
        grid-template-columns: 1fr;
        gap: var(--s-4);
    }

    .book-preview-logo {
        display: none;
    }

    .book-bookmarks {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .jump-menu {
        display: block;
    }

    /* Footer grid stacks */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--s-4);
    }

    /* Gate ledger reflow */
    .gate {
        grid-template-columns: 1fr;
        gap: var(--s-1);
    }

    .gate-status {
        text-align: left;
        justify-self: start;
    }

    /* Case card grid */
    .case-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   19. RESPONSIVE â€” mobile (â‰¤ 640px)
---------------------------------------------------------------------------- */
@media (max-width: 640px) {
    :root {
        --fs-body: 1rem;
        --fs-h1: 1.875rem;
        --fs-h2: 1.5rem;
        --fs-lede: 1.1875rem;
    }

    body {
        background-attachment: scroll;
    }

    .container {
        padding-left: var(--s-3);
        padding-right: var(--s-3);
    }

    section {
        padding-top: var(--s-3);
        padding-bottom: var(--s-4);
    }

    h1 .tm {
        font-size: 0.5em;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }

    .hero-cta {
        gap: var(--s-2);
    }

    .hero-cta .btn {
        width: 100%;
    }

    .hero-cta--journey,
    .hero-cta--journey .hero-cta-row {
        grid-template-columns: 1fr;
    }

    .hero-cta--journey .btn,
    .hero-cta--journey .btn-cta-wide,
    .hero-cta--journey .btn-cta-compact {
        min-width: 0;
        white-space: normal;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Form grid stacks */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Case card dl reflow */
    .case-card dl {
        grid-template-columns: 1fr;
        row-gap: 0.25rem;
    }

    .case-card dt {
        padding-top: var(--s-1);
    }

    /* Archive table â€” convert to stacked block */
    .archive-table thead {
        display: none;
    }

    .archive-table,
    .archive-table tbody,
    .archive-table tr,
    .archive-table td {
        display: block;
        width: 100%;
    }

    .archive-table tr {
        border-bottom: 1px solid var(--c-rule-soft);
        padding: var(--s-3) 0;
    }

    .archive-table td {
        padding: var(--s-0) 0;
        border: 0;
    }

    .archive-table td::before {
        content: attr(data-label) " Â· ";
        font-family: var(--ff-mono);
        font-size: 0.6875rem;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--c-gold-antique);
    }

    .archive-table td:first-child::before {
        content: "";
    }
}

/* ---------------------------------------------------------------------------
   20. PRINT
---------------------------------------------------------------------------- */
@media print {
    body {
        background: white;
        color: black;
    }

    .site-header,
    .site-footer,
    .hero-cta,
    .nav-toggle,
    .toc {
        display: none;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

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

/* ---------------------------------------------------------------------------
   22. PROSE LISTS & VULNERABILITY DL
---------------------------------------------------------------------------- */
.prose-list {
    margin: var(--s-3) 0 var(--s-4) 0;
    padding-left: 0;
    max-width: var(--w-content);
}

.prose-list li {
    padding: var(--s-1) 0 var(--s-1) var(--s-4);
    position: relative;
    color: var(--c-text);
    line-height: var(--lh-base);
}

.prose-list li::before {
    content: "â€”";
    position: absolute;
    left: 0;
    color: var(--c-gold-antique);
    font-family: var(--ff-mono);
}

.vulnerability-list {
    margin-top: var(--s-4);
    max-width: var(--w-content);
}

.vulnerability-list dt {
    font-family: var(--ff-heading);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--c-ivory-soft);
    margin-top: var(--s-4);
    padding-top: var(--s-3);
    border-top: 1px solid var(--c-rule-faint);
}

.vulnerability-list dt:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.vulnerability-list dd {
    margin: var(--s-1) 0 0 0;
    color: var(--c-text-muted);
    font-size: var(--fs-body);
    line-height: var(--lh-base);
}

/* ---------------------------------------------------------------------------
   23. AIP INTERACTIVE MODEL
---------------------------------------------------------------------------- */
.aip-model-section {
    padding-top: 0;
}

.aip-model {
    margin-top: var(--s-4);
    padding: var(--s-4);
    border: 1px solid var(--c-rule-soft);
    background: rgba(11, 9, 6, 0.72);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
    overflow: clip;
}

.aip-model-head {
    margin-bottom: var(--s-4);
}

.aip-model-kicker {
    display: block;
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    margin-bottom: var(--s-1);
}

.aip-model-title {
    font-family: var(--ff-heading);
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--c-ivory-soft);
    margin: 0 0 var(--s-2);
}

.aip-model-copy {
    color: var(--c-text-muted);
    max-width: 48rem;
    margin: 0;
}

.aip-sim {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: var(--s-4);
    align-items: start;
}

.aip-sim-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--s-2);
    align-items: stretch;
    min-height: 16rem;
    padding-top: var(--s-2);
}

.aip-sim-track::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(166, 136, 76, 0.55), transparent);
}

.aip-sim-node {
    position: relative;
    z-index: 1;
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(16, 13, 9, 0.92);
    min-height: 9.5rem;
    display: flex;
    align-items: flex-end;
    transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base), background var(--t-base);
}

.aip-sim-node span {
    display: block;
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-highlight);
}

.aip-sim-node.is-active {
    border-color: var(--c-gold-highlight);
    box-shadow: 0 0 0 1px rgba(217, 184, 106, 0.2), 0 0 34px rgba(217, 184, 106, 0.14);
    background: rgba(26, 20, 11, 0.98);
    transform: translateY(-2px);
}

.aip-sim-node.is-dim {
    opacity: 0.55;
}

.aip-sim-pulse {
    position: absolute;
    top: calc(50% - 0.55rem);
    left: 0.75rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: radial-gradient(circle, var(--c-gold-highlight) 0 30%, var(--c-gold-antique) 50%, transparent 72%);
    box-shadow: 0 0 18px rgba(217, 184, 106, 0.6);
    transform: translateX(0);
    opacity: 0;
}

.aip-sim-panel {
    border-left: 1px solid var(--c-rule-faint);
    padding-left: var(--s-4);
}

.aip-sim-controls {
    display: grid;
    gap: var(--s-3);
}

.aip-sim-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.25rem;
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid var(--c-gold-antique);
    color: var(--c-black-absolute);
    background: var(--c-gold-antique);
}

.aip-sim-button-ghost {
    color: var(--c-ivory-soft);
    background: transparent;
}

.aip-sim-slider {
    display: grid;
    gap: var(--s-1);
    color: var(--c-text-muted);
    font-size: 0.9375rem;
}

.aip-sim-slider span {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-parchment);
}

.aip-sim-slider input[type="range"] {
    width: 100%;
    accent-color: var(--c-gold-antique);
}

.aip-sim-slider small {
    color: var(--c-text-muted);
    line-height: var(--lh-base);
}

.aip-sim-readout {
    margin-top: var(--s-4);
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(255, 255, 255, 0.02);
}

.aip-sim-status {
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-highlight);
    margin-bottom: var(--s-1);
}

.aip-sim-readout p {
    margin: 0;
    color: var(--c-text-muted);
}

.aip-sim-legend {
    display: flex;
    gap: var(--s-3);
    flex-wrap: wrap;
    margin-top: var(--s-3);
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-parchment);
}

.aip-sim-legend span {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
}

.aip-sim-legend i {
    display: inline-block;
    width: 1rem;
    height: 1px;
    background: var(--c-gold-antique);
}

@media (max-width: 1024px) {
    .aip-sim {
        grid-template-columns: 1fr;
    }

    .aip-sim-panel {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid var(--c-rule-faint);
        padding-top: var(--s-4);
    }
}

@media (max-width: 760px) {
    .aip-model {
        padding: var(--s-3);
    }

    .aip-sim-track {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .aip-sim-track::before,
    .aip-sim-pulse {
        display: none;
    }

    .aip-sim-node {
        min-height: 5.5rem;
        transform: none !important;
    }
}

/* ---------------------------------------------------------------------------
   23. HISTORICAL FAILURE — additional polish
--------------------------------------------------------------------------- */
.failure-group-intro {
    font-family: var(--ff-heading);
    font-size: 1rem;
    font-style: italic;
    color: var(--c-parchment);
    margin-bottom: var(--s-4);
    max-width: var(--w-content);
}

.archive-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--s-4) -1rem 0;
    padding: 0 1rem;
}

@media (max-width: 1024px) {
    .archive-scroll {
        overflow-x: visible;
        margin: var(--s-4) 0 0;
        padding: 0;
    }
}

@media (max-width: 640px) {
    .archive-scroll table {
        font-size: 0.875rem;
    }
}

/* ---------------------------------------------------------------------------
   25. AIP COHERENCE-THRESHOLD SIMULATOR
---------------------------------------------------------------------------- */
.aip-lab-section {
    padding-top: var(--s-4);
}

.aip-lab {
    border-top: 1px solid var(--c-rule-soft);
    border-bottom: 1px solid var(--c-rule-soft);
    padding: var(--s-5) 0;
}

.aip-lab-header {
    max-width: var(--w-container-narrow);
    margin-bottom: var(--s-4);
}

.aip-lab-header h2 {
    margin-top: 0;
    margin-bottom: var(--s-2);
}

.aip-lab-header p {
    color: var(--c-text-muted);
    max-width: 48rem;
}

.aip-scenario-selectors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
    margin: var(--s-4) 0;
}

.aip-scenario-selectors select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem;
    border: 1px solid var(--c-rule-faint);
    background: rgba(3, 3, 2, 0.72);
    color: var(--c-ivory-soft);
}

.aip-scenario-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-3);
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(255, 255, 255, 0.025);
    margin-bottom: var(--s-4);
}

.aip-label {
    display: block;
    margin-bottom: var(--s-1);
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.aip-scenario-summary strong,
.aip-scenario-summary a {
    color: var(--c-ivory-soft);
    font-family: var(--ff-body);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.45;
}

.aip-scenario-summary a {
    color: var(--c-gold-highlight);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.aip-variable-guide {
    margin-bottom: var(--s-4);
    border-top: 1px solid var(--c-rule-faint);
    border-bottom: 1px solid var(--c-rule-faint);
    padding: var(--s-3) 0;
}

.aip-variable-guide summary {
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-highlight);
}

.aip-variable-guide dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-3);
    margin-top: var(--s-3);
}

.aip-variable-guide dt {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-parchment);
}

.aip-variable-guide dd {
    margin: var(--s-1) 0 0;
    color: var(--c-text-muted);
    font-size: 0.9375rem;
    line-height: var(--lh-base);
}

.aip-lab-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
    gap: var(--s-4);
    align-items: stretch;
}

.aip-stage {
    position: relative;
    height: clamp(42rem, 64vw, 48rem);
    border: 1px solid var(--c-rule-faint);
    background: linear-gradient(180deg, rgba(7, 6, 4, 0.4), rgba(7, 6, 4, 0.86)),
        radial-gradient(circle at 22% 18%, rgba(166, 136, 76, 0.16), transparent 34%),
        rgba(3, 3, 2, 0.72);
    overflow: hidden;
}

.aip-stage canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.aip-stage-readout {
    position: absolute;
    left: var(--s-3);
    right: var(--s-3);
    bottom: var(--s-3);
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
    align-items: center;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(3, 3, 2, 0.82);
    backdrop-filter: blur(8px);
}

.aip-stage-readout span,
.aip-stage-readout strong {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.aip-stage-readout span {
    color: var(--c-parchment);
}

.aip-stage-readout strong {
    color: var(--c-gold-highlight);
    font-weight: 500;
}

.aip-controls {
    border-left: 1px solid var(--c-rule-faint);
    padding-left: var(--s-4);
}

.aip-control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
}

.aip-control-row .btn {
    width: 100%;
}

.aip-control {
    display: grid;
    gap: var(--s-1);
    margin-bottom: var(--s-3);
}

.aip-control span {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-parchment);
}

.aip-control input[type="range"] {
    width: 100%;
    accent-color: var(--c-gold-antique);
}

.aip-control output {
    font-family: var(--ff-mono);
    font-size: 0.8125rem;
    color: var(--c-gold-highlight);
}

.aip-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
    margin-top: var(--s-4);
}

.aip-metrics div {
    border: 1px solid var(--c-rule-faint);
    padding: var(--s-2);
    background: rgba(255, 255, 255, 0.02);
}

.aip-metrics dt {
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.aip-metrics dd {
    margin: var(--s-1) 0 0;
    font-family: var(--ff-heading);
    font-size: 1.25rem;
    color: var(--c-ivory-soft);
    line-height: 1.1;
}

.aip-equation-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-2);
    margin-top: var(--s-4);
    padding-top: var(--s-3);
    border-top: 1px solid var(--c-rule-faint);
}

.aip-equation-strip span {
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-parchment);
}

.aip-plain-report,
.aip-technical-translation,
.aip-source-evidence {
    margin-top: var(--s-4);
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(3, 3, 2, 0.42);
}

.aip-plain-report h3 {
    margin: 0 0 var(--s-2);
    font-size: 1.25rem;
}

.aip-plain-report p,
.aip-source-evidence p {
    margin: 0;
    color: var(--c-text-muted);
    max-width: none;
}

.aip-source-evidence p + p {
    margin-top: var(--s-1);
}

.aip-scenario-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin: var(--s-3) 0 var(--s-4);
}

.aip-scenario-chips button {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--c-rule-faint);
    background: rgba(255, 255, 255, 0.025);
    color: var(--c-text-muted);
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.aip-scenario-chips button:hover,
.aip-scenario-chips button:focus,
.aip-scenario-chips button.is-active {
    border-color: var(--c-gold-antique);
    color: var(--c-gold-highlight);
    outline: none;
}

.aip-technical-translation summary,
.aip-source-evidence summary {
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-highlight);
}

.aip-technical-translation dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
    margin-top: var(--s-3);
}

.aip-technical-translation div {
    padding-top: var(--s-2);
    border-top: 1px solid var(--c-rule-faint);
}

.aip-technical-translation dt {
    font-family: var(--ff-mono);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-parchment);
}

.aip-technical-translation dd {
    margin: var(--s-1) 0 0;
    color: var(--c-text-muted);
    font-size: 0.9375rem;
    line-height: var(--lh-base);
}

@media (max-width: 1024px) {
    .aip-lab-grid {
        grid-template-columns: 1fr;
    }

    .aip-variable-guide dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aip-controls {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid var(--c-rule-faint);
        padding-top: var(--s-4);
    }

    .aip-equation-strip {
        grid-template-columns: 1fr;
    }

    .aip-technical-translation dl {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .aip-stage {
        height: 38rem;
    }

    .aip-stage-readout {
        position: static;
        margin: var(--s-3);
        flex-direction: column;
        align-items: flex-start;
    }

    .aip-control-row,
    .aip-metrics,
    .aip-scenario-selectors,
    .aip-scenario-summary,
    .aip-variable-guide dl {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   24. STAR-SUBSTRATE DEPLOYMENT (context-aware texture layer)
   ----------------------------------------------------------------------------
   Same vocabulary (sparse starfield), different intensity by spatial function.
   Applied as a low-opacity layer on specific section types so the void reads
   with depth without competing with text. Deployment matches the locked
   asset strategy:
     sparse  â†’ body prose (maximum legibility)
     even    â†’ domain pages, proof sections
     dense   â†’ service / case-card contexts
     warm    â†’ hero, footer, theorem anchors
---------------------------------------------------------------------------- */
/* Hero sections get the warm substrate as a quiet atmospheric anchor */
.hero {
    position: relative;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url("../img/substrate/star-substrate-warm.png");
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    pointer-events: none;
}

/* Page-intro sections (domain headers, proof intro) get the even substrate */
.page-intro {
    position: relative;
    isolation: isolate;
}

.page-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url("../img/substrate/star-substrate-even.png");
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    pointer-events: none;
}

/* Review / form sections get the dense substrate (engagement contexts) */
.review-section {
    position: relative;
    isolation: isolate;
}

.review-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url("../img/substrate/star-substrate-dense.png");
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    pointer-events: none;
}

/* Footer gets the warm substrate layered with the streak background already set */
.site-footer {
    position: relative;
    isolation: isolate;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("../img/substrate/star-substrate-warm.png");
    background-size: cover;
    background-position: center bottom;
    opacity: 0.35;
    pointer-events: none;
}

.site-footer .container {
    position: relative;
    z-index: 1;
}

/* Reduce substrate intensity on mobile to preserve legibility + performance */
@media (max-width: 640px) {
    .hero::before,
    .page-intro::before,
    .review-section::before,
    .site-footer::before {
        opacity: 0.25;
    }
}

/* AIP simulator additions */
.aip-lab [hidden] {
    display: none !important;
}

.aip-mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
}

.aip-mode-switch .is-active {
    pointer-events: none;
}

.aip-lab.is-scenario-mode .aip-controls::before {
    content: "Scenario preset controls are locked. Open Exploratory Mode to test custom values.";
    display: block;
    grid-column: 1 / -1;
    margin-bottom: var(--s-3);
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    line-height: var(--lh-base);
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.aip-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
    align-content: start;
}

.aip-controls .aip-control {
    min-width: 0;
    margin: 0;
    padding: 0 0 var(--s-3);
    border-bottom: 1px solid var(--c-rule-faint);
}

.aip-controls .aip-control input[type="range"] {
    margin-top: 0.2rem;
}

.aip-controls .aip-control output {
    min-height: 1.15rem;
}

.aip-controls .aip-metrics {
    grid-column: 1 / -1;
    margin-top: 0;
}

.aip-control input:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.aip-panel-note {
    color: var(--c-text-muted);
    margin-top: calc(var(--s-2) * -1);
    margin-bottom: var(--s-3);
    max-width: none;
}

.aip-variable-set,
.aip-equation-console {
    margin-top: var(--s-4);
    padding: var(--s-3);
    border: 1px solid var(--c-rule-faint);
    background: rgba(3, 3, 2, 0.42);
}

.aip-stage .aip-equation-console {
    position: absolute;
    left: var(--s-3);
    right: var(--s-3);
    bottom: 4.75rem;
    z-index: 2;
    max-height: none;
    overflow: visible;
    margin-top: 0;
    padding: var(--s-2);
    background: rgba(3, 3, 2, 0.72);
    backdrop-filter: blur(8px);
}

.aip-stage .aip-equation-console h3 {
    font-size: 1rem;
    margin-bottom: var(--s-1);
}

.aip-stage .aip-panel-note {
    font-size: 0.78rem;
    margin-bottom: var(--s-2);
}

.aip-variable-set h3,
.aip-equation-console h3 {
    margin: 0 0 var(--s-2);
    font-size: 1.25rem;
}

.aip-scenario-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.aip-source-registry-link {
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    opacity: 0.72;
    white-space: nowrap;
}

.aip-source-registry-link:hover {
    color: var(--c-gold-highlight);
    opacity: 1;
}

.aip-variable-grid,
.aip-equation-grid,
.aip-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
}

.aip-stage .aip-equation-grid {
    gap: 0.45rem;
}

.aip-report-result {
    grid-column: 1 / -1;
}

.aip-variable-grid > div,
.aip-equation-item,
.aip-report-item {
    border: 1px solid rgba(166, 136, 76, 0.22);
    background: rgba(7, 6, 4, 0.45);
    padding: var(--s-3);
}

.aip-stage .aip-equation-item {
    position: relative;
    min-height: 4.1rem;
    padding: 0.62rem 0.62rem 0.62rem 2.15rem;
}

.aip-stage .aip-equation-item::before {
    position: absolute;
    left: 0.62rem;
    top: 0.67rem;
    display: grid;
    width: 1.05rem;
    height: 1.05rem;
    place-items: center;
    border: 1px solid rgba(217, 184, 106, 0.45);
    border-radius: 999px;
    color: var(--c-gold-highlight);
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    line-height: 1;
}

.aip-equation-item[data-aip-equation-card="threshold"]::before {
    content: "T";
}

.aip-equation-item[data-aip-equation-card="burden"]::before {
    content: "B";
}

.aip-equation-item[data-aip-equation-card="closure"]::before {
    content: "P";
}

.aip-equation-item[data-aip-equation-card="residue"]::before {
    content: "r";
}

.aip-equation-item[data-aip-equation-card="recurrence"]::before {
    content: "n";
}

.aip-equation-item[data-aip-equation-card="margin"]::before {
    content: "M";
}

.aip-equation-item[data-aip-equation-card="amplification"]::before {
    content: "A";
}

.aip-equation-item[data-aip-equation-card="classification"]::before {
    content: "O";
}

.aip-formula,
.aip-substitution {
    display: block;
}

.aip-formula {
    margin-bottom: 0.28rem;
    color: var(--c-text-muted);
    font-family: var(--ff-mono);
    font-size: 0.66rem;
    letter-spacing: 0.02em;
}

.aip-substitution {
    color: var(--c-ivory-soft);
    font-size: 0.8rem;
    line-height: var(--lh-snug);
}

.aip-variable-grid dt {
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-gold-antique);
    margin-bottom: var(--s-1);
}

.aip-variable-grid dd {
    margin: 0;
    color: var(--c-text-muted);
    line-height: var(--lh-base);
}

.aip-equation-item p,
.aip-report-item p {
    margin-bottom: 0;
    max-width: none;
}

.aip-variable-set summary,
.aip-plain-report summary {
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold-highlight);
}

.aip-variable-set .aip-panel-note,
.aip-plain-report .aip-report-grid {
    margin-top: var(--s-3);
}

@media (max-width: 760px) {
    .aip-controls,
    .aip-variable-grid,
    .aip-equation-grid,
    .aip-report-grid {
        grid-template-columns: 1fr;
    }

    .aip-stage .aip-equation-console {
        max-height: 48%;
    }

    .aip-report-result {
        grid-column: auto;
    }

    .aip-scenario-row {
        align-items: flex-start;
    }
}

/* Nav group structure — desktop dropdowns */
.nav-group {
    position: relative;
}

.nav-group > .nav-group-label {
    display: block;
    color: var(--c-text-muted);
    padding: var(--s-1);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    cursor: default;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: color var(--t-base), border-bottom-color var(--t-base);
}

.nav-group-label--link {
    text-decoration: none;
    cursor: pointer;
}

.nav-group > .nav-group-label:hover,
.nav-group > .nav-group-label:focus,
.nav-group.is-open > .nav-group-label {
    color: var(--c-gold-highlight);
    border-bottom-color: var(--c-gold-antique);
    outline: none;
}

.nav-group-links {
    display: none;
    position: fixed;
    top: var(--header-h, 64px);
    left: 0;
    right: 0;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    column-gap: var(--s-3);
    row-gap: 0;
    background: #000;
    border-bottom: 1px solid rgba(214, 174, 95, 0.2);
    padding: 0.35rem var(--s-4);
    min-height: 44px;
    font-size: 0.875rem;
    z-index: 199;
}

.nav-group.is-open .nav-group-links {
    display: flex;
}

.nav-group.is-open .nav-group-links--natural {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    justify-content: end;
    align-content: center;
    row-gap: 0;
}

.nav-group-links--natural a:nth-child(5) {
    grid-column: 2;
}

.nav-group-links--natural a:nth-child(6) {
    grid-column: 3;
}

.nav-group-links--natural a:nth-child(7) {
    grid-column: 4;
}

.nav-group-links a,
.nav-group-links .nav-link-tba {
    display: inline-block;
    padding: 0.4rem var(--s-1);
    white-space: nowrap;
    border-bottom: none;
}

.nav-link-tba {
    opacity: 0.38;
    cursor: default;
    pointer-events: none;
}

.nav-qualifier {
    font-size: 0.72em;
    opacity: 0.65;
    font-style: italic;
    margin-left: 0.3em;
}

/* TBA domain nav state: top-level labels with a qualifier are intentionally
   non-interactive until their sections are ready. Re-enable by removing the
   qualifier from those labels and restoring their anchor markup. See
   NAV_TBA_REVERT_NOTES.md for the full checklist. */
.nav-group > .nav-group-label:has(.nav-qualifier) {
    pointer-events: none;
    border-bottom-color: transparent;
}

@media (max-width: 1024px) {
    .nav-group {
        width: 100%;
    }

    .nav-group > .nav-group-label {
        font-family: var(--ff-mono);
        font-size: 0.6875rem;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--c-gold-antique);
        padding: var(--s-3) 0 var(--s-1);
        border-bottom: 0;
    }

    .nav-group-links {
        display: flex;
        position: static;
        background: transparent;
        border: none;
        padding: 0;
        min-width: 0;
    }

    .nav-group.is-open .nav-group-links--natural {
        display: flex;
    }

    .nav-group-links a,
    .nav-group-links .nav-link-tba {
        padding: var(--s-2) 0;
        border-bottom: 1px solid var(--c-rule-faint);
    }
}

@media (min-width: 1025px) {
    .nav-group > .nav-group-label,
    .nav-group-links a,
    .nav-group-links .nav-link-tba {
        font-family: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
        font-weight: 500;
        letter-spacing: 0.025em;
        color: #d0b88c;
    }

    .nav-group > .nav-group-label {
        font-size: 0.853125rem;
    }

    .nav-group-links {
        font-size: 0.91875rem;
    }

    .nav-group > .nav-group-label:hover,
    .nav-group > .nav-group-label:focus,
    .nav-group.is-open > .nav-group-label,
    .nav-group-links a:hover,
    .nav-group-links a:focus {
        color: #c4a574;
    }

    .nav a[aria-current="page"] {
        color: #e8e5df;
    }
}

/* Red Queen Protocol nav link — crimson/gold glitch treatment */
a.nav-red-queen,
.nav-group-links a.nav-red-queen {
    color: #A8171C !important;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-shadow:
        1px 0 1px rgba(184, 134, 11, 0.65),
        -1px 0 1px rgba(0, 200, 255, 0.18);
    animation: rq-nav-glitch 6s infinite;
}
a.nav-red-queen:hover,
a.nav-red-queen:focus,
.nav-group-links a.nav-red-queen:hover,
.nav-group-links a.nav-red-queen:focus {
    color: #CC2200 !important;
    text-shadow:
        2px 0 2px rgba(184, 134, 11, 0.9),
        -2px 0 2px rgba(0, 200, 255, 0.35);
    border-bottom-color: #A8171C !important;
}

@keyframes rq-nav-glitch {
    0%, 85%, 100% {
        text-shadow: 1px 0 1px rgba(184, 134, 11, 0.65), -1px 0 1px rgba(0, 200, 255, 0.18);
        transform: none;
    }
    87% {
        text-shadow: 3px 0 2px rgba(184, 134, 11, 0.9), -2px 0 2px rgba(255, 0, 60, 0.5);
        transform: translateX(-2px);
    }
    89% {
        text-shadow: -2px 0 2px rgba(184, 134, 11, 0.9), 3px 0 2px rgba(0, 200, 255, 0.5);
        transform: translateX(2px);
    }
    91% {
        text-shadow: 1px 0 1px rgba(184, 134, 11, 0.65), -1px 0 1px rgba(0, 200, 255, 0.18);
        transform: none;
    }
}

/* TBA domain nav state: muted pearl white only for top-level TBA labels.
   Submenu TBA items keep the standard .nav-link-tba muted treatment. */
.nav-group > .nav-group-label:has(.nav-qualifier) {
    color: #e8e5df;
    opacity: 0.72;
}


/* ---------------------------------------------------------------------------
   Return to Top button
---------------------------------------------------------------------------- */
.purchase-logo {
    position: fixed;
    left: calc(-13rem + 20px);
    top: 50%;
    transform: translateY(-50%);
    width: 11rem;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.purchase-logo img {
    width: 100%;
    opacity: 0.85;
}

.purchase-logo.is-visible {
    opacity: 1;
}

.return-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    font-family: var(--ff-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-ivory-soft);
    background: rgba(7, 6, 4, 0.88);
    border: 1px solid var(--c-gold-antique);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
}

.return-top-btn:hover,
.return-top-btn:focus {
    color: var(--c-gold-highlight);
    border-color: var(--c-gold-highlight);
    background: rgba(7, 6, 4, 0.96);
    outline: none;
}

.return-top-btn[hidden] {
    display: none;
}

.return-previous-entry-btn {
    position: fixed;
    right: 2rem;
    bottom: 5.6rem;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    font-family: var(--ff-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-ivory-soft);
    background: rgba(7, 6, 4, 0.88);
    border: 1px solid var(--c-gold-antique);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
}

.return-previous-entry-btn:hover,
.return-previous-entry-btn:focus {
    color: var(--c-gold-highlight);
    border-color: var(--c-gold-highlight);
    background: rgba(7, 6, 4, 0.96);
    outline: none;
}

.return-previous-entry-btn[hidden] {
    display: none;
}
