/* diplomatic.quest - Pop-Art Diplomacy */

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

:root {
    --deep-bg: #0f0f0f;
    --surface: #1c1c1e;
    --panel: #2a2a2d;
    --muted: #8e8e93;
    --body-text: #c7c7cc;
    --headline: #f2f2f7;
    --accent: #ff2d55;
    --accent-glow: #ff2d5540;
    --accent-glow-light: #ff2d5520;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-bg);
    color: var(--body-text);
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* Typography */
.display-headline {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--headline);
    text-align: center;
    line-height: 1.1;
}

.display-xl {
    font-size: clamp(4rem, 12vw, 10rem);
}

.label-text {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
}

.body-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--body-text);
    max-width: 50ch;
    text-align: center;
}

/* Gallery Rooms */
.gallery-room {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.room-content {
    position: relative;
    z-index: 2;
    width: min(680px, 88vw);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Corridors */
.corridor {
    position: relative;
    height: 50vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--deep-bg);
    overflow: hidden;
}

/* Section Divider */
.section-divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    position: relative;
    z-index: 2;
}

.section-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: divider-shimmer 3s ease-in-out infinite;
}

/* Halftone Backgrounds */
.halftone-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.halftone-pulse {
    background-image: radial-gradient(circle, var(--accent) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    opacity: 0.15;
    animation: pulse-glow 4s ease-in-out infinite alternate;
}

.halftone-fine {
    background-image: radial-gradient(circle, var(--accent) 0.8px, transparent 0.8px);
    background-size: 10px 10px;
    opacity: 0.1;
    animation: pulse-glow 4s ease-in-out infinite alternate;
}

.halftone-concentrated {
    background-image: radial-gradient(circle at 50% 50%, var(--accent) 2px, transparent 2px);
    background-size: 14px 14px;
    opacity: 0.2;
    mask-image: radial-gradient(circle at 50% 50%, black 0%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, black 30%, transparent 70%);
    animation: pulse-glow 4s ease-in-out infinite alternate;
}

.halftone-corridor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--accent) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.halftone-corridor.visible {
    opacity: 0.08;
}

/* Neon Shapes */
.neon-shape {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.neon-circle {
    width: clamp(300px, 50vw, 500px);
    height: clamp(300px, 50vw, 500px);
    border: 2px solid var(--accent);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow-light), inset 0 0 15px var(--accent-glow-light);
}

.neon-triangle {
    width: 0;
    height: 0;
    border-left: 120px solid transparent;
    border-right: 120px solid transparent;
    border-bottom: 208px solid transparent;
    top: 15%;
    left: -5%;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.neon-triangle::after {
    content: '';
    position: absolute;
    top: 12px;
    left: -110px;
    width: 0;
    height: 0;
    border-left: 110px solid transparent;
    border-right: 110px solid transparent;
    border-bottom: 190px solid transparent;
}

.neon-hexagon {
    width: 180px;
    height: 180px;
    bottom: 15%;
    right: 5%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
    border: none;
}

.neon-hexagon::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--accent);
    opacity: 1;
}

.neon-hexagon::after {
    content: '';
    position: absolute;
    inset: 3px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--deep-bg);
}

.neon-diamond {
    width: 200px;
    height: 200px;
    top: 20%;
    right: 8%;
    border: 2px solid var(--accent);
    transform: rotate(45deg);
    box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow-light), inset 0 0 15px var(--accent-glow-light);
}

.neon-circle-small {
    width: 150px;
    height: 150px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    bottom: 20%;
    left: 5%;
    box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow-light), inset 0 0 15px var(--accent-glow-light);
}

.neon-circle-large {
    width: clamp(350px, 60vw, 600px);
    height: clamp(350px, 60vw, 600px);
    border: 2px solid var(--accent);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow-light), inset 0 0 15px var(--accent-glow-light);
    transition: box-shadow 0.8s ease;
}

.neon-circle-large.glow-intense.active {
    box-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-glow-light), inset 0 0 40px var(--accent-glow-light);
}

/* Rotation */
.rotate-slow {
    animation: rotate-slow 60s linear infinite;
}

