/* ======================================================
   diplomacy.boo — Styles
   A haunted embassy, Art Deco grandeur in decay
   ====================================================== */

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

:root {
    --midnight-embassy: #0D0B14;
    --mahogany-dark: #1A1218;
    --diplomatic-gold: #C9A84C;
    --phantom-silver: #B8B0C8;
    --parchment: #E8E0D0;
    --fog: #8A8494;
    --redaction-red: #C45C3E;
    --treaty-teal: #3E8A7A;
    --cipher-dark: #14101C;

    --font-display: 'Poiret One', cursive;
    --font-secondary: 'Cormorant Garamond', serif;
    --font-body: 'Libre Baskerville', serif;
    --font-annotation: 'Caveat', cursive;

    --ease-elegant: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-redaction: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    background-color: var(--midnight-embassy);
    color: var(--parchment);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .redacted::after {
        display: none !important;
    }
    .arch-ring {
        opacity: 1 !important;
    }
    .foyer-title {
        opacity: 1 !important;
    }
    .foyer-subtitle {
        opacity: 1 !important;
    }
    .dossier-page {
        transform: none !important;
        opacity: 1 !important;
    }
    .circle-reveal {
        clip-path: circle(80% at 50% 50%) !important;
    }
}

/* ======================================================
   CHAMBER I — THE FOYER
   ====================================================== */

.foyer {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--midnight-embassy);
    overflow: hidden;
}

/* Chandelier */
.chandelier {
    position: absolute;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 160px;
}

.chandelier-arm {
    position: absolute;
    background: var(--diplomatic-gold);
    opacity: 0.25;
}

.chandelier-arm.arm-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
}

.chandelier-arm.arm-2 {
    top: 40px;
    left: 20%;
    width: 60%;
    height: 1px;
}

.chandelier-arm.arm-3 {
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    opacity: 0.15;
}

.chandelier-crystal {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.6) 0%, rgba(201, 168, 76, 0) 70%);
}

.crystal-1 {
    top: 42px;
    left: 20%;
    width: 12px;
    height: 12px;
    animation: crystal-pulse 3s ease-in-out infinite;
}

.crystal-2 {
    top: 42px;
    right: 20%;
    width: 10px;
    height: 10px;
    animation: crystal-pulse 3.7s ease-in-out infinite 0.5s;
}

.crystal-3 {
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    animation: crystal-pulse 4.2s ease-in-out infinite 1s;
}

.crystal-4 {
    top: 50px;
    left: 35%;
    width: 8px;
    height: 8px;
    animation: crystal-pulse 2.8s ease-in-out infinite 0.3s;
}

.crystal-5 {
    top: 50px;
    right: 35%;
    width: 9px;
    height: 9px;
    animation: crystal-pulse 3.3s ease-in-out infinite 0.8s;
}

@keyframes crystal-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.3); }
}

.crystal-1, .crystal-2, .crystal-4, .crystal-5 {
    transform-origin: center;
}

.chandelier-light {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
    animation: light-drift 20s ease-in-out infinite;
}

@keyframes light-drift {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    33% { transform: translateX(-45%) translateY(5px); }
    66% { transform: translateX(-55%) translateY(-3px); }
}

/* Art Deco Arch */
.arch-container {
    position: relative;
    width: clamp(280px, 50vw, 500px);
    height: clamp(200px, 35vh, 350px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch-ring {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid var(--diplomatic-gold);
    border-bottom: none;
    border-radius: 50% 50% 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.arch-ring-1 {
    width: 100%;
    height: 100%;
    border-color: var(--diplomatic-gold);
}

.arch-ring-2 {
    width: 92%;
    height: 92%;
    border-color: transparent;
    border-top-color: var(--diplomatic-gold);
    opacity: 0.7;
}

.arch-ring-3 {
    width: 84%;
    height: 84%;
    border-color: var(--diplomatic-gold);
    opacity: 0.5;
}

.arch-ring-4 {
    width: 76%;
    height: 76%;
    border-color: transparent;
    border-top-color: var(--diplomatic-gold);
    opacity: 0.4;
}

.arch-ring-5 {
    width: 68%;
    height: 68%;
    border-color: var(--diplomatic-gold);
    opacity: 0.3;
}

.arch-ring.visible {
    opacity: 1;
}

.arch-ring.flash {
    box-shadow: 0 0 20px var(--diplomatic-gold);
}

/* Foyer Title */
.foyer-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--diplomatic-gold);
    position: relative;
    z-index: 2;
    opacity: 0;
    min-height: 1.2em;
}

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

/* Foyer Subtitle */
.foyer-subtitle {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    color: var(--phantom-silver);
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1.5s var(--ease-elegant);
    text-align: center;
    max-width: 80%;
    position: relative;
    z-index: 2;
}

.foyer-subtitle.visible {
    opacity: 1;
}

/* ======================================================
   ART DECO CHEVRON DIVIDERS
   ====================================================== */

.deco-divider {
    width: 100%;
    height: 40px;
    position: relative;
    overflow: hidden;
    background: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 10px,
        rgba(201, 168, 76, 0.08) 10px,
        rgba(201, 168, 76, 0.08) 11px,
        transparent 11px,
        transparent 20px
    ),
    repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(201, 168, 76, 0.08) 10px,
        rgba(201, 168, 76, 0.08) 11px,
        transparent 11px,
        transparent 20px
    );
    animation: divider-pulse 8s ease-in-out infinite;
}

