/* ============================================
   monopole.boo — Playful Phantom Playground
   ============================================ */

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

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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: #6A6860;
    background: #F4F0E8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    color: #4A4840;
}

h1 {
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: 0.08em;
}

h2 {
    font-weight: 600;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
}

h3 {
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

p {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
}

.accent-text {
    font-family: 'Baloo 2', cursive;
    font-weight: 500;
    color: #8A8070;
}

/* ---- Sections ---- */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-cream {
    background-color: #F4F0E8;
}

.section-linen {
    background-color: #E8E0D4;
}

.section-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 90%;
    padding: 80px 0;
    text-align: center;
}

/* ---- Morph Transitions ---- */
.morph-transition {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 3;
    pointer-events: none;
}

.morph-1 {
    background: #E8E0D4;
    clip-path: ellipse(55% 60% at 50% 100%);
    animation: morphBlob1 8s ease-in-out infinite alternate;
}

.morph-2 {
    background: #F4F0E8;
    clip-path: ellipse(60% 55% at 45% 100%);
    animation: morphBlob2 10s ease-in-out infinite alternate;
}

.morph-3 {
    background: #E8E0D4;
    clip-path: ellipse(50% 65% at 55% 100%);
    animation: morphBlob3 9s ease-in-out infinite alternate;
}

.morph-4 {
    background: #F4F0E8;
    clip-path: ellipse(58% 58% at 48% 100%);
    animation: morphBlob1 11s ease-in-out infinite alternate;
}

@keyframes morphBlob1 {
    0% {
        clip-path: ellipse(55% 60% at 50% 100%);
    }
    33% {
        clip-path: ellipse(62% 70% at 40% 100%);
    }
    66% {
        clip-path: ellipse(48% 55% at 60% 100%);
    }
    100% {
        clip-path: ellipse(58% 65% at 45% 100%);
    }
}

@keyframes morphBlob2 {
    0% {
        clip-path: ellipse(60% 55% at 45% 100%);
    }
    33% {
        clip-path: ellipse(50% 68% at 55% 100%);
    }
    66% {
        clip-path: ellipse(65% 52% at 42% 100%);
    }
    100% {
        clip-path: ellipse(55% 62% at 52% 100%);
    }
}

@keyframes morphBlob3 {
    0% {
        clip-path: ellipse(50% 65% at 55% 100%);
    }
    33% {
        clip-path: ellipse(58% 58% at 48% 100%);
    }
    66% {
        clip-path: ellipse(52% 70% at 53% 100%);
    }
    100% {
        clip-path: ellipse(60% 60% at 50% 100%);
    }
}

/* ---- Hero Section ---- */
#hero {
    min-height: 100vh;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hero-title {
    opacity: 0;
    transform: translateY(30px);
    animation: bounceIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out 1.2s forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    80% {
        transform: translateY(4px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Ghost Mascot (Hero) ---- */
#hero-ghost {
    width: 140px;
    height: 180px;
    opacity: 0;
    animation: ghostAppear 1s ease-out 0.2s forwards;
}

.ghost-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 20px rgba(74, 72, 64, 0.1));
}

.ghost-arm {
    transform-origin: 105px 60px;
    animation: waveArm 2s ease-in-out infinite;
}

.ghost-hand {
    animation: waveHand 2s ease-in-out infinite;
}

@keyframes ghostAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes waveArm {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

@keyframes waveHand {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(-4px, -6px);
    }
    75% {
        transform: translate(4px, -3px);
    }
}

/* ---- Ghost Markers (Section Icons) ---- */
.ghost-marker {
    width: 80px;
    height: 100px;
    margin: 0 auto 30px;
    animation: gentleFloat 4s ease-in-out infinite;
}

.ghost-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(74, 72, 64, 0.08));
}

@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ---- Section Headings & Body ---- */
.section-heading {
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-body {
    max-width: 650px;
    margin: 0 auto 40px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

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

/* ---- Bubble Decorations ---- */
.bubble-cluster {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 30px;
}

.decorative-bubble {
    border-radius: 50%;
    border: 2px solid #B0A898;
    background: transparent;
    animation: bubbleFloat 5s ease-in-out infinite;
}

.bubble-sm {
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

.bubble-md {
    width: 40px;
    height: 40px;
    animation-delay: 0.5s;
}

.bubble-lg {
    width: 60px;
    height: 60px;
    animation-delay: 1s;
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

/* ---- Feature Cards ---- */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    position: relative;
    background: #E8E0D4;
    border-radius: 24px;
    padding: 40px 28px 32px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:nth-child(2) {
    transition-delay: 0.15s;
}

.feature-card:nth-child(3) {
    transition-delay: 0.3s;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(74, 72, 64, 0.1);
}

.card-bubble {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #A0B098;
    background: rgba(160, 176, 152, 0.15);
    margin: 0 auto 18px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-card:hover .card-bubble {
    transform: scale(1.15);
    background: rgba(160, 176, 152, 0.3);
}

.card-title {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    margin-bottom: 12px;
}

.card-body {
    font-size: clamp(0.88rem, 1.1vw, 1rem);
    line-height: 1.7;
    color: #6A6860;
}

/* ---- Phantom Gallery ---- */
.phantom-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 28px;
    margin-top: 40px;
}

.phantom-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: 24px;
    background: #F4F0E8;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.phantom-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.phantom-card:nth-child(2).visible { transition-delay: 0.1s; }
.phantom-card:nth-child(3).visible { transition-delay: 0.2s; }
.phantom-card:nth-child(4).visible { transition-delay: 0.3s; }

.phantom-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 16px 40px rgba(74, 72, 64, 0.12);
}

.phantom-card:hover .phantom-svg {
    animation: phantomWiggle 0.6s ease-in-out;
}

.phantom-svg {
    width: 100px;
    height: 130px;
    filter: drop-shadow(0 4px 10px rgba(74, 72, 64, 0.08));
}

.phantom-name {
    font-size: 1.1rem;
}

@keyframes phantomWiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-5deg);
    }
    40% {
        transform: rotate(5deg);
    }
    60% {
        transform: rotate(-3deg);
    }
    80% {
        transform: rotate(3deg);
    }
}

/* ---- Farewell Section ---- */
.farewell-content {
    padding-bottom: 60px;
}

.ghost-farewell {
    width: 100px;
    height: 130px;
}

.farewell-domain {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    margin-top: 30px;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.5s forwards;
}

/* ---- Floating Bubbles (Global) ---- */
#bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-bubble {
    position: absolute;
    border-radius: 50%;
    border: 2px solid #B0A898;
    background: transparent;
    animation: floatUp linear infinite;
    pointer-events: none;
}

.floating-bubble::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 30%;
    height: 20%;
    background: rgba(244, 240, 232, 0.4);
    border-radius: 50%;
    transform: rotate(-30deg);
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-120px) translateX(var(--drift, 30px)) scale(var(--end-scale, 0.8));
        opacity: 0;
    }
}

/* ---- Scroll-triggered section entrance ---- */
.section-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Hero content should always be visible (has its own animations) */
.hero-content {
    opacity: 1;
    transform: none;
}

.hero-content.in-view {
    opacity: 1;
    transform: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .section-content {
        width: 92%;
        padding: 60px 0;
    }

    .feature-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .phantom-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .morph-transition {
        height: 80px;
    }

    #hero-ghost {
        width: 110px;
        height: 140px;
    }
}

@media (max-width: 480px) {
    .phantom-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .phantom-svg {
        width: 80px;
        height: 104px;
    }

    .bubble-cluster {
        gap: 16px;
    }
}
