/* aiice.dev — single-page vertical narrative
   Palette: #0a0a12 #0f1129 #00f0ff #ff2d78 #8b5cf6 #e8eaf6 #7a8ba8 #ff6b9d #4a90d9 #4a1060
   Typography: Recursive variable + standard monospace fallback
   Design tokens: Fira Code" Intersection Observer IntersectionObserver opacity with thresholds (`0
*/

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

html {
    scroll-behavior: smooth;
    background: #0a0a12;
}

body {
    font-family: "Recursive", "SF Mono", "Fira Code", monospace;
    font-variation-settings: 'MONO' 0, 'CASL' 0.5, 'wght' 400, 'slnt' 0;
    background: #0a0a12;
    color: #e8eaf6;
    overflow-x: hidden;
    min-height: 100vh;
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Particle canvas ========== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
}

/* ========== Neon glow orbs ========== */
.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: screen;
    filter: blur(20px);
    z-index: 2;
    opacity: 0;
    animation: orb-pulse 12s ease-in-out infinite;
}

.orb-cyan {
    background: radial-gradient(circle, #00f0ff 0%, rgba(0, 240, 255, 0) 70%);
}

.orb-magenta {
    background: radial-gradient(circle, #ff2d78 0%, rgba(255, 45, 120, 0) 70%);
}

.orb-violet {
    background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
}

.orb-1 { width: 320px; height: 320px; top: 8vh;  left: 10vw;  animation-duration: 11s; }
.orb-2 { width: 240px; height: 240px; top: 55vh; right: 8vw;  animation-duration: 14s; animation-delay: -3s; }
.orb-3 { width: 400px; height: 400px; top: 180vh; left: 60vw; animation-duration: 15s; animation-delay: -6s; }
.orb-4 { width: 260px; height: 260px; top: 320vh; left: 15vw; animation-duration: 9s;  animation-delay: -2s; }

@keyframes orb-pulse {
    0%, 100% { opacity: 0.08; transform: scale(1); }
    50%      { opacity: 0.28; transform: scale(1.15); }
}

/* ========== Main + sections ========== */
main {
    position: relative;
    z-index: 3;
}

.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 6vw;
    overflow: hidden;
}

/* ========== Crystalline divider ========== */
.divider {
    display: block;
    width: 100vw;
    height: 2px;
    position: relative;
    z-index: 4;
    opacity: 0.7;
}

.divider line {
    stroke-dashoffset: 1200;
    animation: draw-line 1.8s ease-out forwards;
}

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

/* ========== Opening Void ========== */
.section-void {
    background: radial-gradient(ellipse at center, #0f1129 0%, #0a0a12 55%, #06060c 100%);
    flex-direction: column;
    text-align: center;
}

.pulse-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: #00f0ff;
    border-radius: 50%;
    box-shadow:
        0 0 12px #00f0ff,
        0 0 30px #00f0ff,
        0 0 60px rgba(0, 240, 255, 0.5),
        0 0 120px rgba(0, 240, 255, 0.25);
    animation: pulse-star 3.2s ease-in-out infinite;
    opacity: 0;
}

body.brand-ready .pulse-star {
    opacity: 0.25;
    animation-delay: 0s;
}

@keyframes pulse-star {
    0%, 100% { transform: scale(1);   opacity: 0.25; }
    50%      { transform: scale(1.8); opacity: 0.8;  }
}

/* ========== Brand ========== */
.brand-wrap {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    transition: opacity 1s ease-out;
}

body.brand-ready .brand-wrap {
    opacity: 1;
}

.brand {
    font-family: "Recursive", "SF Mono", "Fira Code", monospace;
    font-size: clamp(72px, 14vw, 180px);
    font-variation-settings: 'MONO' 0, 'CASL' 1, 'wght' 800, 'slnt' -8;
    color: #e8eaf6;
    letter-spacing: -0.02em;
    line-height: 1;
    cursor: pointer;
    transition: font-variation-settings 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                letter-spacing 0.4s ease;
    display: inline-flex;
    user-select: none;
}

.brand:hover {
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 300, 'slnt' 0;
    letter-spacing: 0.04em;
}

.brand .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    animation: letter-in 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(2s + var(--i) * 150ms);
    text-shadow:
        0 0 10px rgba(0, 240, 255, 0.4),
        0 0 28px rgba(0, 240, 255, 0.2);
}

