/* =================================== */
/* diplomacy.quest — Bauhaus War Room  */
/* ================================== */

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

:root {
    /* Primary Palette */
    --terracotta-light: #F5E6D8;
    --terracotta-mid: #E8D5C4;
    --terracotta-warm: #D4B8A0;
    --earth-deep: #6B4226;
    --earth-dark: #4A3228;
    --earth-darkest: #2B1810;
    --ink-black: #1E120B;
    /* Accents */
    --diplo-teal: #2D8F8F;
    --diplo-crimson: #8F2D5A;
    --diplo-gold: #8B6914;
    --diplo-green: #4A8F3D;
    /* Typography */
    --font-display: 'DM Sans', sans-serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-mono: 'Space Mono', monospace;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background: var(--terracotta-light);
    color: var(--earth-darkest);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    font-size: 1.06rem;
    background: var(--terracotta-light);
    cursor: none;
}

/* --- Typography --- */
.display-title {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0.88;
    color: var(--earth-darkest);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.06rem;
    line-height: 1.6;
    color: var(--earth-dark);
}

.body-text-italic {
    font-style: italic;
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--diplo-gold);
}

/* --- Custom Cursor --- */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--terracotta-light);
    border-radius: 50%;
    position: absolute;
    top: -3px;
    left: -3px;
    transition: transform 0.1s ease;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--terracotta-light);
    border-radius: 50%;
    position: absolute;
    top: -20px;
    left: -20px;
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease;
}

.custom-cursor.hovering .cursor-ring {
    width: 60px;
    height: 60px;
    top: -30px;
    left: -30px;
    border-color: var(--diplo-gold);
}

/* --- Aurora Lines --- */
.aurora-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
}

.aurora-svg {
    width: 100%;
    height: 100%;
}

.aurora-path {
    fill: none;
    stroke-width: 1.5;
}

.aurora-path-1 {
    stroke: var(--diplo-teal);
    animation: auroraFlow 12s ease-in-out infinite;
}

.aurora-path-2 {
    stroke: var(--diplo-crimson);
    animation: auroraFlow 15s ease-in-out infinite 0.5s;
}

.aurora-path-3 {
    stroke: var(--diplo-green);
    animation: auroraFlow 18s ease-in-out infinite 1s;
}

@keyframes auroraFlow {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    25% { transform: translateY(-30px); opacity: 0.6; }
    50% { transform: translateY(15px); opacity: 0.4; }
    75% { transform: translateY(-20px); opacity: 0.5; }
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    display: grid;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.section-inner {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    align-items: center;
    padding: 8vh 12vw;
    min-height: 100vh;
}

.ma-space {
    min-height: 8vh;
}

.content-block {
    max-width: 700px;
}

/* --- Section Markers --- */
.section-marker {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.marker-num {
    font-size: 0.7rem;
    color: var(--diplo-gold);
}

.marker-line {
    height: 1px;
    width: 60px;
    background: var(--diplo-gold);
    opacity: 0.4;
}

.section-title {
    font-size: clamp(3rem, 8vw, 7.5rem);
    margin-bottom: 3rem;
}

.section-title-light {
    color: var(--terracotta-light);
}

/* ================================== */
/* SECTION 1: THRESHOLD              */
/* ================================== */
.section-threshold {
    background: var(--terracotta-light);
}

.threshold-content {
    position: relative;
}

.bauhaus-circle.threshold-circle {
    width: clamp(80px, 12vw, 160px);
    height: clamp(80px, 12vw, 160px);
    border: 1.5px solid var(--diplo-teal);
    border-radius: 50%;
    position: absolute;
    top: -4vh;
    right: -4vw;
    opacity: 0.4;
    animation: gentleRotate 40s linear infinite;
}

@keyframes gentleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.threshold-title {
    font-size: clamp(3rem, 10vw, 9.5rem);
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
}

.title-line-accent {
    color: var(--diplo-crimson);
}

.threshold-subtitle {
    max-width: 360px;
    margin-bottom: 2rem;
}

.bauhaus-line.threshold-line {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--diplo-gold), transparent);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: pulseDown 2s ease-in-out infinite;
}

.scroll-indicator-line {
    width: 1px;
    height: 30px;
    background: var(--diplo-gold);
    opacity: 0.5;
}

.scroll-label {
    font-size: 0.6rem;
    color: var(--diplo-gold);
    opacity: 0.6;
}

@keyframes pulseDown {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* ================================== */
/* SECTION 2: PROTOCOL               */
/* ================================== */
.section-protocol {
    background: var(--terracotta-mid);
}

.protocol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
}

.protocol-card {
    padding: 2rem;
    border: 1px solid rgba(43, 24, 16, 0.15);
    background: rgba(245, 230, 216, 0.5);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s ease;
}

