/* ======================================================
   desca.work - Blobitecture Design System
   Colors: Membrane White #F7F3EE, Warm Clay #E8DDD0,
   Amber Glow #D4915E, Deep Loam #2C2418, Resin Teal #4A9E8E,
   Blush Fog #F0C6C6, Slate Umber #6B5D4E, Canopy Green #5B8C5A
   Fonts: Outfit (display), Nunito (body), IBM Plex Mono (accent)
   ====================================================== */

/* --- Custom Properties --- */
:root {
    --membrane-white: #F7F3EE;
    --warm-clay: #E8DDD0;
    --amber-glow: #D4915E;
    --deep-loam: #2C2418;
    --resin-teal: #4A9E8E;
    --blush-fog: #F0C6C6;
    --slate-umber: #6B5D4E;
    --canopy-green: #5B8C5A;
    --dark-bg: #1C1810;

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --breathe-duration: 8s;
    --reveal-duration: 500ms;
    --gutter: clamp(24px, 4vw, 64px);
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    :root {
        --membrane-white: #1C1810;
        --warm-clay: #2C2418;
        --deep-loam: #E8DDD0;
        --slate-umber: #B8A898;
        --blush-fog: #3D2A2A;
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.65;
    color: var(--deep-loam);
    background-color: var(--membrane-white);
    overflow-x: hidden;
    position: relative;
}

/* --- Dot Grid Background (Canvas) --- */
.dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Floating Spores --- */
.spores {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.spore {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}

.spore-1 { width: 6px; height: 6px; background: var(--amber-glow); top: 12%; left: 8%; animation: sporeDrift1 28s ease-in-out infinite; }
.spore-2 { width: 4px; height: 4px; background: var(--blush-fog); top: 25%; left: 85%; animation: sporeDrift2 34s ease-in-out infinite; }
.spore-3 { width: 7px; height: 7px; background: var(--amber-glow); top: 45%; left: 15%; animation: sporeDrift3 22s ease-in-out infinite; }
.spore-4 { width: 5px; height: 5px; background: var(--blush-fog); top: 60%; left: 72%; animation: sporeDrift4 30s ease-in-out infinite; }
.spore-5 { width: 8px; height: 8px; background: var(--amber-glow); top: 78%; left: 40%; animation: sporeDrift5 26s ease-in-out infinite; }
.spore-6 { width: 4px; height: 4px; background: var(--blush-fog); top: 90%; left: 92%; animation: sporeDrift6 38s ease-in-out infinite; }
.spore-7 { width: 6px; height: 6px; background: var(--amber-glow); top: 35%; left: 55%; animation: sporeDrift1 32s ease-in-out infinite reverse; }
.spore-8 { width: 5px; height: 5px; background: var(--blush-fog); top: 15%; left: 65%; animation: sporeDrift2 24s ease-in-out infinite reverse; }
.spore-9 { width: 7px; height: 7px; background: var(--amber-glow); top: 70%; left: 20%; animation: sporeDrift3 36s ease-in-out infinite; }
.spore-10 { width: 4px; height: 4px; background: var(--blush-fog); top: 50%; left: 90%; animation: sporeDrift4 20s ease-in-out infinite reverse; }
.spore-11 { width: 6px; height: 6px; background: var(--amber-glow); top: 85%; left: 60%; animation: sporeDrift5 40s ease-in-out infinite; }
.spore-12 { width: 5px; height: 5px; background: var(--blush-fog); top: 5%; left: 35%; animation: sporeDrift6 25s ease-in-out infinite reverse; }

@keyframes sporeDrift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -40px); }
    50% { transform: translate(-20px, -80px); }
    75% { transform: translate(50px, -30px); }
}

@keyframes sporeDrift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-40px, 20px); }
    50% { transform: translate(30px, -50px); }
    75% { transform: translate(-20px, 40px); }
}

@keyframes sporeDrift3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, 30px); }
    50% { transform: translate(-30px, -20px); }
    75% { transform: translate(20px, -60px); }
}

@keyframes sporeDrift4 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-20px, -50px); }
    50% { transform: translate(40px, 20px); }
    75% { transform: translate(-50px, -10px); }
}

