/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background-color: #1a1410;
    color: #d4c5b0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ===== SCROLL PROGRESS ===== */
#scroll-progress {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#scroll-progress.visible {
    opacity: 1;
}

#scroll-progress.pulse circle#progress-arc {
    stroke: #e8c87a;
    transition: stroke 0.3s ease;
}

/* ===== OPENING SECTION ===== */
#opening {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.opening-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#glyph-main {
    opacity: 0;
    transition: opacity 1.5s ease;
}

#glyph-main.visible {
    opacity: 1;
}

#domain-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.3em;
    color: #c9a96e;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#domain-title.visible {
    opacity: 1;
}

#subtitle {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #8a7b6b;
    max-width: 500px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#subtitle.visible {
    opacity: 1;
}

#gold-rule {
    width: 0;
    height: 1px;
    background-color: #a08450;
    transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#gold-rule.visible {
    width: 60vw;
}

/* ===== ARGUMENT CORRIDOR ===== */
.corridor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
    gap: 4rem;
    position: relative;
}

.corridor-left {
    grid-template-columns: 55% 1fr;
    padding-left: 8%;
}

.corridor-left .main-argument {
    grid-column: 1;
}

.corridor-left .counter-argument {
    grid-column: 2;
    align-self: end;
    padding-top: 30vh;
}

.corridor-right {
    grid-template-columns: 1fr 55%;
    padding-right: 8%;
}

.corridor-right .main-argument {
    grid-column: 2;
}

.corridor-right .counter-argument {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
}

/* ===== ARGUMENT STYLING ===== */
.main-argument p {
    color: #d4c5b0;
    margin-bottom: 1.5rem;
}

.counter-argument p {
    color: #8a7b6b;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Tilt-3D animation */
.argument p {
    opacity: 0;
    transform: perspective(800px) rotateX(3deg);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.counter-argument p {
    transform: perspective(800px) rotateX(-3deg);
}

.argument p.in-view {
    opacity: 1;
    transform: perspective(800px) rotateX(0deg);
}

/* ===== DROP CAPS ===== */
.dropcap::first-letter {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 4em;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: #c9a96e;
    text-shadow: 0 0 30px rgba(201, 169, 110, 0.15);
}

/* ===== LOGIC / MONOSPACE ===== */
.logic {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    color: #c9a96e;
    font-size: 0.9em;
}

/* ===== ANNOTATIONS / MARGINALIA ===== */
.annotation {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    color: #6b5d50;
    display: block;
    border-left: 1px solid #a08450;
    padding-left: 1rem;
    margin-top: 1rem;
    line-height: 1.6;
    font-style: normal;
}

/* ===== FOLD-BACK ===== */
.fold-back {
    position: relative;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.fold-rule {
    width: 100%;
    height: 1px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, transparent, #a08450 20%, #a08450 80%, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.fold-rule.in-view {
    opacity: 1;
}

.diamond {
    width: 8px;
    height: 8px;
    background-color: #a08450;
    transform: rotate(45deg) scale(0);
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.3s ease;
    cursor: default;
}

.fold-rule.in-view .diamond {
    transform: rotate(45deg) scale(1);
}

.diamond:hover {
    transform: rotate(90deg) scale(1);
    background-color: #e8c87a;
}

.paradox-pattern {
    width: 100%;
    height: 200px;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ===== EQUILIBRIUM FOOTER ===== */
#equilibrium {
    padding: 8rem 2rem 6rem;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
}

.equilibrium-content {
    max-width: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.glyph-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.glyph-footer {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.glyph-footer.in-view {
    opacity: 1;
}

.equilibrium-text {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    color: #d4c5b0;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    opacity: 0;
    transform: perspective(800px) rotateX(3deg);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.equilibrium-text.in-view {
    opacity: 1;
    transform: perspective(800px) rotateX(0deg);
}

.final-rule {
    width: 0;
    height: 1px;
    background-color: #a08450;
    transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.final-rule.in-view {
    width: 40vw;
}

.domain-footer {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #c9a96e;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.domain-footer.in-view {
    opacity: 1;
}

/* ===== HEADINGS (if used) ===== */
h1, h2, h3 {
    font-family: 'Libre Baskerville', serif;
    color: #f0e6d3;
    letter-spacing: 0.02em;
}

h2 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .corridor {
        grid-template-columns: 1fr !important;
        padding: 3rem 1.5rem !important;
        gap: 2rem;
    }

    .corridor .main-argument,
    .corridor .counter-argument {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .corridor .counter-argument {
        padding-top: 0 !important;
        padding-left: 1.5rem;
        border-left: 2px solid #a08450;
    }

    .argument p {
        transform: perspective(800px) rotateX(1.5deg);
    }

    .counter-argument p {
        transform: perspective(800px) rotateX(-1.5deg);
    }

    #scroll-progress {
        top: 12px;
        right: 12px;
    }

    #equilibrium {
        padding: 5rem 1.5rem 4rem;
    }
}
