/* ===================================
   koomimi.com - Sunset Pop Design
   =================================== */

/* --- CSS Custom Properties --- */
:root {
    --warm-cream: #faf3eb;
    --peach-mist: #fde8d8;
    --sunset-coral: #e87461;
    --amber-glow: #f0a848;
    --dusty-rose: #c97b8b;
    --sunset-charcoal: #3d2c2e;
    --terracotta-haze: #d4946e;
    --shell: #fefcf8;
    --blush-coral: #e8a090;
    --warm-teal: #6bbfb3;
    --warm-peach: #f5cdb8;

    --bg-start: #faf3eb;
    --bg-mid: #fde8d8;
    --bg-end: rgba(240,168,72,0.08);

    --font-display: 'Bungee Shade', sans-serif;
    --font-secondary: 'Lilita One', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--sunset-charcoal);
    background: linear-gradient(170deg, var(--bg-start) 0%, var(--bg-mid) 40%, var(--bg-end) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: 0.01em;
    line-height: 1.75;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
}

/* --- Halftone Breathing Dots (Gutters) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--blush-coral) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: breatheDots 6s ease-in-out infinite alternate;
    transition: opacity 0.8s ease;
}

body.halftone-visible::before {
    opacity: 0.08;
}

@keyframes breatheDots {
    0% { background-size: 16px 16px; }
    100% { background-size: 17px 17px; }
}

/* --- Floating Decorative Elements --- */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floater {
    position: absolute;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.floater[data-speed="5"] { animation: floatGentle 5s ease-in-out infinite alternate; }
.floater[data-speed="6"] { animation: floatGentle 6s ease-in-out infinite alternate-reverse; }
.floater[data-speed="7"] { animation: floatGentle 7s ease-in-out infinite alternate; }
.floater[data-speed="8"] { animation: floatGentle 8s ease-in-out infinite alternate-reverse; }
.floater[data-speed="9"] { animation: floatGentle 9s ease-in-out infinite alternate; }

@keyframes floatGentle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-15px); }
}

/* --- Glitch Band --- */
.glitch-band {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--sunset-coral);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.glitch-band.flash {
    opacity: 1;
    animation: glitchFlash 100ms linear forwards;
}

@keyframes glitchFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm-cream);
    overflow: hidden;
    scroll-snap-align: start;
    z-index: 2;
}

.hero-halftone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--dusty-rose) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.hero-halftone.visible {
    opacity: 0.08;
    animation: breatheHalftone 6s ease-in-out infinite alternate;
}

@keyframes breatheHalftone {
    0% { background-size: 12px 12px; }
    50% { background-size: 14px 14px; }
    100% { background-size: 12px 12px; }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--sunset-charcoal);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: inline-flex;
    gap: 0;
}

.hero-title .letter {
    display: inline-block;
    transform: scale(0);
    opacity: 0;
    position: relative;
}

.hero-title .letter.popped {
    transform: scale(1);
    opacity: 1;
    animation: popIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Letter ripple effect */
.letter-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.letter-ripple .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid var(--sunset-coral);
    animation: rippleExpand 600ms ease-out forwards;
}

.letter-ripple .ring:nth-child(1) { width: 10px; height: 10px; opacity: 0.3; }
.letter-ripple .ring:nth-child(2) { width: 20px; height: 20px; opacity: 0.15; animation-delay: 80ms; }
.letter-ripple .ring:nth-child(3) { width: 32px; height: 32px; opacity: 0.05; animation-delay: 160ms; }

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: var(--ring-opacity, 0.3); }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--terracotta-haze);
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Speech Bubble Navigation --- */
.bubble-nav {
    position: fixed;
    top: 20vh;
    right: 2vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
}

.bubble-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.nav-bubble {
    position: relative;
    display: inline-block;
    padding: 10px 22px;
    background: var(--peach-mist);
    border: 2px solid var(--sunset-charcoal);
    border-radius: 20px;
    text-decoration: none;
    color: var(--sunset-charcoal);
    font-family: var(--font-secondary);
    font-size: clamp(1rem, 2vw, 1.3rem);
    letter-spacing: 0.02em;
    transform: translateX(60px);
    opacity: 0;
    transition: transform 500ms ease-out, opacity 500ms ease-out, background 300ms ease;
    animation: bubbleDrift 6s ease-in-out infinite alternate;
}

