/* ============================================
   diplomacy.day — Art-Deco Diplomatic Procession
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0B1628;
    color: #B8B5AE;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Noise Texture Overlay === */
.noise-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    filter: url(#noiseFilter);
    background: rgba(255, 255, 255, 0.5);
}

/* === Navigation Medallions === */
.nav-medallions {
    position: fixed;
    left: 3vw;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.nav-medallion {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #C9A255;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 0;
}

.nav-medallion-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #C9A255;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-medallion.active .nav-medallion-fill {
    transform: scale(1);
}

.nav-medallion:hover {
    border-color: #D4B85C;
    box-shadow: 0 0 12px rgba(201, 162, 85, 0.25);
}

/* === Ornamental Gutters === */
.gutter {
    position: fixed;
    top: 0;
    width: 20vw;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.gutter-left {
    left: 0;
}

.gutter-right {
    right: 0;
}

.gutter-pattern {
    width: 100%;
    height: 200%;
    opacity: 0.12;
}

/* === Section (Hall) Base === */
.hall {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 4vh, 100% 100%, 0 96vh);
    padding: 8vh 0;
}

.hall:first-of-type {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 96vh);
}

.hall:last-of-type {
    clip-path: polygon(0 0, 100% 4vh, 100% 100%, 0 100%);
}

