/* ============================================
   mujun.cafe - Retro-Futuristic Kissaten
   Bento-Box Grid / Kinetic Typography
   ============================================ */

:root {
    --deep-indigo: #0D0221;
    --midnight-teal: #0A1628;
    --neon-coral: #FF2E63;
    --neon-coral-soft: #FF6B9D;
    --synth-amber: #FFB627;
    --electric-cyan: #00F5D4;
    --phosphor-white: #F0EDE8;
    --lunar-silver: #C8C2BC;
    --faded-jade: #7B8F8A;
    --seam-width: 3px;
}

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

html { font-size: 16px; }

body {
    background: var(--deep-indigo);
    color: var(--lunar-silver);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* --- Alley Grid Background --- */
.alley-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, #1A0A3E 1px, transparent 1px),
        linear-gradient(to bottom, #1A0A3E 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

/* --- Bento Section --- */
.bento-section {
    position: relative;
    z-index: 5;
    height: 100vh;
    padding: var(--seam-width);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: var(--seam-width);
    height: 100%;
    width: 100%;
    background: var(--neon-coral);
    animation: seam-pulse 4s ease-in-out infinite;
}

@keyframes seam-pulse {
    0%, 100% { background-color: var(--neon-coral); }
    50% { background-color: var(--neon-coral-soft); }
}

/* --- Zones --- */
.zone {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.zone:hover {
    box-shadow: inset 0 0 20px rgba(255, 182, 39, 0.1);
}

.zone-a {
    grid-column: 1 / 9;
    grid-row: 1 / 4;
    background: var(--deep-indigo);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem;
}

.zone-b {
    grid-column: 9 / 13;
    grid-row: 1 / 6;
    background: var(--midnight-teal);
    position: relative;
}

.zone-c {
    grid-column: 1 / 5;
    grid-row: 4 / 7;
    background: var(--midnight-teal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-d {
    grid-column: 5 / 9;
    grid-row: 4 / 7;
    background: var(--deep-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zone-e {
    grid-column: 1 / 13;
    grid-row: 7 / 9;
    background: var(--deep-indigo);
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px dashed rgba(123, 143, 138, 0.2);
}

/* --- Display Title --- */
.display-title {
    font-family: 'Dela Gothic One', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 6rem);
    color: var(--neon-coral);
    text-shadow: 0 0 20px rgba(255, 46, 99, 0.4);
    line-height: 1.1;
}

.display-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(120%);
}

.display-title .char.settled {
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* --- Secondary Heading --- */
.secondary-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--phosphor-white);
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
    animation: weight-breathe 6s ease-in-out infinite;
}

@keyframes weight-breathe {
    0%, 100% { font-weight: 300; }
    50% { font-weight: 500; }
}

/* --- Color Cycle Title --- */
.color-cycle .char {
    display: inline-block;
}

/* --- Body Text --- */
.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.7;
    color: var(--lunar-silver);
    max-width: 38em;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.body-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Kanji Display --- */
.kanji-display {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--neon-coral);
    filter: hue-rotate(0deg);
    animation: kanji-hue 20s linear infinite;
}

@keyframes kanji-hue {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* --- Receipt Text --- */
.receipt-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--faded-jade);
    opacity: 0.7;
    text-transform: uppercase;
}

/* --- Rain Effect --- */
.rain-effect {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.rain-effect::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background-image:
        linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.05) 60%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.12) 40%, transparent 100%);
    background-size: 1px 60px, 1px 40px, 1px 80px;
    background-position: 10% 0, 40% 20px, 75% 10px;
    background-repeat: repeat;
    animation: rain-fall 2s linear infinite;
}

.rain-heavy::before {
    opacity: 0.3;
}

@keyframes rain-fall {
    0% { transform: translateY(0); }
    100% { transform: translateY(50%); }
}

/* --- Vertical Text Deco --- */
.vertical-text-deco {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    writing-mode: vertical-rl;
    font-family: 'Dela Gothic One', cursive;
    font-size: 1.2rem;
    color: var(--faded-jade);
    opacity: 0.15;
    letter-spacing: 0.3em;
}

/* --- Neon Signs --- */
.neon-sign {
    position: relative;
    animation: neon-flicker 5s ease-in-out infinite;
}

@keyframes neon-flicker {
    0%, 5% { opacity: 1; }
    6% { opacity: 0.85; }
    8% { opacity: 1; }
    42% { opacity: 1; }
    43% { opacity: 0.7; }
    44% { opacity: 1; }
    80% { opacity: 1; }
    81% { opacity: 0.9; }
    83% { opacity: 1; }
    100% { opacity: 1; }
}

