/* === CSS Custom Properties === */
:root {
    --blob-deep: #1a2a40;
    --blob-core: #4a7fa5;
    --blob-surface: #d8e8f4;
    --blob-ambient: #eef4f9;
    --blob-nucleus: #d4933a;
    --blob-shadow: #0e1a2b;
    --blob-grain: #8a9aad;
    --blob-text: #2a3b52;
    --blob-warm-bg: #f4f0e9;
    --scroll: 0;
}

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--blob-text);
    background: linear-gradient(to bottom, var(--blob-ambient) 0%, var(--blob-warm-bg) 100%);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === SVG Defs (hidden) === */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* === Film Grain Overlay === */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.12;
    mix-blend-mode: multiply;
}

/* === Parametric Grid === */
#parametric-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    perspective: 800px;
    overflow: hidden;
}

#parametric-grid::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -25%;
    width: 150%;
    height: 200%;
    background-image:
        linear-gradient(rgba(74, 127, 165, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 127, 165, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(60deg);
    transform-origin: center center;
}

/* === Scroll Progress Indicator === */
#scroll-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#scroll-indicator:hover {
    transform: scale(1.15);
}

#scroll-indicator svg {
    width: 100%;
    height: 100%;
}

#indicator-fill {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease;
}

/* === Floating Micro-Lumps === */
.micro-lump {
    position: fixed;
    border-radius: 50% 40% 55% 45% / 45% 55% 40% 50%;
    background: var(--blob-core);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    animation: float-lump 8s ease-in-out infinite;
}

@keyframes float-lump {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(5deg); }
}

/* === Panel Base === */
.panel {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: layout style paint;
}

/* === Vignette === */
.panel-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(14, 26, 43, 0.25) 100%);
    pointer-events: none;
    z-index: 5;
}

/* === Background Blob Layer (midground/background decorative) === */
.blob-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* === Hero Blob === */
.hero-blob {
    position: absolute;
    width: 70vw;
    height: 60vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2;
    animation: blob-materialize 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

.hero-blob-inner {
    width: 100%;
    height: 100%;
    border-radius: 40% 60% 55% 45% / 60% 40% 45% 55%;
    background: radial-gradient(ellipse at 40% 40%, var(--blob-core), var(--blob-deep));
    filter: sepia(0.12) saturate(0.85) contrast(1.05);
    box-shadow: 0 40px 100px rgba(14, 26, 43, 0.4);
}

@keyframes blob-materialize {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* === Closing Blob === */
.closing-blob {
    width: 60vw;
    height: 50vh;
    animation-delay: 0s;
    animation-fill-mode: none;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
}

.closing-inner {
    background: radial-gradient(ellipse at 60% 60%, var(--blob-nucleus), var(--blob-deep));
}

/* === Hero Text === */
.hero-text {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    animation: hero-text-in 0.8s ease-out 1.5s forwards;
}

#hero-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--blob-ambient);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.3em;
    text-shadow: 0 4px 30px rgba(14, 26, 43, 0.5);
}

.subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--blob-surface);
    letter-spacing: 0.05em;
    min-height: 1.5em;
}

@keyframes hero-text-in {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* === Content Blobs === */
.content-blob {
    position: relative;
    z-index: 10;
    max-width: 520px;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
    transform: translateY(30px);
}

.content-blob.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.content-left {
    margin-right: auto;
    margin-left: 8vw;
}

.content-right {
    margin-left: auto;
    margin-right: 8vw;
}

.content-center {
    margin: 0 auto;
    text-align: center;
}

/* === Blob Container (text wrapper) === */
.blob-container {
    background: rgba(216, 232, 244, 0.55);
    backdrop-filter: blur(2px);
    border-radius: 40% 60% 55% 45% / 60% 40% 45% 55%;
    padding: clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4rem);
    border: 1.5px solid rgba(74, 127, 165, 0.25);
    box-shadow: 0 20px 60px rgba(14, 26, 43, 0.15);
    filter: sepia(0.12) saturate(0.85) contrast(1.05);
}

