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

:root {
    --color-dark: #1a1a1e;
    --color-deep-teal: #0d2b2b;
    --color-teal: #3a9e8f;
    --color-cyan: #00d4aa;
    --color-warm-cream: #f7f2ea;
    --color-parchment: #f0dbb4;
    --color-brass: #c9873a;
    --color-earth: #6b6152;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-dark);
    color: var(--color-warm-cream);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    cursor: none;
}

/* === CURSOR FOLLOWER === */
#cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, width 0.3s, height 0.3s, border-color 0.3s;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

#cursor-follower.magnetic {
    width: 50px;
    height: 50px;
    border-color: var(--color-brass);
}

/* === SECTION BORDERS === */
.section-border {
    position: fixed;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-brass), var(--color-cyan), var(--color-brass), transparent);
    z-index: 100;
    opacity: 0.7;
}

#section-border-top { top: 0; }
#section-border-bottom { bottom: 0; }

/* === NARRATIVE SECTIONS === */
.narrative-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#arrival {
    background: radial-gradient(ellipse at center, var(--color-deep-teal) 0%, var(--color-dark) 70%);
}

#discovery {
    background: linear-gradient(180deg, var(--color-dark) 0%, #0f1f1f 50%, var(--color-dark) 100%);
}

#wonder {
    background: radial-gradient(ellipse at center, #0a2020 0%, var(--color-dark) 80%);
}

#knowledge {
    background: linear-gradient(180deg, var(--color-dark) 0%, #1a1a1e 100%);
}

#departure {
    background: radial-gradient(ellipse at top, #0d2b2b 0%, #0a0a0c 100%);
}

/* === PARALLAX LAYERS === */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.layer-bg {
    z-index: 1;
}

.layer-mid {
    z-index: 2;
}

.layer-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    width: 100%;
    min-height: 100vh;
}

/* === GEAR CLUSTERS === */
.gear-cluster {
    position: absolute;
    width: 300px;
    height: 300px;
    animation: rotate-slow 60s linear infinite;
}

.gear-1 {
    top: 10%;
    left: -5%;
    opacity: 0.4;
}

.gear-2 {
    bottom: 10%;
    right: -5%;
    opacity: 0.3;
    animation-direction: reverse;
}

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

/* === FILIGREE FRAME === */
.filigree-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.frame-corner {
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0.6;
}

.frame-corner.top-left { top: 2rem; left: 2rem; }
.frame-corner.top-right { top: 2rem; right: 2rem; }
.frame-corner.bottom-left { bottom: 2rem; left: 2rem; }
.frame-corner.bottom-right { bottom: 2rem; right: 2rem; }

/* === HERO === */
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title-line {
    color: var(--color-warm-cream);
}

.title-accent {
    color: var(--color-cyan);
    font-style: italic;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: var(--color-parchment);
    opacity: 0.8;
    max-width: 600px;
    margin-bottom: 3rem;
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.scroll-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-cyan);
}

.scroll-arrow {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* === SECTION TITLES === */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
    color: var(--color-warm-cream);
}

.section-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    line-height: 1.8;
    color: var(--color-parchment);
    max-width: 650px;
    margin-bottom: 2.5rem;
}

.italic-quote {
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--color-cyan);
    opacity: 0.9;
}

/* === ORNAMENTS === */
.section-ornament {
    margin-bottom: 2rem;
}

.ornament-divider {
    width: 300px;
    height: 20px;
}

/* === CIRCUIT VINES === */
.circuit-vines {
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    opacity: 0.15;
}

.left-vine {
    left: 5%;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 20px,
        var(--color-brass) 20px,
        var(--color-brass) 21px,
        transparent 21px,
        transparent 40px
    );
    border-left: 1px solid var(--color-brass);
}

.right-vine {
    right: 5%;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 30px,
        var(--color-teal) 30px,
        var(--color-teal) 31px,
        transparent 31px,
        transparent 60px
    );
    border-right: 1px solid var(--color-teal);
}

