/* === CSS Custom Properties === */
:root {
    --deep-void: #0A0E1A;
    --deep-void-edge: #060810;
    --electric-cyan: #00F0FF;
    --hot-magenta: #FF2D7B;
    --acid-lime: #B8FF00;
    --plasma-violet: #7B2FFF;
    --soft-white: #E8E6F0;
    --glass-fog: #1A1E2E;
    --glass-fog-alpha: rgba(26, 30, 46, 0.7);
    --aurora-teal: #00D4AA;

    --font-display: 'Josefin Sans', sans-serif;
    --font-secondary: 'Outfit', sans-serif;
    --font-body: 'Space Mono', monospace;
    --font-accent: 'Orbitron', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: radial-gradient(ellipse at center, var(--deep-void) 0%, var(--deep-void-edge) 100%);
    color: var(--soft-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* === Waypoint Navigation === */
#waypoints {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.waypoint {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.2);
    border: 1px solid rgba(0, 240, 255, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.waypoint.active {
    background: var(--electric-cyan);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.6), 0 0 40px rgba(0, 240, 255, 0.2);
    transform: scale(1.3);
}

.waypoint:hover {
    background: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

/* === Particle Field === */
#particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    opacity: 0;
    animation: particle-drift linear infinite;
}

.particle-cyan {
    background: var(--electric-cyan);
    box-shadow: 0 0 4px var(--electric-cyan);
}

.particle-violet {
    background: var(--plasma-violet);
    box-shadow: 0 0 4px var(--plasma-violet);
}

@keyframes particle-drift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(30px);
        opacity: 0;
    }
}

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

/* === Sections === */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

/* === Section 1: Opening Void === */
#opening {
    height: 100vh;
    flex-direction: column;
}

.bloom-ring {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--electric-cyan) 0%, transparent 70%);
    opacity: 0;
    transition: none;
    z-index: 1;
}

.bloom-ring.active {
    animation: bloom-expand 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bloom-expand {
    0% {
        width: 10px;
        height: 10px;
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        width: 200vmax;
        height: 200vmax;
        opacity: 0.08;
    }
}

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

.domain-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.04em;
    color: var(--soft-white);
    opacity: 0;
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.3), 0 0 80px rgba(0, 240, 255, 0.1);
}

.domain-title.visible {
    opacity: 1;
}

.domain-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.domain-title .char.revealed {
    opacity: 1;
    transform: translateY(0);
}

.subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--electric-cyan);
    margin-top: 24px;
    min-height: 1.75em;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.subtitle.visible {
    opacity: 1;
}

/* === Section 2: Dependency Web === */
#web {
    min-height: 150vh;
    position: relative;
    padding: 10vh 5vw;
}

.dependency-graph {
    position: relative;
    width: 100%;
    height: 130vh;
}

.node {
    position: absolute;
    left: var(--node-x);
    top: var(--node-y);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.6s ease;
    z-index: 3;
}

.node.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.node-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0.15;
    animation: halo-pulse 4s ease-in-out infinite;
    z-index: -1;
}

.halo-cyan {
    background: radial-gradient(circle, var(--electric-cyan) 0%, transparent 70%);
}

.halo-violet {
    background: radial-gradient(circle, var(--plasma-violet) 0%, transparent 70%);
}

.halo-magenta {
    background: radial-gradient(circle, var(--hot-magenta) 0%, transparent 70%);
}

.halo-lime {
    background: radial-gradient(circle, var(--acid-lime) 0%, transparent 70%);
}

@keyframes halo-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.15;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.25;
    }
}

.node-content {
    background: var(--glass-fog-alpha);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    padding: 28px 32px;
    max-width: 280px;
    min-width: 200px;
    text-align: center;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.node-content:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}

.node-label {
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--electric-cyan);
    display: block;
    margin-bottom: 10px;
}

.node-text {
    font-family: var(--font-body);
    font-size: clamp(0.78rem, 0.9vw, 0.9rem);
    color: var(--soft-white);
    line-height: 1.65;
    opacity: 0.85;
}

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

.connection-line {
    stroke: url(#line-gradient);
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 8 4;
    animation: dash-flow 2s linear infinite;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.connection-line.visible {
    opacity: 0.4;
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -24;
    }
}

/* === Aurora Bands === */
.aurora-band {
    position: absolute;
    width: 120%;
    height: 200px;
    left: -10%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--electric-cyan) 20%,
        var(--plasma-violet) 40%,
        var(--hot-magenta) 60%,
        var(--aurora-teal) 80%,
        transparent 100%
    );
    opacity: 0.06;
    filter: blur(60px);
    animation: aurora-shift 30s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.aurora-band-top {
    top: 0;
}

.aurora-band-mid {
    top: -100px;
}

@keyframes aurora-shift {
    0%, 100% {
        background-position: 0% 50%;
        transform: translateX(0) scaleY(1);
    }
    33% {
        background-position: 100% 50%;
        transform: translateX(3%) scaleY(1.2);
    }
    66% {
        background-position: 50% 50%;
        transform: translateX(-3%) scaleY(0.9);
    }
}

/* === Section 3: The Reveal === */
#reveal {
    min-height: 120vh;
    padding: 10vh 5vw;
    flex-direction: column;
    align-items: center;
}

.reveal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.reveal-block {
    background: var(--glass-fog-alpha);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px 36px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                border-color 0.3s ease, box-shadow 0.3s ease;
}

.reveal-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.block-what {
    border-radius: 40% 60% 65% 35% / 45% 35% 65% 55%;
}