.nav-bubble.entered {
    transform: translateX(0);
    opacity: 1;
}

.nav-bubble:hover {
    transform: scale(1.08);
    background: var(--shell);
    animation-play-state: paused;
}

@keyframes bubbleDrift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.bubble-tail {
    position: absolute;
    bottom: -10px;
    left: 20%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--sunset-charcoal);
    transform: rotate(-8deg);
}

.bubble-tail::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--peach-mist);
}

.nav-bubble:hover .bubble-tail::after {
    border-top-color: var(--shell);
}

/* --- Panel Sections --- */
.panel {
    position: relative;
    min-height: 100vh;
    border-radius: 24px;
    border: 2px solid var(--sunset-charcoal);
    margin: 0 2vw;
    margin-top: -60px;
    padding: clamp(2rem, 5vw, 4rem);
    background: var(--shell);
    overflow: hidden;
    scroll-snap-align: start;
    z-index: 2;
}

.panel-1 { z-index: 3; }
.panel-2 { z-index: 4; }
.panel-3 { z-index: 5; }
.panel-4 { z-index: 6; background: var(--warm-peach); }

.panel:first-of-type {
    margin-top: 0;
}

.panel-halftone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--blush-coral) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
    z-index: 0;
}

.panel.in-view .panel-halftone {
    opacity: 0.1;
    animation: breatheHalftone 6s ease-in-out infinite alternate;
}

/* --- Panel Grid Layout --- */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
    position: relative;
    z-index: 1;
    min-height: 70vh;
}

.panel-content {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 400ms ease-out 200ms, transform 400ms ease-out 200ms;
}

.panel.in-view .panel-content {
    opacity: 1;
    transform: translateY(0);
}

.panel-illustration {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 500ms ease-out 100ms, transform 500ms ease-out 100ms;
}

.panel:nth-child(even) .panel-illustration {
    transform: translateX(-40px);
}

.panel.in-view .panel-illustration {
    opacity: 1;
    transform: translateX(0);
}

/* --- Speech Bubble Frames --- */
.speech-bubble-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.speech-bubble-body {
    background: var(--peach-mist);
    border: 2px solid var(--sunset-charcoal);
    border-radius: 20px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.speech-tail {
    position: absolute;
    bottom: -22px;
    left: 20%;
    transform: rotate(-8deg);
}

.speech-tail path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

.panel.in-view .speech-tail path {
    stroke-dashoffset: 0;
}

.speech-tail-right {
    left: auto;
    right: 20%;
    transform: rotate(8deg);
}

/* --- Typography --- */
.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--sunset-charcoal);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--sunset-charcoal);
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 1rem;
}

.body-text:last-child {
    margin-bottom: 0;
}

/* --- Illustrations --- */
.illustration {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
    position: relative;
}

/* Glitch micro-moment on hover */
.illustration:hover {
    animation: warmGlitch 150ms linear 1;
}

@keyframes warmGlitch {
    0% {
        filter: none;
    }
    25% {
        filter: drop-shadow(2px 0 0 rgba(232, 116, 97, 0.5)) drop-shadow(-2px 0 0 rgba(107, 191, 179, 0.3));
    }
    75% {
        filter: drop-shadow(2px 0 0 rgba(232, 116, 97, 0.5)) drop-shadow(-2px 0 0 rgba(107, 191, 179, 0.3));
    }
    100% {
        filter: none;
    }
}

/* --- Footer --- */
.site-footer {
    position: relative;
    padding: 4rem 2vw;
    text-align: center;
    z-index: 7;
}

.footer-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--sunset-charcoal);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.6;
}

.footer-whisper {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--terracotta-haze);
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .panel-illustration {
        order: -1;
    }

    .bubble-nav {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        flex-direction: row;
        gap: 8px;
    }

    .nav-bubble {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .panel {
        margin: 0 1vw;
        margin-top: -30px;
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .illustration {
        max-width: 200px;
    }

    .hero-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }
}

@media (max-width: 480px) {
    .bubble-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}
