/* ==========================================
   diplomacy.quest - Styles
   Memphis diplomacy: radical geometry in formal dress
   ========================================== */

/* --- CSS Custom Properties --- */
:root {
    --diplomatic-navy: #0C1929;
    --midnight-slate: #1A2744;
    --champagne-gold: #C9B37E;
    --oxidized-copper: #B87333;
    --brushed-silver: #708090;
    --silver-mist: #D4DAE3;
    --pale-protocol: #E8ECF2;
    --white-glint: #F5F7FA;
    --treaty-burgundy: #6B2D3E;

    --font-display: 'Commissioner', sans-serif;
    --font-accent: 'Anybody', sans-serif;
    --font-body: 'Commissioner', sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.015em;
    color: var(--midnight-slate);
    background-color: var(--diplomatic-navy);
    overflow-x: hidden;
}

/* --- Metallic Shimmer Animation --- */
@keyframes metallic-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.metallic-gold {
    background: linear-gradient(135deg, #C9B37E 0%, #E0D3A8 45%, #C9B37E 55%, #A8924E 100%);
    background-size: 200% 200%;
    animation: metallic-shift 4s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metallic-copper {
    background: linear-gradient(135deg, #B87333 0%, #D4955E 45%, #B87333 55%, #8C5622 100%);
    background-size: 200% 200%;
    animation: metallic-shift 4s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Seal Rotation --- */
@keyframes seal-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Pulse Attention --- */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0px var(--treaty-burgundy);
    }
    50% {
        box-shadow: 0 0 30px rgba(107, 45, 62, 0.4);
    }
}

/* --- Confetti Drift --- */
@keyframes confetti-drift {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-20px); }
}

/* --- Stroke Draw Animation --- */
@keyframes stroke-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Entrance Animation --- */
@keyframes slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Chamber Base --- */
.chamber {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.chamber-dark {
    background-color: var(--diplomatic-navy);
    color: var(--silver-mist);
}

.chamber-light {
    background-color: var(--pale-protocol);
    color: var(--midnight-slate);
}

.chamber-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

/* --- Animate on Scroll (default hidden) --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1), transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Zigzag Divider --- */
.zigzag-divider {
    width: 100%;
    height: 24px;
    line-height: 0;
    position: relative;
    z-index: 10;
}

.zigzag-divider svg {
    width: 100%;
    height: 24px;
    display: block;
}

/* ==========================================
   CHAMBER 1: THE ARRIVAL
   ========================================== */
#chamber-arrival {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

.arrival-arc {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    height: 70%;
    z-index: 1;
}

.arrival-arc path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: stroke-draw 2.5s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}

.arrival-content {
    position: relative;
    z-index: 5;
    padding-top: 18vh;
    padding-left: 6%;
}

.arrival-title {
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: clamp(4.5rem, 14vw, 11rem);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
}

.arrival-subtitle {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1.4rem;
    color: var(--silver-mist);
    margin-top: 3rem;
    max-width: 58ch;
    letter-spacing: 0.06em;
    line-height: 1.5;
}

.arrival-collage {
    position: absolute;
    bottom: 12%;
    right: 8%;
    width: 340px;
    height: 280px;
    z-index: 4;
}

.collage-frame {
    position: absolute;
    background: rgba(201, 179, 126, 0.04);
}

.collage-frame.frame-1 {
    width: 200px;
    height: 160px;
    bottom: 0;
    right: 0;
    border: 2px solid var(--brushed-silver);
    transform: rotate(-3deg);
}

.collage-frame.frame-2 {
    width: 180px;
    height: 140px;
    bottom: 40px;
    right: 60px;
    border: 1px dashed var(--champagne-gold);
    transform: rotate(0deg);
}

.collage-frame.frame-3 {
    width: 160px;
    height: 120px;
    bottom: 80px;
    right: 120px;
    box-shadow: 0 2px 20px rgba(12, 25, 41, 0.5);
    background: rgba(26, 39, 68, 0.6);
    transform: rotate(2deg);
}

/* --- Confetti Field --- */
.confetti-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    animation: confetti-drift 12s ease-in-out infinite alternate;
}

.confetti-circle {
    border-radius: 50%;
}

