/* ============================================================
   xity.dev -- Blobitecture Fluid Layout
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --bubble-milk: #F0ECE3;
    --deep-membrane: #2D3142;
    --inflated-coral: #F4845F;
    --mint-pressure: #6EC6CA;
    --violet-pneuma: #9B72CF;
    --stretched-cream: #FAF3E0;
    --bioluminescent: #C6F7D0;
    --subsurface: #1B1F2E;

    --font-display: 'Nunito', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-accent: 'Syne', sans-serif;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bubble-milk);
    color: var(--deep-membrane);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================
   FLOATING BLOB PARTICLES (Ambient Layer)
   ============================================================ */
#blob-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

/* Each particle has unique size, position, color, and timing */
.p1  { width: 35px; height: 35px; background: rgba(244,132,95,0.15); top: 8%;  left: 12%; animation: floatX 11s ease-in-out infinite, floatY 17s ease-in-out infinite; }
.p2  { width: 18px; height: 18px; background: rgba(110,198,202,0.20); top: 15%; left: 75%; animation: floatX 13s ease-in-out infinite, floatY 19s ease-in-out infinite; }
.p3  { width: 40px; height: 40px; background: rgba(155,114,207,0.12); top: 25%; left: 40%; animation: floatX 7s ease-in-out infinite, floatY 13s ease-in-out infinite; }
.p4  { width: 12px; height: 12px; background: rgba(198,247,208,0.25); top: 35%; left: 88%; animation: floatX 17s ease-in-out infinite, floatY 11s ease-in-out infinite; }
.p5  { width: 28px; height: 28px; background: rgba(244,132,95,0.15); top: 45%; left: 5%;  animation: floatX 19s ease-in-out infinite, floatY 7s ease-in-out infinite; }
.p6  { width: 22px; height: 22px; background: rgba(110,198,202,0.20); top: 55%; left: 60%; animation: floatX 11s ease-in-out infinite, floatY 19s ease-in-out infinite; }
.p7  { width: 8px;  height: 8px;  background: rgba(155,114,207,0.12); top: 65%; left: 30%; animation: floatX 13s ease-in-out infinite, floatY 7s ease-in-out infinite; }
.p8  { width: 30px; height: 30px; background: rgba(198,247,208,0.25); top: 72%; left: 92%; animation: floatX 7s ease-in-out infinite, floatY 17s ease-in-out infinite; }
.p9  { width: 15px; height: 15px; background: rgba(244,132,95,0.15); top: 80%; left: 18%; animation: floatX 19s ease-in-out infinite, floatY 13s ease-in-out infinite; }
.p10 { width: 25px; height: 25px; background: rgba(110,198,202,0.20); top: 10%; left: 50%; animation: floatX 17s ease-in-out infinite, floatY 11s ease-in-out infinite; }
.p11 { width: 20px; height: 20px; background: rgba(155,114,207,0.12); top: 90%; left: 65%; animation: floatX 11s ease-in-out infinite, floatY 7s ease-in-out infinite; }
.p12 { width: 10px; height: 10px; background: rgba(198,247,208,0.25); top: 50%; left: 35%; animation: floatX 13s ease-in-out infinite, floatY 19s ease-in-out infinite; }
.p13 { width: 32px; height: 32px; background: rgba(244,132,95,0.15); top: 20%; left: 85%; animation: floatX 7s ease-in-out infinite, floatY 11s ease-in-out infinite; }
.p14 { width: 14px; height: 14px; background: rgba(110,198,202,0.20); top: 40%; left: 22%; animation: floatX 19s ease-in-out infinite, floatY 17s ease-in-out infinite; }
.p15 { width: 38px; height: 38px; background: rgba(155,114,207,0.12); top: 60%; left: 48%; animation: floatX 11s ease-in-out infinite, floatY 13s ease-in-out infinite; }
.p16 { width: 16px; height: 16px; background: rgba(198,247,208,0.25); top: 85%; left: 8%;  animation: floatX 17s ease-in-out infinite, floatY 7s ease-in-out infinite; }
.p17 { width: 24px; height: 24px; background: rgba(244,132,95,0.15); top: 30%; left: 95%; animation: floatX 13s ease-in-out infinite, floatY 19s ease-in-out infinite; }
.p18 { width: 20px; height: 20px; background: rgba(110,198,202,0.20); top: 75%; left: 55%; animation: floatX 7s ease-in-out infinite, floatY 11s ease-in-out infinite; }

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

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

/* ============================================================
   PILL NAVIGATION
   ============================================================ */
#pill-nav {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.6rem;
    z-index: 100;
}

.pill {
    background: var(--stretched-cream);
    border: 2px solid var(--deep-membrane);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.4s var(--spring-ease), background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pill-label {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--deep-membrane);
    text-transform: lowercase;
    transition: color 0.3s ease;
}