@keyframes sporeDrift5 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(35px, 25px); }
    50% { transform: translate(-45px, -35px); }
    75% { transform: translate(15px, 55px); }
}

@keyframes sporeDrift6 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-25px, 45px); }
    50% { transform: translate(55px, -15px); }
    75% { transform: translate(-35px, -45px); }
}

/* --- Floating Pill Navigation --- */
.pill-nav {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(247, 243, 238, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 40px;
    box-shadow: 0 4px 24px rgba(44, 36, 24, 0.08);
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
}

.pill-nav:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 32px rgba(44, 36, 24, 0.14);
}

.pill-nav-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--slate-umber);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 24px;
    transition: background-color 250ms ease, color 250ms ease;
}

.pill-nav-link:hover {
    background-color: var(--blush-fog);
    color: var(--deep-loam);
}

/* --- Hero Zone --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

.hero-blob-wrapper {
    position: relative;
    width: clamp(300px, 60vw, 700px);
    height: clamp(240px, 45vw, 520px);
    opacity: 0;
    transform: scale(0.3);
}

.hero-blob-wrapper.animate-in {
    animation: blobInflate 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero-blob-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: blobBreathe var(--breathe-duration) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.hero-blob-path {
    filter: url(#resin-texture);
}

@keyframes blobInflate {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes blobBreathe {
    0%, 100% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    width: 90%;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    color: var(--deep-loam);
    white-space: nowrap;
    min-height: 1.2em;
}

.hero-title .accent-dot {
    color: var(--amber-glow);
    display: inline-block;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--slate-umber);
    margin-top: 16px;
    opacity: 0;
    transition: opacity 600ms ease;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* Hero Tendrils */
.hero-tendrils {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    z-index: 1;
    pointer-events: none;
}

.tendril {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 800ms ease-out;
}

.tendril.drawn {
    stroke-dashoffset: 0;
}

.tendril-1 { transition-delay: 0ms; }
.tendril-2 { transition-delay: 200ms; }
.tendril-3 { transition-delay: 400ms; }

/* --- Content Sections --- */
.content-section {
    position: relative;
    z-index: 2;
    padding: var(--gutter) var(--gutter);
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Blob Cards --- */
.blob-card {
    background: rgba(232, 221, 208, 0.6);
    background-image: radial-gradient(ellipse at 40% 35%, rgba(240, 198, 198, 0.15) 0%, transparent 70%);
    padding: clamp(28px, 4vw, 48px);
    position: relative;
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
    box-shadow: 0 4px 20px rgba(44, 36, 24, 0.06);
    margin-bottom: var(--gutter);
}

.blob-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(44, 36, 24, 0.12);
}

/* Unique blob shapes */
.blob-shape-1 { border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; }
.blob-shape-2 { border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%; }
.blob-shape-3 { border-radius: 45% 55% 60% 40% / 50% 50% 55% 45%; }
.blob-shape-4 { border-radius: 50% 50% 45% 55% / 60% 40% 50% 50%; }
.blob-shape-5 { border-radius: 60% 40% 50% 50% / 45% 55% 50% 50%; }
.blob-shape-6 { border-radius: 48% 52% 58% 42% / 52% 48% 44% 56%; }
.blob-shape-7 { border-radius: 52% 48% 42% 58% / 44% 56% 52% 48%; }
.blob-shape-8 { border-radius: 44% 56% 50% 50% / 56% 44% 48% 52%; }
.blob-shape-9 { border-radius: 56% 44% 48% 52% / 48% 52% 56% 44%; }

/* Reveal animation */
.reveal-card {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity var(--reveal-duration) ease-out, transform var(--reveal-duration) ease-out;
}

