/* causality.club — Swiss rationalist debate salon
   honeyed-neutral bento-box with periodic glitch disruption
   Design tokens retained: IntersectionObserver trigger transitions at section boundaries. setInterval` with randomized 8000–15000ms delays; Roboto Slab" (Google Fonts, Source Sans 3" (Google Fonts, labels at 11–13px and provocations at 28–36px. */

:root {
    --bg: #f5f0e8;
    --bg-alt: #ebe4d6;
    --text: #3d3528;
    --text-muted: #8a7560;
    --accent-1: #c4956a;  /* honeycomb gold / premise */
    --accent-2: #d4a574;  /* amber shadow / rebuttal */
    --deep: #5c4a3a;      /* espresso / conclusion */
    --glitch: #6b9e9e;    /* split channel teal */

    --border-premise: #c4956a;
    --border-evidence: #8a7560;
    --border-rebuttal: #d4a574;
    --border-conclusion: #5c4a3a;

    --gutter: 12px;
    --radius: 2px;

    --font-slab: "Roboto Slab", Georgia, serif;
    --font-sans: "Source Sans 3", "Inter", system-ui, sans-serif;

    --ease-bento: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

body {
    background:
        repeating-linear-gradient(
            112deg,
            transparent 0 120px,
            rgba(212,165,116,0.03) 120px 121px,
            transparent 121px 240px
        ),
        repeating-linear-gradient(
            68deg,
            transparent 0 180px,
            rgba(235,228,214,0.5) 180px 181px,
            transparent 181px 360px
        ),
        var(--bg);
    min-height: 100vh;
    position: relative;
}

::selection { background: var(--accent-2); color: var(--bg); }

/* -------- BOKEH FIELD -------- */
.bokeh-field {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bokeh-dot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,165,116,0.22) 0%, rgba(212,165,116,0.08) 40%, transparent 70%);
    will-change: transform;
    pointer-events: none;
    filter: blur(1px);
}
.bokeh-dot.cool {
    background: radial-gradient(circle, rgba(107,158,158,0.12) 0%, rgba(107,158,158,0.04) 45%, transparent 75%);
}

/* -------- SIDE INDEX NAV -------- */
.side-index {
    position: fixed;
    top: 0;
    left: 0;
    width: 48px;
    height: 100vh;
    border-right: 1px solid rgba(138,117,96,0.18);
    background: rgba(245,240,232,0.7);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    z-index: 80;
}
.side-mark {
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--deep);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}
.side-index ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-slab);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.05em;
    background: transparent;
    transition: background 240ms var(--ease-bento), color 240ms var(--ease-bento), border-color 240ms var(--ease-bento), transform 240ms var(--ease-bento);
    position: relative;
}
.dot:hover { color: var(--deep); border-color: var(--deep); transform: scale(1.08); }
.dot.active { background: var(--deep); color: var(--bg); border-color: var(--deep); }
.dot.active::after {
    content: "";
    position: absolute;
    left: -10px; top: 50%;
    width: 6px; height: 1px;
    background: var(--deep);
}
.side-foot {
    font-family: var(--font-slab);
    font-size: 8px;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* -------- TOP BAR -------- */
.top-bar {
    position: sticky;
    top: 0;
    left: 48px;
    margin-left: 48px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px 32px;
    border-bottom: 1px solid rgba(138,117,96,0.18);
    background: rgba(245,240,232,0.85);
    backdrop-filter: blur(6px);
    z-index: 60;
}
.brand {
    font-family: var(--font-slab);
    display: flex;
    gap: 10px;
    align-items: baseline;
    color: var(--deep);
}
.brand-mark {
    font-size: 16px;
    color: var(--accent-1);
}
.brand-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
}
.top-meta {
    font-family: var(--font-slab);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}
.meta-sep { color: var(--accent-1); }

/* -------- STAGE / SECTIONS -------- */
.stage {
    margin-left: 48px;
    padding: 0 32px 48px;
}

.bento-section {
    position: relative;
    padding: 72px 0 56px;
    border-bottom: 1px dashed rgba(138,117,96,0.25);
}
.bento-section:last-of-type { border-bottom: none; }

