/* bada.style - Blobitecture Dashboard / Coastal-Blend / Candle-Atmospheric */

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

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

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.15vw, 20px);
    line-height: 1.65;
    color: #2C4F60;
    background: #F4F0EB;
    overflow-x: hidden;
    cursor: default;
}

/* === TYPOGRAPHY === */
h1 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: -0.02em;
    color: #1B3A4B;
    line-height: 1.05;
}

h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(28px, 4vw, 56px);
    letter-spacing: -0.02em;
    color: #1B3A4B;
    line-height: 1.15;
}

h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(20px, 2.5vw, 36px);
    color: #1B3A4B;
}

/* Counter numbers - Outfit typeface */
.counter-num {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(56px, 7vw, 96px);
    color: #5A9EB0;
    font-variant-numeric: tabular-nums;
    display: block;
    line-height: 1;
}

/* Tile words */
.tile-word {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(16px, 2vw, 24px);
    color: #2C4F60;
    display: block;
    margin-top: 0.5rem;
    text-transform: none;
}

/* Candle poem text */
.candle-poem {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.65;
    color: #2C4F60;
    max-width: 24em;
    text-align: center;
    margin-top: 1.5rem;
}

/* Hex reveal text */
.hex-reveal {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #F4F0EB;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 4px rgba(27,58,75,0.5);
    font-variant-numeric: tabular-nums;
}

/* === ZONES (Full-viewport dashboard sections) === */
.zone {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    scroll-snap-align: start;
    overflow: hidden;
    padding: clamp(24px, 4vw, 60px);
}

