/* Storm Theory — Ontology section (node pages and glossary).
   Reading layout. Tokens match ontology.css / stormtheory.io. */

:root {
    --bg: #000000;
    --fg: #ffffff;
    --muted: rgba(255, 255, 255, 0.55);
    --soft: rgba(255, 255, 255, 0.72);
    --line: #222222;
    --line-strong: #333333;
    --gold: #c4a574;
    --gold-deep: #8a7349;
    --ivory: #d9d2c5;
    --gray: #8a8a8a;
    --counterfeit: #a89880;
}

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

html, body {
    min-height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: Inter, system-ui, sans-serif;
    line-height: 1.6;
    font-synthesis: none;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -40px;
    z-index: 100;
    background: #fff;
    color: #000;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 0.85rem;
}
.skip-link:focus { top: 12px; }

.site-chrome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 14px 22px;
    background: #000;
    border-bottom: 1px solid var(--line);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    color: #fff;
    text-decoration: none;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
}
.wordmark .sigma-mark { font-size: 1.55rem; line-height: 0.7; }
.wordmark:hover { opacity: 0.8; }
.wordmark:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

.title-block h1 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.title-block h1 a {
    color: inherit;
    text-decoration: none;
}
.title-block h1 a:hover { opacity: 0.8; }

.chrome-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 12px;
}
.chrome-links a {
    color: var(--soft);
    text-decoration: none;
    border-bottom: 1px solid #333;
    padding-bottom: 1px;
}
.chrome-links a:hover { color: #fff; border-color: #fff; }
.chrome-links a[aria-current="page"] {
    color: #fff;
    border-color: var(--gold-deep);
}

.page {
    max-width: 42rem;
    margin: 0 auto;
    padding: 36px 22px 80px;
}

.crumbs {
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
    margin-bottom: 28px;
}
.crumbs a { color: var(--soft); text-decoration: none; border-bottom: 1px solid #333; }
.crumbs a:hover { color: #fff; border-color: #fff; }
.crumbs .sep { margin: 0 0.4em; color: #444; }

.rank-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--line-strong);
    padding: 2px 7px;
}
body.indeterminism .rank-badge {
    color: rgba(196, 165, 116, 0.9);
    border-color: rgba(196, 165, 116, 0.4);
}
body.counterfeit .rank-badge,
body.counterfeit-line .rank-badge {
    color: var(--counterfeit);
    border-color: rgba(168, 152, 128, 0.45);
    border-style: dashed;
}

.counterfeit-label {
    display: inline-block;
    margin-left: 10px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--counterfeit);
}

.page-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 14px 0 8px;
}
body.indeterminism .page-title { color: #f3ead8; }
body.counterfeit .page-title,
body.counterfeit-line .page-title { color: #e8dfd0; }

.section {
    margin-top: 2rem;
}
.section h2 {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.section p, .section li {
    font-size: 1.02rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.9);
}

.equation-block {
    border: 1px solid var(--line);
    padding: 14px 16px;
    color: var(--ivory);
    overflow-x: auto;
}
body.indeterminism .equation-block { color: #e8dcc8; border-color: rgba(196, 165, 116, 0.25); }
body.counterfeit .equation-block,
body.counterfeit-line .equation-block { color: #cfc4b0; border-style: dashed; border-color: rgba(168, 152, 128, 0.4); }

.font-math {
    font-family: "EB Garamond", "Times New Roman", serif;
    font-style: italic;
    font-weight: 400;
    font-feature-settings: "kern" 1, "liga" 1, "onum" 0;
    font-size: 1.15rem;
    line-height: 1.5;
}
.equation-block.is-typeset,
.equation-block.is-typeset .katex,
.equation-block.is-typeset .katex * {
    font-style: normal;
    font-synthesis: none !important;
    color: inherit;
    font-family: inherit;
}
.equation-block.is-typeset .katex { font-size: 1.15em; line-height: 1.5; }
.equation-block.is-typeset .katex-html { white-space: nowrap; text-align: left; }

.symbol-links, .rel-list, .toc {
    list-style: none;
    padding: 0;
}
.symbol-links li, .rel-list li { margin: 0.25rem 0; }
.symbol-links a, .rel-list a, .toc a, .plain-link {
    color: var(--ivory);
    text-decoration: none;
    border-bottom: 1px solid #333;
}
body.indeterminism .symbol-links a,
body.indeterminism .rel-list a { color: #e8dcc8; }
.symbol-links a:hover, .rel-list a:hover, .toc a:hover, .plain-link:hover {
    color: #fff;
    border-color: #fff;
}
.symbol-links a .is-typeset,
.symbol-links a .is-typeset .katex,
.symbol-links a .is-typeset .katex * {
    font-style: normal;
    font-synthesis: none !important;
    color: inherit;
}
.symbol-links a .katex { font-size: 1.05em; }

.rel-list .rank {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.6em;
}

.page-footer {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}
.page-footer a { color: var(--soft); text-decoration: none; border-bottom: 1px solid #333; }
.page-footer a:hover { color: #fff; border-color: #fff; }

/* Index / glossary */
.lead {
    color: var(--soft);
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 0.5rem 0 1.5rem;
}
.index-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 2rem; }

.toc { margin-top: 0.4rem; }
.toc li { margin: 0.2rem 0; line-height: 1.45; }
.toc .depth-0 { margin-top: 1.1rem; }
.toc .depth-1 { padding-left: 0; margin-top: 0.85rem; }
.toc .depth-2 { padding-left: 1rem; }
.toc .depth-3 { padding-left: 2rem; }
.toc .depth-4 { padding-left: 3rem; }
.toc .rank {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.55em;
}
.toc .cf { color: var(--counterfeit); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; margin-left: 0.5em; }

.glossary-entry {
    margin: 0 0 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}
.glossary-entry:last-child { border-bottom: 0; }
.glossary-entry h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}
.glossary-entry .glyph {
    font-family: "EB Garamond", "Times New Roman", serif;
    font-style: italic;
    margin-right: 0.4em;
}
.glossary-entry .glyph.is-typeset,
.glossary-entry .glyph.is-typeset .katex,
.glossary-entry .glyph.is-typeset .katex * {
    font-style: normal;
    font-synthesis: none !important;
    color: inherit;
}
.glossary-entry .aka {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0;
    font-family: Inter, system-ui, sans-serif;
}
.sense { margin: 0.65rem 0; }
.sense-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.used-on { font-size: 13px; color: var(--muted); margin-top: 0.5rem; }
.used-on a { color: var(--soft); }
.sense .source {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
    margin-top: 0.35rem;
    line-height: 1.45;
}

.group-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    margin: 2.4rem 0 1rem;
    padding-top: 0.4rem;
}

@media (max-width: 700px) {
    .page-title { font-size: 1.6rem; }
    .page { padding: 24px 16px 64px; }
    .brand-block { flex-wrap: wrap; gap: 8px 16px; }
}


.source-quotes { margin-top: 1.75rem; }
.source-quote {
    margin: 0 0 1.4rem;
    padding: 0 0 0 1rem;
    border-left: 1px solid #3a3428;
}
.source-quote blockquote {
    margin: 0;
    font-family: "EB Garamond", "Times New Roman", serif;
    font-size: 1.12rem;
    line-height: 1.55;
    color: var(--ivory);
    font-style: italic;
}
.source-quote blockquote p { margin: 0; }
.source-quote figcaption {
    margin-top: 0.45rem;
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
    font-style: normal;
    color: var(--muted);
    line-height: 1.45;
}
body.indeterminism .source-quote { border-left-color: #4a3f2e; }
body.indeterminism .source-quote blockquote { color: #e8dcc8; }
.source-quote .katex,
.source-quote .katex-display {
    font-style: normal;
}
.source-quote .katex-display {
    margin: 0.85em 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.section ol {
    margin: 0.4rem 0 0 1.2rem;
    padding: 0;
}
.section ol li {
    margin: 0.45rem 0;
    color: var(--soft);
    line-height: 1.55;
}

@media print {
    html, body { background: #fff; color: #000; }
    .site-chrome { border-color: #ccc; }
    .wordmark, .title-block h1, .page-title, .group-title, .glossary-entry h3 { color: #000; }
    .section p, .section li, .lead, .crumbs, .page-footer, .sense .source, .used-on { color: #111; }
    .equation-block, body.indeterminism .equation-block, body.counterfeit .equation-block {
        color: #000; border-color: #ccc; border-style: solid;
    }
    .equation-block.is-typeset, .equation-block.is-typeset .katex, .equation-block.is-typeset .katex * { color: #000; }
    a { color: #000; border-color: #999; }
    .chrome-links, .skip-link { display: none; }
}