/* Neon Triangle border via SVG-like approach */
.room-reception .neon-triangle {
    border-bottom-color: var(--accent);
}
.room-reception .neon-triangle::after {
    border-bottom-color: var(--deep-bg);
}

/* Speech Bubble */
.speech-bubble {
    position: relative;
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 1.5rem 2.5rem;
    max-width: 400px;
    box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow-light);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid var(--accent);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 17px solid var(--deep-bg);
    z-index: 1;
}

.bubble-text {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--headline);
    text-align: center;
    letter-spacing: 0.04em;
}

/* Negotiation blocks */
.negotiation-blocks {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.neon-divider-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Mountain Silhouettes */
.mountain-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 1;
    pointer-events: none;
}

.mountain-silhouette.inverted {
    bottom: auto;
    top: 0;
    transform: scaleY(-1);
}

.mountain-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mountain-back {
    clip-path: polygon(0% 100%, 0% 70%, 10% 50%, 20% 60%, 35% 30%, 45% 45%, 55% 20%, 65% 40%, 75% 25%, 85% 45%, 95% 35%, 100% 55%, 100% 100%);
    background-color: var(--surface);
}

.mountain-mid {
    clip-path: polygon(0% 100%, 0% 80%, 8% 65%, 18% 75%, 30% 50%, 42% 60%, 50% 40%, 60% 55%, 72% 35%, 82% 55%, 90% 45%, 100% 65%, 100% 100%);
    background-color: var(--panel);
}

.mountain-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0% 100%, 0% 85%, 15% 70%, 25% 80%, 40% 60%, 55% 75%, 65% 55%, 80% 70%, 90% 60%, 100% 75%, 100% 100%);
    background-color: var(--deep-bg);
}

.neon-peaks {
    filter: drop-shadow(0 -2px 4px var(--accent-glow));
}

/* Scroll Cue */
.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.chevron {
    display: block;
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    animation: chevron-pulse 2s ease-in-out infinite;
    opacity: 0.7;
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Arrival headline letters */
.arrival-headline .letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    transition-delay: calc(var(--delay) * 0.08s);
}

.arrival-headline.active .letter {
    opacity: 1;
}

.arrival-headline .letter.dot {
    color: var(--accent);
}

/* Label departure */
.label-departure {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    letter-spacing: 0.3em;
    color: var(--accent);
    opacity: 0.6;
    transition: opacity 1s ease;
}

/* Body accord */
.body-accord {
    font-size: clamp(1.1rem, 1.4vw, 1.35rem);
}

/* Room departure */
.room-departure {
    min-height: 100vh;
}

/* Final darkness */
.final-darkness {
    height: 100vh;
    background-color: var(--deep-bg);
}

/* Animations */
@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(calc(var(--rotate-dir, 1) * 360deg)); }
}

@keyframes pulse-glow {
    from { opacity: 0.08; }
    to { opacity: 0.2; }
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0.3; transform: rotate(45deg) translateY(0); }
    50% { opacity: 0.9; transform: rotate(45deg) translateY(6px); }
}

@keyframes divider-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Fix neon-circle rotation to preserve centering */
.neon-circle {
    animation: rotate-slow-centered 60s linear infinite;
}

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

.neon-circle-large {
    animation: rotate-slow-centered 60s linear infinite;
}

/* Fix diamond rotation */
.neon-diamond {
    animation: rotate-slow-diamond 60s linear infinite;
}

@keyframes rotate-slow-diamond {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .neon-triangle {
        border-left-width: 60px;
        border-right-width: 60px;
        border-bottom-width: 104px;
        left: -8%;
    }
    .neon-triangle::after {
        left: -52px;
        border-left-width: 52px;
        border-right-width: 52px;
        border-bottom-width: 90px;
    }
    .neon-hexagon {
        width: 100px;
        height: 100px;
    }
    .neon-diamond {
        width: 120px;
        height: 120px;
    }
    .neon-circle-small {
        width: 80px;
        height: 80px;
    }
    .mountain-silhouette {
        height: 120px;
    }
}
