/* ============================================
   monopole.boo - Haunted House CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', serif;
    color: #E0D4E8;
    background-color: #0E0812;
    overflow-x: hidden;
    position: relative;
    background: linear-gradient(180deg, #0E0812 0%, #080410 100%);
}

/* ============================================
   Noise Texture - Spirit Photography Effect
   ============================================ */

#noise-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cdefs%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='4' result='noise' seed='1'/%3E%3CfeColorMatrix in='noise' type='saturate' values='0.3'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='0.3'/%3E%3CfeFuncG type='linear' slope='0.2'/%3E%3CfeFuncB type='linear' slope='0.4'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3C/defs%3E%3Crect width='256' height='256' fill='%23000000' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ============================================
   Viewport Container & Room Layout
   ============================================ */

#viewport-container {
    position: relative;
    width: 100%;
}

.room {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #0E0812 0%, #1A1420 50%, #0E0812 100%);
}

.room::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(196, 160, 212, 0.02) 0%, rgba(14, 8, 18, 0.1) 100%);
    pointer-events: none;
}

.room-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
}

.room-offset-left {
    margin-left: -4%;
}

.room-offset-right {
    margin-left: 4%;
}

@media (max-width: 768px) {
    .room-offset-left,
    .room-offset-right {
        margin-left: 0;
    }
}

/* ============================================
   Room 1: The Summoning - Hero
   ============================================ */

#room-1 {
    background: linear-gradient(180deg, #0E0812 0%, #1A1420 100%);
    position: relative;
}

#room-1::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(196, 160, 212, 0.12) 0%, transparent 70%);
    pointer-events: none;
    animation: spotlightPulse 6s ease-in-out infinite;
}

@keyframes spotlightPulse {
    0%, 100% {
        width: 600px;
        height: 600px;
    }
    50% {
        width: 700px;
        height: 700px;
    }
}

.hero-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #E0D4E8;
    text-align: center;
    text-shadow: 0 0 20px rgba(196, 160, 212, 0.3);
    animation: heroAppear 0.7s ease-out forwards 0.5s, flicker 6s ease-in-out 1.2s infinite;
    opacity: 0;
}

@keyframes heroAppear {
    0% {
        opacity: 0.4;
        filter: blur(3px) brightness(1.5);
        transform: scale(1.03);
    }
    100% {
        opacity: 1;
        filter: blur(0px) brightness(1);
        transform: scale(1);
    }
}

@keyframes flicker {
    0% { opacity: 1; }
    5% { opacity: 0.7; }
    10% { opacity: 1; }
    12% { opacity: 0.8; }
    14% { opacity: 1; }
    25% { opacity: 0.95; }
    30% { opacity: 1; }
    35% { opacity: 0.85; }
    40% { opacity: 1; }
    50% { opacity: 0.9; }
    60% { opacity: 1; }
    65% { opacity: 0.75; }
    70% { opacity: 1; }
    75% { opacity: 0.95; }
    100% { opacity: 1; }
}

.summoning-subtitle {
    text-align: center;
    margin-top: 2rem;
    animation: subtitleFade 3s ease-out forwards;
    opacity: 0;
}

.summoning-subtitle p {
    font-family: 'Victor Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: #C4B8D0;
    font-weight: 400;
}

@keyframes subtitleFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ============================================
   Room Titles & Text
   ============================================ */

.room-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    color: #E8B868;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
    text-shadow: 0 0 10px rgba(232, 184, 104, 0.2);
}

.room-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #E0D4E8;
    margin-top: 2rem;
}

.room-text p {
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* ============================================
   Room 2: The Apparition - Wave Forms
   ============================================ */

.wave-form {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 2rem 0;
    opacity: 0.8;
}

.wave-path {
    stroke: #C4A0D4;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: waveDrift 8s ease-in-out infinite;
}

@keyframes waveDrift {
    0%, 100% {
        stroke-dashoffset: 0;
        opacity: 0.6;
    }
    50% {
        opacity: 0.9;
    }
}

/* ============================================
   Room 3: The Séance Circle
   ============================================ */

.seance-container {
    position: relative;
    margin: 3rem 0;
}

.seance-circle {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto;
}

.seance-labels {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 400px;
    margin: -400px auto 0;
    pointer-events: none;
}

.label {
    position: absolute;
    font-family: 'Victor Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #E8B868;
    white-space: nowrap;
    transform-origin: center;
}

.label-north {
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    animation: rotateCounterClockwise 20s linear infinite;
}

.label-east {
    top: 50%;
    right: -10px;
    transform: translateY(-50%) rotate(0deg);
    animation: rotateCounterClockwise 20s linear infinite;
}

.label-south {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    animation: rotateCounterClockwise 20s linear infinite;
}

.label-west {
    top: 50%;
    left: -10px;
    transform: translateY(-50%) rotate(0deg);
    animation: rotateCounterClockwise 20s linear infinite;
}

@keyframes rotateCounterClockwise {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}

/* Adjust individual labels to maintain readability */
.label-north {
    animation: rotateLabelNorth 20s linear infinite;
}

@keyframes rotateLabelNorth {
    0% {
        top: -10px;
        left: 50%;
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        top: -10px;
        left: 50%;
        transform: translateX(-50%) rotate(-360deg);
    }
}

.label-east {
    animation: rotateLabelEast 20s linear infinite;
}

@keyframes rotateLabelEast {
    0% {
        right: -10px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }
    100% {
        right: -10px;
        top: 50%;
        transform: translateY(-50%) rotate(-360deg);
    }
}

.label-south {
    animation: rotateLabelSouth 20s linear infinite;
}

@keyframes rotateLabelSouth {
    0% {
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%) rotate(-360deg);
    }
}

