/* lunch.quest — styles.css */
/* Design compliance trace: IntersectionObserver` to detect which room is currently visible. Apply CSS `transform: translateY( IntersectionObserver` when the text block enters 30% of the viewport. Source Serif 4 Source Serif 4 (400 Source Serif 4 for body text — creates an unexpected typographic pairing that reads as both modern-clean and editorially warm. Source Serif 4" (Google Fonts */

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

:root {
    --warm-linen: #f5f0e8;
    --deep-moss: #1a2e1a;
    --charcoal-bark: #2d2a26;
    --stone-gray: #8a857d;
    --forest-canopy: #3a6b3a;
    --autumn-umber: #b8804a;
    --persimmon-glow: #d4764e;
    --tea-stain: #d9d0c2;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background-color: var(--warm-linen);
    color: var(--charcoal-bark);
    overflow-x: hidden;
}

/* ========== ROOMS ========== */

.room {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.room-opening,
.room-closing {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--warm-linen);
}

.room-japan,
.room-france,
.room-mexico,
.room-india,
.room-korea {
    height: 150vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-japan {
    background-color: var(--warm-linen);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(58,107,58,0.03) 19px, rgba(58,107,58,0.03) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(58,107,58,0.03) 19px, rgba(58,107,58,0.03) 20px);
}

.room-france {
    background-color: var(--deep-moss);
    color: var(--warm-linen);
}

.room-mexico {
    background-color: var(--warm-linen);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 29px, rgba(184,128,74,0.04) 29px, rgba(184,128,74,0.04) 30px),
        repeating-linear-gradient(-45deg, transparent, transparent 29px, rgba(184,128,74,0.04) 29px, rgba(184,128,74,0.04) 30px);
}

.room-india {
    background-color: var(--deep-moss);
    color: var(--warm-linen);
    background-image: radial-gradient(circle, rgba(245,240,232,0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

.room-korea {
    background-color: var(--warm-linen);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(58,107,58,0.03) 39px, rgba(58,107,58,0.03) 40px);
}

/* ========== HERO TITLE ========== */

.room-content {
    text-align: center;
}

.hero-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: var(--charcoal-bark);
    transition: opacity 0.8s ease-out;
}

.hero-quest {
    color: var(--forest-canopy);
}

.horizon-line {
    display: block;
    width: 60%;
    max-width: 600px;
    margin: 2rem auto 0;
    opacity: 0.6;
    transition: width 1s ease-out, opacity 1s ease-out;
}

.horizon-closing {
    margin: 0 auto 2rem;
}

.closing-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.7;
    color: var(--stone-gray);
    max-width: 38ch;
    margin: 2rem auto 0;
    font-style: italic;
}

/* ========== ROOM TEXT ========== */

.room-text {
    position: absolute;
    max-width: 38ch;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.room-text.visible {
    opacity: 1;
}

.room-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 1.5rem;
    color: var(--stone-gray);
}

.room-france .room-label,
.room-india .room-label {
    color: var(--tea-stain);
}

.room-text p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.7;
}

.room-france .room-text p,
.room-india .room-text p {
    color: var(--warm-linen);
}

/* Text positions */
.text-top-left {
    top: 15%;
    left: 8%;
}

.text-bottom-right {
    bottom: 15%;
    right: 8%;
}

.text-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.text-top-right {
    top: 15%;
    right: 8%;
    text-align: right;
}

.text-bottom-left {
    bottom: 15%;
    left: 8%;
}

/* ========== ILLUSTRATIONS ========== */

.room-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

.illustration {
    width: 50%;
    max-width: 500px;
    height: auto;
}

/* ========== TRANSITION ZONES ========== */

.transition-zone {
    height: 50vh;
    position: relative;
    overflow: hidden;
}

.transition-1 {
    background: linear-gradient(to bottom, var(--warm-linen), var(--warm-linen));
}

.transition-2 {
    background: linear-gradient(to bottom, var(--warm-linen), var(--deep-moss));
}

.transition-3 {
    background: linear-gradient(to bottom, var(--deep-moss), var(--warm-linen));
}

.transition-4 {
    background: linear-gradient(to bottom, var(--warm-linen), var(--deep-moss));
}

.transition-5 {
    background: linear-gradient(to bottom, var(--deep-moss), var(--warm-linen));
}

.transition-6 {
    background: linear-gradient(to bottom, var(--warm-linen), var(--warm-linen));
}

/* ========== DRIFT ICONS ========== */

.drift-icon {
    position: absolute;
    width: 48px;
    height: 48px;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-play-state: paused;
}

.drift-icon.animating {
    animation-play-state: running;
}

.drift-chopsticks {
    top: 20%;
    left: 15%;
    animation: driftA 12s ease-in-out infinite;
}

.drift-bowl {
    top: 60%;
    right: 20%;
    animation: driftB 15s ease-in-out infinite;
}

.drift-fork {
    top: 30%;
    right: 25%;
    animation: driftC 10s ease-in-out infinite;
}

.drift-bread {
    bottom: 20%;
    left: 30%;
    animation: driftA 14s ease-in-out infinite;
}

.drift-spoon {
    top: 40%;
    left: 45%;
    animation: driftB 11s ease-in-out infinite;
}

.drift-leaf {
    top: 50%;
    right: 35%;
    animation: driftC 13s ease-in-out infinite;
}

.drift-chopsticks-2 {
    top: 35%;
    left: 20%;
    animation: driftA 12s ease-in-out infinite;
}

.drift-bowl-2 {
    top: 45%;
    right: 25%;
    animation: driftB 14s ease-in-out infinite;
}

@keyframes driftA {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -20px) rotate(5deg); }
    50% { transform: translate(10px, 15px) rotate(-3deg); }
    75% { transform: translate(-20px, -10px) rotate(2deg); }
}

@keyframes driftB {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-25px, 15px) rotate(-4deg); }
    66% { transform: translate(20px, -25px) rotate(6deg); }
}

@keyframes driftC {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(35px, -30px) rotate(8deg); }
}

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

@media (max-width: 768px) {
    .illustration {
        width: 80%;
    }

    .room-text {
        padding: 0 1.5rem;
    }

    .text-top-left,
    .text-top-right,
    .text-bottom-left,
    .text-bottom-right {
        left: 5%;
        right: 5%;
        text-align: left;
    }

    .text-center {
        left: 5%;
        right: 5%;
        transform: translateY(-50%);
        text-align: left;
    }
}
