/* lungi.dev — Living Skin */

:root {
    --char: #1a0e08;
    --umber-dark: #2e2118;
    --warm-clay: #3d2e22;
    --smoked-amber: #5a3d28;
    --burnt-ember: #d4763a;
    --molten-core: #e8923e;
    --parchment: #f2e0cc;
    --dusty-tan: #c4a882;
    --ember-haze: #d4763a33;
    --shadow-deep: #0d0704;

    --blob-radius-1: 50% 40% 60% 50% / 55% 45% 55% 45%;
    --blob-radius-2: 45% 55% 50% 50% / 50% 60% 40% 55%;
    --blob-radius-3: 55% 45% 45% 55% / 60% 40% 50% 50%;
    --blob-radius-4: 40% 60% 55% 45% / 45% 55% 60% 40%;

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--char);
    font-family: 'DM Sans', sans-serif;
    color: var(--parchment);
    overflow-x: hidden;
    animation: reveal 1.5s 0.6s ease-out both;
}

@keyframes reveal {
    from {
        background: var(--char);
    }
    to {
        background: var(--umber-dark);
    }
}

/* Textile Weave Overlay */
.textile-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        repeating-linear-gradient(45deg, #d4763a0a 0px, transparent 1px, transparent 12px),
        repeating-linear-gradient(-45deg, #d4763a0a 0px, transparent 1px, transparent 12px);
    opacity: 0;
    animation: fadeIn 2s 1.5s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Spores */
.spores {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.spore {
    position: absolute;
    border-radius: 50%;
    background: var(--burnt-ember);
    opacity: 0.15;
    box-shadow: 0 0 12px var(--ember-haze);
}

.spore-1 { width: 24px; height: 24px; top: 15%; left: 10%; animation: drift1 25s infinite linear; }
.spore-2 { width: 40px; height: 40px; top: 30%; left: 70%; animation: drift2 35s infinite linear; }
.spore-3 { width: 18px; height: 18px; top: 60%; left: 25%; animation: drift3 30s infinite linear; }
.spore-4 { width: 32px; height: 32px; top: 75%; left: 80%; animation: drift4 40s infinite linear; }
.spore-5 { width: 22px; height: 22px; top: 45%; left: 50%; animation: drift5 28s infinite linear; }
.spore-6 { width: 50px; height: 50px; top: 20%; left: 85%; animation: drift1 45s infinite linear reverse; }
.spore-7 { width: 16px; height: 16px; top: 85%; left: 40%; animation: drift3 22s infinite linear reverse; }
.spore-8 { width: 28px; height: 28px; top: 50%; left: 15%; animation: drift2 38s infinite linear; }

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

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

@keyframes drift3 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(50px, -30px); }
    66% { transform: translate(-30px, 40px); }
    100% { transform: translate(0, 0); }
}

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

@keyframes drift5 {
    0% { transform: translate(0, 0); }
    20% { transform: translate(25px, 40px); }
    40% { transform: translate(-35px, 20px); }
    60% { transform: translate(-15px, -40px); }
    80% { transform: translate(40px, -20px); }
    100% { transform: translate(0, 0); }
}

/* Ember Veins */
.ember-veins {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
}

.vein {
    fill: none;
    stroke: var(--burnt-ember);
    stroke-width: 1.5;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    opacity: 0.4;
}

.vein.visible {
    animation: veinGrow 4s ease-out forwards;
}

@keyframes veinGrow {
    to { stroke-dashoffset: 0; }
}

/* Territory Sections */
.territory {
    position: relative;
    z-index: 4;
}

.emergence {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weave {
    min-height: 150vh;
    padding: 10vh 5vw;
    position: relative;
}

.silence {
    height: 70vh;
}

.fold {
    min-height: 120vh;
    padding: 10vh 5vw;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4vw;
}

.root {
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Blob Base */
.blob {
    border-radius: var(--blob-radius-1);
    padding: clamp(2rem, 4vw, 4rem);
    transition: border-radius 500ms var(--morph-ease),
                box-shadow 400ms var(--morph-ease),
                transform 150ms ease,
                background 400ms ease;
    animation: breathe 10s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { border-radius: var(--blob-radius-1); }
    25% { border-radius: var(--blob-radius-2); }
    50% { border-radius: var(--blob-radius-3); }
    75% { border-radius: var(--blob-radius-4); }
}

.blob:hover {
    box-shadow: 12px 12px 20px var(--shadow-deep), -12px -12px 20px var(--warm-clay);
    background: var(--warm-clay);
}

.blob:active {
    transform: scale(0.97);
    box-shadow: inset 6px 6px 12px var(--shadow-deep), inset -6px -6px 12px var(--warm-clay);
}

/* Hero Blob */
.blob-hero {
    background: var(--warm-clay);
    box-shadow: 8px 8px 16px var(--shadow-deep), -8px -8px 16px var(--warm-clay);
    max-width: 600px;
    text-align: center;
    animation-duration: 12s;
}

.title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    color: var(--parchment);
    margin-bottom: 1rem;
}

.subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--dusty-tan);
    line-height: 1.6;
}

