/* =========================================================
   RECURSIVE REALITY — CLEAN DESIGN
   Loaded after style.css and footer.css. Calm, text-first,
   with one light-blue accent used sparingly.
========================================================= */

:root {
    --bg: #0a0b0d;
    --bg-rgb: 10, 11, 13;
    --surface: #101215;
    --surface-strong: #15181c;
    --text: #eef1f3;
    --text-soft: #cdd4d9;
    --muted: #8a939a;
    --dim: #5a6269;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .14);
    --accent: #7fd8f5;
    --accent-2: #7fd8f5;
    --grid: transparent;
    --nav-bg: rgba(10, 11, 13, .92);
    --shadow: rgba(0, 0, 0, .4);
}

html[data-theme="light"] {
    --bg: #f7f8f9;
    --bg-rgb: 247, 248, 249;
    --surface: #ffffff;
    --surface-strong: #eef1f3;
    --text: #13171a;
    --text-soft: #2b3238;
    --muted: #5f6870;
    --dim: #9aa3aa;
    --line: rgba(0, 0, 0, .08);
    --line-strong: rgba(0, 0, 0, .15);
    --accent: #0a7aa6;
    --accent-2: #0a7aa6;
    --grid: transparent;
    --nav-bg: rgba(247, 248, 249, .94);
    --shadow: rgba(0, 0, 0, .08);
}

/* ---------- Base: no overflow, no decoration ---------- */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    letter-spacing: 0;
}

body::before { display: none; }

main, section, .text {
    max-width: 100%;
    min-width: 0;
}

p, a, li, td, th, h1, h2, h3, h4 {
    overflow-wrap: anywhere;
}

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

/* ---------- Navigation ---------- */
.topbar {
    background: var(--nav-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 500;
    letter-spacing: .12em;
}

.brand span {
    color: var(--text);
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

.menu-overlay { background: var(--bg); }

.menu-link:hover .menu-title { color: var(--accent); }

.setting-option.active {
    color: var(--text);
    background: none;
    border-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
    min-height: 78vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero::after { display: none; }

.hero .label {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--accent);
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2.8rem, 9vw, 6.4rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.03em;
    color: var(--text);
}

.hero h1 span {
    color: var(--accent);
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

.hero-description {
    max-width: 640px;
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--text-soft);
    border-left: 0;
    padding-left: 0;
}

.hero-author {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.theory-type span { color: var(--muted); }

/* ---------- Sections ---------- */
.section {
    border-top: 1px solid var(--line);
}

.section-heading .number {
    display: inline;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: .12em;
}

.section-heading h3 {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -.015em;
    color: var(--text);
}

.text {
    padding: 0;
    border-left: 0;
}

.text::before { display: none; }

.text p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-soft);
}

/* ---------- Quotes between chapters ---------- */
.statement {
    background: none;
    border-block: 0;
}

.statement p {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -.02em;
    color: var(--text);
}

.statement p span { color: var(--muted); }

.statement-mark { color: var(--accent); opacity: .5; }

.statement-source { color: var(--muted); }

.statement-source::before { background: var(--accent); }

/* ---------- Cards and lists (Black Cube, Gnosis) ---------- */
.bc-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    gap: 14px;
}

.bc-card {
    padding: 22px 22px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: none;
}

.bc-card i {
    color: var(--accent);
    font-size: 16px;
    margin-bottom: 12px;
}

.bc-card h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.bc-card p {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--muted);
}

.bc-warning {
    margin-top: 28px;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 0;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.75;
}

.bc-pills {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 14px;
}

.bc-pill {
    padding: 24px 22px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: none;
}

.bc-pill.red,
.bc-pill.blue { background: none; }

.bc-pill h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.bc-pill p {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.7;
}

.gn-table { font-size: .95rem; }

.gn-table th,
.gn-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
}

.gn-table th {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Feedback and FAQ on the main page ---------- */
.rr-faq-item,
.rr-feedback-author,
.rr-allen-socials a {
    max-width: 100%;
}

/* ---------- Mobile ---------- */
@media (max-width: 850px) {
    .section-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .section-heading { position: static; }
}

@media (max-width: 560px) {
    .container {
        padding-inline: 22px;
    }

    .hero { min-height: 70vh; padding: 90px 0 70px; }

    .hero h1 { font-size: clamp(2.5rem, 13vw, 3.6rem); }

    .hero-description { font-size: 1rem; }

    .section { padding: 70px 0; }

    .section-heading h3 { font-size: 1.4rem; }

    .statement { padding: 70px 0; }

    .statement-mark { font-size: 4.5rem; top: -28px; }

    .statement p { font-size: 1.4rem; }

    .gn-table th,
    .gn-table td {
        display: block;
        width: 100%;
        padding: 6px 0;
        border-bottom: 0;
    }

    .gn-table tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
    }

    .bc-card { padding: 20px; }
}

/* ---------- Fixed navigation ----------
   Position fixed keeps the bar on screen while scrolling. The body
   uses overflow-x: clip (not hidden), so it does not become a scroll
   container, which would break sticky positioning. */
html {
    overflow-x: hidden;
}

body {
    overflow-x: clip;
    padding-top: var(--nav-height);
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

/* ---------- Cards: grid layout, flat surfaces ---------- */
.bc-cards,
.bc-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 36px 0 0;
}

.bc-card,
.bc-pill {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.bc-card i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border-radius: 50%;
    background: rgba(127, 216, 245, .1);
    color: var(--accent);
    font-size: 14px;
}

.bc-card h4,
.bc-pill h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.bc-card p,
.bc-pill p {
    margin: 0;
    font-size: .94rem;
    line-height: 1.7;
    color: var(--muted);
}

.bc-warning {
    margin-top: 36px;
}

@media (max-width: 640px) {
    .bc-cards,
    .bc-pills {
        grid-template-columns: 1fr;
    }

    .bc-card,
    .bc-pill {
        padding: 22px;
    }
}