.zone-hero { background: #F4F0EB; }
.zone-tide { background: #F4F0EB; }
.zone-candle { background: #F4F0EB; }
.zone-palette { background: #F4F0EB; }
.zone-farewell { background: #1B3A4B; }

/* === WATERCOLOR BACKGROUNDS === */
.watercolor-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    right: -10%;
    bottom: -10%;
    pointer-events: none;
    z-index: 0;
}

/* Hero: Tidal Teal bleeding into Sea Glass */
.wc-hero {
    background:
        radial-gradient(ellipse at 25% 35%, rgba(90,158,176,0.28) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 65%, rgba(139,206,181,0.22) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212,148,58,0.06) 0%, transparent 70%);
}

/* Style Tide: mixed warm washes */
.wc-tide {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(212,148,58,0.14) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 25%, rgba(90,158,176,0.16) 0%, transparent 45%),
        radial-gradient(ellipse at 40% 75%, rgba(184,164,140,0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 70%, rgba(139,206,181,0.1) 0%, transparent 40%);
}

/* Candle Gallery: warm amber glow */
.wc-candle {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(212,148,58,0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 60%, rgba(212,148,58,0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 55%, rgba(212,148,58,0.15) 0%, transparent 40%);
}

/* Coastal Palette: horizontal bleed of all colors */
.wc-palette {
    background:
        radial-gradient(ellipse at 10% 50%, rgba(244,240,235,0.4) 0%, transparent 25%),
        radial-gradient(ellipse at 25% 50%, rgba(27,58,75,0.15) 0%, transparent 20%),
        radial-gradient(ellipse at 40% 50%, rgba(90,158,176,0.2) 0%, transparent 20%),
        radial-gradient(ellipse at 55% 50%, rgba(212,148,58,0.2) 0%, transparent 20%),
        radial-gradient(ellipse at 70% 50%, rgba(139,206,181,0.18) 0%, transparent 20%),
        radial-gradient(ellipse at 85% 50%, rgba(184,164,140,0.18) 0%, transparent 20%);
}

/* Farewell: deep cove wash at 60% */
.wc-farewell {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(27,58,75,0.6) 0%, transparent 70%),
        radial-gradient(ellipse at 30% 30%, rgba(90,158,176,0.1) 0%, transparent 50%);
}

/* === BLOB SHAPES === */
.blob-1 { border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; }
.blob-2 { border-radius: 55% 45% 40% 60% / 45% 55% 50% 50%; }
.blob-3 { border-radius: 60% 40% 50% 50% / 40% 60% 45% 55%; }
.blob-4 { border-radius: 45% 55% 60% 40% / 50% 50% 55% 45%; }
.blob-5 { border-radius: 50% 50% 45% 55% / 60% 40% 50% 50%; }
.blob-6 { border-radius: 35% 65% 50% 50% / 50% 50% 65% 35%; }

.blob-panel {
    position: relative;
    transition: border-radius 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

/* Blob breathe on hover -- shifts radii by ~5-10% */
.blob-panel.blob-1:hover { border-radius: 45% 55% 50% 50% / 50% 50% 55% 45%; }
.blob-panel.blob-2:hover { border-radius: 50% 50% 45% 55% / 50% 50% 55% 45%; }
.blob-panel.blob-3:hover { border-radius: 55% 45% 55% 45% / 45% 55% 50% 50%; }
.blob-panel.blob-4:hover { border-radius: 50% 50% 55% 45% / 55% 45% 50% 50%; }
.blob-panel.blob-5:hover { border-radius: 55% 45% 50% 50% / 55% 45% 55% 45%; }
.blob-panel.blob-6:hover { border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; }

/* === AMBIENT GLOW (candle-nearby effect) === */
.ambient-glow {
    position: absolute;
    width: 65%;
    height: 65%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,148,58,0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* === HERO ZONE === */
.blob-hero {
    background: rgba(244,240,235,0.85);
    padding: clamp(40px, 6vw, 100px) clamp(30px, 5vw, 80px);
    text-align: center;
    width: clamp(300px, 80%, 900px);
    animation: heroHueShift 30s linear infinite;
    backdrop-filter: blur(1px);
}

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

.hero-title {
    margin-bottom: 1rem;
}

.hero-typed {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(16px, 1.5vw, 22px);
    color: #5A9EB0;
    min-height: 1.65em;
    max-width: 38em;
    margin: 0 auto;
}

.hero-typed-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #5A9EB0;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* === STYLE TIDE ZONE === */
.tide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: clamp(12px, 2vw, 28px);
    width: 90%;
    max-width: 1000px;
    z-index: 1;
}

/* Stagger the tiles for rolling rhythm */
.tide-grid .tide-panel:nth-child(1) { transform: translateY(0); }
.tide-grid .tide-panel:nth-child(2) { transform: translateY(12px); }
.tide-grid .tide-panel:nth-child(3) { transform: translateY(-8px); }
.tide-grid .tide-panel:nth-child(4) { transform: translateY(8px); }
.tide-grid .tide-panel:nth-child(5) { transform: translateY(-12px); }
.tide-grid .tide-panel:nth-child(6) { transform: translateY(4px); }

.blob-tile {
    background: rgba(244,240,235,0.8);
    padding: clamp(24px, 3vw, 48px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
    min-height: 200px;
}

/* Each tide panel: unique watercolor wash per DESIGN.md */
.tide-panel:nth-child(1) { background: rgba(212,148,58,0.15); }   /* Candle Amber */
.tide-panel:nth-child(2) { background: rgba(90,158,176,0.15); }   /* Tidal Teal */
.tide-panel:nth-child(3) { background: rgba(184,164,140,0.15); }  /* Driftwood */
.tide-panel:nth-child(4) { background: rgba(139,206,181,0.15); }  /* Sea Glass */
.tide-panel:nth-child(5) { background: rgba(27,58,75,0.12); }     /* Deep Cove */
.tide-panel:nth-child(6) { background: rgba(44,79,96,0.12); }     /* Kelp Ink */

/* === CANDLE GALLERY ZONE === */
.candle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 28px);
    width: 90%;
    max-width: 1000px;
    z-index: 1;
}

.blob-candle {
    background: rgba(244,240,235,0.85);
    padding: clamp(32px, 4vw, 60px) clamp(16px, 2vw, 32px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
    min-height: 340px;
}

.glow-candle {
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(212,148,58,0.2) 0%, transparent 60%);
}

.candle-svg {
    width: 60px;
    height: 160px;
}

/* Flame Animations */
.flame-group {
    transform-origin: 30px 55px;
}

.flame-outer, .flame-inner {
    transform-origin: center bottom;
}

/* Candle 1 */
.flame-1 .flame-outer,
.flame-1 .flame-inner {
    animation: flicker 1.5s ease-in-out infinite, sway 3s ease-in-out infinite;
}
.flame-1 .flame-glow {
    animation: glowPulse 4s ease-in-out infinite;
}

/* Candle 2 -- offset by 0.4s */
.flame-2 .flame-outer,
.flame-2 .flame-inner {
    animation: flicker 1.5s ease-in-out 0.4s infinite, sway 3s ease-in-out 0.4s infinite;
}
.flame-2 .flame-glow {
    animation: glowPulse 4s ease-in-out 0.4s infinite;
}

/* Candle 3 -- offset by 0.8s */
.flame-3 .flame-outer,
.flame-3 .flame-inner {
    animation: flicker 1.5s ease-in-out 0.8s infinite, sway 3s ease-in-out 0.8s infinite;
}
.flame-3 .flame-glow {
    animation: glowPulse 4s ease-in-out 0.8s infinite;
}

@keyframes sway {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(2px); }
}

@keyframes flicker {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    33% { transform: scaleY(0.92); opacity: 0.88; }
    66% { transform: scaleY(1.08); opacity: 0.95; }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.55; }
}

/* === COASTAL PALETTE ZONE === */
.blob-palette-main {
    background: rgba(244,240,235,0.9);
    padding: clamp(32px, 4vw, 60px);
    width: clamp(300px, 90%, 900px);
    text-align: center;
    z-index: 1;
    backdrop-filter: blur(1px);
}

.palette-heading {
    margin-bottom: 2rem;
}

.palette-strip {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.palette-swatch {
    width: clamp(50px, 8vw, 90px);
    height: clamp(60px, 10vw, 100px);
    border-radius: 30% 70% 50% 50% / 50% 50% 70% 30%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    transition: transform 0.4s ease, border-radius 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.palette-swatch:hover {
    transform: scale(1.1);
    border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
}

/* Swatch colors */
.swatch-sandwash { background: #F4F0EB; box-shadow: inset 0 0 0 1px rgba(184,164,140,0.3); }
.swatch-deepcove { background: #1B3A4B; }
.swatch-kelpink { background: #2C4F60; }
.swatch-tidalteal { background: #5A9EB0; }
.swatch-candleamber { background: #D4943A; }
.swatch-driftwood { background: #B8A48C; }
.swatch-seaglass { background: #8BCEB5; }
.swatch-basalt { background: #1E2D38; }

.palette-details {
    display: flex;
    gap: clamp(12px, 2vw, 24px);
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
}

.palette-detail {
    background: rgba(244,240,235,0.85);
    padding: 20px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    backdrop-filter: blur(1px);
}

.detail-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.detail-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #1B3A4B;
}

.detail-use {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #B8A48C;
}

/* === FAREWELL COVE ZONE === */
.zone-farewell {
    color: #D6CFC4;
}

.farewell-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.farewell-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 100px);
    color: #F4F0EB;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.year-counter {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(60px, 10vw, 120px);
    color: #5A9EB0;
    font-variant-numeric: tabular-nums;
    display: block;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.blob-return {
    background: rgba(244,240,235,0.1);
    padding: 16px 36px;
    cursor: pointer;
    display: inline-block;
    transition: background 0.4s ease, border-radius 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blob-return:hover {
    background: rgba(244,240,235,0.2);
}

.return-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    color: #D6CFC4;
    letter-spacing: 0.05em;
}

/* === CANDLE GLOW CURSOR === */
.candle-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,148,58,0.4) 0%, rgba(212,148,58,0.1) 50%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease-out;
    mix-blend-mode: screen;
    display: none;
    will-change: transform;
}

/* === FAREWELL SCROLL OPACITY === */
.zone-farewell .wc-farewell {
    transition: opacity 0.3s ease;
}

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

    .tide-grid .tide-panel {
        transform: translateY(0);
    }

    .candle-grid {
        grid-template-columns: 1fr;
    }

    .blob-hero {
        width: 95%;
    }

    .blob-palette-main {
        width: 95%;
    }

    .palette-strip {
        flex-wrap: wrap;
    }

    .palette-details {
        flex-direction: column;
        align-items: center;
    }

    .blob-candle {
        min-height: 280px;
    }

    .candle-cursor {
        display: none;
    }
}

@media (pointer: coarse) {
    .candle-cursor {
        display: none;
    }
}