.deco-divider.divider-wide {
    height: 60px;
    background:
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 8px,
            rgba(201, 168, 76, 0.06) 8px,
            rgba(201, 168, 76, 0.06) 9px,
            transparent 9px,
            transparent 16px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(201, 168, 76, 0.06) 8px,
            rgba(201, 168, 76, 0.06) 9px,
            transparent 9px,
            transparent 16px
        ),
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 14px,
            rgba(201, 168, 76, 0.1) 14px,
            rgba(201, 168, 76, 0.1) 15px,
            transparent 15px,
            transparent 28px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 14px,
            rgba(201, 168, 76, 0.1) 14px,
            rgba(201, 168, 76, 0.1) 15px,
            transparent 15px,
            transparent 28px
        );
}

@keyframes divider-pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

/* ======================================================
   DOSSIER PAGES (Chambers II, III, IV)
   ====================================================== */

.dossier-page {
    position: relative;
    min-height: 110vh;
    padding: clamp(3rem, 6vw, 6rem) clamp(2rem, 5vw, 5rem);
    margin-top: -10vh;
    box-shadow: 0 8px 32px rgba(10, 8, 20, 0.6);
    overflow: hidden;
}

/* Dossier page backgrounds */
.treaty-room {
    background: var(--mahogany-dark);
    transform: translateX(100vw) rotate(2deg);
    opacity: 0;
    transition: transform 800ms var(--ease-elegant), opacity 600ms ease;
}

.treaty-room.in-view {
    transform: translateX(0) rotate(-0.6deg);
    opacity: 1;
}

.cipher-room {
    background: var(--cipher-dark);
    transform: translateX(-100vw) rotate(-2deg);
    opacity: 0;
    transition: transform 800ms var(--ease-elegant), opacity 600ms ease;
}

.cipher-room.in-view {
    transform: translateX(0) rotate(0.8deg);
    opacity: 1;
}

.betrayal-gallery {
    background: var(--mahogany-dark);
    transform: translateX(100vw) rotate(2deg);
    opacity: 0;
    transition: transform 800ms var(--ease-elegant), opacity 600ms ease;
    /* Art Deco diamond wallpaper */
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 30px,
            rgba(201, 168, 76, 0.015) 30px,
            rgba(201, 168, 76, 0.015) 31px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 30px,
            rgba(201, 168, 76, 0.015) 30px,
            rgba(201, 168, 76, 0.015) 31px
        );
    background-color: var(--mahogany-dark);
}

.betrayal-gallery.in-view {
    transform: translateX(0) rotate(-0.4deg);
    opacity: 1;
}

/* Classification Stamps */
.classification-stamp {
    position: absolute;
    top: clamp(2rem, 4vw, 4rem);
    right: clamp(2rem, 4vw, 4rem);
    font-family: var(--font-annotation);
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transform: rotate(12deg);
    padding: 0.3em 0.8em;
    border: 2px solid;
    opacity: 0.5;
}

.stamp-top-secret {
    color: var(--redaction-red);
    border-color: var(--redaction-red);
}

.stamp-eyes-only {
    color: var(--redaction-red);
    border-color: var(--redaction-red);
    opacity: 0.6;
}

.stamp-redacted {
    color: var(--redaction-red);
    border-color: var(--redaction-red);
    opacity: 0.4;
    text-decoration: line-through;
}

/* Diplomatic Seals */
.diplomatic-seal {
    position: absolute;
    top: clamp(3rem, 6vw, 6rem);
    left: clamp(2rem, 4vw, 4rem);
    width: 120px;
    height: 120px;
}

.seal-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.seal-outer {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--diplomatic-gold);
    opacity: 0.4;
    animation: seal-spin 60s linear infinite;
}

.seal-middle {
    width: 90px;
    height: 90px;
    border: 1px solid var(--phantom-silver);
    opacity: 0.3;
    animation: seal-spin 60s linear infinite reverse;
}

.seal-inner {
    width: 60px;
    height: 60px;
    border: 2px dashed var(--diplomatic-gold);
    opacity: 0.5;
    animation: seal-spin 45s linear infinite;
}

.seal-core {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.3) 0%, transparent 70%);
    animation: seal-breathe 4s ease-in-out infinite;
}

.diplomatic-seal:hover .seal-middle {
    animation-direction: normal;
    transition: all 0.3s ease;
}

.diplomatic-seal:hover .seal-inner {
    animation-direction: reverse;
    transition: all 0.3s ease;
}