.pill-sub {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--violet-pneuma);
    opacity: 0;
    max-height: 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.pill:hover {
    transform: scale(1.3);
    background: var(--inflated-coral);
    border-color: var(--inflated-coral);
}

.pill:hover .pill-label {
    color: #fff;
}

.pill:hover .pill-sub {
    opacity: 1;
    max-height: 1.5rem;
    color: var(--stretched-cream);
}

/* ============================================================
   ZONES (General)
   ============================================================ */
.zone {
    position: relative;
    z-index: 1;
}

/* ============================================================
   CANOPY ZONE
   ============================================================ */
#canopy {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
}

/* --- Hero Morphing Blob --- */
#hero-blob {
    background: var(--stretched-cream);
    border: 2px solid var(--deep-membrane);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 5rem;
    position: relative;
    z-index: 5;
    animation: blobMorph 12s ease-in-out infinite;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: 0 12px 60px rgba(27,31,46,0.08);
    min-width: 320px;
    min-height: 200px;
}

@keyframes blobMorph {
    0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25%  { border-radius: 58% 42% 36% 64% / 49% 66% 34% 51%; }
    50%  { border-radius: 42% 58% 64% 36% / 66% 34% 66% 34%; }
    75%  { border-radius: 64% 36% 42% 58% / 34% 51% 49% 66%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

#hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 10vw, 9rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--deep-membrane);
    white-space: nowrap;
}

/* --- Satellite Blobs --- */
#satellite-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 4;
}

.satellite {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--stretched-cream);
    border: 2px solid var(--deep-membrane);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    transform-origin: 0 0;
}

.sat-icon {
    color: var(--inflated-coral);
}

.sat-word {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--deep-membrane);
}

/* Prime-number orbital animations */
.sat-1 { animation: orbit1 18s linear infinite; }
.sat-2 { animation: orbit2 23s linear infinite; }
.sat-3 { animation: orbit3 29s linear infinite; }
.sat-4 { animation: orbit4 31s linear infinite; }
.sat-5 { animation: orbit5 37s linear infinite; }
.sat-6 { animation: orbit6 41s linear infinite; }

@keyframes orbit1 {
    from { transform: rotate(0deg)   translateX(min(12vw, 180px)) rotate(0deg);   }
    to   { transform: rotate(360deg) translateX(min(12vw, 180px)) rotate(-360deg); }
}
@keyframes orbit2 {
    from { transform: rotate(60deg)  translateX(min(14vw, 210px)) rotate(-60deg);  }
    to   { transform: rotate(420deg) translateX(min(14vw, 210px)) rotate(-420deg); }
}
@keyframes orbit3 {
    from { transform: rotate(120deg) translateX(min(16vw, 240px)) rotate(-120deg); }
    to   { transform: rotate(480deg) translateX(min(16vw, 240px)) rotate(-480deg); }
}
@keyframes orbit4 {
    from { transform: rotate(180deg) translateX(min(13vw, 195px)) rotate(-180deg); }
    to   { transform: rotate(540deg) translateX(min(13vw, 195px)) rotate(-540deg); }
}
@keyframes orbit5 {
    from { transform: rotate(240deg) translateX(min(15vw, 225px)) rotate(-240deg); }
    to   { transform: rotate(600deg) translateX(min(15vw, 225px)) rotate(-600deg); }
}
@keyframes orbit6 {
    from { transform: rotate(300deg) translateX(min(11vw, 165px)) rotate(-300deg); }
    to   { transform: rotate(660deg) translateX(min(11vw, 165px)) rotate(-660deg); }
}

/* --- Blob City Skyline --- */
#skyline-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    line-height: 0;
}

#blob-skyline {
    width: 100%;
    height: auto;
    display: block;
}

.skyline-building {
    transform-origin: center bottom;
}

.b1  { animation: buildingBreathe 4s ease-in-out infinite; }
.b2  { animation: buildingBreathe 5s ease-in-out 0.3s infinite; }
.b3  { animation: buildingBreathe 3.5s ease-in-out 0.8s infinite; }
.b4  { animation: buildingBreathe 6s ease-in-out 1.2s infinite; }
.b5  { animation: buildingBreathe 4.5s ease-in-out 0.5s infinite; }
.b6  { animation: buildingBreathe 5.5s ease-in-out 1.5s infinite; }
.b7  { animation: buildingBreathe 3.8s ease-in-out 2s infinite; }
.b8  { animation: buildingBreathe 4.8s ease-in-out 0.7s infinite; }
.b9  { animation: buildingBreathe 5.2s ease-in-out 1.8s infinite; }
.b10 { animation: buildingBreathe 4.2s ease-in-out 2.5s infinite; }

@keyframes buildingBreathe {
    0%, 100% { transform: scaleY(1); }
    50%      { transform: scaleY(1.02); }
}

