/* ============================================================
   freedom.study — Stone Tribunal
   ============================================================ */

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

/* --- Noise texture as data URI --- */
:root {
    --ground: #f0ebe3;
    --stone-surface: #e2dace;
    --deep-shadow: #2b2520;
    --body-text: #3d3730;
    --muted-inscription: #8a7e6f;
    --nav-label: #6b6156;
    --accent: #8b2d1a;
    --fracture: #b8a898;
    --void-bg: #f7f3ed;
    --noise-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background-color: var(--ground);
    color: var(--body-text);
    font-family: 'Libre Baskerville', serif;
    font-size: 17px;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Fracture Line --- */
#fracture-line {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100vh;
    background-color: var(--fracture);
    z-index: 1;
    transition: background-color 400ms ease, width 400ms ease;
    pointer-events: none;
}

#fracture-line.active {
    background-color: var(--accent);
    width: 3px;
}

/* --- Sidebar Navigation --- */
#sidebar-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-label {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--nav-label);
    text-decoration: none;
    transition: color 300ms ease, font-weight 300ms ease;
    writing-mode: horizontal-tb;
    text-align: right;
}

.nav-label.active {
    color: var(--accent);
    font-weight: 700;
}

/* --- Scroll Container --- */
#scroll-container {
    position: relative;
    z-index: 2;
}

/* --- Stele Sections --- */
.stele-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6vh 0;
    scroll-snap-align: start;
    position: relative;
    z-index: 2;
}

.stele {
    width: var(--stele-width, 55%);
    margin-left: var(--stele-offset, 0%);
    background-color: var(--stone-surface);
    background-image: var(--noise-svg);
    border-left: 6px solid var(--fracture);
    box-shadow: inset 1px 0 0 0 rgba(43, 37, 32, 0.15);
    padding: 6vh 5vw 6vh 4vw;
    position: relative;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.stele-section[data-side="right"] .stele {
    transform: translateX(30px);
}

.stele.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* --- Ghost Numerals --- */
.stele::before {
    content: attr(data-numeral);
    position: absolute;
    top: 5vh;
    left: 5%;
    font-family: 'Bodoni Moda', serif;
    font-size: 20vw;
    font-weight: 100;
    color: var(--stone-surface);
    z-index: -1;
    line-height: 1;
    pointer-events: none;
    opacity: 0.7;
    will-change: transform;
    transform: translateY(var(--parallax-y, 0px));
}

/* --- Stele Headlines --- */
.stele-headline {
    font-family: 'Bodoni Moda', serif;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--deep-shadow);
    margin-bottom: 4vh;
    line-height: 1.05;
}

/* --- Stele Body --- */
.stele-body {
    max-width: 38em;
}

.stele-body p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    margin-bottom: 1.5em;
}

.stele-body p:last-child {
    margin-bottom: 0;
}

/* --- Rubricated Drop Capital --- */
.stele-body p:first-child::first-letter {
    font-family: 'Bodoni Moda', serif;
    font-size: 4.5em;
    font-weight: 900;
    color: var(--accent);
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
}

/* --- Void Sections --- */
.void-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void-bg);
    position: relative;
    z-index: 0;
    scroll-snap-align: start;
}

.void-quote {
    font-family: 'Cormorant SC', serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--muted-inscription);
    text-align: center;
    max-width: 36em;
    padding: 0 2rem;
    opacity: 0;
    transition: opacity 800ms ease;
}

.void-quote.visible {
    opacity: 1;
}

/* --- Final Void --- */
.void-final {
    min-height: 40vh;
}

/* --- Responsive: Below 768px --- */
@media (max-width: 768px) {
    #sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        transform: none;
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        padding: 12px 8px;
        background-color: rgba(240, 235, 227, 0.95);
        z-index: 100;
        flex-wrap: wrap;
    }

    .nav-label {
        font-size: 10px;
        text-align: center;
    }

    .stele-section {
        padding-top: 60px;
    }

    .stele {
        width: 90% !important;
        margin-left: 5% !important;
    }

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

    .stele::before {
        font-size: 30vw;
    }
}
