/* ============================================
   SocialDebug.Org -- Styles
   Editorial / Magazine-Spread / Scholarly
   ============================================ */

/* --- Global Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #0F0F0F;
    color: #D4CBC0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.72;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1;
    overflow-x: hidden;
}

/* --- Folio Band --- */
#folio-band {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 1000;
    background: transparent;
    transition: background 300ms ease, backdrop-filter 300ms ease;
}

#folio-band.scrolled {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.folio-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.folio-domain {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-variant-caps: small-caps;
    font-size: 1rem;
    letter-spacing: 0.25em;
    color: #F5F0E8;
    transition: font-size 300ms ease;
}

#folio-band.scrolled .folio-domain {
    font-size: 0.75rem;
}

.folio-nav {
    display: flex;
    gap: 32px;
}

.folio-nav a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #D4CBC0;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 300ms ease, color 300ms ease;
}

#folio-band.scrolled .folio-nav a {
    opacity: 1;
}

.folio-nav a:hover {
    color: #B8860B;
    opacity: 1;
}

/* --- Scroll Sentinel --- */
#scroll-sentinel {
    position: absolute;
    top: 100px;
    left: 0;
    width: 1px;
    height: 1px;
}

/* --- Opening Spread --- */
#opening-spread {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.opening-grid {
    max-width: 1280px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 24px;
    position: relative;
}

.opening-text {
    grid-column: 1 / 7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 48px;
}

.hero-headline {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #F5F0E8;
    margin-bottom: 2rem;
}

.hero-subline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.6;
    color: #8A7F72;
    max-width: 640px;
}

.vertical-spine-hero {
    grid-column: 7 / 8;
    position: relative;
}

.vertical-spine-hero::before {
    content: '';
    position: absolute;
    top: -50vh;
    bottom: -50vh;
    left: 0;
    width: 1px;
    background-color: #C8102E;
}

/* --- Content Sections --- */
.content-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Interstitial Spread --- */
.interstitial-spread {
    height: 60vh;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.ghost-numeral {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 12rem;
    font-weight: 900;
    color: #F5F0E8;
    opacity: 0.08;
    position: absolute;
    line-height: 1;
    user-select: none;
    transform: translateX(-120%);
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ghost-numeral.revealed {
    transform: translateX(0);
}

.interstitial-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
    font-variant-caps: small-caps;
    color: #C8102E;
    position: relative;
    z-index: 1;
    transform: translateX(120%);
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms;
}

.interstitial-title.revealed {
    transform: translateX(0);
}

/* --- Column Field Layout --- */
.column-field {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 24px;
    position: relative;
    padding-bottom: 6rem;
}

.primary-column {
    grid-column: 1 / 6;
}

.marginalia-column {
    grid-column: 6 / 9;
    padding-left: 24px;
}

.vertical-spine {
    position: absolute;
    left: calc((5 / 8) * 100%);
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #C8102E;
    opacity: 0.4;
}

/* --- Body Text --- */
.body-text {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    margin-bottom: 1.5em;
    widows: 3;
    orphans: 3;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.body-text.revealed {
    clip-path: inset(0 0 0 0);
}

/* --- Drop Caps --- */
.drop-cap {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 4.5rem;
    float: left;
    line-height: 0.8;
    padding-right: 0.1em;
    margin-top: 0.05em;
    color: #C8102E;
}

/* --- Pull Quotes --- */
.pull-quote {
    border-left: 2px solid #C8102E;
    padding-left: 24px;
    margin: 2.5rem 0;
    position: relative;
    overflow: hidden;
}

.pull-quote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 1.75rem;
    line-height: 1.35;
    color: #C8102E;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 300ms,
                opacity 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 300ms;
}

.pull-quote::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0;
    background-color: #C8102E;
    transition: height 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pull-quote.revealed::before {
    height: 100%;
}

.pull-quote.revealed p {
    transform: translateX(0);
    opacity: 1;
}

/* --- Marginalia --- */
.marginalia-note {
    margin-bottom: 2.5rem;
    transform: translateX(40px);
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.marginalia-note.revealed {
    transform: translateX(0);
    opacity: 1;
}

.ref-mark {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: #C8102E;
    vertical-align: super;
    margin-right: 0.25em;
    font-weight: 500;
}

.marginalia-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #8A7F72;
}

/* --- Redaction Divider --- */
.redaction-divider {
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.redaction-divider.revealed {
    clip-path: inset(0 0 0 0);
}

.redaction-bar {
    height: 4px;
    background-color: #C8102E;
    opacity: 0.3;
}

/* --- Evidence Grid --- */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 6rem;
}

.evidence-tile {
    border-top: 4px solid #C8102E;
    background-color: #1A1A1A;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.evidence-tile.revealed {
    clip-path: inset(0);
}

.evidence-image {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%) sepia(12%) contrast(1.1);
    position: relative;
    overflow: hidden;
}

.evidence-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 1rem;
}

.evidence-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8A7F72;
}

.evidence-caption-overlay {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #F5F0E8;
    opacity: 0.6;
}

.evidence-tile figcaption {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #8A7F72;
    padding: 16px;
    border-top: 1px solid #2E2E2E;
}

/* --- Colophon --- */
#colophon {
    padding: 6rem 24px;
    border-top: 1px solid #2E2E2E;
    margin-top: 4rem;
}

.colophon-inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.colophon-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-variant-caps: small-caps;
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: #8A7F72;
    margin-bottom: 2rem;
}

.colophon-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #8A7F72;
    margin-bottom: 1rem;
}

.colophon-bullet {
    color: #2E2E2E;
    margin: 0 0.5em;
}

.colophon-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #8A7F72;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.gold-date {
    color: #B8860B;
}

.colophon-rights {
    margin-top: 2rem;
    font-style: italic;
}

/* --- Reveal Base Classes (hero elements) --- */
.reveal {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
    clip-path: inset(0 0 0 0);
}

.reveal-slide-left {
    transform: translateX(-120%);
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-slide-left.revealed {
    transform: translateX(0);
}

.reveal-slide-right {
    transform: translateX(120%);
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms;
}

.reveal-slide-right.revealed {
    transform: translateX(0);
}

.reveal-marginalia {
    transform: translateX(40px);
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-marginalia.revealed {
    transform: translateX(0);
    opacity: 1;
}

.reveal-pullquote {
    /* Pull quotes handle their own animation via the ::before and p child */
}

.reveal-tile {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-tile.revealed {
    clip-path: inset(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .opening-grid {
        grid-template-columns: 1fr;
    }

    .opening-text {
        grid-column: 1;
        padding-right: 0;
    }

    .vertical-spine-hero {
        display: none;
    }

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

    .primary-column {
        grid-column: 1;
    }

    .marginalia-column {
        grid-column: 1;
        padding-left: 0;
        padding-top: 2rem;
        border-top: 1px solid #2E2E2E;
    }

    .vertical-spine {
        display: none;
    }

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

    .ghost-numeral {
        font-size: 8rem;
    }
}

@media (max-width: 640px) {
    .folio-nav {
        gap: 16px;
    }

    .folio-nav a {
        font-size: 0.65rem;
    }

    .hero-headline {
        font-size: clamp(2rem, 8vw, 4rem);
    }

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

    .interstitial-spread {
        height: 40vh;
    }

    .ghost-numeral {
        font-size: 6rem;
    }

    .interstitial-title {
        font-size: 1.5rem;
    }

    .pull-quote p {
        font-size: 1.35rem;
    }
}
