/* mystical.boo -- bioluminescent spirit realm */

:root {
    --spirit-void: #0a0a1f;
    --deep-indigo: #1a1a3e;
    --abyss-blue: #0a1a2f;
    --lavender-mist: #e0d0ff;
    --slate-blue: #7b68ee;
    --spirit-green: #00e5a0;
    --mystic-pink: #ff6ec7;
    --ghost-glass: rgba(255, 255, 255, 0.03);
    --ghost-border: rgba(123, 104, 238, 0.15);

    --font-display: 'Tenor Sans', 'Lato', sans-serif;
    --font-body: 'Lato', sans-serif;
    --font-label: 'Megrim', 'Tenor Sans', sans-serif;

    --column-max: 600px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--lavender-mist);
    background: var(--spirit-void);
    background-image: linear-gradient(180deg,
        #0a0a1f 0%,
        #1a1a3e 40%,
        #0a1a2f 70%,
        #0a0a1f 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    line-height: 1.8;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Aurora Layer -- a fixed pseudo-canvas with hue-rotate */
.aurora-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(123, 104, 238, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 85% 30%, rgba(0, 229, 160, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 90% 70% at 50% 80%, rgba(255, 110, 199, 0.08) 0%, transparent 65%),
        radial-gradient(ellipse 60% 40% at 10% 70%, rgba(123, 104, 238, 0.12) 0%, transparent 60%);
    animation: hue-shift 30s linear infinite;
    filter: blur(20px);
}

.aurora-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 40% at 70% 60%, rgba(0, 229, 160, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 40% 30% at 30% 40%, rgba(255, 110, 199, 0.06) 0%, transparent 65%);
    animation: hue-shift 45s linear infinite reverse;
}

@keyframes hue-shift {
    0%   { filter: blur(20px) hue-rotate(0deg); }
    100% { filter: blur(20px) hue-rotate(360deg); }
}

/* Floating Luminous Orbs */
.orb-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.85;
    will-change: transform;
}

.orb-1 {
    top: 8%;
    left: 12%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.45) 0%, rgba(123, 104, 238, 0.12) 40%, transparent 70%);
    animation: drift-a 26s ease-in-out infinite;
}

.orb-2 {
    top: 22%;
    right: 8%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(0, 229, 160, 0.30) 0%, rgba(0, 229, 160, 0.08) 45%, transparent 70%);
    animation: drift-b 32s ease-in-out infinite;
}

.orb-3 {
    top: 48%;
    left: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 110, 199, 0.28) 0%, rgba(255, 110, 199, 0.08) 45%, transparent 70%);
    animation: drift-c 22s ease-in-out infinite;
}

.orb-4 {
    top: 60%;
    right: 18%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.32) 0%, rgba(123, 104, 238, 0.10) 45%, transparent 70%);
    animation: drift-d 38s ease-in-out infinite;
}

.orb-5 {
    top: 80%;
    left: 28%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(0, 229, 160, 0.22) 0%, rgba(0, 229, 160, 0.06) 45%, transparent 70%);
    animation: drift-e 28s ease-in-out infinite;
}

.orb-6 {
    top: 92%;
    right: 12%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 110, 199, 0.22) 0%, rgba(255, 110, 199, 0.06) 45%, transparent 70%);
    animation: drift-f 24s ease-in-out infinite;
}

.orb-7 {
    top: 35%;
    left: 45%;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(224, 208, 255, 0.18) 0%, rgba(224, 208, 255, 0.05) 45%, transparent 70%);
    animation: drift-g 30s ease-in-out infinite;
}

.orb-8 {
    top: 70%;
    left: 60%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.25) 0%, rgba(123, 104, 238, 0.07) 45%, transparent 70%);
    animation: drift-h 34s ease-in-out infinite;
}