.block-why {
    border-radius: 65% 35% 40% 60% / 35% 55% 45% 65%;
}

.block-how {
    border-radius: 35% 65% 55% 45% / 60% 40% 60% 40%;
    grid-column: 1 / -1;
}

.reveal-block:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.1);
}

.reveal-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--electric-cyan), var(--plasma-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reveal-text {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--soft-white);
    opacity: 0.85;
    line-height: 1.75;
    margin-bottom: 14px;
}

.reveal-text:last-child {
    margin-bottom: 0;
}

/* SBOM Sample */
.sbom-sample {
    grid-column: 1 / -1;
    background: rgba(6, 8, 16, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sbom-sample.visible {
    opacity: 1;
    transform: translateY(0);
}

.sample-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--glass-fog-alpha);
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.sample-format {
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--electric-cyan);
    letter-spacing: 0.06em;
}

.sample-hash {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--plasma-violet);
    opacity: 0.7;
}

.sample-code {
    padding: 24px;
    overflow-x: auto;
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--soft-white);
    opacity: 0.9;
}

.sample-code code {
    font-family: inherit;
}

/* === Section 4: Aurora Horizon === */
#horizon {
    min-height: 100vh;
    flex-direction: column;
    position: relative;
}

.aurora-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.aurora-layer {
    position: absolute;
    width: 150%;
    height: 60%;
    left: -25%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    will-change: transform;
}

.aurora-layer-1 {
    top: 10%;
    background: radial-gradient(ellipse, var(--electric-cyan) 0%, var(--plasma-violet) 50%, transparent 70%);
    animation: aurora-float-1 20s ease-in-out infinite;
}

.aurora-layer-2 {
    top: 30%;
    background: radial-gradient(ellipse, var(--hot-magenta) 0%, var(--aurora-teal) 50%, transparent 70%);
    animation: aurora-float-2 25s ease-in-out infinite;
}

.aurora-layer-3 {
    top: 20%;
    background: radial-gradient(ellipse, var(--acid-lime) 0%, var(--electric-cyan) 40%, var(--plasma-violet) 70%, transparent 85%);
    animation: aurora-float-3 30s ease-in-out infinite;
}

@keyframes aurora-float-1 {
    0%, 100% { transform: translateX(0%) translateY(0%) rotate(0deg); }
    33% { transform: translateX(10%) translateY(-5%) rotate(2deg); }
    66% { transform: translateX(-8%) translateY(3%) rotate(-1deg); }
}

@keyframes aurora-float-2 {
    0%, 100% { transform: translateX(0%) translateY(0%) rotate(0deg); }
    33% { transform: translateX(-12%) translateY(4%) rotate(-3deg); }
    66% { transform: translateX(6%) translateY(-2%) rotate(2deg); }
}

@keyframes aurora-float-3 {
    0%, 100% { transform: translateX(5%) translateY(0%) rotate(1deg); }
    33% { transform: translateX(-5%) translateY(-8%) rotate(-2deg); }
    66% { transform: translateX(10%) translateY(5%) rotate(3deg); }
}

.horizon-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 700px;
    padding: 0 20px;
}

.horizon-text {
    font-family: var(--font-secondary);
    font-weight: 300;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    line-height: 2;
    color: var(--soft-white);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.horizon-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.glowing-text {
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}

.horizon-cta {
    margin-top: 60px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.5s, transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
}

.horizon-cta.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-node {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--electric-cyan), var(--hot-magenta), var(--acid-lime));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-cycle 8s ease-in-out infinite;
    display: inline-block;
    text-shadow: none;
}

@keyframes gradient-cycle {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.final-domain {
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    transition: opacity 2s ease;
}

.final-domain.visible {
    opacity: 0.15;
}

.final-domain-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.06em;
    color: var(--soft-white);
    text-shadow: 0 0 60px rgba(0, 240, 255, 0.1);
}

/* === Bottom Aurora Bar === */
#bottom-aurora {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 99;
    background: linear-gradient(
        90deg,
        var(--electric-cyan),
        var(--plasma-violet),
        var(--hot-magenta),
        var(--aurora-teal),
        var(--electric-cyan)
    );
    background-size: 300% 100%;
    animation: bottom-aurora-flow 10s linear infinite;
    opacity: 0.6;
}

@keyframes bottom-aurora-flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 300% 0%; }
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
    #waypoints {
        left: 12px;
        gap: 14px;
    }

    .waypoint {
        width: 8px;
        height: 8px;
    }

    .dependency-graph {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding: 5vh 0;
    }

    .node {
        position: relative;
        left: auto;
        top: auto;
        transform: scale(0);
        opacity: 0;
    }

    .node.visible {
        transform: scale(1);
        opacity: 1;
    }

    .node-content {
        max-width: 90vw;
        min-width: auto;
        border-radius: 24px;
    }

    .connection-lines {
        display: none;
    }

    .reveal-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 10px;
    }

    .block-what,
    .block-why,
    .block-how {
        border-radius: 20px;
        grid-column: auto;
    }

    .reveal-block {
        padding: 28px 24px;
    }

    .horizon-text {
        font-size: clamp(1.1rem, 4vw, 1.6rem);
    }

    #web {
        padding: 5vh 3vw;
    }
}

@media (max-width: 480px) {
    .domain-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .node-content {
        padding: 20px 22px;
    }

    .sample-code {
        font-size: 0.7rem;
        padding: 16px;
    }
}
