* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brown-dark: #3a2516;
    --brown-deep: #5a3e28;
    --brown-burnt: #6b4226;
    --brown-medium: #a0805c;
    --tan: #d4c4ad;
    --cream: #faf5ed;
    --red: #c8553d;
    --gold: #e8a84c;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

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

.scene {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
    padding: 2rem;
}

.scene-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.domain-title {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 1.0;
    color: var(--brown-burnt);
    margin-bottom: 1rem;
}

.subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--brown-medium);
    margin-bottom: 3rem;
    font-style: italic;
}

.scene-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--brown-burnt);
    margin-bottom: 1.5rem;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    color: var(--brown-deep);
    max-width: 650px;
    margin: 0 auto 2.5rem;
}

.field-diagram {
    width: 100%;
    max-width: 700px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.diagram-label {
    font-family: 'Source Code Pro', monospace;
    font-weight: 300;
}

.equation {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
}

.notebook-annotation {
    font-family: 'Source Code Pro', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--brown-medium);
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
}

.code-annotation {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--brown-deep);
    margin-top: 2rem;
}

.status-blink {
    color: var(--gold);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.final-note {
    font-style: italic;
    color: var(--brown-burnt);
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* Hand-drawn line animation */
.hand-drawn {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-out;
}

.hand-drawn.visible {
    stroke-dashoffset: 0;
}

.hand-drawn.delay-1 { transition-delay: 0.3s; }
.hand-drawn.delay-2 { transition-delay: 0.6s; }
.hand-drawn.delay-3 { transition-delay: 0.9s; }

/* Pulse animation for detector signal */
.pulse {
    animation: pulse-signal 3s ease-in-out infinite;
}

@keyframes pulse-signal {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Monopole particle fade in/out */
.monopole-particle {
    animation: monopole-appear 5s ease-in-out infinite;
}

@keyframes monopole-appear {
    0%, 80%, 100% { opacity: 0; }
    85%, 95% { opacity: 0.8; }
}

/* Scene backgrounds with subtle variation */
.scene-1 { background: var(--cream); }
.scene-2 { background: linear-gradient(180deg, var(--cream) 0%, #f5efe5 100%); }
.scene-3 { background: linear-gradient(180deg, #f5efe5 0%, #f0e8db 100%); }
.scene-4 { background: linear-gradient(180deg, #f0e8db 0%, #ebe3d4 100%); }
.scene-5 { background: linear-gradient(180deg, #ebe3d4 0%, var(--cream) 100%); }

/* Scroll progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--gold);
    width: 0%;
    z-index: 100;
    transition: width 0.1s linear;
}

/* Scene fade-in */
.scene-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scene.in-view .scene-content {
    opacity: 1;
    transform: translateY(0);
}