.confetti-square {
    border-radius: 0;
}

.confetti-triangle {
    width: 0 !important;
    height: 0 !important;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-bottom: 7px solid;
    background: transparent !important;
}

/* ==========================================
   CHAMBER 2: THE FOYER
   ========================================== */
#chamber-foyer {
    display: flex;
    align-items: flex-start;
    padding: 8vh 0;
    position: relative;
}

.foyer-content {
    width: 58%;
    margin-left: 8%;
    padding-top: 6vh;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 9vw, 7.5rem);
    letter-spacing: 0.06em;
    line-height: 1.08;
    margin-bottom: 2.5rem;
    color: var(--midnight-slate);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.015em;
    max-width: 58ch;
    margin-bottom: 1.5rem;
}

.light-text {
    color: var(--silver-mist);
}

.foyer-credential {
    position: absolute;
    top: 12%;
    right: 10%;
}

.credential-plate {
    background: var(--white-glint);
    border: 1px solid var(--brushed-silver);
    box-shadow: 0 2px 12px rgba(12, 25, 41, 0.25);
    padding: 0.8rem 1.8rem;
    transform: rotate(var(--rotate, 0deg));
}

.credential-label {
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--champagne-gold);
}

.foyer-medallions {
    position: absolute;
    right: 14%;
    top: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.medallion {
    border-radius: 50%;
    border: 1.5px solid var(--champagne-gold);
    flex-shrink: 0;
}

.medallion-lg {
    width: 180px;
    height: 180px;
}

.medallion-md {
    width: 120px;
    height: 120px;
}

.medallion-sm {
    width: 80px;
    height: 80px;
}

.medallion-curve {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

/* ==========================================
   CHAMBER 3: THE ROUND TABLE
   ========================================== */
#chamber-roundtable {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8vh 0;
    position: relative;
}

.roundtable-curve {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.roundtable-curve path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.1s linear;
}

.roundtable-content {
    position: relative;
    z-index: 5;
    width: 62%;
    margin-right: 6%;
    padding: 4vh 0;
}

.glass-panel {
    background: rgba(232, 236, 242, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(112, 128, 144, 0.2);
}

.glass-panel .section-heading {
    color: var(--silver-mist);
}

.offset-panel {
    margin-left: 8%;
}

.metallic-seal {
    position: absolute;
    width: 120px;
    height: 120px;
    z-index: 3;
    animation: seal-rotate 30s linear infinite;
}

#seal-roundtable {
    left: 12%;
    top: 20%;
}

#seal-accord {
    left: 8%;
    top: 15%;
}

/* ==========================================
   CHAMBER 4: THE ACCORD
   ========================================== */
#chamber-accord {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8vh 8%;
    position: relative;
}

.accord-content {
    width: 62%;
}

.pulse-word-container {
    margin: 3rem 0;
    text-align: left;
}

.pulse-word {
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 10rem);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--treaty-burgundy);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: box-shadow;
}

.squiggle-underline {
    position: relative;
    display: inline;
}

.squiggle-underline::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 12'%3E%3Cpath d='M0,6 Q10,0 20,6 Q30,12 40,6 Q50,0 60,6 Q70,12 80,6' fill='none' stroke='%23B87333' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 80px 12px;
}

.accord-credential {
    position: absolute;
    top: 18%;
    right: 10%;
}

/* ==========================================
   CHAMBER 5: THE GALLERY
   ========================================== */
#chamber-gallery {
    min-height: 110vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 0;
    position: relative;
}

.gallery-collage {
    position: relative;
    width: 85%;
    height: 70vh;
    margin: 0 auto;
}

.gallery-frame {
    position: absolute;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    transition-delay: var(--delay, 0s);
}

.gallery-frame svg {
    width: 100%;
    height: 100%;
}

.gallery-frame-1 {
    width: 35%;
    height: 55%;
    top: 5%;
    left: 2%;
    border: 2px solid var(--champagne-gold);
    background: rgba(201, 179, 126, 0.03);
}

.gallery-frame-2 {
    width: 30%;
    height: 45%;
    top: 0%;
    left: 28%;
    box-shadow: 0 4px 30px rgba(12, 25, 41, 0.5);
    background: rgba(26, 39, 68, 0.5);
}