@keyframes drift-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(60px, -40px) scale(1.08); }
    66%      { transform: translate(-30px, 50px) scale(0.95); }
}
@keyframes drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-70px, 60px) scale(1.10); }
}
@keyframes drift-c {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(40px, 30px) scale(1.05); }
    75%      { transform: translate(-20px, -40px) scale(0.92); }
}
@keyframes drift-d {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40%      { transform: translate(80px, -50px) scale(1.06); }
    80%      { transform: translate(-40px, 30px) scale(0.96); }
}
@keyframes drift-e {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(50px, -70px) scale(1.07); }
}
@keyframes drift-f {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-50px, 40px) scale(1.04); }
    66%      { transform: translate(30px, -30px) scale(0.94); }
}
@keyframes drift-g {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20px, 80px) scale(1.12); }
}
@keyframes drift-h {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40%      { transform: translate(-60px, -20px) scale(1.06); }
    80%      { transform: translate(40px, 50px) scale(0.95); }
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* Header */
.veil-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.6rem 3rem;
    background: linear-gradient(180deg, rgba(10, 10, 31, 0.45) 0%, rgba(10, 10, 31, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sigil {
    width: 42px;
    height: 42px;
    opacity: 0.85;
    animation: sigil-spin 90s linear infinite;
}

.sigil svg {
    width: 100%;
    height: 100%;
}

@keyframes sigil-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.spirit-nav {
    display: flex;
    gap: 2.4rem;
}

.spirit-link {
    font-family: var(--font-label);
    font-size: 0.85rem;
    color: var(--lavender-mist);
    text-decoration: none;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    opacity: 0.7;
    transition: opacity 0.6s ease, color 0.6s ease, text-shadow 0.6s ease;
    position: relative;
}

.spirit-link:hover {
    opacity: 1;
    color: var(--mystic-pink);
    text-shadow: 0 0 12px rgba(255, 110, 199, 0.6);
}

.spirit-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 1px;
    background: var(--spirit-green);
    transition: width 0.6s ease, left 0.6s ease;
}

.spirit-link:hover::after {
    width: 100%;
    left: 0;
}

/* Main serpentine container */
.serpentine {
    position: relative;
    z-index: 10;
    padding-top: 0;
    padding-bottom: 8rem;
}

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

.hero-inner {
    max-width: var(--column-max);
    text-align: center;
    position: relative;
}

.spirit-label {
    display: inline-block;
    font-family: var(--font-label);
    font-size: 0.9rem;
    color: var(--spirit-green);
    letter-spacing: 0.32em;
    text-transform: lowercase;
    margin-bottom: 2rem;
    text-shadow: 0 0 16px rgba(0, 229, 160, 0.45);
    opacity: 0.9;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 7vw, 5.2rem);
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: var(--lavender-mist);
    margin-bottom: 2rem;
    text-shadow:
        0 0 24px rgba(123, 104, 238, 0.5),
        0 0 48px rgba(123, 104, 238, 0.25);
}

.hero-title .dot {
    color: var(--mystic-pink);
    text-shadow: 0 0 16px rgba(255, 110, 199, 0.7);
    animation: pulse-dot 4s ease-in-out infinite;
    display: inline-block;
}

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

.hero-tagline {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--lavender-mist);
    opacity: 0.78;
    max-width: 480px;
    margin: 0 auto 4rem;
    font-weight: 300;
}

.scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    opacity: 0.6;
}

.cue-text {
    font-family: var(--font-label);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    color: var(--spirit-green);
}

.cue-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--spirit-green) 0%, transparent 100%);
    animation: cue-pulse 3s ease-in-out infinite;
}

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

/* Spirit Sections -- the serpentine path */
.spirit-section {
    position: relative;
    max-width: var(--column-max);
    width: 90%;
    margin-top: 6rem;
    margin-bottom: 6rem;
    padding: 3rem 3rem 3.5rem;
    background: var(--ghost-glass);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid var(--ghost-border);
    border-radius: 24px;
    box-shadow:
        0 12px 60px rgba(10, 10, 31, 0.35),
        0 0 80px rgba(123, 104, 238, 0.05) inset;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 1.2s ease,
                box-shadow 0.8s ease;
    opacity: 0;
    transform: translateY(50px);
}

.spirit-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section-a { margin-left: 14%; }
.section-b { margin-left: 32%; }
.section-c { margin-left: 22%; }
.section-d { margin-left: 38%; }
.section-e { margin-left: 18%; }

.spirit-section .spirit-label {
    color: var(--mystic-pink);
    text-shadow: 0 0 12px rgba(255, 110, 199, 0.4);
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    letter-spacing: 0.28em;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    line-height: 1.25;
    color: var(--lavender-mist);
    margin-bottom: 1.8rem;
    letter-spacing: 0.01em;
    text-shadow: 0 0 20px rgba(123, 104, 238, 0.25);
}

.section-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--lavender-mist);
    opacity: 0.82;
    margin-bottom: 1.4rem;
    font-weight: 300;
}

.section-body:last-of-type {
    margin-bottom: 0;
}

