/* ========================================
   gur.al - Goblincore Split-Screen
   ======================================== */

:root {
    --mycelium-black: #0D0F0C;
    --damp-stone: #1A1F18;
    --sandstone: #D4C4A8;
    --aurora-mint: #7FFFD4;
    --spore-violet: #B388FF;
    --forest-underbelly: #2D4A3E;
    --fungal-amber: #C9A84C;
    --lichen-rose: #E8A0BF;
    --split-pos: 50%;
    --ease-elastic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--mycelium-black);
    color: var(--sandstone);
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: multiply;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* --- Typography --- */
h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: 0.03em;
    line-height: 1.1;
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.05em;
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
}

.mono-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--aurora-mint);
    text-shadow: 0 0 8px rgba(127, 255, 212, 0.3);
}

/* --- Section Base --- */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.section-geode {
    min-height: 120vh;
}

/* --- Split Panels --- */
.split-panel {
    position: absolute;
    top: 0;
    height: 100%;
    transition: width 0.8s var(--ease-elastic);
}

.panel-organic {
    left: 0;
    width: var(--split-pos);
    background-color: var(--damp-stone);
    z-index: 1;
}

.panel-circuit {
    right: 0;
    width: calc(100% - var(--split-pos));
    background-color: var(--mycelium-black);
    z-index: 1;
}