.blob-container h2 {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--blob-deep);
    letter-spacing: -0.03em;
    margin-bottom: 0.6em;
    line-height: 1.15;
}

.blob-container p {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    max-width: 38ch;
    margin-bottom: 1em;
    line-height: 1.7;
}

.blob-container code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    background: rgba(180, 210, 235, 0.25);
    border-radius: 20px;
    padding: 0.15em 0.6em;
    color: var(--blob-deep);
}

/* === Code Blob === */
.code-blob {
    background: rgba(26, 42, 64, 0.9);
    border-radius: 35% 50% 45% 55% / 50% 40% 55% 45%;
    padding: 1.5rem 2rem;
    margin: 1.2em 0;
}

.code-blob code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--blob-surface);
    background: none;
    padding: 0;
    display: block;
    line-height: 2;
}

/* === Blob List === */
.blob-list {
    list-style: none;
    margin: 1em 0;
}

.blob-list li {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-bottom: 0.6em;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
}

.list-blob {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--blob-nucleus);
    border-radius: 50% 40% 55% 45%;
    flex-shrink: 0;
}

/* === Accent Blobs (large decorative) === */
.accent-blob {
    position: absolute;
    z-index: 3;
    border-radius: 45% 55% 50% 50% / 55% 45% 50% 50%;
    filter: sepia(0.12) saturate(0.85) contrast(1.05);
    opacity: 0;
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.accent-blob.revealed {
    opacity: 1;
}

.ab-right {
    width: 45vw;
    height: 55vh;
    right: -5vw;
    top: 15%;
    background: radial-gradient(ellipse at 30% 40%, var(--blob-core), var(--blob-deep));
    opacity: 0;
    filter: blur(4px);
}

.ab-right.revealed {
    opacity: 0.35;
    filter: blur(4px);
}

.ab-left {
    width: 40vw;
    height: 50vh;
    left: -5vw;
    top: 20%;
    background: radial-gradient(ellipse at 70% 50%, var(--blob-surface), var(--blob-core));
    border-radius: 55% 45% 48% 52% / 50% 55% 45% 50%;
    opacity: 0;
    filter: blur(4px);
}

.ab-left.revealed {
    opacity: 0.3;
    filter: blur(4px);
}

.ab-right-alt {
    width: 50vw;
    height: 45vh;
    right: -8vw;
    top: 25%;
    background: radial-gradient(ellipse at 40% 60%, var(--blob-deep), var(--blob-shadow));
    border-radius: 50% 50% 42% 58% / 48% 55% 45% 52%;
    opacity: 0;
    filter: blur(6px);
}

.ab-right-alt.revealed {
    opacity: 0.25;
    filter: blur(6px);
}

.ab-left-alt {
    width: 42vw;
    height: 52vh;
    left: -6vw;
    top: 18%;
    background: radial-gradient(ellipse at 55% 45%, var(--blob-core), var(--blob-deep));
    border-radius: 48% 52% 55% 45% / 52% 48% 50% 50%;
    opacity: 0;
    filter: blur(5px);
}

.ab-left-alt.revealed {
    opacity: 0.3;
    filter: blur(5px);
}

/* === Decorative Blobs === */
.decorative-blob {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    filter: sepia(0.12) saturate(0.85) contrast(1.05);
}

.db-1 {
    width: 15vw;
    height: 15vw;
    top: 10%;
    right: 8%;
    background: radial-gradient(var(--blob-surface), var(--blob-core));
    border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%;
    opacity: 0.15;
    filter: blur(12px);
}

.db-2 {
    width: 10vw;
    height: 10vw;
    bottom: 15%;
    left: 12%;
    background: var(--blob-core);
    border-radius: 50% 45% 55% 50% / 55% 50% 45% 50%;
    opacity: 0.1;
    filter: blur(10px);
}

.db-3 {
    width: 8vw;
    height: 8vw;
    top: 8%;
    right: 15%;
    background: var(--blob-surface);
    border-radius: 50% 55% 45% 50%;
    opacity: 0.2;
    filter: blur(8px);
}

.db-4 {
    width: 12vw;
    height: 12vw;
    bottom: 10%;
    left: 5%;
    background: radial-gradient(var(--blob-core), var(--blob-deep));
    border-radius: 45% 55% 50% 50%;
    opacity: 0.12;
    filter: blur(14px);
}

.db-5 {
    width: 18vw;
    height: 18vw;
    top: 5%;
    left: 10%;
    background: var(--blob-surface);
    border-radius: 52% 48% 55% 45% / 48% 52% 45% 55%;
    opacity: 0.1;
    filter: blur(16px);
}

.db-6 {
    width: 14vw;
    height: 14vw;
    bottom: 8%;
    right: 5%;
    background: radial-gradient(var(--blob-nucleus), var(--blob-core));
    border-radius: 48% 52% 50% 50%;
    opacity: 0.08;
    filter: blur(12px);
}

.db-7 {
    width: 6vw;
    height: 6vw;
    top: 20%;
    right: 30%;
    background: var(--blob-nucleus);
    border-radius: 50% 45% 55% 50%;
    opacity: 0.1;
    filter: blur(6px);
}

.db-8 {
    width: 20vw;
    height: 20vw;
    top: -5%;
    right: -3%;
    background: radial-gradient(var(--blob-deep), var(--blob-shadow));
    border-radius: 55% 45% 48% 52%;
    opacity: 0.08;
    filter: blur(18px);
}

.db-9 {
    width: 12vw;
    height: 12vw;
    top: 15%;
    left: 8%;
    background: var(--blob-nucleus);
    border-radius: 50% 45% 55% 50%;
    opacity: 0.12;
    filter: blur(10px);
}

.db-10 {
    width: 8vw;
    height: 8vw;
    bottom: 20%;
    right: 12%;
    background: var(--blob-core);
    border-radius: 48% 52% 45% 55%;
    opacity: 0.15;
    filter: blur(8px);
}

/* === SVG Path Accents === */
.path-accent {
    position: absolute;
    width: 35vw;
    height: auto;
    z-index: 4;
    pointer-events: none;
    bottom: 10%;
    left: 30%;
}

.path-accent path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.5s ease-out;
}