@keyframes seal-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes seal-breathe {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

/* Dossier Content Layout */
.dossier-content {
    display: grid;
    grid-template-columns: 1fr 0.65fr;
    gap: clamp(2rem, 4vw, 4rem);
    max-width: 1200px;
    margin: 0 auto;
    padding-top: clamp(6rem, 10vh, 10rem);
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--diplomatic-gold);
    margin-bottom: 2rem;
    line-height: 1.1;
}

.dossier-text {
    color: rgba(232, 224, 208, 0.88);
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

/* Margin Notes */
.dossier-margin {
    padding-top: 2rem;
    border-left: 1px solid rgba(201, 168, 76, 0.15);
    padding-left: clamp(1rem, 2vw, 2rem);
}

.margin-note {
    font-family: var(--font-annotation);
    font-size: 0.85rem;
    color: rgba(196, 92, 62, 0.6);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Cipher Fragments */
.cipher-fragment {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(232, 224, 208, 0.4);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}

/* Redaction Bars */
.redacted {
    position: relative;
    display: inline;
    color: transparent;
    cursor: pointer;
    transition: color 0.4s var(--ease-redaction);
}

.redacted::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    background: var(--midnight-embassy);
    background-image: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 0px,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    transition: transform 0.4s var(--ease-redaction);
    transform-origin: left center;
}

.redacted:hover {
    color: var(--treaty-teal);
}

.redacted:hover::after {
    transform: scaleX(0);
}

/* Pull Quotes */
.pull-quote {
    border: 4px solid transparent;
    border-image: repeating-linear-gradient(
        135deg,
        var(--diplomatic-gold) 0px,
        var(--diplomatic-gold) 4px,
        transparent 4px,
        transparent 8px,
        var(--diplomatic-gold) 8px,
        var(--diplomatic-gold) 9px,
        transparent 9px,
        transparent 13px
    ) 4;
    padding: 2rem;
    margin: 2.5rem 0;
}

.pull-quote p {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    color: var(--phantom-silver);
    line-height: 1.5;
}

/* Evidence Placeholders */
.evidence-placeholder {
    width: 100%;
    height: 120px;
    border: 1px dashed var(--phantom-silver);
    opacity: 0.4;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-end;
    padding: 0.5rem;
}

.evidence-label {
    font-family: var(--font-annotation);
    font-size: 0.8rem;
    color: rgba(196, 92, 62, 0.6);
}

/* Ghost Signatures */
.ghost-signature {
    position: absolute;
    bottom: clamp(2rem, 4vw, 4rem);
    right: clamp(3rem, 6vw, 8rem);
    width: 200px;
    height: 60px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.ghost-signature.visible {
    opacity: 0.3;
}

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

.signature-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 3000ms ease-in-out;
}

.ghost-signature.visible .signature-path {
    stroke-dashoffset: 0;
}

/* ======================================================
   CHAMBER V — THE EMPTY CHAMBER
   ====================================================== */

.empty-chamber {
    position: relative;
    height: 100vh;
    background: var(--midnight-embassy);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.circle-reveal {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 1.5s var(--ease-elegant);
    background: var(--midnight-embassy);
}

.circle-reveal.revealed {
    clip-path: circle(80% at 50% 50%);
}

.circle-content {
    text-align: center;
    max-width: 700px;
    padding: 2rem;
}

.final-statement {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--diplomatic-gold);
    line-height: 1.6;
    letter-spacing: 0.02em;
    margin-bottom: 4rem;
}

.seal-final {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.seal-final .seal-outer {
    width: 200px;
    height: 200px;
    animation-duration: 180s;
}

.seal-final .seal-middle {
    width: 150px;
    height: 150px;
    animation-duration: 120s;
}

.seal-final .seal-inner {
    width: 100px;
    height: 100px;
    animation-duration: 90s;
}

.seal-final .seal-core {
    width: 50px;
    height: 50px;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 768px) {
    .dossier-content {
        grid-template-columns: 1fr;
    }

    .dossier-margin {
        border-left: none;
        border-top: 1px solid rgba(201, 168, 76, 0.15);
        padding-left: 0;
        padding-top: 2rem;
    }

    .classification-stamp {
        font-size: 0.9rem;
        top: 1rem;
        right: 1rem;
    }

    .diplomatic-seal {
        width: 80px;
        height: 80px;
    }

    .diplomatic-seal .seal-outer {
        width: 80px;
        height: 80px;
    }

    .diplomatic-seal .seal-middle {
        width: 60px;
        height: 60px;
    }

    .diplomatic-seal .seal-inner {
        width: 40px;
        height: 40px;
    }

    .diplomatic-seal .seal-core {
        width: 20px;
        height: 20px;
    }

    .ghost-signature {
        right: 1rem;
        bottom: 1rem;
        width: 140px;
    }

    .seal-final {
        width: 140px;
        height: 140px;
    }

    .seal-final .seal-outer {
        width: 140px;
        height: 140px;
    }

    .seal-final .seal-middle {
        width: 105px;
        height: 105px;
    }

    .seal-final .seal-inner {
        width: 70px;
        height: 70px;
    }

    .seal-final .seal-core {
        width: 35px;
        height: 35px;
    }
}
