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

html {
    scroll-behavior: smooth;
    background: #0a0e1a;
    color: #d8e4f0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    letter-spacing: 0.02em;
}

body {
    background: #0a0e1a;
    overflow-x: hidden;
}

/* === Scroll Progress Indicator === */
.scroll-progress {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 0%;
    background: #4a7fb5;
    z-index: 100;
    transition: height 0.05s linear;
}

/* === Particles === */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #4a7fb5;
    opacity: 0.15;
    will-change: transform;
}

@keyframes drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100vh); }
}

/* === Main Layout === */
main {
    position: relative;
    z-index: 2;
}

/* === Typography === */
.heading {
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(2rem, 4.5vw, 4rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    line-height: 1.2;
    color: #d8e4f0;
    margin-bottom: 1.5rem;
}

.caption {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #5c6878;
    margin-bottom: 0.75rem;
}

article p {
    max-width: 38ch;
    margin-bottom: 1.5em;
    color: #d8e4f0;
}

.warm-text {
    color: #c4956a;
}

/* === Monopole Dot === */
.monopole-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6ba3d6;
    box-shadow:
        0 0 4px 1px #6ba3d6,
        0 0 15px 4px rgba(106, 163, 214, 0.4),
        0 0 40px 10px rgba(106, 163, 214, 0.15),
        0 0 80px 20px rgba(106, 163, 214, 0.05);
    animation: monopole-pulse 4s ease-in-out infinite;
    transform: translate(-50%, -50%);
    z-index: 5;
}

@keyframes monopole-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

/* === Field Lines (SVG) === */
.field-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
}

.field-lines path {
    stroke: #1a2744;
    stroke-width: 0.5px;
    fill: none;
    vector-effect: non-scaling-stroke;
}

/* === Opening Section === */
.opening {
    position: relative;
    height: 100vh;
    background: radial-gradient(ellipse at 61.8% 38.2%, #1a2744 0%, #0a0e1a 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.opening-title {
    position: absolute;
    z-index: 5;
}

.vertical-text {
    writing-mode: vertical-rl;
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0.25em;
    color: #5c6878;
}

/* === Drift Sections === */
.drift {
    position: relative;
    min-height: 80vh;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0 clamp(1.5rem, 3vw, 3rem);
    align-content: center;
    padding: clamp(4rem, 10vh, 8rem) clamp(1rem, 4vw, 3rem);
}

.drift-left {
    background: radial-gradient(ellipse at 35% 45%, #1a2744 0%, #0a0e1a 70%);
    padding-block: clamp(6rem, 12vh, 10rem);
}

.drift-right {
    background: radial-gradient(ellipse at 65% 30%, #1a2744 0%, #0a0e1a 70%);
    padding-block: clamp(5rem, 10vh, 9rem);
}

.drift-inner {
    display: flex;
    flex-direction: column;
}

/* === Candle Interludes === */
.candle-interlude {
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, #1a2744 0%, #0a0e1a 70%);
    position: relative;
}

.candle {
    position: relative;
    width: 40px;
    height: 60px;
}

.flame-outer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 32px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: #c4956a;
    opacity: 0.6;
    filter: blur(1px);
    animation: flicker 3s ease-in-out infinite;
    will-change: transform;
}

.flame-inner {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: #f0f3f7;
    opacity: 0.8;
    filter: blur(0.5px);
    animation: flicker 2.7s ease-in-out infinite 0.3s;
    will-change: transform;
}

.flame-reflection {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) scaleY(-1);
    width: 16px;
    height: 32px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: #c4956a;
    opacity: 0.15;
    filter: blur(4px);
    animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { transform: translateX(-50%) scaleY(1) skewX(0deg); }
    25% { transform: translateX(-50%) scaleY(1.05) skewX(-1deg); }
    50% { transform: translateX(-50%) scaleY(0.95) skewX(1.5deg); }
    75% { transform: translateX(-50%) scaleY(1.02) skewX(-0.5deg); }
}

/* === Terminal Section === */
.terminal {
    position: relative;
    height: 100vh;
    background: radial-gradient(ellipse at 38.2% 61.8%, #1a2744 0%, #0a0e1a 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* === Responsive === */
@media (max-width: 768px) {
    .drift {
        grid-template-columns: 1fr;
        padding: clamp(3rem, 8vh, 6rem) 1.25rem;
    }
    .drift-inner {
        grid-column: 1 / -1 !important;
    }
    .opening-title {
        left: 50% !important;
    }
}
