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

:root {
    --deep-space: #0a1628;
    --frame-blue: #1a3a5c;
    --light-cone: #4a2d7a;
    --receding-red: #c4633a;
    --field-glow: #1e6b7b;
    --text-primary: #d8dce6;
    --text-bright: #f0f2f8;
    --grid-whisper: #2a4a6e;
    --angle: 26.57deg;
    --angle-comp: 63.43deg;
    --lorentz-scale: 1;
    --hue-shift: 0;
    --velocity-fraction: 0;
}

html {
    font-size: 16px;
    scroll-behavior: auto;
}

body {
    background-color: var(--deep-space);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === FIXED OVERLAYS === */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.worldline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 3;
}

/* === WATERCOLOR FIELD BACKGROUNDS === */
.watercolor-fields {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.field {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    transition: background 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, background;
}

.field-1 {
    width: 600px;
    height: 600px;
    top: -10%;
    right: -5%;
    background: radial-gradient(circle, #1e6b7b 0%, transparent 70%);
}

.field-2 {
    width: 450px;
    height: 450px;
    top: 30%;
    left: -8%;
    background: radial-gradient(circle, #1e6b7b 0%, transparent 70%);
}

.field-3 {
    width: 500px;
    height: 500px;
    bottom: 10%;
    right: 20%;
    background: radial-gradient(circle, #1e6b7b 0%, transparent 70%);
}

.field-4 {
    width: 350px;
    height: 350px;
    top: 55%;
    left: 30%;
    background: radial-gradient(circle, #1e6b7b 0%, transparent 65%);
}

.field-5 {
    width: 700px;
    height: 700px;
    top: 15%;
    left: 45%;
    background: radial-gradient(circle, #1a3a5c 0%, transparent 75%);
    opacity: 0.2;
}

/* Doppler shift state applied via JS */
.watercolor-fields.doppler-shifted .field-1,
.watercolor-fields.doppler-shifted .field-2,
.watercolor-fields.doppler-shifted .field-3,
.watercolor-fields.doppler-shifted .field-4 {
    background: radial-gradient(circle, #4a2d7a 0%, transparent 70%);
}

/* === SCROLL CONTAINER === */
.scroll-container {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* === SECTION BASE === */
.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* === HERO SECTION === */
.section-hero {
    height: 100vh;
    position: relative;
}

.hero-diagonal-split {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

.hero-left {
    position: absolute;
    bottom: 10%;
    left: 5%;
    z-index: 5;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 14vw, 12rem);
    letter-spacing: 0.04em;
    color: var(--text-bright);
    line-height: 0.9;
    text-transform: lowercase;
}

.hero-title-line {
    display: block;
    opacity: 0;
    transform: translateX(-40px) rotate(-2deg);
    animation: heroReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title-line:nth-child(2) {
    animation-delay: 0.2s;
    margin-left: 0.5em;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

.hero-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
    overflow: hidden;
}

.hero-field-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 60% 50% at 70% 40%, #1e6b7b 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 60%, #4a2d7a 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 60% 50%, #1a3a5c 0%, transparent 70%);
    opacity: 0.7;
}

.hero-light-cone {
    position: absolute;
    top: 20%;
    left: 30%;
    width: 50%;
    height: 60%;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: linear-gradient(180deg, #1a3a5c 0%, transparent 100%);
    opacity: 0.15;
}

.hero-diagonal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--frame-blue) 20%, var(--field-glow) 50%, var(--frame-blue) 80%, transparent 100%);
    transform-origin: 0 0;
    transform: rotate(0deg);
    animation: diagonalReveal 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
    z-index: 6;
}

@keyframes diagonalReveal {
    to {
        transform: rotate(26.57deg);
    }
}

.hero-subtitle {
    position: absolute;
    bottom: 5%;
    right: 5%;
    z-index: 5;
}

/* === DATA LABELS === */
.data-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--field-glow);
    display: inline-block;
}

.data-label-grid {
    margin-bottom: 1rem;
    display: block;
    color: var(--grid-whisper);
}

/* Typewriter effect: chars hidden until JS reveals */
.data-label[data-typewrite] {
    overflow: hidden;
}

/* === PANEL SECTIONS === */
.section-panel {
    min-height: 100vh;
    padding: 5vh 0;
}

.panel-container {
    max-width: 700px;
    padding: 4rem 3rem;
    position: relative;
}

.panel-parallelogram {
    clip-path: polygon(8% 0%, 100% 0%, 92% 100%, 0% 100%);
    background: linear-gradient(135deg, rgba(26, 58, 92, 0.15) 0%, rgba(10, 22, 40, 0.6) 100%);
    backdrop-filter: blur(4px);
}

.panel-left {
    margin-left: 5%;
    transform: translateX(-60px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-left.visible {
    transform: translateX(0);
    opacity: 1;
}

.panel-right {
    margin-left: auto;
    margin-right: 5%;
    transform: translateX(60px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-right.visible {
    transform: translateX(0);
    opacity: 1;
}

.panel-center {
    margin-left: auto;
    margin-right: auto;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.04em;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    line-height: 1.05;
}

.panel-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === PULL QUOTES === */
.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--text-bright);
    line-height: 1.5;
    margin-top: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--light-cone);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pull-quote.visible {
    opacity: 1;
    transform: scale(1);
}

/* === INTERACTIVE ZONE === */
.section-interactive {
    min-height: 200vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.interactive-content {
    position: sticky;
    top: 10vh;
    width: 90%;
    max-width: 900px;
    text-align: center;
    padding: 3rem 0;
}

.lorentz-display {
    margin-bottom: 3rem;
}

.lorentz-label {
    margin-bottom: 0.5rem;
}

.lorentz-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--text-bright);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3em;
}

.gamma-symbol {
    color: var(--field-glow);
    font-style: italic;
}

.gamma-equals {
    color: var(--grid-whisper);
    font-size: 0.6em;
}

.gamma-number {
    font-variant-numeric: tabular-nums;
    min-width: 4ch;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === VELOCITY BAR === */
.velocity-display {
    margin-bottom: 3rem;
}

.velocity-bar-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(42, 74, 110, 0.3);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: visible;
}

.velocity-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--field-glow), var(--light-cone));
    border-radius: 2px;
    transition: width 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.velocity-marker {
    position: absolute;
    top: -24px;
    left: 0%;
    transform: translateX(-50%);
    transition: left 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.velocity-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--text-bright);
}

/* === SIMULTANEITY LINES === */
.simultaneity-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.sim-line {
    position: absolute;
    width: 120%;
    height: 1px;
    left: -10%;
    background: linear-gradient(90deg, transparent 0%, var(--frame-blue) 30%, var(--frame-blue) 70%, transparent 100%);
    opacity: 0.2;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-line-1 { top: 15%; }
.sim-line-2 { top: 30%; }
.sim-line-3 { top: 50%; }
.sim-line-4 { top: 70%; }
.sim-line-5 { top: 85%; }

/* === TERMINAL SECTION === */
.section-terminal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.terminal-content {
    max-width: 700px;
    padding: 3rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-decel-indicator {
    margin-bottom: 2rem;
}

.terminal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.04em;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    line-height: 1.05;
}

.terminal-body {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.terminal-quote {
    border-left: none;
    padding-left: 0;
    text-align: center;
    margin-bottom: 2rem;
}

.terminal-coordinates {
    margin-top: 3rem;
}

.terminal-coordinates .data-label {
    color: var(--grid-whisper);
    font-size: 0.7rem;
}

/* === GRID INTERSECTION MARKERS === */
.grid-intersection {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--field-glow);
    pointer-events: none;
    z-index: 4;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.5); }
}

/* === LIGHT CONE DECORATIONS === */
.section-panel::before {
    content: '';
    position: absolute;
    top: 10%;
    right: -5%;
    width: 40%;
    height: 60%;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: linear-gradient(180deg, rgba(26, 58, 92, 0.08) 0%, transparent 100%);
    pointer-events: none;
}

.section-panel:nth-child(odd)::before {
    left: -5%;
    right: auto;
    clip-path: polygon(50% 100%, 100% 0%, 0% 0%);
}

/* === DOPPLER COLOR SHIFT ON ELEMENTS === */
.doppler-blueshift {
    color: var(--light-cone) !important;
}

.doppler-redshift {
    color: var(--receding-red) !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .hero-right {
        width: 50%;
        clip-path: polygon(40% 0, 100% 0, 100% 100%, 10% 100%);
    }

    .panel-container {
        max-width: 90%;
        padding: 3rem 2rem;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .panel-parallelogram {
        clip-path: polygon(4% 0%, 100% 0%, 96% 100%, 0% 100%);
    }

    .lorentz-value {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .field-1 { width: 350px; height: 350px; }
    .field-2 { width: 280px; height: 280px; }
    .field-3 { width: 300px; height: 300px; }
    .field-4 { width: 200px; height: 200px; }
    .field-5 { width: 400px; height: 400px; }
}

@media (max-width: 480px) {
    .hero-left {
        bottom: 15%;
        left: 3%;
    }

    .hero-subtitle {
        bottom: 3%;
        right: 3%;
    }

    .panel-container {
        padding: 2rem 1.5rem;
    }
}
