/* ============================================
   heisei.boo - Candy-bright Heisei-era pop
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --strawberry: #FF6B9D;
    --lavender: #C084FC;
    --mint: #6EE7B7;
    --lemon: #FDE68A;
    --sky: #7DD3FC;
    --cloud: #FFF5F7;
    --plum: #4A2040;
    --cloud-alt: #FFF0F5;
    --mint-white: #F0FDF4;
    --mint-green: #F0FFF4;
    --warm-white: #FFF8F0;

    --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius-soft: 28px;
    --radius-pill: 999px;
    --shadow-pink: 0 12px 32px rgba(255, 107, 157, 0.15);
    --shadow-lavender: 0 12px 32px rgba(192, 132, 252, 0.15);
    --shadow-mint: 0 12px 32px rgba(110, 231, 183, 0.15);
    --shadow-sky: 0 12px 32px rgba(125, 211, 252, 0.15);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    color: var(--plum);
    background: var(--cloud);
    overflow-x: hidden;
    line-height: 1.7;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.font-baloo {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
}

.subtitle {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
}

/* ---------- Floating Navigation Pill ---------- */
#nav-pill {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    z-index: 1000;
    display: flex;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.12);
    transition: box-shadow 0.4s ease, transform 0.6s var(--bounce), padding 0.3s ease;
    will-change: transform;
}

#nav-pill.visible {
    transform: translateX(-50%) translateY(0);
}

#nav-pill.scrolled {
    padding: 8px 20px;
    box-shadow: 0 4px 24px rgba(255, 107, 157, 0.25), 0 0 0 2px rgba(255, 107, 157, 0.2);
}

.nav-link {
    display: inline-block;
    padding: 6px 16px;
    color: var(--plum);
    text-decoration: none;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-pill);
    position: relative;
    transition: color 0.2s ease, background 0.2s ease, transform 0.3s var(--bounce);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 2.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--strawberry), var(--lavender), var(--sky));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: var(--strawberry);
    transform: scale(1.03);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-link:active {
    transform: scale(1.03) scaleY(0.92);
}

/* Nav mascot */
#nav-mascot {
    position: fixed;
    top: -4px;
    left: calc(50% + 140px);
    z-index: 1001;
    opacity: 0;
    transform: translateY(-120px);
    transition: opacity 0.6s ease 1.2s, transform 0.6s var(--bounce) 1.2s;
    pointer-events: none;
}

#nav-mascot.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Floating Shapes (Global) ---------- */
.floating-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    contain: layout style;
    pointer-events: none;
}

.floating-shape.star {
    border-radius: 0;
}

.floating-shape.pill {
    border-radius: var(--radius-pill);
}

.floating-shape.rounded-rect {
    border-radius: 50%;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0) rotate(var(--rot-start, 0deg)); }
    50% { transform: translateY(-20px) rotate(var(--rot-end, 15deg)); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(var(--rot-start, 0deg)) scale(1); }
    50% { transform: translateY(-14px) rotate(var(--rot-end, 10deg)) scale(1.05); }
}

/* ---------- Hero Section ---------- */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--cloud) 0%, var(--cloud-alt) 100%);
    overflow: hidden;
    animation: heroBreath 4s ease-in-out infinite;
}

@keyframes heroBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.008); }
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-left: 8%;
    margin-left: -8%;
}

#hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--strawberry) 0%, var(--lavender) 50%, var(--sky) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
    letter-spacing: 0.01em;
    min-height: 1.2em;
}

#hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0);
    animation: letterBounce 0.5s var(--bounce) forwards;
}

@keyframes letterBounce {
    0% { opacity: 0; transform: scale(0); }
    60% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

#hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--plum);
    opacity: 0;
    transform: translateY(20px);
    margin-top: 16px;
}

#hero-subtitle.visible {
    animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 0.75;
        transform: translateY(0);
    }
}

/* ---------- Stories Section ---------- */
#stories {
    position: relative;
    padding: 80px 5% 100px;
    background: linear-gradient(180deg, var(--cloud-alt) 0%, var(--warm-white) 50%, var(--mint-white) 100%);
    overflow: hidden;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ---------- Story Bubble ---------- */
.story-bubble {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 32px;
    padding: 36px 28px 32px;
    margin-top: var(--float-offset, 0px);
    transform: rotate(var(--tilt, 0deg));
    box-shadow: var(--shadow-pink);
    border: 3px dashed rgba(192, 132, 252, 0.35);
    position: relative;
    transition: transform 0.3s var(--bounce), box-shadow 0.3s ease;
    opacity: 0;
    will-change: transform, opacity;
}

.story-bubble.animate-in {
    animation: bubbleBounceIn 0.6s var(--bounce) forwards;
}

@keyframes bubbleBounceIn {
    0% {
        opacity: 0.3;
        transform: rotate(var(--tilt, 0deg)) translateY(30px) scale(0.85);
    }
    100% {
        opacity: 1;
        transform: rotate(var(--tilt, 0deg)) translateY(0) scale(1);
    }
}

.story-bubble:hover {
    transform: translateY(-4px) rotate(0deg) !important;
    box-shadow: 0 16px 40px rgba(255, 107, 157, 0.25);
}