.protocol-card:hover {
    box-shadow: 0 8px 40px rgba(30, 18, 11, 0.12);
}

.card-shape {
    width: 50px;
    height: 50px;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.card-shape-circle {
    border: 1.5px solid var(--diplo-teal);
    border-radius: 50%;
}

.card-shape-triangle {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 50px solid var(--diplo-crimson);
    opacity: 0.3;
}

.card-shape-square {
    border: 1.5px solid var(--diplo-green);
}

.card-title {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.card-desc {
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ================================== */
/* SECTION 3: CHAMBER                */
/* ================================== */
.section-chamber {
    background: var(--earth-darkest);
    color: var(--terracotta-light);
}

.duotone-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(43, 24, 16, 0.9) 0%, rgba(30, 18, 11, 0.95) 100%);
    mix-blend-mode: multiply;
    z-index: 1;
}

.section-chamber .section-inner {
    z-index: 2;
    position: relative;
}

.chamber-content .marker-num,
.chamber-content .marker-line {
    color: var(--diplo-gold);
    background: var(--diplo-gold);
}

.chamber-content .marker-num {
    background: none;
}

.chamber-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.chamber-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-number {
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    color: var(--diplo-gold);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--terracotta-warm);
    opacity: 0.8;
}

.chamber-quote {
    border-left: 2px solid var(--diplo-crimson);
    padding-left: 1.5rem;
    max-width: 500px;
}

.chamber-quote .body-text {
    color: var(--terracotta-warm);
    font-size: 1.1rem;
}

/* Geometric Pattern Overlay */
.geometric-pattern {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.geo-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    opacity: 0.08;
}

.geo-circle-1 {
    width: 40vw;
    height: 40vw;
    border-color: var(--diplo-teal);
    right: -10vw;
    top: 10vh;
}

.geo-circle-2 {
    width: 25vw;
    height: 25vw;
    border-color: var(--diplo-gold);
    right: 5vw;
    bottom: 10vh;
}

.geo-line {
    position: absolute;
    height: 1px;
    opacity: 0.06;
}

.geo-line-1 {
    width: 50vw;
    background: var(--diplo-crimson);
    top: 30%;
    right: 0;
    transform: rotate(-15deg);
}

.geo-line-2 {
    width: 35vw;
    background: var(--diplo-green);
    bottom: 25%;
    right: 10vw;
    transform: rotate(10deg);
}

/* ================================== */
/* SECTION 4: CARTOGRAPHY            */
/* ================================== */
.section-cartography {
    background: var(--terracotta-light);
}

.cartography-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

.cartography-item {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
}

.cartography-visual {
    padding: 2rem;
}

.map-abstraction {
    width: 100%;
    height: auto;
}

.cartography-label {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--diplo-teal);
}

.cartography-text .body-text {
    max-width: 450px;
}

/* ================================== */
/* SECTION 5: ACCORD                 */
/* ================================== */
.section-accord {
    background: var(--terracotta-warm);
}

.accord-statement {
    max-width: 550px;
    margin-bottom: 3rem;
}

.accord-text {
    font-size: 1.1rem;
    line-height: 1.7;
}

.accord-sigil {
    width: clamp(120px, 20vw, 200px);
    height: clamp(120px, 20vw, 200px);
    margin-bottom: 3rem;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.accord-sigil:hover {
    transform: rotate(45deg) scale(1.05);
}

.sigil-svg {
    width: 100%;
    height: 100%;
}

.accord-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(43, 24, 16, 0.2);
    max-width: 400px;
}

.accord-year {
    color: var(--earth-deep);
}

/* --- Parallax Elements --- */
.parallax-element {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* --- Reveal Animations --- */
.content-block {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.content-block.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered child reveals */
.content-block.visible .protocol-card,
.content-block.visible .chamber-stat,
.content-block.visible .cartography-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.content-block.visible .protocol-card:nth-child(1),
.content-block.visible .chamber-stat:nth-child(1),
.content-block.visible .cartography-item:nth-child(1) {
    animation-delay: 0.2s;
}

.content-block.visible .protocol-card:nth-child(2),
.content-block.visible .chamber-stat:nth-child(2),
.content-block.visible .cartography-item:nth-child(2) {
    animation-delay: 0.4s;
}

.content-block.visible .protocol-card:nth-child(3),
.content-block.visible .chamber-stat:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        padding: 6vh 6vw;
    }

    .chamber-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .cartography-item {
        grid-template-columns: 1fr;
    }

    .cartography-visual {
        max-width: 250px;
    }

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

    .custom-cursor {
        display: none;
    }

    body {
        cursor: auto;
    }
}