.reveal-card.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Blob breathing animations per card */
.blob-card.revealed {
    animation: cardBreathe 7s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

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

.blob-card.revealed:hover {
    animation: none;
    transform: scale(1.02);
}

/* --- Typography --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    color: var(--deep-loam);
    margin-bottom: 20px;
}

.accent-dot {
    color: var(--amber-glow);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    color: var(--deep-loam);
    margin-bottom: 12px;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.65;
    color: var(--deep-loam);
    margin-bottom: 12px;
}

.body-text:last-of-type {
    margin-bottom: 0;
}

.label-tag {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--slate-umber);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(232, 221, 208, 0.5);
    margin-top: 16px;
}

/* --- Text Links (underline-draw pattern) --- */
.text-link {
    color: var(--resin-teal);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.text-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--resin-teal);
    transition: width 300ms ease-out;
}

.text-link:hover::after {
    width: 100%;
}

/* --- Section Tendrils --- */
.section-tendril {
    display: block;
    width: 60px;
    height: 80px;
    margin: -10px auto 0;
    position: relative;
    z-index: 2;
}

.tendril-connector {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 800ms ease-out;
}

.tendril-connector.drawn {
    stroke-dashoffset: 0;
}

/* --- River Section (Work Decomposition) --- */
.river-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--deep-loam);
    text-align: center;
    margin-bottom: calc(var(--gutter) * 1.5);
}

.river-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.river-flow .blob-card {
    max-width: 680px;
    width: 100%;
}

.river-flow .blob-card:nth-child(odd) {
    align-self: flex-start;
}

.river-flow .blob-card:nth-child(even) {
    align-self: flex-end;
}

.river-tendril {
    width: 60px;
    height: 50px;
    margin: -8px auto;
    display: block;
    position: relative;
    z-index: 1;
}

/* --- Concepts Grid --- */
.concepts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gutter);
    position: relative;
}

.concepts-tendrils {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Footer Puddle --- */
.footer-puddle {
    position: relative;
    z-index: 2;
    margin-top: calc(var(--gutter) * 3);
    padding: calc(var(--gutter) * 2) var(--gutter);
    display: flex;
    justify-content: center;
}

.footer-blob {
    background: rgba(232, 221, 208, 0.6);
    background-image: radial-gradient(ellipse at 50% 40%, rgba(240, 198, 198, 0.12) 0%, transparent 70%);
    border-radius: 60% 40% 55% 45% / 40% 60% 45% 55%;
    padding: clamp(40px, 6vw, 80px);
    text-align: center;
    max-width: 700px;
    width: 100%;
    animation: footerBreathe 10s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    box-shadow: 0 4px 24px rgba(44, 36, 24, 0.06);
}

@keyframes footerBreathe {
    0%, 100% { transform: scale(0.98); border-radius: 60% 40% 55% 45% / 40% 60% 45% 55%; }
    50% { transform: scale(1.02); border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%; }
}

.footer-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    color: var(--deep-loam);
    margin-bottom: 16px;
}

.footer-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.65;
    color: var(--deep-loam);
    margin-bottom: 20px;
}

.footer-cta {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--amber-glow);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.footer-cta::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--amber-glow);
    transition: width 300ms ease-out;
}

.footer-cta:hover::after {
    width: 100%;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--slate-umber);
    margin-top: 32px;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .pill-nav {
        flex-direction: column;
        top: 16px;
        right: 16px;
        padding: 8px;
        gap: 2px;
        border-radius: 24px;
    }

    .pill-nav-link {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .blob-card {
        border-radius: 32px;
    }

    .blob-shape-1, .blob-shape-2, .blob-shape-3,
    .blob-shape-4, .blob-shape-5, .blob-shape-6,
    .blob-shape-7, .blob-shape-8, .blob-shape-9 {
        border-radius: 32px;
    }

    .concepts-grid {
        grid-template-columns: 1fr;
    }

    .river-flow .blob-card:nth-child(odd),
    .river-flow .blob-card:nth-child(even) {
        align-self: center;
    }

    .footer-blob {
        border-radius: 32px;
    }

    @keyframes footerBreathe {
        0%, 100% { transform: scale(0.98); border-radius: 32px; }
        50% { transform: scale(1.02); border-radius: 32px; }
    }

    .spore-7, .spore-8, .spore-9,
    .spore-10, .spore-11, .spore-12 {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-blob-wrapper {
        width: 85vw;
        height: 65vw;
    }

    .hero-title {
        font-size: clamp(1.6rem, 8vw, 2.5rem);
    }
}