/* Spirit quote */
.spirit-quote {
    margin-top: 2rem;
    padding: 2rem 1.6rem 1.8rem 2.4rem;
    border-left: 1px solid rgba(0, 229, 160, 0.35);
    position: relative;
    background: linear-gradient(90deg, rgba(0, 229, 160, 0.04) 0%, transparent 100%);
    border-radius: 0 16px 16px 0;
}

.spirit-quote .quote-mark {
    position: absolute;
    top: 0.4rem;
    left: 0.6rem;
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--spirit-green);
    opacity: 0.5;
    line-height: 1;
}

.spirit-quote p {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--lavender-mist);
    font-style: italic;
    margin-bottom: 0.8rem;
    opacity: 0.92;
}

.spirit-quote .quote-attrib {
    display: block;
    font-family: var(--font-label);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: var(--spirit-green);
    opacity: 0.75;
}

/* Liminal list */
.liminal-list {
    list-style: none;
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.liminal-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--lavender-mist);
    opacity: 0.85;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    transition: background 0.6s ease;
}

.liminal-list li:hover {
    background: rgba(255, 255, 255, 0.025);
}

.lum-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: lum-pulse 4s ease-in-out infinite;
}

.lum-dot-violet {
    background: var(--slate-blue);
    box-shadow: 0 0 12px rgba(123, 104, 238, 0.7);
}

.lum-dot-green {
    background: var(--spirit-green);
    box-shadow: 0 0 12px rgba(0, 229, 160, 0.7);
    animation-delay: 0.5s;
}

.lum-dot-pink {
    background: var(--mystic-pink);
    box-shadow: 0 0 12px rgba(255, 110, 199, 0.7);
    animation-delay: 1s;
}

.lum-dot-lavender {
    background: var(--lavender-mist);
    box-shadow: 0 0 12px rgba(224, 208, 255, 0.7);
    animation-delay: 1.5s;
}

@keyframes lum-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.25); opacity: 0.7; }
}

/* Particle trail between sections */
.trail {
    position: absolute;
    bottom: -5.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
}

.trail span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--spirit-green) 0%, transparent 70%);
    box-shadow: 0 0 8px rgba(0, 229, 160, 0.6);
    animation: trail-fade 3s ease-in-out infinite;
}

.trail span:nth-child(1) { animation-delay: 0s; }
.trail span:nth-child(2) { animation-delay: 0.4s; }
.trail span:nth-child(3) { animation-delay: 0.8s; }
.trail span:nth-child(4) { animation-delay: 1.2s; }
.trail span:nth-child(5) { animation-delay: 1.6s; }
.trail span:nth-child(6) { animation-delay: 2.0s; }

.trail-down span {
    background: radial-gradient(circle, var(--mystic-pink) 0%, transparent 70%);
    box-shadow: 0 0 8px rgba(255, 110, 199, 0.6);
}

@keyframes trail-fade {
    0%, 100% { opacity: 0.2; transform: scale(0.7); }
    50%      { opacity: 1; transform: scale(1.3); }
}

/* Threshold Footer */
.threshold-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 6rem 2rem 4rem;
    color: var(--lavender-mist);
}

.footer-sigil {
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem;
    opacity: 0.6;
    animation: sigil-spin 120s linear infinite reverse;
}

.footer-sigil svg {
    width: 100%;
    height: 100%;
}

.footer-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.18em;
    color: var(--lavender-mist);
    opacity: 0.75;
    margin-bottom: 0.6rem;
}

.footer-meta {
    font-family: var(--font-label);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: var(--spirit-green);
    opacity: 0.55;
    text-transform: lowercase;
}

#moon-time {
    color: var(--mystic-pink);
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 900px) {
    .veil-header {
        padding: 1.2rem 1.6rem;
    }

    .spirit-nav {
        gap: 1.2rem;
    }

    .spirit-link {
        font-size: 0.75rem;
        letter-spacing: 0.14em;
    }

    .section-a,
    .section-b,
    .section-c,
    .section-d,
    .section-e {
        margin-left: auto;
        margin-right: auto;
        width: 92%;
    }

    .spirit-section {
        padding: 2.2rem 1.6rem 2.4rem;
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .hero {
        padding: 7rem 1.4rem 4rem;
    }

    .orb-1, .orb-4 { width: 220px; height: 220px; }
    .orb-2, .orb-5 { width: 180px; height: 180px; }
    .orb-3, .orb-6 { width: 160px; height: 160px; }
    .orb-7, .orb-8 { width: 140px; height: 140px; }
}

@media (max-width: 560px) {
    .spirit-nav {
        display: none;
    }

    .veil-header {
        justify-content: center;
    }
}
