/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow: hidden; height: 100vh; width: 100vw; }

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background: #1a1a2e;
    color: #e8ddd4;
}

/* Palette reference: #2e1a3d #f4ede4 #e8724a #4ae8c4 #c4a87a #1a1a2e #e8ddd4 #3d2e24 */

/* === Typography === */
.headline {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

h1.headline {
    font-size: clamp(3rem, 7vw, 6rem);
    color: #e8724a;
}

h2.headline {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 700;
    color: #e8724a;
    margin-bottom: 1.5rem;
}

.source-serif {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    max-width: 38ch;
}

.dark-text { color: #3d2e24; }

.mono-quote {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c4a87a;
    text-align: center;
    line-height: 2;
}

.panel-number {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(232, 221, 212, 0.3);
    z-index: 5;
}

.dark-num { color: rgba(61, 46, 36, 0.3); }

/* === Scroll Container === */
#scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
#scroll-container::-webkit-scrollbar { display: none; }

.scroll-track {
    display: flex;
    width: max-content;
    height: 100vh;
}

.panel {
    min-width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Progress Bar === */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, #e8724a, #4ae8c4);
    z-index: 100;
    transition: width 0.1s linear;
}

/* === Vertical Watermark === */
.vertical-watermark {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    color: rgba(232, 221, 212, 0.06);
    letter-spacing: 0.05em;
    z-index: 1;
    pointer-events: none;
}

/* === Panel Content === */
.panel-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
}

.panel-1-content {
    text-align: left;
    max-width: 60vw;
    padding-left: 10vw;
}
.panel-1-content .body-text {
    margin-top: 1.5rem;
    color: #e8ddd4;
}

.panel-2-content {
    max-width: 50vw;
    padding-left: 8vw;
}
.panel-2-content .body-text {
    margin-bottom: 1.2rem;
}

.panel-3-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-4-content {
    max-width: 50vw;
    padding-left: 8vw;
}
.panel-4-content .body-text {
    margin-bottom: 1.2rem;
    color: #e8ddd4;
}

.panel-5-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* === Watermark Background (Panel 5) === */
.watermark-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 9rem);
    color: rgba(61, 46, 36, 0.08);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

/* === Raked Sand Texture === */
.raked-sand {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 7px,
        rgba(196, 168, 122, 0.04) 7px,
        rgba(196, 168, 122, 0.04) 8px
    );
    pointer-events: none;
    z-index: 0;
}

/* === Bubbles (in-panel) === */
.bubble {
    position: absolute;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.6);
}

.bubble-orange {
    background: radial-gradient(circle at 30% 30%, rgba(232, 114, 74, 0.25), rgba(232, 114, 74, 0.05) 70%);
    box-shadow: inset 0 0 20px rgba(232, 114, 74, 0.15);
}

.bubble-teal {
    background: radial-gradient(circle at 30% 30%, rgba(74, 232, 196, 0.25), rgba(74, 232, 196, 0.05) 70%);
    box-shadow: inset 0 0 20px rgba(74, 232, 196, 0.15);
}

.bubble-orange-light {
    background: radial-gradient(circle at 30% 30%, rgba(232, 114, 74, 0.2), rgba(232, 114, 74, 0.03) 70%);
    box-shadow: inset 0 0 20px rgba(232, 114, 74, 0.1);
}

.bubble-teal-light {
    background: radial-gradient(circle at 30% 30%, rgba(74, 232, 196, 0.2), rgba(74, 232, 196, 0.03) 70%);
    box-shadow: inset 0 0 20px rgba(74, 232, 196, 0.1);
}

.bubble-glow {
    background: radial-gradient(circle at 35% 35%, rgba(232, 114, 74, 0.15), rgba(232, 114, 74, 0.03) 60%, transparent 80%);
    box-shadow: 0 0 40px rgba(232, 114, 74, 0.2), 0 0 80px rgba(74, 232, 196, 0.1), inset 0 0 20px rgba(232, 114, 74, 0.1);
}

.bubble-glow-teal {
    background: radial-gradient(circle at 35% 35%, rgba(74, 232, 196, 0.2), rgba(74, 232, 196, 0.05) 60%, transparent 80%);
    box-shadow: 0 0 40px rgba(74, 232, 196, 0.2), 0 0 80px rgba(232, 114, 74, 0.1), inset 0 0 20px rgba(74, 232, 196, 0.1);
}

/* === Floating Bubble Layer === */
#bubble-layer {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    overflow: hidden;
}

.float-bubble {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    transform: translateZ(0);
    animation: floatDrift var(--duration) ease-in-out infinite;
}

.float-bubble[style*="--hue:orange"] {
    background: radial-gradient(circle at 30% 30%, rgba(232, 114, 74, 0.08), rgba(232, 114, 74, 0.02) 70%);
    opacity: 0.07;
}

.float-bubble[style*="--hue:teal"] {
    background: radial-gradient(circle at 30% 30%, rgba(74, 232, 196, 0.08), rgba(74, 232, 196, 0.02) 70%);
    opacity: 0.1;
}

@keyframes floatDrift {
    0%, 100% { transform: translate(0, 0) scale(1) translateZ(0); }
    25% { transform: translate(calc(var(--x-range) * 0.5), calc(var(--y-range) * -1)) scale(1.05) translateZ(0); }
    50% { transform: translate(var(--x-range), 0) scale(0.95) translateZ(0); }
    75% { transform: translate(calc(var(--x-range) * 0.3), var(--y-range)) scale(1.02) translateZ(0); }
}

/* === Concentric Ripple SVGs === */
.ripple-svg {
    position: absolute;
    width: 70vh;
    height: 70vh;
    right: -10%;
    top: 15%;
    z-index: 1;
    pointer-events: none;
}

.ripple-large {
    width: 80vh;
    height: 80vh;
    left: 20%;
    top: 10%;
    right: auto;
}

/* === Callout Lines === */
.callout-line {
    z-index: 4;
    pointer-events: none;
    opacity: 0;
}

.callout-line line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

/* === Staggered Animations === */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.panel.visible .headline {
    animation: fadeSlideUp 0.8s ease-out 0s forwards;
    opacity: 0;
}

.panel.visible .body-text {
    animation: fadeSlideUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.panel.visible .mono-quote {
    animation: fadeSlideUp 0.8s ease-out 0.1s forwards;
    opacity: 0;
}

.panel.visible .bubble {
    animation: fadeScale 1.2s ease-out 0.4s forwards;
}

.panel.visible .callout-line {
    animation: fadeIn 0.1s ease-out 0.6s forwards;
    opacity: 0;
}

.panel.visible .callout-line line {
    animation: drawLine 0.6s ease-out 0.7s forwards;
}

/* Initial states for animated elements */
.panel .headline,
.panel .body-text,
.panel .mono-quote {
    opacity: 0;
}
