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

/* --- Phases: dark red ball → whirlpool + chrome --- */
html.phase-ball body {
    background: radial-gradient(ellipse 125% 100% at 50% 28%, #2a1418 0%, #140a0c 48%, #0a0506 100%);
    color: #c4b8a6;
    transition: background 0.7s ease, color 0.4s ease;
}

html.phase-whirlpool body {
    background: radial-gradient(ellipse 130% 100% at 50% 35%, #1a0c0c 0%, #0c0404 45%, #080303 100%);
    color: #a69b89;
}

/* Full-screen bridge: “crackling” seam between ball break and whirlpool + chrome */
.nirmana-crack-overlay {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    display: block;
    opacity: 0;
    transition: opacity 0.1s ease-out;
}

.nirmana-crack-overlay[hidden] {
    display: none !important;
}

.nirmana-crack-overlay--on {
    opacity: 1;
}

.nirmana-crack-overlay--out {
    opacity: 0;
    transition: opacity 0.55s ease;
}

.nirmana-crack-overlay__veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 85% 70% at 50% 42%, rgba(50, 12, 16, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 100% 100% at 50% 50%, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.88) 70%, #050203 100%);
    animation: crack-veil-pulse 0.5s ease-in-out infinite alternate;
}

.nirmana-crack-overlay__mesh {
    position: absolute;
    inset: -2%;
    opacity: 0.55;
    background-image:
        repeating-linear-gradient(
            108deg,
            transparent 0,
            transparent 1px,
            rgba(255, 190, 175, 0.06) 1px,
            rgba(255, 190, 175, 0.06) 2px,
            transparent 2px,
            transparent 9px
        ),
        repeating-linear-gradient(
            -38deg,
            transparent 0,
            transparent 2px,
            rgba(200, 90, 75, 0.07) 2px,
            rgba(200, 90, 75, 0.07) 3px,
            transparent 3px,
            transparent 11px
        ),
        repeating-linear-gradient(
            12deg,
            transparent 0,
            transparent 3px,
            rgba(80, 20, 25, 0.25) 3px,
            rgba(80, 20, 25, 0.25) 3.4px,
            transparent 3.4px,
            transparent 20px
        );
    background-size: 100% 100%, 100% 100%, 120% 120%;
    animation: crack-mesh-snap 0.32s steps(2, end) infinite;
    mix-blend-mode: screen;
}

.nirmana-crack-overlay__hot {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(125deg, transparent 46%, rgba(255, 110, 90, 0.07) 49%, transparent 52%),
        linear-gradient(-15deg, transparent 52%, rgba(200, 60, 50, 0.08) 54.2%, rgba(200, 60, 50, 0.08) 54.5%, transparent 55%),
        linear-gradient(40deg, transparent 30%, rgba(255, 200, 180, 0.04) 30.1%, 30.25%, transparent 30.4%);
    opacity: 0.85;
    animation: crack-hot-flicker 0.18s steps(2, end) infinite;
}

.nirmana-crack-overlay--out .nirmana-crack-overlay__veil,
.nirmana-crack-overlay--out .nirmana-crack-overlay__mesh,
.nirmana-crack-overlay--out .nirmana-crack-overlay__hot {
    animation: none;
}

@keyframes crack-veil-pulse {
    from {
        filter: brightness(0.95);
    }
    to {
        filter: brightness(1.08);
    }
}

@keyframes crack-mesh-snap {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-0.3%, 0.15%) scale(1.01);
        opacity: 0.65;
    }
}

@keyframes crack-hot-flicker {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.95;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nirmana-crack-overlay {
        display: none !important;
    }
}

body {
    font-family: 'EB Garamond', serif;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

.stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.funnel-section.funnel-stage {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 1;
    transition: opacity 0.6s ease;
}

html.phase-ball .funnel-section.funnel-stage {
    opacity: 0;
    pointer-events: none;
}

html.phase-whirlpool .funnel-section.funnel-stage {
    opacity: 1;
    pointer-events: none;
}

.funnel-stage #webgl-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Ball phase: mobile/tablet strip — name + contact (desktop: hidden) */
.ball-landing {
    display: none;
    position: fixed;
    z-index: 3;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom, 0));
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
    text-align: center;
}

html.phase-ball .ball-landing {
    display: flex;
}

html.phase-whirlpool .ball-landing {
    display: none !important;
}

@media (min-width: 1025px) {
    html.phase-ball .ball-landing {
        display: none !important;
    }
}

