/* ============================================================
   diplomatic.bar - Aurora Diplomacy
   ============================================================ */

/* --- Color Palette ---
   Deep Nightshade:    #1A1028
   Midnight Indigo:    #0F1B3D
   Aurora Mint:        #00FF9D
   Aurora Magenta:     #E040A0
   Plasma Violet:      #7B2FBE
   Pale Amethyst:      #D8D0E8
   Celestial Teal:     #14E8C8
   Warm Ivory:         #F5F0E6
   Burnt Diplomatique: #8B3A4A
*/

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

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

body {
    background: #1A1028;
    color: #D8D0E8;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 3px;
    height: 0%;
    background: linear-gradient(180deg, #00FF9D, #7B2FBE, #E040A0, #14E8C8);
    z-index: 1000;
    transition: height 0.1s linear;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: absolute;
    inset: 0;
    filter: url(#noiseFilter);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

.noise-dark {
    opacity: 0.04;
}

.noise-light {
    opacity: 0.07;
}

/* --- Luminous Dividers --- */
.luminous-divider {
    width: 100%;
    height: 2px;
    background: #00FF9D;
    box-shadow: 0 0 12px 2px rgba(0, 255, 157, 0.4), 0 0 24px 4px rgba(0, 255, 157, 0.15);
    position: relative;
    z-index: 10;
}

/* --- Section Base --- */
.scene {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.scene-content {
    position: relative;
    z-index: 5;
}

.content-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: inherit;
    padding: clamp(2rem, 6vw, 5rem);
}

.content-column {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 5rem);
}

/* --- Aurora Curtains --- */
.aurora-curtain {
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    filter: blur(40px);
}

.curtain-1 {
    width: 4vw;
    left: 48%;
    background: linear-gradient(180deg, #00FF9D, #7B2FBE, #14E8C8, transparent);
    opacity: 0.1;
    animation: auroraDrift1 20s ease-in-out infinite alternate;
}

.curtain-2 {
    width: 3vw;
    left: 25%;
    background: linear-gradient(180deg, #14E8C8, #7B2FBE, #00FF9D, transparent);
    opacity: 0.08;
    animation: auroraDrift2 18s ease-in-out infinite alternate;
}

.curtain-3 {
    width: 5vw;
    right: 20%;
    background: linear-gradient(180deg, #7B2FBE, #00FF9D, #E040A0, transparent);
    opacity: 0.06;
    animation: auroraDrift3 22s ease-in-out infinite alternate;
}

.curtain-4 {
    width: 3vw;
    left: 15%;
    background: linear-gradient(180deg, #00FF9D, #14E8C8, transparent);
    opacity: 0.1;
    animation: auroraDrift1 17s ease-in-out infinite alternate;
}

.curtain-5 {
    width: 4vw;
    left: 40%;
    background: linear-gradient(180deg, #7B2FBE, #E040A0, #00FF9D, transparent);
    opacity: 0.08;
    animation: auroraDrift2 23s ease-in-out infinite alternate;
}

.curtain-6 {
    width: 2vw;
    right: 30%;
    background: linear-gradient(180deg, #14E8C8, #7B2FBE, transparent);
    opacity: 0.12;
    animation: auroraDrift3 15s ease-in-out infinite alternate;
}

.curtain-7 {
    width: 6vw;
    right: 10%;
    background: linear-gradient(180deg, #E040A0, #00FF9D, #7B2FBE, transparent);
    opacity: 0.07;
    animation: auroraDrift1 25s ease-in-out infinite alternate;
}

@keyframes auroraDrift1 {
    from { transform: translateX(-2vw); }
    to { transform: translateX(3vw); }
}

@keyframes auroraDrift2 {
    from { transform: translateX(2vw); }
    to { transform: translateX(-3vw); }
}

@keyframes auroraDrift3 {
    from { transform: translateX(-3vw); }
    to { transform: translateX(5vw); }
}

/* --- Diplomatic Seal --- */
.seal-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #E040A0;
    outline: 1px solid rgba(0, 255, 157, 0.3);
    outline-offset: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', Garamond, serif;
    font-weight: 300;
    font-size: 2.5rem;
    color: #D8D0E8;
    animation: sealRotate 60s linear infinite;
}

.seal-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    z-index: 3;
    pointer-events: none;
}

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

/* Fix seal-watermark rotation to only rotate the inner seal */
.seal-watermark .seal-circle {
    animation: sealRotate 60s linear infinite;
}

/* ============================================================
   SCENE 1: THE THRESHOLD
   ============================================================ */
.scene-threshold {
    min-height: 100vh;
    background: #1A1028;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-threshold .content-centered {
    min-height: 100vh;
}

.title-main {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.6rem, 7vw, 6.5rem);
    letter-spacing: 0.06em;
    line-height: 1.08;
    color: #D8D0E8;
    text-align: center;
    font-feature-settings: 'liga' 1, 'kern' 1;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-main.visible {
    opacity: 1;
}

.epigraph {
    font-family: 'Cormorant Garamond', Garamond, serif;
    font-weight: 300;
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #D8D0E8;
    opacity: 0.7;
    text-align: center;
    margin-top: 2rem;
    max-width: 62ch;
}

/* ============================================================
   SCENE 2: THE CREDENTIALS
   ============================================================ */
.scene-credentials {
    min-height: 85vh;
    background: #0F1B3D;
    padding: 6rem 0;
}

.aurora-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.glow-top-left {
    background: radial-gradient(ellipse at 20% 20%, rgba(0, 255, 157, 0.15) 0%, rgba(123, 47, 190, 0.08) 50%, transparent 80%);
}

/* Card Container */
.card-container {
    perspective: 1200px;
    width: 320px;
    height: 480px;
    margin: 0 auto 3rem auto;
}

.credential-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-container.flipped .credential-card {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 4px;
    overflow: hidden;
}

/* Card Front */
.card-front {
    background: linear-gradient(180deg, #0F1B3D 0%, #1A1028 60%, #8B3A4A 100%);
    border: 1px solid #E040A0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.card-front::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#noiseFilter);
    mix-blend-mode: overlay;
    opacity: 0.04;
    pointer-events: none;
}

.card-seal {
    margin-bottom: 2rem;
}

.seal-card {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    line-height: 1.08;
    color: #D8D0E8;
    text-align: center;
    font-feature-settings: 'liga' 1, 'kern' 1;
    margin-bottom: 1rem;
}

.card-descriptor {
    font-family: 'Cormorant Garamond', Garamond, serif;
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(216, 208, 232, 0.6);
    text-align: center;
}

/* Card Back */
.card-back {
    background: #F5F0E6;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    box-shadow: inset 0 0 30px rgba(123, 47, 190, 0.08);
}

.card-back-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1A1028;
    margin-bottom: 1.2rem;
    letter-spacing: 0.04em;
}

.card-back-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.72;
    color: #1A1028;
    max-width: 62ch;
}

/* ============================================================
   SCENE 3: THE CHAMBER
   ============================================================ */
.scene-chamber {
    min-height: 100vh;
    background: linear-gradient(135deg, #1A1028 0%, #0F1B3D 30%, #7B2FBE 60%, #00FF9D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-chamber .content-centered {
    min-height: 100vh;
    padding-top: 25vh;
    padding-bottom: 25vh;
}

.constellation-grid {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0, 255, 157, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 2;
}

.pull-quote {
    font-family: 'Cormorant Garamond', Garamond, serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #00FF9D;
    text-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
    text-align: center;
    max-width: 62ch;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

/* ============================================================
   SCENE 4: THE ARCHIVE
   ============================================================ */
.scene-archive {
    min-height: 85vh;
    background: #1A1028;
    padding: 6rem 0;
}

.archive-block {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.archive-meta {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #00FF9D;
    border-left: 2px solid #E040A0;
    padding-left: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.archive-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #D8D0E8;
    max-width: 62ch;
    padding-left: 1rem;
}

/* ============================================================
   SCENE 5: THE SUMMIT
   ============================================================ */
.scene-summit {
    min-height: 100vh;
    background: linear-gradient(180deg, #0F1B3D 0%, rgba(123, 47, 190, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-summit .content-centered {
    min-height: 100vh;
    gap: 2.5rem;
}

.summit-seal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-large {
    width: 200px;
    height: 200px;
    font-size: 4rem;
    color: #00FF9D;
    border-color: #00FF9D;
    outline-color: rgba(0, 255, 157, 0.3);
    animation: sealRotate 60s linear infinite, sealPulse 4s ease-in-out infinite;
}

@keyframes sealPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 157, 0.2), 0 0 40px rgba(0, 255, 157, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 157, 0.4), 0 0 80px rgba(0, 255, 157, 0.2);
    }
}

.summit-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    line-height: 1.08;
    color: #D8D0E8;
    text-align: center;
    font-feature-settings: 'liga' 1, 'kern' 1;
}

.formal-rule {
    border: none;
    height: 1px;
    width: 60%;
    background: #14E8C8;
    opacity: 0.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .card-container {
        width: 280px;
        height: 420px;
    }

    .archive-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .aurora-curtain {
        filter: blur(30px);
    }
}

@media (max-width: 480px) {
    .card-container {
        width: 260px;
        height: 400px;
    }

    .seal-large {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
}
