/* ============================================================
   domain - Blobitecture Knowledge Organism
   Color Palette:
     #FFF8F0 - Warm Cream (Primary Ground)
     #F5E6E0 - Blush Mist (Secondary Ground)
     #C9A0A0 - Dusty Rose (Accent Primary)
     #A8C0B0 - Sage Frost (Accent Secondary)
     #2D2A32 - Deep Charcoal (Scholarly Ink)
     #5C5665 - Warm Graphite (Scholarly Mid)
     #D4B896 - Antique Gold (Highlight)
     #8B7B8E - Muted Plum (Depth Shadow)
   ============================================================ */

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

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

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.75;
    color: #2D2A32;
    background: linear-gradient(180deg, #FFF8F0 0%, #F5E6E0 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Background Orbs --- */
#bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
}

.orb-rose {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(201, 160, 160, 0.18) 0%, transparent 70%);
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    animation: orbDrift1 40s ease-in-out infinite;
}

.orb-sage {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(168, 192, 176, 0.15) 0%, transparent 70%);
    top: 20%;
    right: -10%;
    animation: orbDrift2 35s ease-in-out infinite;
}

.orb-gold {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(212, 184, 150, 0.12) 0%, transparent 70%);
    top: 50%;
    left: -5%;
    animation: orbDrift3 45s ease-in-out infinite;
}

.orb-plum {
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(139, 123, 142, 0.10) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation: orbDrift4 38s ease-in-out infinite;
}

@keyframes orbDrift1 {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-45%) translateY(30px); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-40px) translateX(-20px); }
}

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

@keyframes orbDrift4 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-35px) translateX(15px); }
}

/* --- SVG Background Network --- */
#bg-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    animation: particleDrift 40s ease-in-out infinite;
}

.particle:nth-child(2n) {
    animation-duration: 35s;
    animation-direction: reverse;
}

.particle:nth-child(3n) {
    animation-duration: 45s;
    animation-delay: -10s;
}

@keyframes particleDrift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -12px); }
    50% { transform: translate(-6px, 8px); }
    75% { transform: translate(10px, 5px); }
}

/* --- Floating Chamber Indicator --- */
#chamber-indicator {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.indicator-pill {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(255, 248, 240, 0.6);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(201, 160, 160, 0.25);
    border-radius: 30px;
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(92, 86, 101, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.indicator-dot.active {
    background: #D4B896;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(212, 184, 150, 0.4);
}

.indicator-dot:hover:not(.active) {
    background: #C9A0A0;
    transform: scale(1.2);
}

/* --- Blob Shadow Echoes --- */
.blob-shadow-echo {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
    background: rgba(139, 123, 142, 0.06);
    pointer-events: none;
    z-index: 0;
}

.hero-echo {
    width: 82%;
    height: 82%;
    top: 52%;
    left: 52%;
    transform: translate(-50%, -50%);
    animation: echoFloat 30s ease-in-out infinite;
}

.thesis-echo {
    width: 88%;
    height: 90%;
    top: 52%;
    left: 52%;
    transform: translate(-50%, -50%);
    border-radius: 30% 70% 60% 40% / 50% 50% 50% 50%;
    animation: echoFloat 28s ease-in-out infinite;
}

.evidence-echo-1 {
    width: 75%;
    height: 50%;
    top: 22%;
    left: 52%;
    transform: translate(-50%, -50%);
    animation: echoFloat 32s ease-in-out infinite;
}

.evidence-echo-2 {
    width: 75%;
    height: 50%;
    bottom: -2%;
    left: 52%;
    transform: translate(-50%, 0);
    animation: echoFloat 26s ease-in-out infinite reverse;
}

.synthesis-echo {
    width: 90%;
    height: 90%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50% 50% 50% 50%;
    animation: echoFloat 34s ease-in-out infinite;
}

.archive-echo {
    width: 92%;
    height: 90%;
    top: 52%;
    left: 51%;
    transform: translate(-50%, -50%);
    border-radius: 45% 55% 50% 50% / 40% 40% 60% 60%;
    animation: echoFloat 29s ease-in-out infinite;
}

@keyframes echoFloat {
    0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
    33% { transform: translate(-50%, -50%) translate(10px, 20px); }
    66% { transform: translate(-50%, -50%) translate(-8px, -15px); }
}

/* --- Chamber Base --- */
.chamber {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* --- Neural Pathways --- */
.neural-pathway {
    display: block;
    width: 100px;
    height: 15vh;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.neural-path {
    stroke-dasharray: 8 4;
    animation: neuralFlow 4s linear infinite;
}

@keyframes neuralFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -24; }
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    min-height: 100vh;
    padding: 0;
}

.hero-blob {
    width: min(80vw, 900px);
    height: min(75vh, 700px);
    border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
    background: rgba(255, 248, 240, 0.65);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(201, 160, 160, 0.25);
    box-shadow: 0 20px 60px rgba(139, 123, 142, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: blobBreathe 25s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes blobBreathe {
    0%   { border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; }
    33%  { border-radius: 55% 45% 40% 60% / 45% 55% 50% 50%; }
    66%  { border-radius: 45% 55% 60% 40% / 60% 45% 40% 55%; }
    100% { border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; }
}

.hero-content {
    text-align: center;
    padding: clamp(2rem, 6vw, 5rem);
}

.site-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #2D2A32;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.site-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
}

.site-tagline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    letter-spacing: 0.06em;
    color: #5C5665;
}

/* --- Chamber Blobs --- */
.chamber-blob {
    position: relative;
    z-index: 2;
    padding: clamp(2rem, 6vw, 5rem);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(201, 160, 160, 0.25);
}

/* Chamber Heading */
.chamber-heading {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    color: #C9A0A0;
    margin-bottom: 2rem;
    text-align: center;
}

.chamber-heading span {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
}

/* --- Chamber Content Grid --- */
.chamber-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- Glassmorphic Cards --- */
.glass-card {
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.7), rgba(245, 230, 224, 0.4));
    border: 1px solid rgba(212, 184, 150, 0.3);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(139, 123, 142, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    cursor: default;
}