.story-bubble:active {
    transform: translateY(-4px) rotate(0deg) scaleY(0.92) !important;
    transition-duration: 0.1s;
}

.bubble-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.bubble-title {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    text-align: center;
    color: var(--plum);
    margin-bottom: 12px;
}

.bubble-text {
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.7;
    color: var(--plum);
    max-width: 38em;
    opacity: 0.85;
}

/* Alternating shadow colors for bubbles */
.story-bubble:nth-child(2) { box-shadow: var(--shadow-lavender); }
.story-bubble:nth-child(3) { box-shadow: var(--shadow-mint); }
.story-bubble:nth-child(4) { box-shadow: var(--shadow-sky); }
.story-bubble:nth-child(5) { box-shadow: var(--shadow-lavender); }
.story-bubble:nth-child(6) { box-shadow: var(--shadow-pink); }

.story-bubble:nth-child(2):hover { box-shadow: 0 16px 40px rgba(192, 132, 252, 0.25); }
.story-bubble:nth-child(3):hover { box-shadow: 0 16px 40px rgba(110, 231, 183, 0.25); }
.story-bubble:nth-child(4):hover { box-shadow: 0 16px 40px rgba(125, 211, 252, 0.25); }
.story-bubble:nth-child(5):hover { box-shadow: 0 16px 40px rgba(192, 132, 252, 0.25); }
.story-bubble:nth-child(6):hover { box-shadow: 0 16px 40px rgba(255, 107, 157, 0.25); }

/* ---------- Peek Mascot ---------- */
#peek-mascot {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#peek-mascot.visible {
    opacity: 1;
}

/* ---------- Ribbon River Section ---------- */
#ribbon-section {
    position: relative;
    padding: 60px 5% 80px;
    background: linear-gradient(180deg, var(--mint-white) 0%, #F0FFF4 30%, var(--warm-white) 60%, var(--cloud) 100%);
    overflow: hidden;
    text-align: center;
}

#ribbon-river {
    width: 100%;
    height: 180px;
    position: relative;
    z-index: 1;
}

#ribbon-path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 2s ease;
}

#ribbon-path.drawn {
    stroke-dashoffset: 0;
}

#ribbon-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    z-index: 2;
    pointer-events: none;
}

.ribbon-icon {
    position: absolute;
    left: var(--ri-left);
    top: var(--ri-top);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease, transform 0.5s var(--bounce);
}

.ribbon-icon.pop-in {
    opacity: 1;
    transform: scale(1);
}

#ribbon-callout {
    position: relative;
    z-index: 2;
    margin-top: 24px;
}

.ribbon-heading {
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--plum);
    margin-bottom: 12px;
}

.ribbon-text {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--plum);
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto;
}

/* ---------- Farewell Garden (Footer) ---------- */
#farewell {
    position: relative;
    padding: 100px 5% 60px;
    background: linear-gradient(180deg, var(--cloud) 0%, var(--mint-white) 40%, #E6FFF0 100%);
    overflow: hidden;
    text-align: center;
    min-height: 420px;
}

#garden-elements {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 0;
    pointer-events: none;
}

.garden-svg {
    width: 100%;
    height: 200px;
    display: block;
}

#footer-mascot {
    position: relative;
    z-index: 3;
    margin-bottom: 24px;
    display: inline-block;
    animation: floatSlow 5s ease-in-out infinite;
    --rot-start: -3deg;
    --rot-end: 3deg;
}

#farewell-content {
    position: relative;
    z-index: 2;
}

.footer-pill {
    display: inline-block;
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-mint);
    font-size: 1.4rem;
    color: var(--plum);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-pill-link {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-pill);
    color: var(--plum);
    text-decoration: none;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(110, 231, 183, 0.15);
    transition: transform 0.3s var(--bounce), box-shadow 0.3s ease;
}

.footer-pill-link:hover {
    transform: scale(1.03) translateY(-2px);
    box-shadow: 0 6px 20px rgba(110, 231, 183, 0.25);
}

.footer-pill-link:active {
    transform: scale(1.03) scaleY(0.92);
    transition-duration: 0.1s;
}

.footer-note {
    font-size: 0.9rem;
    color: var(--plum);
    opacity: 0.6;
    margin-top: 8px;
}

/* ---------- Confetti ---------- */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
}

/* ---------- Bounce-enter for generic scroll reveal ---------- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.85);
    transition: opacity 0.6s ease, transform 0.6s var(--bounce);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---------- Mascot shared ---------- */
.mascot {
    pointer-events: none;
}

/* ---------- Selection color ---------- */
::selection {
    background: rgba(255, 107, 157, 0.3);
    color: var(--plum);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cloud);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--strawberry), var(--lavender));
    border-radius: var(--radius-pill);
}

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

    .story-bubble {
        margin-top: 0 !important;
    }

    #nav-pill {
        padding: 8px 16px;
        gap: 4px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    #nav-mascot {
        display: none;
    }

    #peek-mascot {
        display: none;
    }

    #hero-content {
        padding-left: 0;
        margin-left: 0;
    }

    #ribbon-icons {
        display: none;
    }
}

@media (max-width: 480px) {
    .nav-link {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .story-bubble {
        padding: 24px 20px 24px;
        border-radius: 24px;
    }
}
