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

:root {
    --color-bg-deep: #1a1610;
    --color-bg: #2a241c;
    --color-bg-card: #3d3428;
    --color-text: #ede6d8;
    --color-amber: #e8b44d;
    --color-gold: #f0c76e;
    --color-tan: #a08b6d;
    --color-warm: #d4a574;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg-deep);
    color: var(--color-text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* === CUSTOM CURSOR === */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--color-amber);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.custom-cursor--magnetic {
    width: 40px;
    height: 40px;
    border-color: var(--color-gold);
}

/* === TYPOGRAPHY === */
h1, h2, h3 {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.95;
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 700;
    color: var(--color-text);
    position: relative;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--color-tan);
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

.section-header {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 600;
    color: var(--color-amber);
    margin-bottom: 2rem;
}

.mono-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--color-tan);
}

/* === SECTIONS === */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem;
}

.section-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* === SOURCE / HERO === */
.section--source {
    flex-direction: column;
    background: var(--color-bg-deep);
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.archetype-shapes {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease;
}

.shape--triangle { top: 15%; left: 10%; }
.shape--circle { top: 60%; left: 75%; }
.shape--spiral { top: 25%; right: 15%; }
.shape--pentagon { bottom: 20%; left: 25%; }
.shape--infinity { bottom: 30%; right: 20%; }

.shapes-visible .shape {
    opacity: 0.6;
    animation: drift 20s ease-in-out infinite;
}

.shape--circle { animation-delay: -3s; }
.shape--spiral { animation-delay: -7s; }
.shape--pentagon { animation-delay: -11s; }
.shape--infinity { animation-delay: -15s; }

@keyframes drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -20px) rotate(5deg); }
    50% { transform: translate(-10px, 15px) rotate(-3deg); }
    75% { transform: translate(20px, 10px) rotate(7deg); }
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.scroll-indicator__text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--color-tan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.scroll-indicator__line {
    width: 1px;
    height: 40px;
    background: var(--color-tan);
    animation: pulse-line 2s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.3); }
}

/* === BRANCHES === */
.section--branches {
    background: var(--color-bg);
    clip-path: ellipse(85% 55% at 50% 50%);
}

.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.branch-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-tan);
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.branch-card:hover {
    border-color: var(--color-amber);
    transform: translateY(-4px);
}

.branch-card__index {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.branch-card__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.branch-card__desc {
    font-size: 0.95rem;
    color: var(--color-tan);
    line-height: 1.6;
}

/* === DELTA === */
.section--delta {
    background: var(--color-bg-deep);
}

.graph-container {
    width: 100%;
    height: 400px;
    position: relative;
    border: 1px solid var(--color-bg-card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#forceGraph {
    width: 100%;
    height: 100%;
}

.delta-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--color-tan);
    text-align: center;
}

/* === CONFLUENCE === */
.section--confluence {
    background: var(--color-bg);
    clip-path: ellipse(90% 55% at 50% 50%);
}

.confluence-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text);
    max-width: 700px;
    margin-bottom: 3rem;
}

.confluence-stats {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat__number {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1;
}

.stat__label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--color-tan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === ESTUARY === */
.section--estuary {
    background: var(--color-bg-deep);
    text-align: center;
}

.estuary-text {
    font-size: 1.1rem;
    color: var(--color-tan);
    margin-bottom: 2rem;
}

.estuary-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    color: var(--color-amber);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
    padding: 0.5rem 1rem;
    display: inline-block;
}

.estuary-link:hover {
    border-bottom-color: var(--color-amber);
}

.estuary-footer {
    margin-top: 4rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .section--branches,
    .section--confluence {
        clip-path: none;
    }

    .confluence-stats {
        gap: 2rem;
    }
}
