:root {
    --cloud-white: #F4F2F7;
    --slate-ink: #2D2B3A;
    --wisteria: #C8B6D4;
    --stone-blue: #A8B5C8;
    --moss-whisper: #B4C9B2;
    --petal-pink: #D4B8C4;
    --mist: #DDD8E4;
    --deep-well: #1E1C28;
    --text-secondary: #6B6E7B;
    --text-tertiary: #9B96A8;
    --accent-lavender: #B8A9C9;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cloud-white);
    color: var(--slate-ink);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.8;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===========================
   Room Layout System
   Each room = 100vh "page"
   Total ~600vh scroll journey
   =========================== */

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

.room-content {
    max-width: 680px;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===========================
   Room 1: Arrival
   Domain title + enso + rule + chevron
   =========================== */

.room-1 {
    position: relative;
}

.enso-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.site-title {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--slate-ink);
    position: relative;
    z-index: 1;
}

.hero-rule {
    width: 120px;
    height: 1px;
    background-color: var(--wisteria);
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* Scroll chevron: appears after 3s, pulses gently */
.scroll-chevron {
    margin-top: 48px;
    color: var(--mist);
    opacity: 0;
    transition: opacity 0.6s ease-out;
    position: relative;
    z-index: 1;
    cursor: default;
}

.scroll-chevron.visible {
    animation: chevron-pulse 3s ease-in-out infinite;
}

.scroll-chevron.hidden {
    animation: none;
    opacity: 0;
    pointer-events: none;
}

@keyframes chevron-pulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===========================
   Room 2: Breath
   Intentionally empty - pure ma
   =========================== */

.room-2 {
    min-height: 100vh;
}

/* ===========================
   Horizon Lines
   120px wide, 1px, Mist color
   Sugimoto-inspired dividers
   =========================== */

.horizon-line {
    width: 120px;
    height: 1px;
    background-color: var(--mist);
    margin-bottom: 60px;
}

/* ===========================
   Text Blocks
   IBM Plex Sans Light, left-aligned in centered column
   =========================== */

.text-block {
    max-width: 680px;
    text-align: left;
    width: 100%;
}

.text-block p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.8;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

/* ===========================
   Room 4: Stone Garden (Karesansui)
   5 circles in asymmetric Ryoan-ji arrangement
   =========================== */

.karesansui {
    width: 300px;
    height: 200px;
    position: relative;
}

.stone {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

/* Wisteria stone - upper left area */
.stone-1 {
    background-color: var(--wisteria);
    top: 30px;
    left: 45px;
}

/* Stone Blue - center */
.stone-2 {
    background-color: var(--stone-blue);
    top: 90px;
    left: 130px;
}

/* Moss Whisper - upper right area */
.stone-3 {
    background-color: var(--moss-whisper);
    top: 55px;
    left: 210px;
}

/* Petal Pink - lower left area */
.stone-4 {
    background-color: var(--petal-pink);
    top: 140px;
    left: 75px;
}

/* Mist - lower right area */
.stone-5 {
    background-color: var(--mist);
    top: 120px;
    left: 240px;
}

/* ===========================
   Room 5: Second Text
   Single contemplative sentence
   =========================== */

.room-5 .text-block p {
    font-size: 1rem;
    text-align: left;
}

/* ===========================
   Room 6: Departure
   Small enso + Reiwa year label
   =========================== */

.enso-small {
    margin-bottom: 32px;
}

.era-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-lavender);
}

/* ===========================
   Fade Animation System
   Elements start invisible, revealed by IntersectionObserver
   =========================== */

.fade-element {
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.fade-element.visible {
    opacity: 1;
}

/* Karesansui uses shorter fade (600ms per design spec) */
.karesansui.fade-element {
    transition: opacity 600ms ease-out;
}

/* Horizon lines use 600ms fade per design spec */
.horizon-line.fade-element {
    transition: opacity 600ms ease-out;
}

/* ===========================
   Responsive Design
   Mobile: content 90vw, spacing increases to 40vh
   =========================== */

@media (max-width: 768px) {
    .room {
        min-height: 100vh;
    }

    .room-content {
        max-width: 90vw;
        padding: 0 1rem;
    }

    /* Increase breathing space on mobile */
    .room-2 {
        min-height: 100vh;
    }

    .karesansui {
        width: 250px;
        height: 170px;
    }

    .stone-3 {
        left: 175px;
    }

    .stone-5 {
        left: 200px;
    }
}

@media (max-width: 480px) {
    .room-content {
        max-width: 90vw;
    }

    .karesansui {
        width: 220px;
        height: 150px;
    }

    .stone-2 {
        left: 110px;
    }

    .stone-3 {
        left: 155px;
    }

    .stone-5 {
        left: 175px;
    }

    .site-title {
        font-size: clamp(1rem, 5vw, 1.8rem);
    }
}
