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

html, body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background: #F5EFE6;
    font-family: 'Libre Baskerville', Georgia, serif;
    color: #5B4A3E;
}

/* ===== WORDMARK ===== */
.wordmark {
    position: fixed;
    top: 1.5rem;
    left: 2rem;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 0.75rem;
    color: #8B6F5C;
    opacity: 0.7;
    z-index: 100;
    letter-spacing: 0.01em;
}

/* ===== SCROLL CONTAINER ===== */
#scroll-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100vh;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* ===== CHAPTERS ===== */
.chapter {
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: grid;
    place-items: center;
    position: relative;
    background: #F5EFE6;
}

.chapter-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 70vw;
    text-align: center;
}

/* ===== DOT GRID BACKGROUND ===== */
.dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(232,213,196,0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ===== CHAPTER 1: ONE ===== */
.title-one {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(8rem, 20vw, 18rem);
    letter-spacing: -0.05em;
    line-height: 0.95;
    color: #5B4A3E;
    margin-bottom: 2rem;
}

.wave-single {
    width: clamp(300px, 50vw, 800px);
    height: 100px;
}

.wave-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wave-path.animate {
    stroke-dashoffset: 0;
}

/* ===== CHAPTER 2: THE MONOPOLE ===== */
.chapter-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 12rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: #5B4A3E;
    margin-bottom: 2rem;
}

.monopole-diagram {
    width: clamp(250px, 40vw, 400px);
    height: clamp(250px, 40vw, 400px);
}

.field-line {
    stroke: #5B8A72;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.field-line.animate {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== CHAPTER 3: UNITY ===== */
.duotone-container {
    position: relative;
    width: clamp(300px, 50vw, 600px);
    height: clamp(200px, 30vw, 400px);
    overflow: hidden;
}

.duotone-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B6F5C 0%, #D4A78B 50%, #8B6F5C 100%);
    filter: grayscale(100%);
    position: relative;
}

/* Create a silhouette figure using pseudo-element */
.duotone-image::before {
    content: '';
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 40px;
    background: #F5EFE6;
    border-radius: 50% 50% 0 0;
    box-shadow:
        0 -8px 0 0 #F5EFE6,
        -6px 10px 0 0 #F5EFE6,
        6px 10px 0 0 #F5EFE6,
        -4px 25px 0 0 #F5EFE6,
        4px 25px 0 0 #F5EFE6;
}

/* Horizon line */
.duotone-image::after {
    content: '';
    position: absolute;
    bottom: 35%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(245,239,230,0.3);
}

.duotone-overlay {
    position: absolute;
    inset: 0;
    background: #8B6F5C;
    mix-blend-mode: multiply;
    opacity: 0.4;
}

/* ===== CHAPTER 4: WAVE FORMS ===== */
.wave-title {
    position: absolute;
    top: 10vh;
    z-index: 2;
}

.wave-harmonics {
    width: 80vw;
    height: 60vh;
}

.harmonic {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 3s cubic-bezier(0.4, 0, 0.2, 1);
}

.harmonic.animate {
    stroke-dashoffset: 0;
}

.harmonic.h2.animate { transition-delay: 0.3s; }
.harmonic.h3.animate { transition-delay: 0.6s; }
.harmonic.h4.animate { transition-delay: 0.9s; }

/* ===== CHAPTER 5: THE PROOF ===== */
.proof-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: #6B5D52;
    max-width: 55ch;
    text-align: left;
}

.proof-text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.proof-text .word.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== CHAPTER 6: THEREFORE ===== */
.therefore-symbol {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(8rem, 20vw, 18rem);
    color: #3E3229;
    line-height: 1;
    margin-bottom: 2rem;
}

.therefore-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: #6B5D52;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
}

.therefore-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    z-index: 100;
}

.progress-track {
    width: 100%;
    height: 3px;
    background: #E8D5C4;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #8B6F5C;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-dots {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E8D5C4;
    display: block;
    transition: transform 0.3s ease;
}

.dot.active {
    background: #8B6F5C;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ===== NODE CIRCLES (wave intersections) ===== */
.node-circle {
    fill: #D4A78B;
}
