/* reiwa.boo - Frutiger Aero meets Japanese Minimal */

:root {
    --glass-bg: #e8f0f8;
    --deep-layer: #1a2a3a;
    --frost-white: #f4f7fa;
    --accent-glow: #7eb8e0;
    --ghost-pink: #e8c8d8;
    --text-primary: #2a3a4a;
    --border-shimmer: rgba(255, 255, 255, 0.3);
    --gradient-start: #d0e8f4;
    --gradient-end: #a0c8e0;

    --glass-opacity: 0.65;
    --frost-intensity: 20px;
    --vapor-opacity: 0.12;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--glass-bg);
    background: linear-gradient(135deg, var(--glass-bg), var(--gradient-start), var(--glass-bg), var(--ghost-pink), var(--glass-bg));
    background-size: 400% 400%;
    animation: glacialShift 30s ease infinite;
    overflow-x: hidden;
    line-height: 1.85;
    letter-spacing: 0.02em;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
}

@keyframes glacialShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

/* Noise Overlay */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

/* Vapor Wisps */
#vapor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.vapor-wisp {
    position: absolute;
    bottom: -200px;
    width: 80px;
    height: 300px;
    background: rgba(255, 255, 255, var(--vapor-opacity));
    border-radius: 50%;
    filter: url(#vaporDisplace) blur(30px);
    animation: vaporRise 20s linear infinite;
}

@keyframes vaporRise {
    0% {
        transform: translateY(0) scaleX(1);
        opacity: var(--vapor-opacity);
    }
    50% {
        transform: translateY(-60vh) scaleX(1.3);
        opacity: calc(var(--vapor-opacity) * 0.6);
    }
    100% {
        transform: translateY(-120vh) scaleX(0.8);
        opacity: 0;
    }
}

/* Sections */
.section {
    position: relative;
    z-index: 2;
}

/* Glass Entrance */
#glass-entrance {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-panel {
    position: relative;
    background: rgba(244, 247, 250, var(--glass-opacity));
    backdrop-filter: blur(var(--frost-intensity));
    -webkit-backdrop-filter: blur(var(--frost-intensity));
    border: 1px solid var(--border-shimmer);
    border-radius: 12px;
    padding: 4rem 5rem;
    text-align: center;
}

.hero-panel {
    opacity: 0;
    animation: panelFadeIn 1.2s ease-out 0.8s forwards;
}

.hero-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    color: var(--text-primary);
    opacity: 0;
    animation: textFadeIn 1s ease-out 1.1s forwards;
    display: block;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes textFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Condensation Drops */
.condensation-drops {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
}

.condensation-drop {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(255,255,255,0.1));
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    opacity: 0;
    animation: dropAppear 0.4s ease-out forwards;
}

@keyframes dropAppear {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* Vapor Corridor */
#vapor-corridor {
    min-height: 200vh;
    position: relative;
    padding: 10vh 0;
}

.corridor-card {
    position: relative;
    width: 70vw;
    max-width: 700px;
    padding: 3rem 3.5rem;
    background: rgba(244, 247, 250, var(--glass-opacity));
    border: 1px solid var(--border-shimmer);
    border-radius: 12px;
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.corridor-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.card-1 {
    margin-left: 5vw;
    margin-bottom: 15vh;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card-2 {
    margin-left: 15vw;
    margin-bottom: 15vh;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateX(100px);
}

.card-2.visible {
    transform: translateX(0);
}

.card-3 {
    margin-left: 8vw;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.card-heading {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.glass-card p {
    margin-bottom: 1rem;
}

.whisper-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* Era Seal */
.era-seal {
    position: absolute;
    top: 40vh;
    right: 10vw;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(126, 184, 224, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sealRotate 60s linear infinite, sealPulse 4s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
}

.era-seal span {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: 1.4rem;
    color: var(--accent-glow);
}

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

@keyframes sealPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Still Room */
#still-room {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15vh 5vw;
}

.still-room-content {
    max-width: 45ch;
    position: relative;
    padding-left: 2rem;
}

.remnant-drop {
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(255,255,255,0.2));
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Reflection Pool */
#reflection-pool {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 10vh;
    position: relative;
}

.reflection-panel {
    transform: scaleY(-1);
    opacity: 0.4;
    margin-bottom: 5vh;
}

.final-kanji {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: clamp(8rem, 15vw, 14rem);
    color: var(--text-primary);
    opacity: 0.2;
    text-align: center;
    transition: filter 0.5s ease;
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
}

/* Page blur transition for reflection pool */
body.blurring {
    transition: filter 2s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .corridor-card {
        width: 85vw;
        padding: 2rem 2rem;
    }

    .card-1 { margin-left: 3vw; }
    .card-2 { margin-left: 5vw; }
    .card-3 { margin-left: 3vw; }

    .glass-panel {
        padding: 3rem 2.5rem;
    }

    .era-seal {
        right: 5vw;
        width: 80px;
        height: 80px;
    }

    .era-seal span {
        font-size: 1.1rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-panel,
    .hero-title,
    .corridor-card,
    .condensation-drop {
        opacity: 1 !important;
        transform: none !important;
    }

    body {
        animation: none;
    }
}