.section-pediment {
    position: relative;
    margin-bottom: 40px;
    padding-top: 20px;
}
.pediment-shape {
    width: 100%;
    max-width: 400px;
    height: 56px;
    display: block;
    opacity: 0.55;
}
.section-label {
    position: absolute;
    bottom: -6px;
    left: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-slab);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    padding-right: 12px;
}
.section-label .num {
    color: var(--deep);
    font-weight: 700;
    font-size: 13px;
}
.section-label .sep { color: var(--accent-1); }

/* -------- BENTO GRID (SECTION 1) -------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, minmax(80px, auto));
    gap: var(--gutter);
    position: relative;
}

.cell {
    position: relative;
    background: var(--bg);
    border: 1px solid rgba(138,117,96,0.2);
    border-left-width: 3px;
    padding: 20px 22px;
    overflow: hidden;
    transition:
        transform 600ms var(--ease-bento),
        border-color 300ms var(--ease-bento),
        background 300ms var(--ease-bento),
        box-shadow 300ms var(--ease-bento),
        opacity 500ms var(--ease-bento);
    grid-column: var(--gc-s) / var(--gc-e);
    grid-row: var(--gr-s) / var(--gr-e);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cell[data-type="premise"]    { border-left-color: var(--border-premise); }
.cell[data-type="evidence"]   { border-left-color: var(--border-evidence); }
.cell[data-type="rebuttal"]   { border-left-color: var(--border-rebuttal); }
.cell[data-type="conclusion"] { border-left-color: var(--border-conclusion); }

.cell:nth-child(odd) { background: var(--bg); }
.cell:nth-child(even) { background: var(--bg-alt); }

.cell:hover {
    box-shadow: 0 2px 0 0 var(--accent-1), 0 14px 34px -22px rgba(92,74,58,0.35);
    transform: translateY(-1px);
}

.cell-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-slab);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(138,117,96,0.18);
    padding-bottom: 8px;
    margin-bottom: 2px;
}
.cell-tag { color: var(--deep); font-weight: 500; }
.cell-id { color: var(--accent-1); font-weight: 400; }

.thesis-heading {
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 12px 0 6px;
    color: var(--deep);
    position: relative;
}
.thesis-sub {
    font-size: 17px;
    color: var(--text);
    max-width: 46ch;
    margin: 0;
}
.cell-thesis { padding: 28px 30px 30px; }
.cell-thesis .cell-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-slab);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-top: 14px;
    border-top: 1px solid rgba(138,117,96,0.18);
}
.cell-thesis .glyph { font-size: 14px; color: var(--accent-1); }

.cell-body {
    font-size: 15.5px;
    color: var(--text);
    margin: 0;
}
.cell-body.big {
    font-family: var(--font-slab);
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    line-height: 1.2;
    font-weight: 500;
    color: var(--deep);
}
.cell-foot-note {
    margin-top: auto;
    font-family: var(--font-slab);
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.pull-quote {
    font-family: var(--font-slab);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.6rem, 2.4vw, 2.25rem);
    line-height: 1.2;
    color: var(--deep);
    margin: 4px 0 4px;
    padding-left: 18px;
    border-left: 2px solid var(--accent-1);
}
.pull-quote.small { font-size: clamp(1.1rem, 1.6vw, 1.5rem); }
.pq-cite {
    display: block;
    font-family: var(--font-slab);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 8px;
    padding-left: 18px;
}

/* Marble vein texture */
.marble-vein {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    background:
        repeating-linear-gradient(
            18deg,
            transparent 0 14px,
            #ebe4d6 14px 15px,
            transparent 15px 40px,
            #d4a574 40px 40.5px,
            transparent 40.5px 80px
        ),
        repeating-linear-gradient(
            -62deg,
            transparent 0 30px,
            #ebe4d6 30px 30.6px,
            transparent 30.6px 70px
        );
    mix-blend-mode: multiply;
}

/* -------- CONNECTOR SVG -------- */
.connector-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 2;
}
.connector {
    fill: none;
    stroke: var(--accent-1);
    stroke-width: 1;
    stroke-dasharray: 4 2;
    stroke-dashoffset: 1000;
    opacity: 0.7;
    transition: stroke-width 600ms var(--ease-bento), opacity 400ms var(--ease-bento);
}
.connector.drawn {
    animation: draw 1400ms var(--ease-bento) forwards;
}
@keyframes draw {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}
.connector.pulse { stroke-width: 2; }

