/* ===================== RESET & BASE ===================== */

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

html {
    --scroll: 0;
}

body {
    background: #1a1a2e;
    color: #d4a574;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    overflow-x: hidden;
}

main {
    display: block;
}

/* ===================== REALM SECTIONS ===================== */

.realm {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-layer {
    position: absolute;
    inset: -10vh 0;
    width: 100%;
    pointer-events: none;
}

.parallax-layer.far {
    z-index: 0;
}

.parallax-layer.mid {
    z-index: 1;
}

.realm-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

/* ===================== HERO SECTION ===================== */

#realm-hero {
    background: linear-gradient(180deg, #87ceeb 0%, #4a4a8a 50%, #1a1a2e 100%);
}

#realm-hero .parallax-layer.far {
    background: radial-gradient(ellipse at 50% 30%, rgba(135, 206, 235, 0.25), transparent 70%);
}

#realm-hero .parallax-layer.mid {
    background: radial-gradient(ellipse at 50% 60%, rgba(74, 74, 138, 0.35), transparent 50%);
}

.hero-horizon {
    width: 80vw;
    max-width: 600px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(135, 206, 235, 0.5), rgba(212, 165, 116, 0.4), rgba(135, 206, 235, 0.5), transparent);
    margin: 0 auto 2rem;
}

/* Silhouette figure per design spec */
.silhouette {
    margin: 0 auto;
    background: #1a1a2e;
    clip-path: polygon(42% 0, 58% 0, 60% 15%, 65% 30%, 55% 32%, 58% 50%, 70% 80%, 58% 82%, 50% 55%, 42% 82%, 30% 80%, 42% 50%, 45% 32%, 35% 30%, 40% 15%);
}

.silhouette-hero {
    width: 50px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.silhouette-small {
    width: 24px;
    height: 48px;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

/* Hero realm silhouette coloring */
#realm-material .silhouette {
    background: rgba(139, 105, 20, 0.5);
}

#realm-emotional .silhouette {
    background: rgba(204, 51, 102, 0.4);
}

#realm-cultural .silhouette {
    background: rgba(45, 95, 45, 0.5);
}

#realm-existential .silhouette {
    background: rgba(26, 26, 62, 0.6);
}

.hero-title {
    font-family: 'Philosopher', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #87ceeb;
    margin-bottom: 0.5rem;
    min-height: 1.2em;
}

.hero-title .cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: #87ceeb;
    margin-left: 3px;
    vertical-align: baseline;
    animation: blink-cursor 0.7s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #d4a574;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-subtitle.visible {
    opacity: 0.8;
}

/* ===================== MATERIAL REALM ===================== */

#realm-material {
    background: linear-gradient(180deg, #1a1a2e 0%, #8b6914 40%, #d4a574 100%);
}

#realm-material .parallax-layer.far {
    background: radial-gradient(ellipse at 30% 40%, rgba(139, 105, 20, 0.25), transparent 55%);
}

#realm-material .parallax-layer.mid {
    background: radial-gradient(ellipse at 70% 60%, rgba(212, 165, 116, 0.2), transparent 50%);
}

#realm-material .realm-title {
    color: #d4a574;
}

#realm-material .realm-subtitle {
    color: #8b6914;
}

#realm-material .story-card {
    border-color: rgba(139, 105, 20, 0.3);
}

/* ===================== EMOTIONAL REALM ===================== */

#realm-emotional {
    background: linear-gradient(180deg, #d4a574 0%, #cc3366 40%, #ff88aa 100%);
}

#realm-emotional .parallax-layer.far {
    background: radial-gradient(ellipse at 60% 40%, rgba(204, 51, 102, 0.25), transparent 55%);
}

#realm-emotional .parallax-layer.mid {
    background: radial-gradient(ellipse at 40% 70%, rgba(255, 136, 170, 0.2), transparent 50%);
}

#realm-emotional .realm-title {
    color: #ff88aa;
}

#realm-emotional .realm-subtitle {
    color: #cc3366;
}

#realm-emotional .story-card {
    border-color: rgba(204, 51, 102, 0.3);
}

/* ===================== CULTURAL REALM ===================== */

#realm-cultural {
    background: linear-gradient(180deg, #ff88aa 0%, #2d5f2d 40%, #7aaa7a 100%);
}

#realm-cultural .parallax-layer.far {
    background: radial-gradient(ellipse at 50% 30%, rgba(45, 95, 45, 0.25), transparent 55%);
}

#realm-cultural .parallax-layer.mid {
    background: radial-gradient(ellipse at 50% 70%, rgba(122, 170, 122, 0.2), transparent 50%);
}

#realm-cultural .realm-title {
    color: #7aaa7a;
}

#realm-cultural .realm-subtitle {
    color: #2d5f2d;
}

#realm-cultural .story-card {
    border-color: rgba(45, 95, 45, 0.3);
}

/* ===================== EXISTENTIAL REALM ===================== */

#realm-existential {
    background: linear-gradient(180deg, #7aaa7a 0%, #1a1a3e 50%, #4a4a8a 100%);
}

#realm-existential .parallax-layer.far {
    background: radial-gradient(ellipse at 50% 50%, rgba(26, 26, 62, 0.3), transparent 60%);
}

#realm-existential .parallax-layer.mid {
    background: radial-gradient(ellipse at 50% 40%, rgba(74, 74, 138, 0.2), transparent 50%);
}

#realm-existential .realm-title {
    color: #4a4a8a;
}

#realm-existential .realm-subtitle {
    color: #1a1a3e;
}

#realm-existential .story-card {
    border-color: rgba(74, 74, 138, 0.3);
}

/* ===================== TREASURE REALM ===================== */

#realm-treasure {
    background: radial-gradient(
        circle at 50% 50%,
        #8b6914 0%,
        #cc3366 25%,
        #2d5f2d 45%,
        #1a1a3e 65%,
        #1a1a2e 100%
    );
}

#realm-treasure .parallax-layer.far {
    background: radial-gradient(ellipse at 50% 50%, rgba(139, 105, 20, 0.15), transparent 60%);
}

#realm-treasure .parallax-layer.mid {
    background: radial-gradient(ellipse at 50% 50%, rgba(204, 51, 102, 0.1), transparent 50%);
}

.treasure-character {
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    font-size: clamp(5rem, 15vw, 12rem);
    color: #d4a574;
    text-shadow: 0 0 20px #d4a574, 0 0 40px #d4a574, 0 0 80px #d4a574;
    animation: breathe 4s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes breathe {
    0%, 100% {
        text-shadow: 0 0 20px currentColor;
    }
    50% {
        text-shadow: 0 0 60px currentColor, 0 0 120px currentColor;
    }
}

.treasure-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #d4a574;
    opacity: 0.85;
    margin-top: 1rem;
}

/* ===================== REALM TITLES ===================== */

.realm-title {
    font-family: 'Philosopher', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 0.5rem;
}

.realm-subtitle {
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    font-size: 1.2rem;
    opacity: 0.75;
    margin-bottom: 2rem;
}

/* ===================== STORY CARDS ===================== */

.story-card {
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(212, 165, 116, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.story-card p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.8;
    color: #1a1a2e;
}

/* ===================== FADE-IN ON SCROLL ===================== */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 768px) {
    .story-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .realm-content {
        padding: 1.5rem;
    }

    .hero-horizon {
        width: 90vw;
    }
}