.ball-landing-name {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(1.35rem, 4.2vw, 1.75rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #efe6dc;
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.6);
    margin: 0;
    pointer-events: none;
}

.ball-landing-contact {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 2.55vw, 1.02rem);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: #c4b8a0;
    border-bottom: 1px solid rgba(200, 185, 168, 0.35);
    padding-bottom: 0.1rem;
    pointer-events: auto;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ball-landing-contact:hover,
.ball-landing-contact:focus-visible {
    color: #f0e8e0;
    border-bottom-color: rgba(240, 232, 224, 0.55);
    outline: none;
}

/* Background audio: mute after splash (whirlpool); top-right, above reveal chrome */
.site-audio-toggle {
    position: fixed;
    z-index: 6;
    top: max(0.65rem, env(safe-area-inset-top, 0));
    right: max(0.65rem, env(safe-area-inset-right, 0));
    font-family: "JetBrains Mono", monospace;
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a69b89;
    background: rgba(6, 2, 2, 0.55);
    border: 1px solid rgba(166, 155, 137, 0.35);
    border-radius: 0;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

html.phase-ball .site-audio-toggle {
    visibility: hidden;
    pointer-events: none;
}

.site-audio-toggle:hover,
.site-audio-toggle:focus-visible {
    color: #d4ccc0;
    border-color: rgba(200, 185, 170, 0.55);
    background: rgba(12, 4, 4, 0.7);
    outline: none;
}

/* Post–crack: hero left / nav right / contact bottom-right; wide screens: vertically centered band */
.reveal-chrome[hidden] {
    display: none !important;
}

.reveal-chrome {
    position: fixed;
    inset: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-rows: 1fr auto;
    align-items: start;
    padding: clamp(1.25rem, 3.5vh, 2.25rem) clamp(1rem, 3vw, 1.75rem);
    padding-bottom: max(3.25rem, env(safe-area-inset-bottom, 0));
    padding-top: max(clamp(1.25rem, 3.5vh, 2.25rem), env(safe-area-inset-top, 0));
    column-gap: clamp(0.75rem, 2vw, 1.5rem);
    row-gap: clamp(1rem, 2vh, 1.5rem);
    pointer-events: none;
    animation: reveal-in 0.6s ease 0.15s both;
}

/* Wide: inner wrapper is transparent to grid; hide sheet toggle */
.reveal-sheet-toggle {
    display: none;
}

@keyframes reveal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reveal-hero {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
    pointer-events: auto;
}

.hero-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(0.4rem, 1.2vh, 0.7rem);
    max-width: min(38rem, 100%);
}

/* Serif stack: relative scale + clear weight steps */
.hero-name {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(2.4rem, 4.5vw, 4.2rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: 0.03em;
    color: #e8ddd4;
    margin: 0;
    text-rendering: optimizeLegibility;
}

.hero-creation {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 500;
    line-height: 1.3;
    color: rgba(220, 210, 200, 0.92);
    margin: 0;
}

.hero-creation em {
    font-style: italic;
    font-weight: 500;
}

.hero-lede {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 400;
    line-height: 1.5;
    color: #a69b89;
    margin: 0;
    max-width: 42ch;
}

.hero-credit {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    color: rgba(166, 155, 137, 0.58);
    margin: clamp(0.3rem, 0.9vh, 0.6rem) 0 0;
}

/* Rail: vertical column of line-only (geometric) controls */
.site-rail {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1.1vh, 0.7rem);
    align-items: stretch;
    width: 100%;
    max-width: min(18.5rem, 100%);
    pointer-events: auto;
    max-height: min(80vh, 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

button.rail-btn {
    appearance: none;
    font: inherit;
    cursor: pointer;
    width: 100%;
}

.rail-btn {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 1.35vw, 1.05rem);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: left;
    text-decoration: none;
    color: #c4b8a6;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border: 1px solid rgba(166, 155, 137, 0.38);
    padding: 0.78em 0.95em 0.78em 1.1em;
    line-height: 1.3;
    box-sizing: border-box;
    min-height: 3.4rem;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        border-width 0.2s ease;
}

.rail-btn:hover,
.rail-btn:focus-visible {
    color: #efe8e0;
    border-color: rgba(200, 185, 170, 0.95);
    border-width: 2px;
    padding: calc(0.75em - 0.5px) calc(0.9em - 0.5px) calc(0.75em - 0.5px) calc(1.05em - 0.5px);
    outline: none;
}

.rail-btn:focus-visible {
    border-color: rgba(220, 200, 185, 1);
}

.contact-link {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    pointer-events: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.92rem, 1.35vw, 1.12rem);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: #8a7f6f;
    padding: 0.4rem 0.2rem;
    border-bottom: 1px solid rgba(166, 155, 137, 0.28);
    background: none;
    box-shadow: none;
    transition: color 0.2s ease, border-bottom-width 0.2s ease, border-color 0.2s ease;
}