/* -------- SECTION 2: CHAIN -------- */
.chain-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.chain-cell {
    flex: 1 1 180px;
    min-width: 180px;
    padding: 18px 20px 20px;
    background: var(--bg);
    border: 1px solid rgba(138,117,96,0.2);
    border-top: 3px solid var(--border-premise);
    position: relative;
    transition: transform 400ms var(--ease-bento), background 300ms var(--ease-bento);
}
.chain-cell[data-type="evidence"]   { border-top-color: var(--border-evidence); background: var(--bg-alt); }
.chain-cell[data-type="rebuttal"]   { border-top-color: var(--border-rebuttal); }
.chain-cell[data-type="conclusion"] { border-top-color: var(--border-conclusion); background: var(--bg-alt); }
.chain-cell:hover { transform: translateY(-2px); }
.chain-section.in-view .chain-cell:nth-of-type(1) { transform: translateY(-4px); }
.chain-section.in-view .chain-cell:nth-of-type(2) { transform: translateY(4px); }
.chain-section.in-view .chain-cell:nth-of-type(3) { transform: translateY(-2px); }
.chain-section.in-view .chain-cell:nth-of-type(4) { transform: translateY(3px); }

.chain-num {
    font-family: var(--font-slab);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-1);
}
.chain-head {
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--deep);
    margin: 4px 0 8px;
}
.chain-body { font-size: 14.5px; color: var(--text); margin: 0; }

.chain-link {
    flex: 0 0 50px;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
}
.chain-link svg { width: 100%; height: 20px; }

.chain-foot {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid rgba(138,117,96,0.25);
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}
.foot-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-1);
    flex-shrink: 0;
}

/* -------- SECTION 3: DEBATE FLOOR -------- */
.debate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(170px, auto);
    gap: var(--gutter);
}
.debate-card {
    position: relative;
    background: var(--bg);
    border: 1px solid rgba(138,117,96,0.2);
    border-top: 3px solid var(--border-premise);
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 350ms var(--ease-bento), background 300ms var(--ease-bento), box-shadow 350ms var(--ease-bento);
    overflow: hidden;
}
.debate-card[data-type="evidence"]   { border-top-color: var(--border-evidence); background: var(--bg-alt); }
.debate-card[data-type="rebuttal"]   { border-top-color: var(--border-rebuttal); }
.debate-card[data-type="conclusion"] { border-top-color: var(--border-conclusion); background: var(--bg-alt); }

.debate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -28px rgba(92,74,58,0.45);
}

.card-tag {
    font-family: var(--font-slab);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.card-head {
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: 1.28rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--deep);
    margin: 2px 0 4px;
    position: relative;
}
.card-body { font-size: 14.5px; color: var(--text); margin: 0; }
.card-glyph {
    position: absolute;
    top: 14px;
    right: 16px;
    font-family: var(--font-slab);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--accent-1);
    opacity: 0.8;
}

/* -------- GLITCH EFFECT ON [data-text] -------- */
[data-text] { position: relative; }
[data-text]::before,
[data-text]::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 80ms linear;
}
[data-text].glitching::before {
    opacity: 1;
    color: var(--accent-1);
    transform: translate(2.5px, -1px);
    mix-blend-mode: multiply;
}
[data-text].glitching::after {
    opacity: 1;
    color: var(--glitch);
    transform: translate(-2.5px, 1px);
    mix-blend-mode: multiply;
}

.scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(transparent 0%, rgba(107,158,158,0.6) 50%, transparent 100%);
    pointer-events: none;
    z-index: 5;
    animation: scan 400ms linear forwards;
}
@keyframes scan {
    0% { top: 0; opacity: 0.8; }
    100% { top: 100%; opacity: 0; }
}

.cell.glitch-border,
.debate-card.glitch-border,
.chain-cell.glitch-border,
.unravel-cell.glitch-border { animation: borderShake 220ms steps(2, end); }
@keyframes borderShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(3px); }
    50% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