.path-accent.drawn path {
    stroke-dashoffset: 0;
}

.pa-2 {
    top: 12%;
    right: 5%;
    left: auto;
    width: 30vw;
}

.pa-3 {
    bottom: 15%;
    left: 10%;
    width: 32vw;
}

/* === Blob CTA === */
.blob-cta {
    display: inline-block;
    margin-top: 1em;
    padding: 1em 2.5em;
    background: var(--blob-nucleus);
    color: var(--blob-ambient);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    text-decoration: none;
    border-radius: 50% 45% 55% 50% / 55% 50% 45% 50%;
    border: none;
    box-shadow: 0 10px 40px rgba(212, 147, 58, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.blob-cta:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 50px rgba(212, 147, 58, 0.5);
}

/* === Closing Panel === */
.closing-container {
    text-align: center;
}

.closing-container p {
    max-width: 42ch;
    margin-left: auto;
    margin-right: auto;
}

/* === Blob Breathing (scroll-driven) === */
.blob-breathe {
    transition: transform 0.1s linear;
}

/* === Responsive === */
@media (max-width: 768px) {
    .content-left,
    .content-right {
        margin: 0 5vw;
        max-width: 90vw;
    }

    .blob-container {
        border-radius: 30% 40% 35% 45% / 40% 35% 45% 35%;
        padding: 2rem 1.8rem;
    }

    .accent-blob {
        display: none;
    }

    .hero-blob {
        width: 90vw;
        height: 50vh;
    }

    #scroll-indicator {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .path-accent {
        display: none;
    }
}