.contact-link:hover,
.contact-link:focus-visible {
    color: #c4b8a6;
    border-bottom-width: 2px;
    border-color: rgba(166, 155, 137, 0.55);
    outline: none;
}

/* Wide screens: row 1 vertically centered; L/R column alignment preserved (cascade after base) */
@media (min-width: 1025px) {
    .reveal-panel-inner {
        display: contents;
    }

    .reveal-chrome {
        align-items: center;
    }

    .reveal-hero {
        justify-self: start;
        align-self: center;
    }

    .site-rail {
        justify-self: end;
        align-self: center;
    }

    .contact-link {
        justify-self: end;
        align-self: end;
    }
}

/* Tablet + phone: bottom sheet (center-aligned panel), pull-up toggle */
@media (max-width: 1024px) {
    .reveal-hero,
    .site-rail,
    .contact-link {
        grid-column: auto;
        grid-row: auto;
        justify-self: center;
    }

    .reveal-chrome {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        padding: 0;
        padding-bottom: 0;
        padding-top: env(safe-area-inset-top, 0);
        row-gap: 0;
    }

    .reveal-sheet-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        order: 1;
        width: 100%;
        max-width: 32rem;
        min-height: 3.1rem;
        margin: 0 auto;
        padding: 0.55rem 1rem 0.45rem;
        border: none;
        border-radius: 1.1rem 1.1rem 0 0;
        background: rgba(8, 3, 3, 0.78);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        color: #c4b8a6;
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.88rem;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        pointer-events: auto;
        cursor: pointer;
        z-index: 2;
    }

    .reveal-sheet-grip {
        display: block;
        width: 2.5rem;
        height: 4px;
        border-radius: 2px;
        background: rgba(200, 185, 170, 0.35);
    }

    .reveal-sheet-toggle-label {
        font-size: 0.92rem;
        padding: 0.2rem 0 0.15rem;
    }

    .reveal-chrome--collapsed .reveal-sheet-grip {
        background: rgba(200, 185, 170, 0.55);
    }

    .reveal-panel-inner {
        order: 2;
        width: 100%;
        max-width: 32rem;
        max-height: min(78vh, 720px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: clamp(1rem, 3vh, 1.4rem);
        margin: 0 auto;
        padding: clamp(1rem, 3vh, 1.5rem) clamp(1.1rem, 4vw, 1.5rem) max(1.25rem, env(safe-area-inset-bottom, 0));
        padding-top: 0.25rem;
        background: linear-gradient(180deg, rgba(14, 6, 6, 0.92) 0%, rgba(6, 2, 2, 0.97) 100%);
        border-radius: 1.1rem 1.1rem 0 0;
        border: 1px solid rgba(120, 90, 85, 0.28);
        border-bottom: none;
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
        pointer-events: auto;
        transition:
            max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            padding 0.35s ease,
            border-color 0.2s ease,
            box-shadow 0.3s ease;
    }

    .reveal-chrome--collapsed .reveal-panel-inner {
        max-height: 0;
        min-height: 0;
        opacity: 0;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
        overflow: hidden;
        pointer-events: none;
    }

    .reveal-hero {
        display: block;
        width: 100%;
    }

    .hero-stack {
        align-items: center;
        text-align: center;
        max-width: 100%;
    }

    .hero-name {
        font-size: clamp(2.15rem, 6.2vw, 2.75rem);
    }

    .hero-creation {
        font-size: clamp(1.5rem, 4.4vw, 1.9rem);
    }

    .hero-lede {
        font-size: clamp(1.3rem, 4.1vw, 1.5rem);
        max-width: 36ch;
    }

    .site-rail {
        width: 100%;
        max-width: 20rem;
        margin: 0 auto;
    }

    .rail-btn {
        text-align: center;
        min-height: 3.5rem;
        font-size: clamp(0.95rem, 2.65vw, 1.12rem);
    }

    .contact-link {
        justify-self: center;
        align-self: center;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Ball: chromatic / specular / layered scuffs */
.sphere .chromatic-layer {
    z-index: 1;
}
.sphere .specular {
    z-index: 2;
}
.sphere .scuff-stack {
    z-index: 4;
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}

.nirmana-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


.ball-section {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    --sphere-size: clamp(200px, 44vmin, 360px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.55s ease, visibility 0.55s ease;
    scroll-snap-align: start;
}

.ball-section.ball--gone {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: default;
}

/* Dark crimson glass sphere — perfect circle, scuff + crosshatch */
html.phase-ball .ball-section {
    z-index: 2;
}

html.phase-ball .sphere-container {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

html.phase-ball .ball-ground-shadow {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 0;
    width: min(58vw, 240px);
    height: 22%;
    max-height: 3.2rem;
    min-height: 2rem;
    transform: translate(-50%, calc(-50% + 0.47 * var(--sphere-size, 360px) + 0.1rem)) scale(1.15, 0.6);
    transform-origin: center center;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        ellipse 100% 100% at 50% 40%,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(40, 6, 10, 0.32) 38%,
        rgba(20, 4, 6, 0.12) 55%,
        rgba(0, 0, 0, 0) 70%
    );
    filter: blur(9px) saturate(0.85);
    opacity: 0.92;
    mix-blend-mode: multiply;
}

html.phase-ball .sphere.sphere--perfect {
    z-index: 1;
    position: relative !important;
    flex-shrink: 0;
    width: var(--sphere-size, 360px) !important;
    height: var(--sphere-size, 360px) !important;
    max-width: min(90vw, 400px);
    max-height: min(90vw, 400px);
    aspect-ratio: 1;
    border-radius: 50% !important;
    /* Saturated crimson with light from upper-right; deep plum / blood in shadow (reference-inspired) */
    background: linear-gradient(
        150deg,
        rgba(200, 64, 58, 0.42) 0%,
        rgba(145, 32, 38, 0.62) 32%,
        rgba(80, 18, 28, 0.75) 58%,
        rgba(32, 8, 14, 0.92) 100%
    );
    border: 1px solid rgba(255, 160, 150, 0.22);
    box-shadow:
        inset 0 4px 22px rgba(255, 230, 220, 0.14),
        inset 8px 10px 32px rgba(255, 120, 110, 0.12),
        inset 0 -22px 48px rgba(0, 0, 0, 0.42),
        inset -20px 0 36px rgba(20, 4, 8, 0.35),
        0 22px 56px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.1s ease-out, opacity 0.55s ease !important;
}

html.phase-ball .sphere.sphere--perfect,
html.phase-ball .sphere.sphere--perfect * {
    border-radius: 50% !important;
}

html.phase-ball .chromatic-layer {
    opacity: 0.5 !important;
    filter: blur(14px) saturate(1.12);
    background: radial-gradient(
        circle at 62% 24%,
        rgba(255, 120, 100, 0.38) 0%,
        rgba(200, 55, 55, 0.48) 35%,
        rgba(100, 28, 36, 0.55) 65%,
        rgba(32, 10, 16, 0.85) 100%
    ) !important;
    mix-blend-mode: screen;
}

html.phase-ball .scuff-stack {
    transition: transform 0.12s ease-out, opacity 0.35s ease;
}

/* Sparse shine grain in the light + pencil scuffs (scratch-fine) */
html.phase-ball .hatch-faint-lit {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    mix-blend-mode: soft-light;
    opacity: 0.4;
    background-image: repeating-linear-gradient(
        -6deg,
        rgba(255, 255, 255, 0) 0 6px,
        rgba(255, 228, 220, 0.1) 6px 6.3px
    );
    background-size: 100% 100%;
    -webkit-mask-image: radial-gradient(
        ellipse 42% 44% at 64% 24%,
        #fff 0%,
        #fff 42%,
        rgba(255, 255, 255, 0) 100%
    );
    mask-image: radial-gradient(ellipse 42% 44% at 64% 24%, #fff 0%, #fff 42%, rgba(255, 255, 255, 0) 100%);
}

html.phase-ball .scratch-fine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8,12 L14,20 M24,6 L20,16 M40,8 L48,4 M6,32 L12,28 M30,30 L28,40 M50,20 L55,30 M10,50 L18,48 M44,50 L50,55 M20,24 L25,20 M32,12 L30,22' stroke='%23a0706e' stroke-width='0.4' fill='none' stroke-linecap='round' opacity='0.55'/%3E%3Cpath d='M14,8 L10,18 M38,32 L45,28 M18,40 L14,50 M48,12 L42,18' stroke='%23201818' stroke-width='0.4' fill='none' stroke-linecap='round' opacity='0.48'/%3E%3Cpath d='M4,28 L0,22 M2,4 L0,0' stroke='%23100808' stroke-width='0.32' fill='none' stroke-linecap='round' opacity='0.4'/%3E%3Cpath d='M0,0 L64,64 M64,0 L0,64' stroke='%23000' stroke-width='0.2' stroke-opacity='0.1'/%3E%3C/svg%3E");
    background-size: 48px 48px;
    opacity: 0.64;
    mix-blend-mode: soft-light;
    -webkit-mask-image: radial-gradient(
        ellipse 58% 62% at 32% 58%,
        #fff 0%,
        #fff 48%,
        rgba(255, 255, 255, 0.2) 100%
    );
    mask-image: radial-gradient(ellipse 58% 62% at 32% 58%, #fff 0%, #fff 48%, rgba(255, 255, 255, 0.2) 100%);
}

html.phase-ball .specular {
    opacity: 0.9;
    background: radial-gradient(
        ellipse 78% 52% at 64% 22%,
        rgba(255, 250, 248, 0.42) 0%,
        rgba(255, 195, 180, 0.18) 35%,
        rgba(200, 80, 75, 0.05) 52%,
        rgba(255, 255, 255, 0) 64%
    ) !important;
}

html.phase-ball .sphere.sphere--perfect::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(
        circle at 18% 48%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0) 55%,
        rgba(18, 4, 8, 0.28) 100%
    );
    mix-blend-mode: multiply;
    opacity: 0.7;
}

html.phase-ball .dispersion-shadow {
    opacity: 0.65;
    filter: blur(20px);
    background: radial-gradient(ellipse, rgba(90, 32, 48, 0.55) 0%, rgba(30, 10, 16, 0.25) 50%, transparent 72%) !important;
}



.funnel-section {
    background: #160a09;
    color: #e5c8a0;
}

.link-tree-section {
    background: linear-gradient(180deg, #160a09 0%, #0d0504 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section Copy Overlays */
.copy-center {
    position: absolute;
    z-index: 100;
    text-align: center;
    pointer-events: none;
}

.copy-center h1 {
    font-size: 5rem;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.copy-center h2 {
    font-size: 3rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.copy-center p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ball-hero-copy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
    text-align: center;
    padding: 2rem;
}

.ball-hero-copy h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.12em;
    text-transform: none;
    margin-bottom: 1rem;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.ball-hero-copy p {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1.8vw, 0.95rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    max-width: 28rem;
    line-height: 1.5;
    opacity: 0.92;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.ball-section .scene {
    position: relative;
    z-index: 1;
}

/* Link Tree Styles */
.link-tree-container {
    width: 100%;
    max-width: 42rem;
    text-align: center;
}

.link-tree-lede {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
    max-width: 36rem;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

.link-tree-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: stretch;
}

.link-tree-nav .tree-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex: 1 1 10rem;
    max-width: 14rem;
}

.link-tree-container h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

.tree-link {
    display: block;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(229, 200, 160, 0.05);
    border: 1px solid rgba(229, 200, 160, 0.2);
    color: #e5c8a0;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}
.tree-link:hover {
    background: rgba(229, 200, 160, 0.15);
    border-color: #e5c8a0;
    transform: translateY(-2px);
}


.tree-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* --- BALL ORIGINAL CSS (with tweaks for section-based approach) --- */

    :root {
    --bg-color: #090606;
    --glass-yellow: rgba(145, 60, 40, 0.85); /* Deep dark red/copper */
    --glass-cyan: rgba(20, 60, 65, 0.8);     /* Dark teal */
    --glass-blue: rgba(15, 10, 20, 0.95);    /* Extremely dark shadow core */
    --dispersion-pink: rgba(200, 30, 40, 0.8); 
    --dispersion-cyan: rgba(30, 80, 90, 0.6);
    --sphere-size: 380px;
}

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

    body.ball-ignored {
        background-color: var(--bg-color);
        background-image: radial-gradient(circle at 50% 0%, #FFFFFF 0%, #F0F0F5 100%);
        min-height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        font-family: system-ui, -apple-system, sans-serif;
    }

    
    .scene {
        position: relative;
        width: var(--sphere-size);
        height: var(--sphere-size);
        display: flex;
        justify-content: center;
        align-items: center;
        perspective: 1000px;
    }

    
    .dispersion-shadow {
        position: absolute;
        bottom: -80px;
        width: 240px;
        height: 30px;
        border-radius: 50%;
        background: linear-gradient(90deg, 
            rgba(255,255,255,0) 0%, 
            var(--dispersion-cyan) 20%, 
            var(--dispersion-pink) 50%, 
            var(--glass-yellow) 80%, 
            rgba(255,255,255,0) 100%
        );
        filter: blur(12px);
        opacity: 0.9;
        animation: shadow-pulse 6s ease-in-out infinite;
        transform-origin: center;
        z-index: 1;
    }

    
    .sphere-container {
        position: relative;
        width: 100%;
        height: 100%;
        animation: float 6s ease-in-out infinite;
        z-index: 2;
        transform-style: preserve-3d;
    }

    
    .sphere {
        position: absolute;
        inset: 0;
        
        border-radius: 49% 51% 50% 50% / 50% 50% 49% 51%;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        overflow: hidden;
        
        
        box-shadow: 
            
            inset 0 4px 6px rgba(255, 255, 255, 0.9),
            
            inset 0 -20px 60px rgba(86, 120, 160, 0.5),
            
            inset -20px 0 50px rgba(140, 205, 220, 0.3),
            inset 20px 0 50px rgba(255, 230, 180, 0.2),
            
            0 15px 35px rgba(0, 0, 0, 0.03);
            
        border: 1px solid rgba(255, 255, 255, 0.4);
        transition: border-radius 2s ease;
    }

    
    .chromatic-layer {
        position: absolute;
        inset: -30%; 
        border-radius: 50%;
        background: radial-gradient(
            circle at 50% 30%,
            var(--glass-yellow) 10%,
            var(--glass-cyan) 45%,
            var(--glass-blue) 80%
        );
        filter: blur(15px);
        opacity: 0.85;
        mix-blend-mode: color-dodge;
        transition: transform 0.1s linear;
        pointer-events: none;
    }

    
    .scratch-layer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20,20 L30,25 M70,40 L60,35 M50,80 L55,70 M10,60 L20,65' stroke='%23ffffff' stroke-width='0.5' fill='none' stroke-linecap='round' opacity='0.3'/%3E%3Cpath d='M80,20 L75,30 M30,80 L25,70 M45,45 L50,55 M45,55 L50,45' stroke='%23ffffff' stroke-width='0.5' fill='none' stroke-linecap='round' opacity='0.2'/%3E%3C/svg%3E");
    background-size: 80px 80px;
    opacity: 0.15; /* subtle initially */
    mix-blend-mode: color-dodge;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease !important;
}

    
    .specular {
    position: absolute;
    inset: -10%;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 40% 20%,
        rgba(255, 220, 200, 0.4) 0%,
        rgba(255, 255, 255, 0) 30%
    );
    filter: blur(4px);
    mix-blend-mode: overlay;
    transition: transform 0.1s linear;
}

    
    .reflection {
        position: absolute;
        bottom: -10%;
        left: -10%;
        width: 120%;
        height: 60%;
        border-radius: 50%;
        background: radial-gradient(ellipse at bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
        filter: blur(8px);
        pointer-events: none;
    }

    
    @keyframes float {
        0%, 100% {
            transform: translateY(0) rotateX(0deg) rotateY(0deg);
        }
        25% {
            transform: translateY(-15px) rotateX(2deg) rotateY(-2deg);
        }
        50% {
            transform: translateY(-25px) rotateX(0deg) rotateY(0deg);
        }
        75% {
            transform: translateY(-15px) rotateX(-2deg) rotateY(2deg);
        }
    }

    @keyframes shadow-pulse {
        0%, 100% {
            transform: scale(1);
            opacity: 0.9;
        }
        50% {
            transform: scale(0.85);
            opacity: 0.6;
        }
    }




/* --- FUNNEL ORIGINAL CSS (with tweaks for section-based approach) --- */

        :root {
    --bg-color: #090606;
    --glass-yellow: rgba(145, 60, 40, 0.85); /* Deep dark red/copper */
    --glass-cyan: rgba(20, 60, 65, 0.8);     /* Dark teal */
    --glass-blue: rgba(15, 10, 20, 0.95);    /* Extremely dark shadow core */
    --dispersion-pink: rgba(200, 30, 40, 0.8); 
    --dispersion-cyan: rgba(30, 80, 90, 0.6);
    --sphere-size: 380px;
}

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

        body, html {
            width: 100%;
            height: 100%;
            background-color: var(--bg);
            color: var(--fg);
            overflow: hidden;
            font-family: var(--font-mono);
            font-size: 11px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        
        #webgl-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: var(--z-canvas);
            pointer-events: none; 
        }

        
        #ui-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: var(--z-ui);
            pointer-events: none; 
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: auto 1fr auto;
            padding: 3rem 4rem;
        }

        .clickable {
            pointer-events: auto;
        }

        
        h1, h2, h3, .serif-title {
            font-family: var(--font-serif);
            font-weight: 400;
            letter-spacing: 0.02em;
        }

        .mono-text {
            font-family: var(--font-mono);
            font-weight: 300;
            letter-spacing: -0.02em;
        }

        
        header {
            grid-column: 1 / -1;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }

        .brand-cluster {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .logo {
            font-family: var(--font-serif);
            font-size: 24px;
            font-style: italic;
            line-height: 1;
        }

        .phonetics {
            color: var(--fg-muted);
            font-size: 10px;
            letter-spacing: 0.05em;
        }

        .system-status {
            text-align: right;
            display: flex;
            flex-direction: column;
            gap: 4px;
            color: var(--fg-muted);
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        
        .mid-zone {
            grid-column: 1 / -1;
            position: relative;
        }

        .bottom-zone {
            grid-column: 1 / -1;
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
        }

        
        
        .annotation {
            position: absolute;
            display: flex;
            align-items: flex-start;
            gap: 20px;
        }

        
        .anno-1 {
            top: 15%;
            left: 10%;
        }

        .anno-2 {
            bottom: 15%;
            left: 15%;
        }

        .anno-data-cluster {
            display: flex;
            flex-direction: column;
            width: 140px;
        }

        .anno-title {
            font-size: 14px;
            line-height: 1.2;
            margin-bottom: 16px;
            color: var(--fg);
        }

        .data-row {
            display: flex;
            align-items: center;
            height: 24px;
            position: relative;
        }

        .data-value {
            font-size: 13px;
            font-weight: 400;
            width: 45px;
            text-align: right;
            margin-right: 8px;
        }

        .data-unit {
            font-size: 8px;
            color: var(--fg-muted);
            line-height: 1.1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .data-unit span {
            display: block;
        }

        .axis-label {
            font-family: var(--font-serif);
            font-size: 12px;
            color: var(--fg-muted);
            margin-top: 12px;
            text-align: right;
            padding-right: 40px;
            font-style: italic;
        }

        
        .anno-graphics {
            position: relative;
            width: 300px; 
            height: 100%;
            padding-top: 45px; 
        }

        .leader-line {
            position: absolute;
            left: 0;
            height: 1px;
            background-color: var(--line-color);
            width: 100%;
        }

        .leader-circle {
            position: absolute;
            width: 12px;
            height: 12px;
            border: 1px solid var(--line-color);
            border-radius: 50%;
            top: -5px; 
            transform: translateX(-50%);
            background: transparent;
        }

        
        .anno-1 .line-1 { top: 45px; width: 60%; }
        .anno-1 .line-1 .leader-circle { left: 100%; }
        
        .anno-1 .line-2 { top: 69px; width: 100%; }
        .anno-1 .line-2 .leader-circle { left: 100%; }
        
        .anno-1 .line-3 { top: 93px; width: 140%; }
        .anno-1 .line-3 .leader-circle { left: 100%; }

        .anno-2 .line-1 { top: 45px; width: 40%; }
        .anno-2 .line-1 .leader-circle { left: 100%; }
        
        .anno-2 .line-2 { top: 69px; width: 110%; }
        .anno-2 .line-2 .leader-circle { left: 100%; }
        
        .anno-2 .line-3 { top: 93px; width: 160%; }
        .anno-2 .line-3 .leader-circle { left: 100%; }

        
        .axis-markers {
            position: absolute;
            bottom: -20px;
            left: 0;
            width: 160%;
            display: flex;
            justify-content: space-between;
            font-size: 8px;
            color: var(--fg-dark);
        }
        
        .axis-markers span {
            position: relative;
        }
        
        .axis-markers span::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 50%;
            width: 1px;
            height: 3px;
            background-color: var(--fg-dark);
        }

        
        .terminal-block {
            max-width: 300px;
            color: var(--fg-muted);
            line-height: 1.5;
        }

        .terminal-line {
            display: flex;
            gap: 12px;
            margin-bottom: 4px;
        }

        .term-key {
            color: var(--fg-dark);
            min-width: 60px;
        }

        .term-val {
            color: var(--fg);
        }

        .cta-container {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 8px;
        }

        .cta-link {
            color: var(--fg);
            text-decoration: none;
            font-family: var(--font-mono);
            font-size: 11px;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            border-bottom: 1px solid var(--line-color);
            padding-bottom: 2px;
            transition: border-color 0.3s ease;
        }

        .cta-link:hover {
            border-color: var(--fg);
        }

        .agent-note {
            font-size: 9px;
            color: var(--fg-dark);
            font-style: italic;
            font-family: var(--font-serif);
        }

        @media (max-width: 1024px) {
            .anno-1 { top: 10%; left: 5%; }
            .anno-2 { bottom: 25%; left: 5%; }
            .anno-graphics { width: 150px; }
            .anno-1 .line-3 { width: 100%; }
            .anno-2 .line-3 { width: 100%; }
        }
    


/* --- UX SCROLL STYLES --- */
body {
    overflow: hidden;
}

.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.scroll-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar WebKit */
}

.nirmana-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.link-tree-section {
    background: linear-gradient(180deg, #160a09 0%, #0d0504 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-center {
    background: rgba(0, 0, 0, 0.15); /* Scrim for better text legibility */
    padding: 3rem 4rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 10;
}

.ball-section .copy-center {
    color: #111;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.scratch-layer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20,20 L30,25 M70,40 L60,35 M50,80 L55,70 M10,60 L20,65' stroke='%23ffffff' stroke-width='0.5' fill='none' stroke-linecap='round' opacity='0.3'/%3E%3Cpath d='M80,20 L75,30 M30,80 L25,70 M45,45 L50,55 M45,55 L50,45' stroke='%23ffffff' stroke-width='0.5' fill='none' stroke-linecap='round' opacity='0.2'/%3E%3C/svg%3E");
    background-size: 80px 80px;
    opacity: 0.15; /* subtle initially */
    mix-blend-mode: color-dodge;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease !important;
}
.sphere {
    transition: border-radius 0.1s ease-out, transform 0.5s ease-out;
}

/* ── Site dialogs (home: Story deck / Manifestation warning) ── */
.home-site-dialog {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    border: 1px solid rgba(166, 155, 137, 0.45);
    border-radius: 2px;
    background: #120808;
    color: #a69b89;
    width: min(92vw, 26rem);
    max-height: min(88vh, 28rem);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
}

.home-site-dialog::backdrop {
    background: rgba(8, 4, 4, 0.78);
    backdrop-filter: blur(4px);
}

.home-site-dialog__inner {
    position: relative;
    padding: 1.5rem 1.25rem 1.35rem;
}

.home-site-dialog__kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a7f6f;
    margin-bottom: 0.4rem;
}

.home-site-dialog__title {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    font-weight: 600;
    color: #e8ddd4;
    margin-bottom: 0.85rem;
    padding-right: 2rem;
    line-height: 1.2;
}

.home-site-dialog__body {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #9a9086;
    margin-bottom: 0.75rem;
}

.home-site-dialog__fine {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.61rem;
    letter-spacing: 0.04em;
    color: #6a6058;
    margin-top: 1rem;
    line-height: 1.45;
}

.home-site-dialog__fine code {
    font-size: inherit;
    color: #8a806f;
}

.home-site-dialog__close {
    position: absolute;
    top: 0.5rem;
    right: 0.45rem;
    width: 2.35rem;
    height: 2.35rem;
    border: none;
    background: transparent;
    color: #8a7f6f;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.home-site-dialog__close:hover,
.home-site-dialog__close:focus-visible {
    color: #e8ddd4;
    outline: none;
}

.home-site-dialog__actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1rem;
}

.home-site-dialog__actions--split {
    flex-direction: column;
}

.home-site-dialog__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(0.72rem, 2.5vw, 0.82rem);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #c4b8a6;
    background: transparent;
    border: 1px solid rgba(166, 155, 137, 0.42);
    padding: 0.72rem 0.95rem;
    cursor: pointer;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
    box-sizing: border-box;
    line-height: 1.3;
}

.home-site-dialog__btn:hover,
.home-site-dialog__btn:focus-visible {
    color: #efe8e0;
    border-color: rgba(200, 185, 170, 0.9);
    outline: none;
}

.home-site-dialog__btn--accent {
    color: #efe8e0;
    border-color: rgba(200, 185, 170, 0.75);
    background: rgba(40, 25, 25, 0.35);
}

.home-site-dialog__btn--muted {
    border-color: rgba(120, 110, 100, 0.45);
    color: #8f8478;
}

@media (min-width: 480px) {
    .home-site-dialog__actions--split {
        flex-direction: row;
        justify-content: space-between;
    }

    .home-site-dialog__actions--split .home-site-dialog__btn {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-site-dialog__btn,
    .home-site-dialog__close {
        transition: none;
    }
}
