/* ============================================
   penclos.com — The Privacy Encloser
   Fairycore privacy aesthetic
   ============================================ */

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

:root {
    --deep-umber: #2d1b0e;
    --peach: #e8a87c;
    --dark-brown: #6b4226;
    --warm-brown: #8b5e3c;
    --burnt-sienna: #d4875e;
    --terra: #b85c2f;
    --cream: #faf5ee;
    --light-cream: #f5efe5;
    --parchment: #f0e4d4;
    --copper: #c96e3a;
    --shadow-brown: #4a3628;
}

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

body {
    font-family: 'Crimson Text', Georgia, serif;
    background-color: var(--cream);
    color: var(--deep-umber);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Scroll Progress Dots --- */
#scroll-progress {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--burnt-sienna);
    opacity: 0.25;
    transition: opacity 0.4s ease, transform 0.4s ease;
    cursor: pointer;
}

.progress-dot.active {
    opacity: 1;
    transform: scale(1.4);
}

/* --- Particles --- */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--peach);
    opacity: 0;
    animation: particle-drift 8s infinite ease-in-out;
}

@keyframes particle-drift {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    20% { opacity: 0.4; }
    80% { opacity: 0.2; }
    100% { opacity: 0; transform: translateY(-120px) scale(1.2); }
}

/* --- Panels --- */
.panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
    z-index: 2;
}

.panel-content {
    text-align: center;
    max-width: 680px;
    padding: 2rem;
    position: relative;
}

.panel-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.01em;
    color: var(--deep-umber);
    margin-bottom: 1rem;
    line-height: 1.15;
}

.panel-title em {
    font-style: italic;
    color: var(--copper);
}

.panel-subtitle {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--warm-brown);
    font-weight: 400;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}

.mono-text {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* --- Panel 1: Open Field --- */
#panel-open-field {
    background: linear-gradient(180deg, var(--cream) 0%, var(--parchment) 100%);
}

#data-fragments {
    position: relative;
    width: 360px;
    height: 200px;
    margin: 0 auto 2.5rem;
}

.data-fragment {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--burnt-sienna);
    background: rgba(232, 168, 124, 0.1);
    border: 1px solid rgba(212, 135, 94, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    animation: fragment-float 6s infinite ease-in-out;
    animation-delay: var(--delay);
    transform: translate(var(--x), var(--y));
}

@keyframes fragment-float {
    0%, 100% { transform: translate(var(--x), var(--y)); }
    50% { transform: translate(calc(var(--x) + 8px), calc(var(--y) - 12px)); }
}

.scroll-hint {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    animation: hint-pulse 2.5s infinite ease-in-out;
}

.scroll-hint-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-brown);
}

.scroll-arrow {
    color: var(--warm-brown);
    animation: arrow-bounce 2s infinite ease-in-out;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

@keyframes arrow-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- Panel 2: Gathering --- */
#panel-gathering {
    background: linear-gradient(180deg, var(--parchment) 0%, var(--cream) 50%, var(--parchment) 100%);
}

.bubble-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

.enclosure-bubble {
    display: block;
}

#gathering-bubble {
    width: 300px;
    height: 300px;
}

#gathering-bubble .enclosure-bubble {
    width: 300px;
    height: 300px;
}

.gathering-fragments .data-fragment {
    animation: gather-in 1.5s forwards ease-out;
    animation-delay: var(--delay);
}

/* --- Panel 3: Membrane --- */
#panel-membrane {
    background: radial-gradient(ellipse at center, rgba(232,168,124,0.06) 0%, var(--cream) 70%);
}

#membrane-bubble {
    width: 400px;
    height: 400px;
}

.membrane-svg {
    animation: membrane-pulse 4s infinite ease-in-out;
}

@keyframes membrane-pulse {
    0%, 100% { filter: url(#glow); opacity: 1; }
    50% { filter: url(#glow) brightness(1.05); opacity: 0.95; }
}

.membrane-label {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--copper);
    opacity: 0.6;
}

/* --- Panel 4: Enclosure --- */
#panel-enclosure {
    background: radial-gradient(ellipse at center, rgba(201,110,58,0.05) 0%, var(--cream) 60%);
}

#enclosure-bubble {
    width: 450px;
    height: 450px;
}

.enclosure-svg {
    animation: enclosure-breathe 5s infinite ease-in-out;
}

@keyframes enclosure-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.enclosed-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.enclosed-item {
    color: var(--burnt-sienna);
    opacity: 0.5;
    font-size: 0.75rem;
}

/* --- Panel 5: Garden --- */
#panel-garden {
    background: linear-gradient(180deg, var(--light-cream) 0%, var(--parchment) 60%, rgba(139,94,60,0.08) 100%);
    min-height: 100vh;
}

.garden-scene {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 2rem;
}

.garden-bubbles {
    position: relative;
    width: 100%;
    height: 100%;
}

.garden-bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 135, 94, 0.25);
    background: radial-gradient(circle at 35% 35%, rgba(250,245,238,0.15), rgba(232,168,124,0.08), transparent);
    animation: garden-float var(--duration) infinite ease-in-out;
    animation-delay: var(--delay);
}

@keyframes garden-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(var(--float-y, -15px)); }
}

.garden-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--peach) 30%, var(--burnt-sienna) 50%, var(--peach) 70%, transparent 100%);
    opacity: 0.2;
}

.garden-title {
    margin-bottom: 1.2rem;
}

.garden-sub {
    margin-bottom: 2.5rem;
}

.cta-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
}

.cta-label {
    color: var(--copper);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.cta-tagline {
    font-family: 'Crimson Text', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--shadow-brown);
    opacity: 0.7;
}

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

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

/* --- Responsive --- */
@media (max-width: 600px) {
    #data-fragments {
        width: 280px;
        height: 160px;
    }

    .data-fragment {
        font-size: 0.65rem;
    }

    #gathering-bubble,
    #gathering-bubble .enclosure-bubble {
        width: 220px;
        height: 220px;
    }

    #membrane-bubble {
        width: 280px;
        height: 280px;
    }

    #enclosure-bubble {
        width: 320px;
        height: 320px;
    }

    #scroll-progress {
        right: 12px;
    }
}