/* Weave Blobs */
.blob-weave-1,
.blob-weave-2,
.blob-weave-3 {
    background: var(--warm-clay);
    box-shadow: 8px 8px 16px var(--shadow-deep), -8px -8px 16px var(--warm-clay);
    max-width: 420px;
}

.blob-weave-1 {
    margin-left: 5%;
    animation-duration: 9s;
    animation-delay: 0s;
}

.blob-weave-2 {
    margin-left: 30%;
    margin-top: -5vh;
    animation-duration: 11s;
    animation-delay: -3s;
}

.blob-weave-3 {
    margin-left: 55%;
    margin-top: -3vh;
    animation-duration: 13s;
    animation-delay: -6s;
}

.blob h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--parchment);
    margin-bottom: 0.8rem;
}

.blob p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--dusty-tan);
    line-height: 1.7;
}

/* Shadow Pools */
.shadow-pool {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, #1a0e0880, transparent 70%);
    pointer-events: none;
}

.shadow-pool-1 {
    width: 300px;
    height: 200px;
    top: 35%;
    left: 20%;
}

.shadow-pool-2 {
    width: 250px;
    height: 180px;
    top: 55%;
    left: 50%;
}

/* Fold Blobs */
.blob-fold-convex {
    background: var(--warm-clay);
    box-shadow: 8px 8px 16px var(--shadow-deep), -8px -8px 16px var(--warm-clay);
    flex: 1;
    min-width: 280px;
    max-width: 520px;
    animation-duration: 14s;
}

.blob-fold-concave {
    background: var(--umber-dark);
    box-shadow: inset 6px 6px 12px var(--shadow-deep), inset -6px -6px 12px var(--warm-clay);
    flex: 1;
    min-width: 280px;
    max-width: 520px;
    animation-duration: 11s;
    animation-delay: -4s;
}

.blob-fold-concave:hover {
    box-shadow: inset 4px 4px 8px var(--shadow-deep), inset -4px -4px 8px var(--smoked-amber);
    background: var(--umber-dark);
}

/* Root */
.blob-root {
    background: var(--umber-dark);
    box-shadow: inset 6px 6px 12px var(--shadow-deep), inset -6px -6px 12px var(--warm-clay);
    text-align: center;
    padding: 3rem 4rem;
    animation-duration: 15s;
}

.root-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-variant: small-caps;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--dusty-tan);
    letter-spacing: 0.15em;
}

.root-sub {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--smoked-amber);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .fold {
        flex-direction: column;
        align-items: stretch;
    }

    .blob-weave-1,
    .blob-weave-2,
    .blob-weave-3 {
        margin-left: 5%;
        max-width: 90%;
    }
}