/* -------- SECTION 4: UNRAVELING -------- */
.unraveling-section { position: relative; }
.unravel-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 110px;
    gap: var(--gutter);
    position: relative;
}
.unravel-cell {
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid rgba(138,117,96,0.2);
    border-left: 3px solid var(--border-premise);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14.5px;
    color: var(--text);
    transition: transform 700ms var(--ease-bento), opacity 700ms var(--ease-bento);
}
.unravel-cell[data-type="evidence"]   { border-left-color: var(--border-evidence); background: var(--bg-alt); }
.unravel-cell[data-type="rebuttal"]   { border-left-color: var(--border-rebuttal); }
.unravel-cell[data-type="conclusion"] { border-left-color: var(--border-conclusion); background: var(--bg-alt); }
.unravel-cell p { margin: 0; }
.unravel-cell .cell-tag {
    font-family: var(--font-slab);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.u-1 { grid-column: 1 / 5;  grid-row: 1 / 3; }
.u-2 { grid-column: 5 / 9;  grid-row: 1 / 2; }
.u-3 { grid-column: 9 / 13; grid-row: 1 / 3; }
.u-4 { grid-column: 5 / 7;  grid-row: 2 / 3; }
.u-5 { grid-column: 7 / 9;  grid-row: 2 / 3; }
.u-6 { grid-column: 1 / 5;  grid-row: 3 / 4; }
.u-7 { grid-column: 5 / 9;  grid-row: 3 / 4; }
.u-8 { grid-column: 9 / 13; grid-row: 3 / 4; }

.unraveling-section.unraveled .u-1 { transform: translate(-14px, 6px) rotate(-1.4deg); }
.unraveling-section.unraveled .u-2 { transform: translate(10px, -8px) rotate(1.2deg); }
.unraveling-section.unraveled .u-3 { transform: translate(14px, 4px) rotate(-0.8deg); }
.unraveling-section.unraveled .u-4 { transform: translate(-8px, 12px) rotate(2deg); }
.unraveling-section.unraveled .u-5 { transform: translate(6px, -12px) rotate(-1.6deg); }
.unraveling-section.unraveled .u-6 { transform: translate(-12px, -6px) rotate(0.8deg); }
.unraveling-section.unraveled .u-7 { transform: translate(12px, 10px) rotate(-2deg); }
.unraveling-section.unraveled .u-8 { transform: translate(-6px, 6px) rotate(1.4deg); }

.column-fragment {
    position: absolute;
    right: 8px;
    top: 72px;
    width: 60px;
    height: 240px;
    opacity: 0.5;
    pointer-events: none;
}

/* -------- SECTION 5: RECOMPOSITION -------- */
.recomp-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(7, minmax(72px, auto));
    gap: var(--gutter);
    position: relative;
}
.recomp-section .cell {
    transform: translateY(24px) scale(0.98);
}
.recomp-section.recomposed .cell {
    transform: translateY(0) scale(1);
}

.recomp-head {
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.6vw, 3rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--deep);
    margin: 10px 0 10px;
    position: relative;
}
.recomp-body {
    font-size: 16.5px;
    max-width: 52ch;
    color: var(--text);
    margin: 0;
}

.ledger-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    font-family: var(--font-slab);
    font-size: 13px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ledger-list .lx { color: var(--accent-1); margin-right: 8px; }
.ledger-list em { color: var(--deep); font-style: normal; font-weight: 500; }

/* -------- CELL OVERLAY (expand/collapse) -------- */
.cell-overlay {
    position: fixed;
    inset: 0;
    background: rgba(245,240,232,0.94);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 64px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 340ms var(--ease-bento);
}
.cell-overlay.is-open { opacity: 1; pointer-events: auto; }

.overlay-inner {
    max-width: 920px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    background: var(--bg);
    border: 1px solid rgba(138,117,96,0.28);
    border-left-width: 4px;
    padding: 36px 40px;
    position: relative;
    transform: scale(0.96);
    transition: transform 340ms var(--ease-bento);
}
.cell-overlay.is-open .overlay-inner { transform: scale(1); }

.overlay-inner .cell-head { margin-bottom: 18px; }
.overlay-inner h1,
.overlay-inner h2,
.overlay-inner h3,
.overlay-inner h4 {
    font-family: var(--font-slab);
    color: var(--deep);
}
.overlay-inner .pull-quote { font-size: clamp(1.4rem, 2.4vw, 2rem); }