/* --- Marble Surface --- */
.marble-surface {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, #2D4A3E 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, #3A5A4A 0%, transparent 40%),
        radial-gradient(ellipse at 50% 20%, #2D4A3E 0%, transparent 60%),
        linear-gradient(135deg, #1A1F18 0%, #1A1F18 100%);
    opacity: 0.8;
}

.marble-deep {
    background:
        radial-gradient(ellipse at 20% 50%, #2D4A3E 0%, transparent 40%),
        radial-gradient(ellipse at 80% 30%, #3A5A4A 0%, transparent 35%),
        radial-gradient(ellipse at 40% 80%, #2D4A3E 0%, transparent 50%),
        linear-gradient(180deg, #151A14 0%, #1A1F18 100%);
    opacity: 0.9;
}

.marble-cracked {
    background:
        radial-gradient(ellipse at 60% 40%, #1E2A20 0%, transparent 50%),
        linear-gradient(160deg, #0D0F0C 0%, #151A14 100%);
    opacity: 0.6;
}

.marble-merged {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, #2D4A3E 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, #1A1F18 0%, transparent 40%),
        linear-gradient(135deg, #1A1F18 0%, #0D0F0C 100%);
    opacity: 0.5;
}

/* --- Circuit Traces SVG --- */
.circuit-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.circuit-traces line {
    stroke: var(--aurora-mint);
    stroke-opacity: 0.2;
    stroke-width: 1;
}

.circuit-traces circle {
    fill: var(--spore-violet);
    opacity: 0.4;
}

.circuit-traces .trace-glow {
    stroke-opacity: 0.4;
    animation: circuitPulse 4s ease-in-out infinite alternate;
}

@keyframes circuitPulse {
    from { stroke-opacity: 0.15; }
    to { stroke-opacity: 0.4; }
}

.circuit-traces .node-pulse {
    animation: nodePulse 3.5s ease-in-out infinite alternate;
}

@keyframes nodePulse {
    from { opacity: 0.2; }
    to { opacity: 0.6; }
}

.circuit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.5;
}

/* --- Split Seam --- */
.split-seam {
    position: absolute;
    top: 0;
    left: var(--split-pos);
    width: 40px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 5;
    background: linear-gradient(135deg,
        rgba(127, 255, 212, 0.08) 0%,
        rgba(179, 136, 255, 0.08) 35%,
        rgba(232, 160, 191, 0.06) 70%,
        rgba(201, 168, 76, 0.06) 100%
    );
    transition: left 0.8s var(--ease-elastic);
    pointer-events: none;
}

.section-core .split-seam {
    display: none;
}

/* --- Section Content --- */
.section-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* --- Section 1: Surface --- */
.surface-content {
    text-align: center;
}

.site-title {
    background: linear-gradient(90deg,
        var(--sandstone) 0%,
        var(--sandstone) 48%,
        var(--aurora-mint) 52%,
        var(--aurora-mint) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.surface-tagline {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--sandstone);
    opacity: 0;
    animation: fadeUp 0.8s ease 0.8s forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-hint {
    margin-top: 3rem;
    color: var(--sandstone);
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* --- Section 2: Canopy --- */
.canopy-content {
    align-items: flex-start;
    padding-left: 8vw;
}

.canopy-text {
    max-width: 38ch;
    color: var(--sandstone);
}

.canopy-text p {
    font-weight: 400;
}

.mushroom-cluster {
    position: absolute;
    bottom: 2rem;
    left: 12vw;
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
}

.mushroom {
    position: relative;
}

/* Mushroom cap */
.mushroom::before {
    content: '';
    display: block;
    background: var(--forest-underbelly);
    border-radius: 50% 50% 10% 10%;
}

/* Mushroom stem */
.mushroom::after {
    content: '';
    display: block;
    background: rgba(212, 196, 168, 0.6);
    margin: 0 auto;
    border-radius: 2px;
}

.mushroom-1 { transform: rotate(-5deg); }
.mushroom-1::before { width: 28px; height: 18px; }
.mushroom-1::after { width: 6px; height: 20px; }

.mushroom-2 { transform: rotate(3deg); }
.mushroom-2::before { width: 22px; height: 14px; }
.mushroom-2::after { width: 5px; height: 16px; }

.mushroom-3 { transform: rotate(10deg); }
.mushroom-3::before { width: 16px; height: 10px; }
.mushroom-3::after { width: 4px; height: 12px; }

.mushroom {
    opacity: 0;
    transform: translateY(20px);
}

.section-canopy.in-view .mushroom {
    opacity: 1;
    transform: translateY(0) rotate(var(--rot, 0deg));
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-canopy.in-view .mushroom-1 {
    --rot: -5deg;
    transition-delay: 0ms;
}

.section-canopy.in-view .mushroom-2 {
    --rot: 3deg;
    transition-delay: 120ms;
}

.section-canopy.in-view .mushroom-3 {
    --rot: 10deg;
    transition-delay: 240ms;
}

/* --- Section 3: Geode --- */
.geode-content {
    flex-direction: column;
    gap: 3rem;
}

.geode-element {
    position: relative;
    width: clamp(180px, 30vw, 300px);
    height: clamp(180px, 30vw, 300px);
    border-radius: 50%;
}

.geode-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 100%;
    height: 100%;
    background: var(--mycelium-black);
    border: 2px solid rgba(127, 255, 212, 0.15);
}

.ring-2 {
    width: 80%;
    height: 80%;
    background: var(--forest-underbelly);
    border: 1px solid rgba(179, 136, 255, 0.2);
}

.ring-3 {
    width: 60%;
    height: 60%;
    background: var(--fungal-amber);
    opacity: 0.7;
}

.ring-4 {
    width: 40%;
    height: 40%;
    background: var(--aurora-mint);
    opacity: 0.5;
}

.ring-5 {
    width: 22%;
    height: 22%;
    background: var(--spore-violet);
    clip-path: polygon(50% 0%, 80% 25%, 100% 60%, 70% 100%, 30% 100%, 0% 60%, 20% 25%);
}

.geode-label {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--aurora-mint);
    text-shadow: 0 0 8px rgba(127, 255, 212, 0.3);
    white-space: nowrap;
}

.label-outer {
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.label-mid {
    right: -6rem;
    top: 50%;
    transform: translateY(-50%);
}

.label-inner {
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.geode-columns {
    display: flex;
    gap: clamp(2rem, 4vw, 4rem);
    max-width: 900px;
}

.geode-col {
    flex: 1;
}

.geode-col-left {
    color: var(--sandstone);
}

.geode-col-right {
    color: var(--aurora-mint);
}

.geode-col-right h2 {
    color: var(--aurora-mint);
}

/* --- Section 4: Root Network --- */
.roots-content {
    align-items: flex-end;
    padding-right: 8vw;
}

.terminal-block {
    position: relative;
    max-width: 48ch;
    padding: 2rem;
    background: rgba(13, 15, 12, 0.8);
    border: 1px solid rgba(127, 255, 212, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.terminal-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(127, 255, 212, 0.03) 2px,
        rgba(127, 255, 212, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.terminal-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--aurora-mint);
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.terminal-block.revealed .terminal-line {
    opacity: 1;
    transform: translateX(0);
}

.terminal-block.revealed .terminal-line:nth-child(2) { transition-delay: 0.15s; }
.terminal-block.revealed .terminal-line:nth-child(3) { transition-delay: 0.30s; }
.terminal-block.revealed .terminal-line:nth-child(4) { transition-delay: 0.45s; }
.terminal-block.revealed .terminal-line:nth-child(5) { transition-delay: 0.60s; }
.terminal-block.revealed .terminal-line:nth-child(6) { transition-delay: 0.75s; }
.terminal-block.revealed .terminal-line:nth-child(7) { transition-delay: 0.90s; }
.terminal-block.revealed .terminal-line:nth-child(8) { transition-delay: 1.05s; }

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: var(--aurora-mint);
    animation: cursorBlink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

.ripple-node {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--spore-violet);
}

.ripple-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--aurora-mint);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.section-roots.in-view .ripple-node::after {
    animation: rippleExpand 4s ease-out infinite;
}

.node-1 { top: 30%; right: 20%; }
.node-1::after { animation-delay: 0s; }
.node-2 { top: 55%; right: 35%; }
.node-2::after { animation-delay: 1.5s; }
.node-3 { top: 75%; right: 15%; }
.node-3::after { animation-delay: 3s; }

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* --- Section 5: Core --- */
.section-core {
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.core-aurora {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle,
        rgba(127, 255, 212, 0.12) 0%,
        rgba(179, 136, 255, 0.08) 30%,
        rgba(232, 160, 191, 0.05) 60%,
        transparent 80%
    );
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.core-content {
    z-index: 10;
    text-align: center;
}

.core-statement {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #7FFFD4 0%, #B388FF 35%, #E8A0BF 70%, #C9A84C 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.core-sub {
    font-weight: 300;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    color: var(--sandstone);
    max-width: 40ch;
    margin: 0 auto 3rem;
}

.pebble-cluster {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pebble-link {
    display: inline-block;
    padding: 0.75rem 1.8rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--mycelium-black);
    background: var(--fungal-amber);
    border: 2px solid var(--aurora-mint);
    text-decoration: none;
    transition: transform 0.35s var(--ease-elastic), box-shadow 0.35s ease;
    cursor: pointer;
}

.pebble-link:nth-child(1) {
    border-radius: 43% 57% 61% 39% / 54% 38% 62% 46%;
}

.pebble-link:nth-child(2) {
    border-radius: 55% 45% 38% 62% / 46% 60% 40% 54%;
}

.pebble-link:nth-child(3) {
    border-radius: 38% 62% 52% 48% / 60% 42% 58% 40%;
}

.pebble-link:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(127, 255, 212, 0.25);
}

/* --- Pebble Navigation --- */
.pebble-nav {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 9999;
}

.pebble-btn {
    padding: 0.5rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sandstone);
    background: rgba(26, 31, 24, 0.85);
    border: 1px solid rgba(127, 255, 212, 0.2);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.pebble-btn:nth-child(1) {
    border-radius: 43% 57% 61% 39% / 54% 38% 62% 46%;
}

.pebble-btn:nth-child(2) {
    border-radius: 55% 45% 38% 62% / 46% 60% 40% 54%;
}

.pebble-btn:nth-child(3) {
    border-radius: 38% 62% 52% 48% / 60% 42% 58% 40%;
}

.pebble-btn:hover {
    background: rgba(45, 74, 62, 0.9);
    border-color: var(--aurora-mint);
}

/* --- Reveal --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .terminal-line {
        opacity: 1;
        transform: none;
    }

    .mushroom {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .canopy-content {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .roots-content {
        padding-right: 2rem;
        padding-left: 2rem;
        align-items: center;
    }

    .geode-columns {
        flex-direction: column;
    }

    .pebble-nav {
        bottom: 1rem;
        left: 1rem;
    }

    .geode-label.label-mid {
        right: -4rem;
    }

    .pebble-cluster {
        flex-direction: column;
        align-items: center;
    }
}