/* ============================================================
   DISTRICT GRID ZONE
   ============================================================ */
#district {
    position: relative;
    padding: 8rem 2rem 6rem;
    min-height: 100vh;
}

#contour-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#district-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    align-items: flex-start;
}

/* --- Content Blobs --- */
.content-blob {
    background: var(--stretched-cream);
    border: 2px solid var(--deep-membrane);
    padding: 2.5rem 2rem;
    position: relative;
    transition: transform 0.4s var(--spring-ease),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    opacity: 0;
    transform: scale(0);
    box-shadow: 0 8px 32px rgba(27,31,46,0.08);
    max-width: 360px;
    width: 100%;
}

.content-blob.visible {
    opacity: 1;
    transform: scale(1);
}

.content-blob:hover {
    transform: scale(1.03);
    border-color: var(--inflated-coral);
    box-shadow: 0 8px 32px rgba(198,247,208,0.3);
}

.content-blob h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--deep-membrane);
}

.content-blob p {
    color: var(--deep-membrane);
    line-height: 1.65;
}

/* No two containers share the same shape */
.blob-shape-1 { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
.blob-shape-2 { border-radius: 58% 42% 36% 64% / 49% 66% 34% 51%; }
.blob-shape-3 { border-radius: 42% 58% 64% 36% / 66% 49% 51% 34%; }
.blob-shape-4 { border-radius: 64% 36% 58% 42% / 34% 51% 66% 49%; }
.blob-shape-5 { border-radius: 36% 64% 42% 58% / 51% 34% 49% 66%; }
.blob-shape-6 { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
.blob-shape-7 { border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%; }

/* Pulse-attention animation for the CTA-like blob */
.pulse-blob {
    animation: pulseAttention 2s ease-in-out infinite;
}

.pulse-blob.visible {
    animation: pulseAttention 2s ease-in-out infinite;
}

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

.pulse-blob:hover {
    animation: none;
    transform: scale(1.08);
    border-color: var(--inflated-coral);
    background: var(--inflated-coral);
    cursor: pointer;
}

.pulse-blob:hover h2,
.pulse-blob:hover p {
    color: #fff;
}

/* ============================================================
   SUBSTRATE ZONE
   ============================================================ */
#substrate {
    position: relative;
    min-height: 60vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

#substrate-mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(110,198,202,0.10) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 60%, rgba(155,114,207,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 70% 40% at 50% 80%, rgba(198,247,208,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 70% at 70% 20%, rgba(244,132,95,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 55% 55% at 30% 70%, rgba(155,114,207,0.05) 0%, transparent 70%);
    background-size: 200% 200%;
    animation: meshShimmer 20s ease-in-out infinite;
}

@keyframes meshShimmer {
    0%   { background-position: 0% 0%; }
    25%  { background-position: 50% 30%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50% 80%; }
    100% { background-position: 0% 0%; }
}

#substrate-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.substrate-blob {
    background: rgba(250,243,224,0.6);
    border: 1.5px solid rgba(45,49,66,0.15);
    border-radius: 58% 42% 42% 58% / 42% 58% 42% 58%;
    padding: 3rem 2.5rem;
    max-width: 500px;
    margin: 0 auto 3rem;
}

.substrate-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--deep-membrane);
    line-height: 1.65;
    opacity: 0.8;
}

.substrate-domain {
    position: relative;
}

.domain-echo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--deep-membrane);
    opacity: 0.08;
}

/* ============================================================
   SCROLL POSITION INDICATOR BLOB
   ============================================================ */
#scroll-indicator {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--mint-pressure);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: background-color 0.5s ease;
    box-shadow: 0 4px 16px rgba(27,31,46,0.12);
}

#zone-label {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    #pill-nav {
        top: 1rem;
        right: 1rem;
        gap: 0.4rem;
    }

    .pill {
        padding: 0.3rem 0.7rem;
    }

    .pill-label {
        font-size: 0.75rem;
    }

    #hero-blob {
        padding: 2rem 2.5rem;
        min-width: 260px;
        min-height: 150px;
    }

    .satellite {
        width: 55px;
        height: 55px;
    }

    .sat-word {
        font-size: 0.45rem;
    }

    .sat-icon {
        width: 14px;
        height: 14px;
    }

    #district-content {
        gap: 1.5rem;
    }

    .content-blob {
        padding: 2rem 1.5rem;
        max-width: 320px;
    }

    #scroll-indicator {
        bottom: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
    }

    #zone-label {
        font-size: 0.38rem;
    }
}

@media (max-width: 480px) {
    .satellite {
        width: 45px;
        height: 45px;
    }

    .sat-icon {
        width: 12px;
        height: 12px;
    }

    .sat-word {
        font-size: 0.4rem;
    }

    .content-blob {
        max-width: 100%;
    }
}