/* === DATA FLOW === */
.data-flow-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.data-node {
    width: 120px;
    height: 120px;
    border: 2px solid var(--color-brass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.data-node::before {
    content: '';
    position: absolute;
    inset: -6px;
    border: 1px solid var(--color-cyan);
    border-radius: 50%;
    opacity: 0.3;
}

.data-node:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.3);
    transform: scale(1.1);
}

.node-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--color-cyan);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* === PARTICLE CANVAS === */
#particle-canvas {
    width: 100%;
    height: 100%;
}

/* === HOLOGRAPHIC DISPLAY === */
.holographic-display {
    position: relative;
    width: 250px;
    height: 250px;
    margin-top: 3rem;
}

.holo-ring {
    position: absolute;
    border: 2px solid var(--color-cyan);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
}

.ring-1 {
    width: 100%;
    height: 100%;
    animation: holo-spin 8s linear infinite;
    border-style: dashed;
}

.ring-2 {
    width: 70%;
    height: 70%;
    animation: holo-spin 6s linear infinite reverse;
    border-color: var(--color-brass);
}

.ring-3 {
    width: 40%;
    height: 40%;
    animation: holo-spin 4s linear infinite;
    border-style: dotted;
}

.holo-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--color-cyan);
    border-radius: 50%;
    box-shadow: 0 0 40px var(--color-cyan), 0 0 80px rgba(0, 212, 170, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes holo-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 40px var(--color-cyan), 0 0 80px rgba(0, 212, 170, 0.3); }
    50% { box-shadow: 0 0 60px var(--color-cyan), 0 0 120px rgba(0, 212, 170, 0.5); }
}

/* === CROSSHATCH PATTERN === */
.crosshatch-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(45deg, var(--color-brass) 0, var(--color-brass) 1px, transparent 0, transparent 20px),
        repeating-linear-gradient(-45deg, var(--color-brass) 0, var(--color-brass) 1px, transparent 0, transparent 20px);
}

/* === KNOWLEDGE GRID === */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    width: 100%;
    margin-top: 2rem;
}

.knowledge-card {
    background: rgba(26, 26, 30, 0.8);
    border: 1px solid var(--color-brass);
    border-radius: 4px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.knowledge-card:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.15);
    transform: translateY(-5px);
}

.card-icon {
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-warm-cream);
    margin-bottom: 0.75rem;
}

.card-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--color-earth);
    line-height: 1.6;
}

/* === STARFIELD === */
.starfield {
    position: absolute;
    inset: 0;
    background: radial-gradient(1px 1px at 20px 30px, var(--color-cyan), transparent),
                radial-gradient(1px 1px at 40px 70px, var(--color-warm-cream), transparent),
                radial-gradient(1px 1px at 90px 40px, var(--color-brass), transparent),
                radial-gradient(1px 1px at 130px 80px, var(--color-cyan), transparent),
                radial-gradient(1px 1px at 160px 30px, var(--color-warm-cream), transparent);
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.4; }
    to { opacity: 0.8; }
}

/* === DEPARTURE === */
.departure-wordmark {
    margin-top: 3rem;
}

.wordmark-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--color-brass), var(--color-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === REVEAL ANIMATIONS === */
.narrative-section .layer-content > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.narrative-section.visible .layer-content > * {
    opacity: 1;
    transform: translateY(0);
}

.narrative-section.visible .layer-content > *:nth-child(1) { transition-delay: 0.1s; }
.narrative-section.visible .layer-content > *:nth-child(2) { transition-delay: 0.3s; }
.narrative-section.visible .layer-content > *:nth-child(3) { transition-delay: 0.5s; }
.narrative-section.visible .layer-content > *:nth-child(4) { transition-delay: 0.7s; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .frame-corner { width: 60px; height: 60px; }
    .gear-cluster { width: 150px; height: 150px; }
    .data-flow-container { gap: 1rem; }
    .data-node { width: 80px; height: 80px; }
    .node-label { font-size: 0.6rem; }
    .holographic-display { width: 180px; height: 180px; }
}