.glass-card:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 12px 40px rgba(139, 123, 142, 0.18), 0 4px 16px rgba(139, 123, 142, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.glass-card h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    letter-spacing: 0.06em;
    color: #2D2A32;
    margin-bottom: 1rem;
}

.glass-card p {
    max-width: 65ch;
    color: #2D2A32;
    margin-bottom: 0.75rem;
}

.glass-card p:last-child {
    margin-bottom: 0;
}

.glass-card em {
    font-style: italic;
    color: #5C5665;
}

.citation {
    border-left: 3px solid #C9A0A0;
    padding-left: 1.5rem;
    margin-top: 1rem;
}

/* --- Thesis Chamber --- */
#thesis {
    padding: 0 5vw;
    min-height: 80vh;
}

.thesis-blob {
    width: 85%;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(245, 230, 224, 0.5);
    border-radius: 30% 70% 60% 40% / 50% 50% 50% 50%;
    box-shadow: 0 15px 50px rgba(139, 123, 142, 0.10);
}

/* --- Evidence Chamber --- */
#evidence {
    padding: 0 5vw;
    min-height: 90vh;
}

.evidence-container {
    width: 80%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.evidence-blob-top {
    background: rgba(255, 248, 240, 0.55);
    border-radius: 45% 55% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 15px 50px rgba(139, 123, 142, 0.10);
    margin-bottom: -4rem;
    position: relative;
    z-index: 3;
}

.evidence-blob-bottom {
    background: rgba(245, 230, 224, 0.55);
    border-radius: 50% 50% 45% 55% / 40% 40% 60% 60%;
    box-shadow: 0 15px 50px rgba(139, 123, 142, 0.10);
    position: relative;
    z-index: 2;
    mix-blend-mode: multiply;
}

/* --- Synthesis Chamber --- */
#synthesis {
    padding: 0 5vw;
    min-height: 80vh;
}

.synthesis-cluster {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    z-index: 2;
}

.synthesis-blob {
    background: rgba(255, 248, 240, 0.55);
    box-shadow: 0 12px 40px rgba(139, 123, 142, 0.10);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.synthesis-blob-1 {
    border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
    grid-column: 1;
    grid-row: 1;
}

.synthesis-blob-2 {
    border-radius: 45% 55% 45% 55% / 50% 45% 55% 50%;
    grid-column: 2;
    grid-row: 1;
    background: rgba(245, 230, 224, 0.55);
}

.synthesis-blob-3 {
    border-radius: 50% 50% 55% 45% / 55% 50% 50% 45%;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    max-width: 500px;
    background: rgba(255, 248, 240, 0.6);
}

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

.synthesis-line {
    animation: neuralFlow 5s linear infinite;
}

/* --- Archive Chamber --- */
#archive {
    padding: 0 5vw 10vh;
    min-height: 60vh;
}

.archive-blob {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    background: rgba(245, 230, 224, 0.5);
    border-radius: 45% 55% 50% 50% / 35% 35% 65% 65%;
    box-shadow: 0 15px 50px rgba(139, 123, 142, 0.10);
}

.archive-content {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.reference-list {
    list-style: none;
    padding: 0;
}

.reference-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(201, 160, 160, 0.15);
    font-size: 0.95em;
    color: #5C5665;
}

.reference-list li:last-child {
    border-bottom: none;
}

.reference-list li em {
    color: #2D2A32;
}

/* --- WIP Marker (Shake Target) --- */
.wip-marker {
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(212, 184, 150, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wip-marker.shaking {
    animation: shakeError 600ms ease;
    border-color: #C9A0A0;
    box-shadow: 0 0 20px rgba(139, 123, 142, 0.25);
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* --- Chamber Enter Animations --- */
.chamber-blob,
.evidence-container,
.synthesis-cluster {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 900ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chamber-blob.visible,
.evidence-container.visible,
.synthesis-cluster.visible {
    opacity: 1;
    transform: scale(1);
}

/* Hero blob starts visible */
.hero-blob {
    opacity: 1;
    transform: scale(1);
}

/* --- Character Stagger Animation on Headings --- */
.chamber-heading span.char-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- Scroll Background Tint (JS-controlled) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 30%, var(--scroll-tint, rgba(168, 192, 176, 0.08)), transparent 70%);
    transition: background 0.8s ease;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-blob {
        width: 92vw;
        height: 70vh;
    }

    .thesis-blob,
    .evidence-container,
    .archive-blob {
        width: 95%;
    }

    .synthesis-cluster {
        grid-template-columns: 1fr;
        width: 95%;
    }

    .synthesis-blob-3 {
        grid-column: 1;
    }

    .chamber-content {
        grid-template-columns: 1fr;
    }

    #chamber-indicator {
        top: 1rem;
        right: 1rem;
    }

    .indicator-pill {
        padding: 8px 6px;
    }

    .indicator-dot {
        width: 8px;
        height: 8px;
    }

    .neural-pathway {
        height: 10vh;
    }
}

@media (max-width: 480px) {
    .site-title {
        letter-spacing: 0.08em;
    }

    .glass-card {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .chamber-blob {
        padding: clamp(1.5rem, 4vw, 3rem);
    }
}
