/* ============================================
   bada.coffee — Sea + Coffee, Zen Contemplative
   Horizontal scroll, bioluminescent particles
   ============================================ */

:root {
    --abyss: #070d1a;
    --midnight-tide: #0f1d35;
    --tidal-slate: #1e3150;
    --driftwood: #8b7355;
    --espresso-crema: #c4956a;
    --sea-foam: #b8ccc4;
    --bioluminescence: #4ecdc4;
    --dawn-amber: #e8a84c;

    --font-display: 'Noto Serif KR', serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Azeret Mono', monospace;
}

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

body {
    background: var(--abyss);
    color: var(--sea-foam);
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.75;
    overflow: hidden;
    height: 100vh;
    animation: tidalBreathe 20s ease-in-out infinite;
}

@keyframes tidalBreathe {
    0%, 100% { background-color: var(--abyss); }
    50% { background-color: var(--midnight-tide); }
}

/* Fixed domain name */
.domain-fixed {
    position: fixed;
    top: 2rem;
    left: 2rem;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--driftwood);
    opacity: 0.15;
    z-index: 100;
}

/* Particle Canvas */
#particleCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
}

/* ============================================
   Scroll Container
   ============================================ */

.scroll-container {
    display: flex;
    flex-wrap: nowrap;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.panel {
    flex-shrink: 0;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

.panel-approach { width: 100vw; }
.panel-shoreline { width: 150vw; }
.panel-counter { width: 120vw; }
.panel-return { width: 100vw; }

/* ============================================
   Horizon Line
   ============================================ */

.horizon-line {
    position: absolute;
    top: 55%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--tidal-slate);
    z-index: 5;
    transition: background-color 0.8s ease;
}

.horizon-line.warm {
    background: var(--espresso-crema);
    opacity: 0.5;
}

/* ============================================
   Hangul Watermarks
   ============================================ */

.hangul-watermark {
    position: absolute;
    font-family: var(--font-display);
    font-size: clamp(200px, 40vw, 500px);
    font-weight: 700;
    color: var(--midnight-tide);
    opacity: 0.04;
    z-index: 1;
    user-select: none;
    line-height: 1;
}

/* ============================================
   Coffee Ring Stains
   ============================================ */

.coffee-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 1px solid var(--driftwood);
    opacity: 0.08;
    z-index: 2;
}

.coffee-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px solid var(--driftwood);
    opacity: 0.6;
}

/* ============================================
   Panel 1: Approach
   ============================================ */

.panel-approach {
    background: linear-gradient(to bottom, #000000 0%, var(--abyss) 40%, var(--midnight-tide) 100%);
}

.amber-dot {
    position: absolute;
    top: 58%;
    left: 70%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dawn-amber);
    box-shadow: 0 0 20px rgba(232, 168, 76, 0.5), 0 0 40px rgba(232, 168, 76, 0.2);
    opacity: 0;
    animation: amberAppear 1s ease-out 2s forwards;
    z-index: 10;
}

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

/* ============================================
   Panel 2: Shoreline (Bento)
   ============================================ */

.panel-shoreline {
    display: flex;
    align-items: center;
    padding: 4rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    grid-auto-rows: minmax(120px, auto);
    gap: 12px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.bento-cell {
    background: rgba(15, 29, 53, 0.6);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(30, 49, 80, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-cell.tall {
    grid-row: span 2;
}

.bento-cell.wide {
    grid-column: span 2;
}

.cell-text {
    color: var(--sea-foam);
    font-size: 16px;
    line-height: 1.75;
}

.cell-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bioluminescence);
    margin-bottom: 0.5rem;
}

/* ============================================
   Panel 3: Counter
   ============================================ */

.panel-counter {
    background: linear-gradient(135deg, #0d1520 0%, #1a1208 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.counter-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 900px;
    position: relative;
    z-index: 10;
}

.cup-circle {
    flex-shrink: 0;
    width: 360px;
    height: 360px;
    position: relative;
}

.cup-rings {
    width: 100%;
    height: 100%;
}

.ring-draw {
    stroke-dasharray: 1100;
    stroke-dashoffset: 1100;
    transition: stroke-dashoffset 2s ease-out;
}

.ring-draw.drawn {
    stroke-dashoffset: 0;
}

.counter-text {
    max-width: 400px;
}

.body-text {
    color: var(--sea-foam);
    margin-bottom: 1.25rem;
}

.accent-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--espresso-crema);
}

.body-small {
    font-size: 14px;
    color: var(--driftwood);
    font-style: italic;
}

/* ============================================
   Panel 4: Return
   ============================================ */

.panel-return {
    background: linear-gradient(to right, var(--abyss) 0%, #1a2a4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.return-text {
    max-width: 400px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.dawn-edge {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(26, 42, 74, 0.5));
}

/* ============================================
   Progress Bar
   ============================================ */

.progress-bar {
    position: fixed;
    bottom: 20px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: rgba(30, 49, 80, 0.3);
    z-index: 200;
    border-radius: 1px;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--tidal-slate), var(--espresso-crema));
    border-radius: 1px;
    transition: width 0.15s ease;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }

    .scroll-container {
        flex-direction: column;
        height: auto;
        overflow-x: hidden;
        overflow-y: visible;
        scroll-snap-type: y proximity;
    }

    .panel {
        width: 100% !important;
        min-height: 100vh;
        scroll-snap-align: start;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .bento-cell.wide,
    .bento-cell.tall {
        grid-column: auto;
        grid-row: auto;
    }

    .counter-content {
        flex-direction: column;
        gap: 2rem;
    }

    .cup-circle {
        width: 250px;
        height: 250px;
    }

    .panel-shoreline,
    .panel-counter {
        padding: 2rem;
    }

    .progress-bar {
        top: auto;
        bottom: 12px;
    }

    .domain-fixed {
        top: 1rem;
        left: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
    }

    .amber-dot {
        animation: none;
        opacity: 1;
    }

    .ring-draw {
        stroke-dashoffset: 0;
        transition: none;
    }
}