@keyframes letter-in {
    0% {
        opacity: 0;
        transform: translateY(24px);
        text-shadow:
            0 0 0 rgba(0, 240, 255, 0),
            0 0 0 rgba(0, 240, 255, 0);
        filter: blur(4px);
    }
    40% {
        text-shadow:
            0 0 30px #00f0ff,
            0 0 60px #00f0ff,
            0 0 120px rgba(0, 240, 255, 0.3);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        text-shadow:
            0 0 10px rgba(0, 240, 255, 0.4),
            0 0 28px rgba(0, 240, 255, 0.2);
        filter: blur(0);
    }
}

/* Brand reflection */
.brand-reflection {
    font-family: "Recursive", "SF Mono", "Fira Code", monospace;
    font-size: clamp(72px, 14vw, 180px);
    font-variation-settings: 'MONO' 0, 'CASL' 1, 'wght' 800, 'slnt' -8;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #8b5cf6;
    margin-top: -0.4em;
    transform: scaleY(-1);
    filter: blur(2px) brightness(0.6) hue-rotate(40deg);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 70%);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 1.2s ease-out;
    transition-delay: 2.5s;
    user-select: none;
    pointer-events: none;
}

body.brand-ready .brand-reflection {
    opacity: 0.85;
}

.brand-sub {
    margin-top: 1rem;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 300, 'slnt' 0;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: #7a8ba8;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    transition-delay: 3.2s;
}

body.brand-ready .brand-sub {
    opacity: 1;
}

.brand-sub .label {
    color: #4a90d9;
    margin-right: 0.5em;
}

.brand-sub .label-value {
    color: #7a8ba8;
}

/* Scroll whisper */
.scroll-whisper {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 300, 'slnt' 0;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #4a90d9;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    transition-delay: 4s;
}

body.brand-ready .scroll-whisper {
    opacity: 0.7;
}

.scroll-arrow {
    font-size: 18px;
    color: #00f0ff;
    animation: arrow-drift 2.4s ease-in-out infinite;
}

@keyframes arrow-drift {
    0%, 100% { transform: translateY(0);    opacity: 0.5; }
    50%      { transform: translateY(8px);  opacity: 1;   }
}

/* ========== Descent text blocks ========== */
.text-block {
    position: relative;
    z-index: 5;
    max-width: 38ch;
}

.upper-left {
    margin-right: auto;
    margin-left: 8vw;
    margin-top: -20vh;
    align-self: flex-start;
}

.lower-right {
    margin-left: auto;
    margin-right: 8vw;
    margin-top: 20vh;
    text-align: right;
    align-self: flex-end;
}

.enormous {
    max-width: 22ch;
    text-align: center;
    margin: 0 auto;
}

.descent-1 { align-items: flex-start; padding-top: 24vh; }
.descent-2 { align-items: flex-end;   padding-bottom: 18vh; }
.descent-3 { align-items: center; }

.narrative {
    font-variation-settings: 'MONO' 0, 'CASL' 0.5, 'wght' 400, 'slnt' 0;
    font-size: clamp(18px, 1.6vw, 22px);
    line-height: 1.8;
    letter-spacing: 0.02em;
    color: #e8eaf6;
    margin: 1.4rem 0;
}

.narrative em {
    font-style: normal;
    font-variation-settings: 'MONO' 0, 'CASL' 1, 'wght' 500, 'slnt' -6;
    color: #00f0ff;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
    transition: letter-spacing 0.3s ease, text-shadow 0.3s ease;
}

.narrative em:hover {
    letter-spacing: 0.07em;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.65);
}