.overlay-close {
    position: fixed;
    top: 32px; right: 40px;
    width: 42px; height: 42px;
    background: var(--bg);
    border: 1px solid rgba(138,117,96,0.3);
    color: var(--deep);
    font-family: var(--font-slab);
    font-size: 22px;
    cursor: pointer;
    z-index: 210;
    transition: transform 200ms var(--ease-bento), background 200ms var(--ease-bento);
    line-height: 1;
}
.overlay-close:hover { background: var(--deep); color: var(--bg); transform: rotate(90deg); }

body.has-overlay { overflow: hidden; }

/* -------- FOOTER -------- */
.site-foot {
    margin-left: 48px;
    border-top: 1px solid rgba(138,117,96,0.3);
    padding: 28px 32px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: center;
    background: var(--bg-alt);
}
.foot-col { display: flex; flex-direction: column; gap: 4px; }
.foot-col.center { align-items: center; }
.foot-col.right { align-items: flex-end; text-align: right; }
.foot-label {
    font-family: var(--font-slab);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-1);
}
.foot-val {
    font-family: var(--font-slab);
    font-size: 13px;
    color: var(--deep);
    letter-spacing: 0.04em;
}
.foot-column { width: 200px; height: 24px; opacity: 0.7; }

/* -------- BENTO ASSEMBLY ANIMATION -------- */
.cell.assembling,
.debate-card.assembling,
.chain-cell.assembling,
.unravel-cell.assembling {
    opacity: 0;
    transform: translate(var(--tx, 0), var(--ty, 40px)) scale(0.96);
}
.cell.assembled,
.debate-card.assembled,
.chain-cell.assembled,
.unravel-cell.assembled {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* expanded state when a cell is selected */
.cell.is-expanded {
    z-index: 180;
}
.bento-section.has-expand .cell:not(.is-expanded),
.bento-section.has-expand .debate-card:not(.is-expanded),
.bento-section.has-expand .chain-cell:not(.is-expanded),
.bento-section.has-expand .unravel-cell:not(.is-expanded) {
    opacity: 0.2;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 980px) {
    .bento-grid,
    .recomp-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .cell-thesis       { grid-column: 1 / 7 !important; grid-row: auto !important; }
    .cell-counter      { grid-column: 1 / 4 !important; grid-row: auto !important; }
    .cell-evidence     { grid-column: 4 / 7 !important; grid-row: auto !important; }
    .cell-question     { grid-column: 1 / 4 !important; grid-row: auto !important; }
    .cell-pullquote    { grid-column: 4 / 7 !important; grid-row: auto !important; }
    .cell-small        { grid-column: 1 / 4 !important; grid-row: auto !important; }
    .cell-stat         { grid-column: 4 / 7 !important; grid-row: auto !important; }

    .cell-recomp-main  { grid-column: 1 / 7 !important; grid-row: auto !important; }
    .cell-recomp-a     { grid-column: 1 / 4 !important; grid-row: auto !important; }
    .cell-recomp-b     { grid-column: 4 / 7 !important; grid-row: auto !important; }
    .cell-recomp-c     { grid-column: 1 / 4 !important; grid-row: auto !important; }
    .cell-recomp-d     { grid-column: 4 / 7 !important; grid-row: auto !important; }
    .cell-recomp-e     { grid-column: 1 / 7 !important; grid-row: auto !important; }

    .debate-grid { grid-template-columns: repeat(2, 1fr); }

    .unravel-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 100px; }
    .u-1,.u-2,.u-3,.u-4,.u-5,.u-6,.u-7,.u-8 { grid-column: auto / span 2; grid-row: auto; }
}

@media (max-width: 620px) {
    .side-index { width: 38px; }
    .top-bar { margin-left: 38px; padding: 14px 18px; flex-direction: column; align-items: flex-start; gap: 6px; }
    .top-meta { font-size: 9px; }
    .stage { margin-left: 38px; padding: 0 14px 28px; }
    .site-foot { margin-left: 38px; grid-template-columns: 1fr; padding: 22px 18px; }
    .foot-col.right { align-items: flex-start; text-align: left; }
    .debate-grid { grid-template-columns: 1fr; }
    .chain-link { flex-basis: 100%; transform: rotate(90deg); height: 20px; }
    .overlay-close { top: 14px; right: 14px; }
    .cell-overlay { padding: 60px 18px 18px; }
}