.gallery-frame-3 {
    width: 32%;
    height: 50%;
    top: 10%;
    right: 5%;
    border: 1px dashed var(--champagne-gold);
    background: rgba(112, 128, 144, 0.04);
}

.gallery-frame-4 {
    width: 28%;
    height: 40%;
    bottom: 5%;
    left: 12%;
    border: 2px solid var(--brushed-silver);
    background: rgba(112, 128, 144, 0.03);
}

.gallery-frame-5 {
    width: 34%;
    height: 48%;
    bottom: 2%;
    right: 10%;
    box-shadow: 0 6px 40px rgba(12, 25, 41, 0.6);
    background: rgba(201, 179, 126, 0.04);
}

.frame-composition {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10%;
}

/* ==========================================
   CHAMBER 6: THE RESOLUTION
   ========================================== */
#chamber-resolution {
    min-height: 80vh;
    text-align: center;
    padding: 10vh 8%;
    position: relative;
}

.resolution-curve {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 60px;
    transform: translateY(2rem);
    z-index: 1;
}

.resolution-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resolution-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.06em;
    line-height: 1.08;
    color: var(--midnight-slate);
    margin-bottom: 4rem;
}

.resolution-credential {
    transform: rotate(0deg);
    margin-top: 2rem;
    background: var(--white-glint);
}

.credential-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1rem;
    color: var(--midnight-slate);
    letter-spacing: 0.03em;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .arrival-title {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .arrival-collage {
        width: 220px;
        height: 180px;
        right: 4%;
        bottom: 8%;
    }

    .collage-frame.frame-1 {
        width: 140px;
        height: 110px;
    }
    .collage-frame.frame-2 {
        width: 120px;
        height: 90px;
    }
    .collage-frame.frame-3 {
        width: 100px;
        height: 80px;
    }

    #chamber-foyer {
        flex-direction: column;
        padding: 6vh 6%;
    }

    .foyer-content {
        width: 100%;
        margin-left: 0;
    }

    .foyer-medallions {
        position: relative;
        right: auto;
        top: auto;
        flex-direction: row;
        margin-top: 4vh;
        gap: 1rem;
    }

    .medallion-curve {
        display: none;
    }

    .foyer-credential {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 2rem;
        display: inline-block;
    }

    #chamber-roundtable {
        justify-content: center;
        padding: 6vh 6%;
    }

    .roundtable-content {
        width: 90%;
        margin-right: 0;
    }

    .offset-panel {
        margin-left: 0;
    }

    #seal-roundtable {
        left: 5%;
        top: 5%;
        width: 80px;
        height: 80px;
    }

    #chamber-accord {
        padding: 6vh 6%;
    }

    .accord-content {
        width: 100%;
    }

    .pulse-word {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .accord-credential {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 2rem;
        display: inline-block;
    }

    .gallery-collage {
        width: 95%;
        height: 80vh;
    }

    .gallery-frame-1 {
        width: 50%;
        height: 40%;
    }
    .gallery-frame-2 {
        width: 45%;
        height: 35%;
        left: 40%;
    }
    .gallery-frame-3 {
        width: 48%;
        height: 38%;
        top: 35%;
        right: 2%;
    }
    .gallery-frame-4 {
        width: 45%;
        height: 32%;
        left: 2%;
    }
    .gallery-frame-5 {
        width: 50%;
        height: 35%;
        right: 2%;
    }
}

@media (max-width: 600px) {
    .section-heading {
        font-size: clamp(2rem, 8vw, 4rem);
    }

    .arrival-subtitle {
        font-size: 1.1rem;
        margin-top: 2rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .medallion-lg {
        width: 100px;
        height: 100px;
    }
    .medallion-md {
        width: 70px;
        height: 70px;
    }
    .medallion-sm {
        width: 50px;
        height: 50px;
    }
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .metallic-gold,
    .metallic-copper {
        animation: none;
    }

    .metallic-seal {
        animation: none;
    }

    .pulse-word {
        animation: none;
        box-shadow: 0 0 15px rgba(107, 45, 62, 0.3);
    }

    .confetti-particle {
        animation: none;
    }

    .arrival-arc path {
        animation: none;
        stroke-dashoffset: 0;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