.narrative.huge {
    font-variation-settings: 'MONO' 0, 'CASL' 0.8, 'wght' 600, 'slnt' -4;
    font-size: clamp(44px, 8vw, 96px);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.narrative.huge .word {
    display: inline-block;
    margin: 0 0.22em;
    transition: letter-spacing 0.3s ease, color 0.3s ease;
}

.narrative.huge .word:hover {
    letter-spacing: 0.05em;
}

.narrative.huge .word.accent {
    color: #ff2d78;
    text-shadow:
        0 0 18px rgba(255, 45, 120, 0.5),
        0 0 44px rgba(255, 45, 120, 0.25);
    font-variation-settings: 'MONO' 0, 'CASL' 1, 'wght' 700, 'slnt' -10;
}

.narrative.narrow {
    max-width: 34ch;
    margin-top: 3rem;
}

.annotation {
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 300, 'slnt' 0;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: #4a90d9;
    text-transform: lowercase;
}

.annotation.annotation-right {
    text-align: right;
    color: #7a8ba8;
    margin-top: 1rem;
}

.annotation .label {
    color: #00f0ff;
    margin-right: 0.6em;
}

.annotation.center-anno {
    text-align: center;
    margin-bottom: 2.4rem;
}

/* Side mountain in descent-2 */
.side-mountain {
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    height: 100%;
    z-index: 3;
    opacity: 0.75;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, #000 60%, transparent 100%);
            mask-image: linear-gradient(to right, #000 60%, transparent 100%);
}

.side-mountain svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ========== Fade blocks via scroll ========== */
.fade-block {
    opacity: 0.06;
    transition: opacity 0.8s ease;
}

.fade-block.enter {
    opacity: 1;
}

.fade-block.exit {
    opacity: 0.3;
}

/* ========== Reflection Chamber ========== */
.reflection-chamber {
    background: linear-gradient(180deg, #0a0a12 0%, #0f1129 100%);
    flex-direction: column;
}

.reflection-wrap {
    width: 100%;
    max-width: 1000px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.reflection-stage {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.reflect-brand {
    font-family: "Recursive", "SF Mono", "Fira Code", monospace;
    font-variation-settings: 'MONO' 0, 'CASL' 1, 'wght' 800, 'slnt' -8;
    font-size: clamp(64px, 12vw, 160px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: #e8eaf6;
    text-shadow:
        0 0 10px rgba(0, 240, 255, 0.4),
        0 0 28px rgba(0, 240, 255, 0.2);
}

.reflect-line {
    width: 90%;
    max-width: 720px;
    height: 1px;
    margin: 0.4rem 0;
    background: linear-gradient(to right,
        transparent 0%,
        #00f0ff 15%,
        #00f0ff 85%,
        transparent 100%);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
    position: relative;
}

.reflect-mirror {
    transform: scaleY(-1);
    filter: blur(1.5px) brightness(0.6) hue-rotate(40deg);
    color: #8b5cf6;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 65%);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 65%);
    opacity: 0.9;
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    -webkit-background-clip: text;
            background-clip: text;
}

/* ========== Summit ========== */
.summit {
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    min-height: 110vh;
}

.summit-sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        #0a0a12 0%,
        #1a1040 40%,
        #4a1060 70%,
        #ff2d78 95%,
        #ff6b9d 100%);
    background-size: 100% 200%;
    background-position: 0% 0%;
    animation: aurora-shift 20s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes aurora-shift {
    0%   { background-position: 0% 0%;  }
    100% { background-position: 0% 30%; }
}

.summit-mountain {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.summit-mountain svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mtn {
    stroke: #00f0ff;
    stroke-width: 1;
    stroke-dasharray: 6000;
    stroke-dashoffset: 6000;
    transition: stroke-dashoffset 3s ease-out, fill 1s ease-out;
}

.mtn-back  { fill: #0f1129; }
.mtn-mid   { fill: #1a1040; opacity: 0.6; }
.mtn-front { fill: #2a1855; opacity: 0.3; }

.summit.enter .mtn {
    stroke-dashoffset: 0;
}

.summit-text {
    position: relative;
    z-index: 4;
    text-align: center;
    width: 100%;
    padding: 0 6vw 16vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.summit-statement {
    max-width: 28ch;
    font-variation-settings: 'MONO' 0, 'CASL' 0.7, 'wght' 500, 'slnt' -4;
    font-size: clamp(24px, 3vw, 40px);
    color: #e8eaf6;
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.6);
}

.summit-sign {
    display: flex;
    gap: 1.2rem;
    color: #e8eaf6;
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: lowercase;
}

.summit-sign .label {
    color: #00f0ff;
}

.summit-sign .label.dim {
    color: rgba(232, 234, 246, 0.55);
}

/* ========== Click ring ========== */
#click-ring-host {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.click-ring {
    position: absolute;
    border: 1px solid #00f0ff;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    width: 20px;
    height: 20px;
    box-shadow:
        0 0 12px rgba(0, 240, 255, 0.7),
        inset 0 0 12px rgba(0, 240, 255, 0.3);
    animation: ring-expand 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ring-expand {
    0%   { transform: translate(-50%, -50%) scale(0);  opacity: 0.9; border-width: 2px; }
    60%  { opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(18); opacity: 0;   border-width: 1px; }
}

/* ========== Responsive ========== */
@media (max-width: 720px) {
    .upper-left, .lower-right {
        margin-left: 6vw;
        margin-right: 6vw;
        margin-top: 0;
        text-align: left;
        align-self: center;
        max-width: 90vw;
    }
    .lower-right {
        text-align: right;
    }
    .side-mountain {
        width: 70%;
        opacity: 0.5;
    }
    .narrative.huge {
        font-size: clamp(36px, 12vw, 72px);
    }
    .reflect-brand {
        font-size: clamp(52px, 18vw, 120px);
    }
}