.label-west {
    animation: rotateLabelWest 20s linear infinite;
}

@keyframes rotateLabelWest {
    0% {
        left: -10px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }
    100% {
        left: -10px;
        top: 50%;
        transform: translateY(-50%) rotate(-360deg);
    }
}

/* ============================================
   Room 4: The Hunt - Cards
   ============================================ */

.hunt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.hunt-card {
    padding: 2rem;
    background: rgba(26, 20, 32, 0.6);
    border: 1px solid rgba(196, 160, 212, 0.3);
    border-radius: 4px;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    animation: cardSlide 0.8s ease-out forwards;
    opacity: 0;
}

.hunt-card:nth-child(1) {
    animation-delay: 0s;
}

.hunt-card:nth-child(2) {
    animation-delay: 0.15s;
}

.hunt-card:nth-child(3) {
    animation-delay: 0.3s;
}

.hunt-card:nth-child(4) {
    animation-delay: 0.45s;
}

@keyframes cardSlide {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hunt-card:hover {
    background: rgba(26, 20, 32, 0.9);
    border-color: rgba(196, 160, 212, 0.6);
    box-shadow: 0 0 20px rgba(196, 160, 212, 0.15);
}

.hunt-card h3 {
    font-family: 'Victor Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #E8B868;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.hunt-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #C4B8D0;
}

/* ============================================
   Room 5: The Door - Finale
   ============================================ */

.door-section {
    padding: 3rem;
    background: linear-gradient(135deg, rgba(26, 20, 32, 0.4) 0%, rgba(52, 42, 64, 0.4) 100%);
    border: 2px solid rgba(232, 184, 104, 0.2);
    border-radius: 2px;
}

.door-text {
    font-size: 1.2rem;
    line-height: 1.9;
    color: #E0D4E8;
    margin-bottom: 1.5rem;
    font-weight: 400;
    font-style: italic;
}

.door-text:last-of-type {
    margin-bottom: 3rem;
}

.door-footer {
    text-align: center;
    border-top: 1px solid rgba(196, 160, 212, 0.2);
    padding-top: 2rem;
}

.copyright {
    font-family: 'Victor Mono', monospace;
    font-size: 0.85rem;
    color: #A898B0;
    letter-spacing: 0.03em;
}

/* ============================================
   Scroll Interactions & Entrance Animations
   ============================================ */

.room {
    opacity: 0;
    animation: roomFadeIn 1s ease-out forwards;
}

#room-1 {
    animation-delay: 0s;
}

#room-2 {
    animation-delay: 0.2s;
}

#room-3 {
    animation-delay: 0.4s;
}

#room-4 {
    animation-delay: 0.6s;
}

#room-5 {
    animation-delay: 0.8s;
}

@keyframes roomFadeIn {
    0% {
        opacity: 0;
        filter: blur(2px) brightness(1.5);
        transform: scale(1.01);
    }
    100% {
        opacity: 1;
        filter: blur(0px) brightness(1);
        transform: scale(1);
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2.5rem, 6vw, 5rem);
    }

    .room-title {
        font-size: clamp(1.5rem, 4vw, 3rem);
    }

    .hunt-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .room {
        min-height: auto;
        padding: 2rem 1.5rem;
    }

    .room-content {
        max-width: 100%;
    }

    .hero-title {
        font-size: clamp(2rem, 5vw, 4rem);
    }

    .summoning-subtitle p {
        font-size: 0.95rem;
    }

    .room-title {
        font-size: clamp(1.25rem, 3vw, 2rem);
    }

    .room-text {
        font-size: 1rem;
    }

    .door-section {
        padding: 1.5rem;
    }

    .door-text {
        font-size: 1rem;
    }

    .seance-circle {
        max-width: 300px;
    }

    .seance-labels {
        max-width: 300px;
        height: 300px;
        margin-top: -300px;
    }

    .label {
        font-size: 0.7rem;
    }

    .hunt-card {
        padding: 1.5rem;
    }
}

/* ============================================
   Color Palette Variables (for reference)
   ============================================
   Background Deep: #080410 (Void Purple)
   Background: #0E0812 (Haunted Plum)
   Surface: #1A1420 (Spirit Chamber)
   Border Outer: #8A78A8 (Spectral Violet)
   Border Inner: #C4A0D4 (Ectoplasm)
   Text Display: #E0D4E8 (Ghost White)
   Text Body: #A898B0 (Fog Lavender)
   Text Handwritten: #C4B8D0 (Pale Mauve)
   Accent Warm: #E8B868 (Candlelight)
   ============================================ */