.hall-content {
    width: 54vw;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

/* === Decorative Bands === */
.deco-band {
    width: 100%;
    height: 40px;
    position: relative;
    z-index: 5;
    overflow: hidden;
    background: #0B1628;
}

.band-pattern {
    width: 100%;
    height: 100%;
}

/* === HALL I: The Vestibule === */
.hall-vestibule {
    background: #0B1628;
    flex-direction: column;
}

.vestibule-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Sunburst Medallion */
.sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

.sunburst-hero {
    width: 80vh;
    height: 80vh;
    opacity: 0;
    animation: sunburstFadeIn 2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

.sunburst-svg {
    width: 100%;
    height: 100%;
    animation: sunburstRotate 120s linear infinite;
}

@keyframes sunburstFadeIn {
    from { opacity: 0; }
    to { opacity: 0.08; }
}

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

/* Hero Title */
.hero-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 400;
    color: #C9A255;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.05;
    text-shadow: 0 0 30px rgba(201, 162, 85, 0.15);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    animation: letterReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.letter:nth-child(1) { animation-delay: 0.8s; }
.letter:nth-child(2) { animation-delay: 0.86s; }
.letter:nth-child(3) { animation-delay: 0.92s; }
.letter:nth-child(4) { animation-delay: 0.98s; }
.letter:nth-child(5) { animation-delay: 1.04s; }
.letter:nth-child(6) { animation-delay: 1.10s; }
.letter:nth-child(7) { animation-delay: 1.16s; }
.letter:nth-child(8) { animation-delay: 1.22s; }
.letter:nth-child(9) { animation-delay: 1.28s; }

@keyframes letterReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Rule */
.hero-rule {
    width: 0;
    height: 1px;
    background: #D4B85C;
    margin: 2rem auto;
    animation: ruleExpand 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.6s forwards;
}

@keyframes ruleExpand {
    from { width: 0; }
    to { width: 40vw; }
}

/* Hero Subtitle */
.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.3em;
    color: rgba(240, 232, 216, 0.7);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 2.0s forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === HALL II: The Map Room === */
.hall-maproom {
    background: #0B1628;
}

/* Section Labels */
.section-label {
    text-align: center;
    margin-bottom: 1rem;
}

.label-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: rgba(201, 162, 85, 0.6);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

/* Section Headings */
.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    color: #F0E8D8;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-align: center;
    margin-bottom: 4rem;
}

/* Timeline Axis */
.timeline-axis {
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(201, 162, 85, 0.4);
    transform: translateX(-50%);
}

.timeline-block {
    position: relative;
    width: 45%;
    margin-bottom: 6vh;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.timeline-left {
    margin-right: auto;
    padding-right: 3vw;
}

.timeline-right {
    margin-left: auto;
    padding-left: 3vw;
}

/* Diamond Waypoints */
.diamond-waypoint {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #C9A255;
    transform: rotate(45deg) scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    top: 50%;
    opacity: 0.6;
}

.timeline-left .diamond-waypoint {
    right: -4px;
    margin-right: -3vw;
}

.timeline-right .diamond-waypoint {
    left: -4px;
    margin-left: -3vw;
}

.timeline-block.revealed .diamond-waypoint {
    transform: rotate(45deg) scale(1);
}

/* Cartographic Frame */
.cartographic-frame {
    position: relative;
    padding: 2rem;
    background: #1E2A3A;
    border-radius: 2px;
}

.frame-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.frame-svg .frame-outer,
.frame-svg .frame-inner {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.revealed .frame-svg .frame-outer,
.revealed .frame-svg .frame-inner {
    stroke-dashoffset: 0;
}

.body-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    color: #B8B5AE;
    line-height: 1.75;
    letter-spacing: 0.01em;
}

/* === HALL III: The Treaty Hall === */
.hall-treaty {
    background: #0B1628;
    background-image: radial-gradient(ellipse at center, #2D6A4F14 0%, transparent 70%);
}

.treaty-statements {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.treaty-statement {
    width: 100%;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.treaty-statement.revealed {
    opacity: 1;
    transform: translateY(0);
}

.frame-statement {
    text-align: center;
}

.statement-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    color: #F0E8D8;
    line-height: 1.4;
    padding: 0.5rem 1rem;
}

/* Stepped Pyramid Dividers */
.stepped-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 1rem 0;
}

.pyramid-step {
    height: 3px;
    background: rgba(212, 184, 92, 0.4);
}

.step-wide { width: 40px; }
.step-medium { width: 28px; }
.step-narrow { width: 16px; }

/* === HALL IV: The Seal Chamber === */
.hall-seal {
    background: #0B1628;
}

.seal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 3rem auto;
    width: 320px;
    height: 320px;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.seal-container.revealed {
    opacity: 1;
}

/* Seal Orbit Words */
.seal-orbit {
    position: absolute;
    width: 320px;
    height: 320px;
    top: 0;
    left: 0;
}

.orbit-word {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    color: rgba(201, 162, 85, 0.5);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    top: 50%;
    left: 50%;
    transform: rotate(var(--angle)) translateY(-150px) rotate(calc(-1 * var(--angle)));
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
}

.seal-container.revealed .orbit-word:nth-child(1)  { opacity: 1; transition-delay: 0.3s; }
.seal-container.revealed .orbit-word:nth-child(2)  { opacity: 1; transition-delay: 0.38s; }
.seal-container.revealed .orbit-word:nth-child(3)  { opacity: 1; transition-delay: 0.46s; }
.seal-container.revealed .orbit-word:nth-child(4)  { opacity: 1; transition-delay: 0.54s; }
.seal-container.revealed .orbit-word:nth-child(5)  { opacity: 1; transition-delay: 0.62s; }
.seal-container.revealed .orbit-word:nth-child(6)  { opacity: 1; transition-delay: 0.70s; }
.seal-container.revealed .orbit-word:nth-child(7)  { opacity: 1; transition-delay: 0.78s; }
.seal-container.revealed .orbit-word:nth-child(8)  { opacity: 1; transition-delay: 0.86s; }
.seal-container.revealed .orbit-word:nth-child(9)  { opacity: 1; transition-delay: 0.94s; }
.seal-container.revealed .orbit-word:nth-child(10) { opacity: 1; transition-delay: 1.02s; }
.seal-container.revealed .orbit-word:nth-child(11) { opacity: 1; transition-delay: 1.10s; }
.seal-container.revealed .orbit-word:nth-child(12) { opacity: 1; transition-delay: 1.18s; }

/* Diplomatic Seal */
.diplomatic-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6) rotate(-8deg);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #C44536, #8B2218);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -1px 2px rgba(212, 86, 74, 0.4),
        0 0 20px rgba(196, 69, 54, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seal-container.revealed .diplomatic-seal {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.seal-monogram {
    font-family: 'Poiret One', cursive;
    font-size: 28px;
    color: #F0E8D8;
    text-shadow: 1px 1px 0 #8B2218, -1px -1px 0 #D4564A;
    line-height: 1;
}

.seal-description {
    text-align: center;
    margin-top: 4rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* === HALL V: The Archive === */
.hall-archive {
    background: #0B1628;
}

.sunburst-archive {
    width: 120vh;
    height: 120vh;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.sunburst-archive.revealed {
    opacity: 0.25;
}

.archive-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.archive-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    color: #F0E8D8;
    line-height: 1.6;
    max-width: 600px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-quote.revealed {
    opacity: 1;
    transform: translateY(0);
}

.archive-rule {
    width: 40vw;
    height: 1px;
    background: #D4B85C;
    margin: 2.5rem auto 0;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-rule.collapsing {
    width: 0;
}

/* === Responsive: Below 768px === */
@media (max-width: 768px) {
    .gutter {
        width: 8vw;
    }

    .hall-content {
        width: 84vw;
    }

    .nav-medallions {
        left: 2vw;
    }

    .nav-medallion {
        width: 14px;
        height: 14px;
    }

    .timeline-line {
        left: 8vw;
    }

    .timeline-left,
    .timeline-right {
        width: 80%;
        margin-left: auto;
        margin-right: 0;
        padding-left: 3vw;
        padding-right: 0;
    }

    .timeline-left .diamond-waypoint,
    .timeline-right .diamond-waypoint {
        left: -4px;
        right: auto;
        margin-left: -3vw;
        margin-right: 0;
    }

    .seal-container {
        width: 260px;
        height: 260px;
    }

    .seal-orbit {
        width: 260px;
        height: 260px;
    }

    .orbit-word {
        transform: rotate(var(--angle)) translateY(-120px) rotate(calc(-1 * var(--angle)));
        font-size: 0.6rem;
    }

    .hero-title {
        letter-spacing: 0.12em;
    }
}

/* === Small screens === */
@media (max-width: 480px) {
    .hall {
        clip-path: polygon(0 0, 100% 2vh, 100% 100%, 0 98vh);
    }

    .hall:first-of-type {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 98vh);
    }

    .hall:last-of-type {
        clip-path: polygon(0 0, 100% 2vh, 100% 100%, 0 100%);
    }

    .hall-content {
        width: 90vw;
    }

    .gutter {
        display: none;
    }

    .seal-container {
        width: 220px;
        height: 220px;
    }

    .seal-orbit {
        width: 220px;
        height: 220px;
    }

    .orbit-word {
        transform: rotate(var(--angle)) translateY(-100px) rotate(calc(-1 * var(--angle)));
        font-size: 0.55rem;
    }
}
