/* taisho.day — Taishō-era romantic modernism */

:root {
    --cream: #f0e6d3;
    --warm-gray: #b8a99a;
    --deep-indigo: #1a1035;
    --violet: #7b4fad;
    --dark-plum: #2d1b2e;
    --teal: #4fa89e;
    --gold: #e8a84c;
    --coral: #d4726a;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    background: var(--deep-indigo);
    color: var(--cream);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--teal), var(--violet));
    z-index: 1000;
    transition: width 0.1s linear;
}

/* Room Base */
.room {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.room-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#room1 .room-bg {
    background: radial-gradient(ellipse at 50% 80%, var(--dark-plum) 0%, var(--deep-indigo) 70%);
}

#room2 .room-bg {
    background: radial-gradient(ellipse at 30% 50%, #2a1548 0%, var(--deep-indigo) 60%);
}

#room3 .room-bg {
    background: radial-gradient(ellipse at 70% 40%, #1b2a35 0%, var(--deep-indigo) 65%);
}

#room4 .room-bg {
    background: radial-gradient(ellipse at 50% 30%, #2d1b2e 0%, var(--deep-indigo) 60%);
}

#room5 .room-bg {
    background: radial-gradient(ellipse at 50% 50%, #1a1035 0%, #0d0820 80%);
}

/* Aurora Overlay */
.aurora-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.3;
    background: linear-gradient(
        135deg,
        transparent 20%,
        rgba(79, 168, 158, 0.1) 35%,
        transparent 50%,
        rgba(123, 79, 173, 0.08) 65%,
        transparent 80%
    );
    animation: auroraShift 12s ease-in-out infinite alternate;
}

@keyframes auroraShift {
    0% { transform: translateX(-5%) rotate(0deg); opacity: 0.2; }
    50% { opacity: 0.4; }
    100% { transform: translateX(5%) rotate(1deg); opacity: 0.25; }
}

/* Room Content */
.room-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 55%;
    padding: 2rem;
}

.kanji-display {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(4rem, 15vw, 14rem);
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--warm-gray) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.room.active .kanji-display {
    opacity: 1;
    transform: translateY(0);
}

.room-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.room.active .room-subtitle {
    opacity: 1;
    transform: translateY(0);
}

.room-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 400;
    line-height: 1.8;
    color: rgba(240, 230, 211, 0.85);
    max-width: 38ch;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.6s, transform 1.2s ease 0.6s;
}

.room.active .room-body {
    opacity: 1;
    transform: translateY(0);
}

.room-coda {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--gold);
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 2s ease 1.5s;
}

.room.active .room-coda {
    opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 1.5s ease 1.2s;
}

.room.active .scroll-indicator {
    opacity: 0.6;
}

.scroll-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--warm-gray);
}

.scroll-arrow {
    width: 1px;
    height: 30px;
    background: var(--warm-gray);
    margin: 0.8rem auto 0;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 0.5; }
    50% { transform: scaleY(1.5); opacity: 1; }
}

/* SVG Motifs */
.motif {
    position: absolute;
    z-index: 2;
    opacity: 0.15;
    pointer-events: none;
}

.kiku-motif {
    width: 300px;
    height: 300px;
    bottom: 10%;
    right: 8%;
    animation: motifRotate 60s linear infinite;
}

.asanoha-motif {
    width: 250px;
    height: 250px;
    top: 15%;
    left: 5%;
    animation: motifFloat 20s ease-in-out infinite;
}

.seigaiha-motif {
    width: 350px;
    height: 200px;
    bottom: 8%;
    left: 10%;
    animation: motifFloat 25s ease-in-out infinite alternate;
}

.taisho-circle {
    width: 200px;
    height: 200px;
    top: 20%;
    right: 10%;
    animation: motifRotate 40s linear infinite reverse;
}

.taisho-circle circle {
    stroke: var(--gold);
}

@keyframes motifRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes motifFloat {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

/* Glitch text effect on hover */
.kanji-display:hover {
    animation: textGlitch 0.3s ease;
}

@keyframes textGlitch {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px) skewX(1deg); }
    40% { transform: translateX(2px) skewX(-1deg); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .room-content {
        max-width: 85%;
    }

    .motif {
        opacity: 0.08;
    }
}
