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

:root {
    --deep-bg: #0a1628;
    --mid-bg: #0f2240;
    --ice-white: #e8f0ff;
    --body-text: #c8daf0;
    --accent-glow: #5ca8e8;
    --highlight-gem: #b088d8;
    --warm-signal: #e8a060;
    --frost-surface: rgba(200, 220, 245, 0.07);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-bg);
    color: var(--body-text);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 850vh;
}

/* === Frost Particles === */
.frost-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.frost-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(200, 220, 255, 0.15);
    border-radius: 50%;
    animation: drift linear infinite;
}

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

/* === Diamond Nav === */
.diamond-nav {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
}

.diamond-icon {
    width: 28px;
    height: 28px;
    background: rgba(92, 168, 232, 0.15);
    border: 1px solid rgba(92, 168, 232, 0.4);
    transform: rotate(45deg);
    cursor: pointer;
    animation: pulse-diamond 3s ease-in-out infinite;
    transition: background 0.3s;
}

.diamond-icon:hover {
    background: rgba(92, 168, 232, 0.3);
}

@keyframes pulse-diamond {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.radial-menu {
    position: absolute;
    top: 40px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.diamond-nav:hover .radial-menu {
    opacity: 1;
    pointer-events: all;
}

.radial-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-glow);
    text-decoration: none;
    padding: 4px 12px;
    background: rgba(15, 34, 64, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(92, 168, 232, 0.2);
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.2s;
}

.radial-link:hover {
    background: rgba(92, 168, 232, 0.15);
}

/* === Stations General === */
.station {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* === Station 0: The Crystal === */
.station-0 {
    height: 100vh;
    flex-direction: column;
}

.crystal-network {
    width: min(80vw, 700px);
    height: auto;
    opacity: 0.8;
}

.pulse-line {
    stroke-dasharray: 8 12;
    animation: pulse-travel 4s linear infinite;
}

@keyframes pulse-travel {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -40; }
}

.hero-text {
    position: absolute;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 7vw, 6.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ice-white);
    text-shadow: 0 0 40px rgba(160, 200, 255, 0.3);
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: letterReveal 0.4s forwards;
}

@keyframes letterReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    margin-top: 1.5rem;
}

/* === McBling Glint Effect === */
.glint {
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: glintSweep 4s ease-in-out 2s;
}

@keyframes glintSweep {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* === Data Chips === */
.data-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #7eb8e0;
    background: rgba(120, 180, 240, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    display: inline-block;
}

.data-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1.5rem 0;
}

/* === Frost Panels === */
.frost-panel {
    background: rgba(200, 220, 245, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 220, 255, 0.1);
    border-radius: 16px;
    padding: clamp(2rem, 4vw, 3.5rem);
    max-width: 560px;
    box-shadow: 0 8px 32px rgba(180, 210, 240, 0.08);
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.frost-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

@supports not (backdrop-filter: blur(20px)) {
    .frost-panel {
        background: rgba(15, 34, 64, 0.92);
    }
}

.left-panel {
    margin-right: auto;
    margin-left: 10%;
}

.right-panel {
    margin-left: auto;
    margin-right: 10%;
}

/* === Station 1 === */
.station-1 {
    margin-top: 20vh;
    min-height: 100vh;
}

.station-headline {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ice-white);
    text-shadow: 0 0 40px rgba(160, 200, 255, 0.3);
    margin-bottom: 1.5rem;
}

.body-text {
    color: var(--body-text);
    max-width: 38ch;
    margin-bottom: 1.5rem;
}

.stat-display {
    margin: 2rem 0;
}

.big-stat {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--ice-white);
    display: block;
    letter-spacing: 0.04em;
}

.big-stat.amber {
    color: var(--warm-signal);
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #7eb8e0;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

.crystal-growth {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: auto;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.frost-panel.visible .crystal-growth {
    opacity: 0.6;
}

/* === Station 2 === */
.station-2 {
    margin-top: 40vh;
    min-height: 100vh;
}

.route-map {
    width: 100%;
    height: auto;
    margin-bottom: 2rem;
}

.route-path {
    transition: d 1.5s ease;
}

.traveling-dot {
    animation: travel 6s linear infinite;
}

@keyframes travel {
    0% { cx: 50; }
    100% { cx: 550; }
}

/* === Station 3 === */
.station-3 {
    margin-top: 40vh;
    min-height: 100vh;
}

.node-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 1.5rem 0;
}

.node-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(200, 220, 245, 0.04);
    border: 1px solid rgba(200, 220, 255, 0.08);
    border-radius: 12px;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.node-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.node-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.node-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-name {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--ice-white);
}

.frost-fern {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: auto;
}

/* === Station 4 === */
.station-4 {
    margin-top: 40vh;
    min-height: 100vh;
}

.amber-tint {
    background: rgba(200, 220, 245, 0.07);
    background-image: linear-gradient(135deg, rgba(232, 160, 96, 0.03) 0%, transparent 60%);
}

.amber-chip {
    color: var(--warm-signal);
    background: rgba(232, 160, 96, 0.08);
}

.signal-node {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.pulse-crystal {
    width: 160px;
    height: 160px;
}

.signal-polygon {
    animation: signalPulse 3s ease-in-out infinite;
}

@keyframes signalPulse {
    0%, 100% { stroke: #e8a060; opacity: 0.8; }
    50% { stroke: #5ca8e8; opacity: 1; }
}

.signal-polygon-inner {
    animation: signalPulse 3s ease-in-out infinite 1.5s;
}

/* === Station 5: The Fade === */
.station-5 {
    margin-top: 40vh;
    min-height: 100vh;
    flex-direction: column;
}

.fade-content {
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.fade-content.visible {
    opacity: 1;
}

.fade-headline {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.06em;
    color: var(--ice-white);
    text-shadow: 0 0 40px rgba(160, 200, 255, 0.3);
    margin-bottom: 4rem;
}

.fade-crystal {
    opacity: 0.3;
    width: min(70vw, 600px);
    animation: fadeOut 8s ease forwards 3s;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .left-panel,
    .right-panel {
        margin-left: 5%;
        margin-right: 5%;
        max-width: 90%;
    }

    .crystal-growth {
        display: none;
    }

    .frost-fern {
        display: none;
    }
}