/* Coffee Cup */
.coffee-cup {
    width: 50px;
    height: 40px;
    border: 3px solid var(--neon-coral);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 0 15px rgba(255, 46, 99, 0.4);
    position: relative;
}

.coffee-handle {
    position: absolute;
    right: -18px;
    top: 8px;
    width: 15px;
    height: 20px;
    border: 3px solid var(--neon-coral);
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 0 10px rgba(255, 46, 99, 0.3);
}

/* Vinyl Disc */
.neon-vinyl { position: relative; }

.vinyl-disc {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--midnight-teal);
    box-shadow: 0 0 0 6px var(--deep-indigo), 0 0 0 9px var(--midnight-teal), 0 0 0 15px var(--deep-indigo), 0 0 0 18px var(--midnight-teal);
    animation: vinyl-spin 4s linear infinite;
}

.vinyl-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--synth-amber);
    box-shadow: 0 0 10px rgba(255, 182, 39, 0.5);
}

@keyframes vinyl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Moon */
.moon-shape {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--electric-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.4), 20px -5px 0 0 var(--midnight-teal);
}

/* Torii Gate */
.torii-gate {
    width: 60px;
    height: 50px;
    position: relative;
    border-top: 5px solid var(--neon-coral);
    box-shadow: 0 -3px 10px rgba(255, 46, 99, 0.4);
}

.torii-gate::before,
.torii-gate::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 5px;
    height: 40px;
    background: var(--neon-coral);
    box-shadow: 0 0 8px rgba(255, 46, 99, 0.3);
}

.torii-gate::before { left: 8px; }
.torii-gate::after { right: 8px; }

/* Cassette */
.cassette-body {
    width: 80px;
    height: 50px;
    border: 3px solid var(--synth-amber);
    border-radius: 5px;
    box-shadow: 0 0 12px rgba(255, 182, 39, 0.4);
    position: relative;
}

.cassette-reel {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--synth-amber);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    animation: vinyl-spin 3s linear infinite;
}

.reel-left { left: 14px; }
.reel-right { right: 14px; }

/* Paper Crane */
.crane-shape {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 40px solid var(--phosphor-white);
    opacity: 0.8;
    filter: drop-shadow(0 0 8px rgba(240, 237, 232, 0.3));
}

/* --- Conic Gradient Spinner --- */
.conic-gradient-spin {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--synth-amber), var(--deep-indigo), var(--midnight-teal), var(--synth-amber));
    animation: conic-rotate 30s linear infinite;
}

@keyframes conic-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Steam Effect --- */
.steam-effect {
    position: absolute;
    inset: 0;
}

.steam-effect::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 30%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 237, 232, 0.06), transparent);
    filter: blur(20px);
    animation: steam-rise 6s ease-in-out infinite;
}

.steam-effect::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 55%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 237, 232, 0.04), transparent);
    filter: blur(15px);
    animation: steam-rise 8s ease-in-out infinite 2s;
}

@keyframes steam-rise {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.5; }
    50% { transform: translateY(-30px) scale(1.3); opacity: 1; }
}

/* --- Skyline Container --- */
.skyline-container {
    width: 100%;
    height: 80%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

/* --- Equalizer --- */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
}

.eq-bar {
    width: 8px;
    background: var(--neon-coral);
    border-radius: 2px 2px 0 0;
    animation: eq-bounce ease-in-out infinite;
}

.eq-bar:nth-child(even) {
    background: var(--electric-cyan);
}

/* --- Corridor --- */
.corridor {
    position: relative;
    z-index: 5;
    height: 20vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--midnight-teal), var(--deep-indigo));
    cursor: pointer;
}

.corridor-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--phosphor-white);
    letter-spacing: 0.02em;
    transition: letter-spacing 0.4s ease;
}

.corridor-final {
    height: 40vh;
}

.final-glyph {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(6rem, 15vw, 12rem);
    color: var(--neon-coral);
    opacity: 1;
    transition: opacity 2s ease;
}

.final-glyph.fading {
    opacity: 0;
}

/* --- Playlist --- */
.playlist {
    margin-top: 1.5rem;
}

.playlist-item {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--lunar-silver);
    padding: 0.4rem 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.playlist-item.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: var(--seam-width);
    }

    .zone {
        min-height: 120px;
    }

    .zone-a { padding: 2rem 1.5rem; min-height: 200px; }
    .zone-b { min-height: 80px; }
    .zone-c, .zone-d { min-height: 150px; }
    .zone-e { min-height: 60px; }

    .bento-section {
        height: auto;
        min-height: 100vh;
    }

    .vertical-text-deco {
        writing-mode: horizontal-tb;
        font-size: 0.8rem;
    }

    .display-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}

@media (max-width: 480px) {
    .zone-a { padding: 1.5rem 1rem; }
}
