/* ============================================
   WHAT A NICE DAY - Complete Stylesheet
   A website for dogs.
   ============================================ */

/* ============ CSS VARIABLES ============ */
:root {
    /* Section Colors */
    --dawn-dark: #1a1a2e;
    --dawn-light: #3d5a80;
    --dawn-sun: #ffd166;

    --play-pink: #ff006e;
    --play-yellow: #ffbe0b;
    --play-energy: #ff5400;

    --nap-cream: #f5ebe0;
    --nap-warm: #ddb892;
    --nap-soft: #e6ccb2;

    --walk-moss: #606c38;
    --walk-sky: #87ceeb;
    --walk-earth: #283618;

    --dinner-white: #ffffff;
    --dinner-sparkle: #ffd700;

    --dream-deep: #0d1b2a;
    --dream-purple: #1b263b;
    --dream-star: #e0e1dd;

    /* Typography */
    --font-main: 'Cormorant Garamond', 'Yu Mincho', 'Noto Serif JP', Georgia, serif;

    /* Timing */
    --transition-slow: 1.2s;
    --transition-medium: 0.6s;
    --transition-fast: 0.3s;

    /* Spacing */
    --section-height: 300vh;
    --transition-zone-height: 150vh;
}

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

html {
    font-size: 16px;
    scroll-behavior: auto; /* GSAP handles scroll */
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    font-weight: 300;
    line-height: 1.6;
    background: var(--dawn-dark);
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============ PRELOADER ============ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease, visibility 1s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: #fff;
}

.preloader-title {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.15em;
    opacity: 0;
    animation: fadeInOut 3s ease forwards;
}

.preloader-tagline {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.2em;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInOut 3s ease 2s forwards;
}

.preloader-progress {
    margin-top: 3rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeIn 1s ease 4s forwards;
}

.preloader-percent {
    font-variant-numeric: tabular-nums;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    30% { opacity: 1; transform: translateY(0); }
    70% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

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

/* ============ SOUND PROMPT ============ */
.sound-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: opacity var(--transition-medium) ease, visibility var(--transition-medium) ease;
}

.sound-question {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-style: italic;
    letter-spacing: 0.2em;
    color: #fff;
}

.sound-buttons {
    display: flex;
    gap: 3rem;
}

.sound-btn {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-style: italic;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1.5rem;
    transition: color var(--transition-fast) ease;
}

.sound-btn:hover,
.sound-btn:focus {
    color: #fff;
}

/* ============ SOUND TOGGLE (persistent corner) ============ */
.sound-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    z-index: 1000;
    color: rgba(255, 255, 255, 0.3);
    transition: opacity var(--transition-medium) ease,
                visibility var(--transition-medium) ease,
                color var(--transition-fast) ease;
}

.sound-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.sound-icon {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity var(--transition-fast) ease;
}

.sound-toggle[data-muted="true"] .sound-on,
.sound-toggle[data-muted="false"] .sound-off {
    opacity: 0;
}

.sound-toggle[data-muted="true"] .sound-off,
.sound-toggle[data-muted="false"] .sound-on {
    opacity: 1;
}

/* ============ SCROLL INDICATOR (tennis ball) ============ */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: opacity var(--transition-medium) ease, visibility var(--transition-medium) ease;
}

.tennis-ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c8e038 0%, #9bc400 50%, #7aa300 100%);
    box-shadow:
        inset -3px -3px 6px rgba(0, 0, 0, 0.2),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: ballPulse 2s ease-in-out infinite;
}

.tennis-ball::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(30deg);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
}

@keyframes ballPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-8px) scale(1.05);
        opacity: 1;
    }
}

/* ============ LOOP COUNTER ============ */
.loop-counter {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.05);
    letter-spacing: 0.1em;
    z-index: 50;
    pointer-events: none;
}

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

/* ============ SECTIONS BASE ============ */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    z-index: 1;
}

/* Solid opaque background layer to prevent bleed-through */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.section-dawn::before { background: #1a1a2e; }
.section-play::before { background: #ff006e; }
.section-nap::before { background: #f5ebe0; }
.section-walk::before { background: #606c38; }
.section-dinner::before { background: #ffffff; }
.section-dream::before { background: #0d1b2a; }
.section-loop::before { background: #000000; }

/* Hide section content by default (JS manages visibility) */
.section .section-content,
.section .section-background {
    opacity: 0;
    visibility: hidden;
}

/* Show dawn section initially before JS loads */
.section-dawn .section-content,
.section-dawn .section-background {
    opacity: 1;
    visibility: visible;
}

/* Active section gets higher z-index for proper stacking */
.section.active-section {
    z-index: 100;
}

/* Ensure pinned sections are fully opaque with their background */
.section.pin-spacer-inner,
.pin-spacer > .section {
    z-index: 1;
}

.section.active-section.pin-spacer-inner,
.pin-spacer > .section.active-section {
    z-index: 100;
}

.section-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.section-content {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

/* ============ DOG CONTAINER ============ */
.dog-container {
    position: relative;
    width: clamp(200px, 50vw, 500px);
    height: clamp(200px, 50vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.dog-sprite {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity var(--transition-medium) ease;
}

.dog-sprite.active {
    opacity: 1;
}

/* ============ ENVIRONMENT ELEMENTS ============ */
.environment-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.env-element {
    position: absolute;
    opacity: 0;
    transition: opacity var(--transition-medium) ease, transform var(--transition-medium) ease;
}

.env-element.visible {
    opacity: 1;
}

/* ============ SECTION TEXT ============ */
.section-text {
    position: absolute;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.15em;
    text-align: center;
    opacity: 0;
    z-index: 30;
    transition: opacity var(--transition-slow) ease;
}

.section-text.visible {
    opacity: 1;
}

/* ============ TRANSITION ZONES ============ */
.transition-zone {
    position: relative;
    height: var(--transition-zone-height);
    z-index: 15;
}

.particle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
}

.morph-sprites {
    position: sticky;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(200px, 50vw, 500px);
    height: clamp(200px, 50vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.morph-sprite {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity var(--transition-fast) ease;
}

.morph-sprite.active {
    opacity: 1;
}

/* ============ SECTION: DAWN ============ */
.section-dawn {
    background: var(--dawn-dark);
}

.dawn-bg {
    background: linear-gradient(180deg, var(--dawn-dark) 0%, var(--dawn-light) 100%);
}

.dawn-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 70% 30%, rgba(255, 209, 102, 0) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 2s ease;
}

.dawn-gradient.sunrise {
    background: radial-gradient(ellipse at 70% 30%, rgba(255, 209, 102, 0.4) 0%, transparent 50%);
    opacity: 1;
}

.ambient-light {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse at top right, rgba(255, 209, 102, 0.3), transparent 70%);
    opacity: 0;
    transition: opacity 3s ease;
}

.ambient-light.active {
    opacity: 1;
}

/* Dust motes */
.dust-motes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.dust-mote {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    opacity: 0;
    filter: blur(0.5px);
}

.dust-mote:nth-child(1) { left: 15%; bottom: 20%; animation: dustFloat 8s ease-in-out infinite 0s; }
.dust-mote:nth-child(2) { left: 25%; bottom: 30%; animation: dustFloat 10s ease-in-out infinite 1s; }
.dust-mote:nth-child(3) { left: 40%; bottom: 15%; animation: dustFloat 9s ease-in-out infinite 2s; }
.dust-mote:nth-child(4) { left: 55%; bottom: 25%; animation: dustFloat 11s ease-in-out infinite 0.5s; }
.dust-mote:nth-child(5) { left: 65%; bottom: 35%; animation: dustFloat 8s ease-in-out infinite 1.5s; }
.dust-mote:nth-child(6) { left: 75%; bottom: 20%; animation: dustFloat 10s ease-in-out infinite 2.5s; }
.dust-mote:nth-child(7) { left: 35%; bottom: 40%; animation: dustFloat 9s ease-in-out infinite 3s; }
.dust-mote:nth-child(8) { left: 80%; bottom: 30%; animation: dustFloat 12s ease-in-out infinite 0.8s; }

.dust-motes-active .dust-mote {
    opacity: 0.7;
}

@keyframes dustFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-100px) translateX(20px);
        opacity: 0.8;
    }
}

/* Dawn dog: soft painterly gouache */
.dawn-dog .dog-sprite {
    filter:
        saturate(0.9)
        contrast(0.95)
        brightness(0.95);
}

.dawn-text {
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
}

/* Dawn environment positions */
.section-dawn .window {
    top: 10%;
    right: 10%;
    width: 20%;
    max-width: 200px;
}

.section-dawn .sunbeam {
    top: 15%;
    right: 5%;
    width: 40%;
    max-width: 400px;
    transform: rotate(-15deg);
}

.section-dawn .blanket {
    bottom: 10%;
    left: 20%;
    width: 30%;
    max-width: 300px;
}

/* ============ SECTION: PLAY ============ */
.section-play {
    background: var(--play-pink);
}

.play-bg {
    background: linear-gradient(135deg, var(--play-pink) 0%, var(--play-yellow) 50%, var(--play-energy) 100%);
}

.play-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, var(--play-yellow) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--play-pink) 0%, transparent 40%);
    animation: playPulse 4s ease-in-out infinite;
}

@keyframes playPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.energy-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 50px,
        rgba(255, 255, 255, 0.03) 50px,
        rgba(255, 255, 255, 0.03) 51px
    );
    animation: energyScroll 2s linear infinite;
}

@keyframes energyScroll {
    to { background-position: 51px 0; }
}

/* Play dog: anime-adjacent, motion blur, saturated */
.play-dog .dog-sprite {
    filter:
        saturate(1.3)
        contrast(1.1)
        brightness(1.05);
}

.play-dog.motion-blur .dog-sprite {
    filter:
        saturate(1.3)
        contrast(1.1)
        blur(2px);
}

/* Play text scattered */
.play-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.play-word {
    position: absolute;
    font-size: clamp(1.5rem, 6vw, 4rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.1em;
    color: #fff;
    text-shadow: 2px 2px 0 var(--play-pink);
    opacity: 0;
    transition: opacity var(--transition-medium) ease;
}

.play-word.visible {
    opacity: 1;
}

.play-word[data-word="1"] { top: 15%; left: 10%; transform: rotate(-5deg); }
.play-word[data-word="2"] { top: 25%; right: 15%; transform: rotate(8deg); }
.play-word[data-word="3"] { bottom: 30%; left: 20%; transform: rotate(-3deg); }
.play-word[data-word="4"] {
    bottom: 15%;
    right: 10%;
    font-size: clamp(2rem, 8vw, 5rem);
    transform: rotate(5deg);
}

/* Play environment positions */
.section-play .ball {
    top: 20%;
    left: 15%;
    width: 10%;
    max-width: 80px;
    animation: ballBounce 1s ease-in-out infinite;
}

@keyframes ballBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.section-play .rope-toy {
    bottom: 15%;
    right: 20%;
    width: 15%;
    max-width: 120px;
    transform: rotate(30deg);
}

.section-play .squeaky-duck {
    top: 60%;
    left: 10%;
    width: 8%;
    max-width: 60px;
}

.section-play .motion-blur {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

/* ============ SECTION: NAP ============ */
.section-nap {
    background: var(--nap-cream);
}

.nap-bg {
    background: linear-gradient(180deg, var(--nap-cream) 0%, var(--nap-warm) 100%);
}

.nap-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
}

.soft-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    filter: blur(40px);
}

/* Nap dog: soft focus, warm, dreamy */
.nap-dog .dog-sprite {
    filter:
        saturate(0.85)
        contrast(0.9)
        brightness(1.05)
        blur(0.5px);
}

.nap-text {
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    color: var(--walk-earth);
    opacity: 0.8;
}

/* Nap environment positions */
.section-nap .dog-bed {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    max-width: 400px;
    z-index: 4;
}

.section-nap .sunpatch {
    top: 20%;
    right: 10%;
    width: 30%;
    max-width: 250px;
    opacity: 0.6;
}

/* ============ SECTION: WALK ============ */
.section-walk {
    background: var(--walk-moss);
}

.walk-bg {
    background: linear-gradient(180deg, var(--walk-sky) 0%, var(--walk-sky) 40%, var(--walk-moss) 40%, var(--walk-moss) 100%);
}

.walk-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.woodblock-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        );
    mix-blend-mode: multiply;
}

/* Walk dog: bold outlines, graphic/woodblock */
.walk-dog .dog-sprite {
    filter:
        saturate(0.95)
        contrast(1.2)
        brightness(1);
}

/* Walk text sequential */
.walk-text {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.walk-line {
    font-size: clamp(1rem, 3vw, 1.8rem);
    color: var(--walk-earth);
    opacity: 0;
    transition: opacity var(--transition-slow) ease;
}

.walk-line.visible {
    opacity: 1;
}

/* Walk environment positions */
.section-walk .leash {
    top: 30%;
    left: 60%;
    width: 5%;
    max-width: 40px;
    transform: rotate(-45deg);
}

.section-walk .fire-hydrant {
    bottom: 20%;
    right: 15%;
    width: 12%;
    max-width: 100px;
}

.section-walk .grass-tufts {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    object-fit: cover;
}

.section-walk .leaf {
    top: 20%;
    left: 20%;
    width: 5%;
    max-width: 40px;
    animation: leafFloat 6s ease-in-out infinite;
}

@keyframes leafFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(30px) rotate(180deg); }
}

/* ============ SECTION: DINNER ============ */
.section-dinner {
    background: var(--dinner-white);
}

.dinner-bg {
    background: var(--dinner-white);
}

.dinner-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center bottom, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
}

.anime-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--dinner-sparkle);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkleAnim 1.5s ease-in-out infinite;
}

@keyframes sparkleAnim {
    0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1) rotate(180deg); opacity: 1; }
}

/* Dinner dog: simple anime style */
.dinner-dog .dog-sprite {
    filter:
        saturate(1.1)
        contrast(1.05)
        brightness(1.02);
}

/* Dinner text spatial scatter */
.dinner-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dinner-word {
    position: absolute;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.1em;
    color: var(--play-pink);
    opacity: 0;
    transition: opacity var(--transition-medium) ease;
}

.dinner-word.visible {
    opacity: 1;
}

.dinner-word[data-pos="bowl"] { bottom: 25%; left: 15%; }
.dinner-word[data-pos="dog"] { top: 20%; right: 20%; }
.dinner-word[data-pos="center"] {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 8vw, 5rem);
    color: var(--play-energy);
}

/* Dinner environment positions */
.section-dinner .food-bowl {
    bottom: 15%;
    left: 30%;
    width: 20%;
    max-width: 180px;
}

.section-dinner .water-bowl {
    bottom: 15%;
    right: 30%;
    width: 15%;
    max-width: 120px;
}

.section-dinner .kibble {
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 15%;
    max-width: 100px;
}

/* ============ SECTION: DREAM ============ */
.section-dream {
    background: var(--dream-deep);
}

.dream-bg {
    background: linear-gradient(180deg, var(--dream-deep) 0%, var(--dream-purple) 50%, var(--dream-deep) 100%);
}

.dream-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(100, 100, 180, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 80%, rgba(150, 100, 180, 0.15) 0%, transparent 40%);
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--dream-star);
    border-radius: 50%;
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.nebula-clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(65, 105, 225, 0.1) 0%, transparent 50%);
    filter: blur(30px);
}

/* Dream dog: all styles collide, dissolve, abstract */
.dream-dog .dog-sprite {
    filter:
        saturate(0.8)
        contrast(0.9)
        brightness(1.1);
}

.dream-dog .constellation-dog {
    mix-blend-mode: screen;
}

.dream-dog .ethereal-dog {
    mix-blend-mode: overlay;
    opacity: 0.6;
}

.dream-dog .dissolve-dog {
    mix-blend-mode: soft-light;
}

.dream-text {
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(2rem, 6vw, 4rem);
}

/* Dream environment positions */
.section-dream .star-cluster {
    top: 15%;
    right: 20%;
    width: 25%;
    max-width: 200px;
    mix-blend-mode: screen;
}

.section-dream .cloud-wisp {
    top: 40%;
    left: 10%;
    width: 30%;
    max-width: 250px;
    opacity: 0.5;
}

.section-dream .floating-bone {
    bottom: 30%;
    right: 15%;
    width: 15%;
    max-width: 120px;
    animation: floatBone 8s ease-in-out infinite;
}

@keyframes floatBone {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(15deg); }
}

.section-dream .spiral {
    top: 60%;
    left: 60%;
    width: 20%;
    max-width: 150px;
    opacity: 0.3;
    animation: spiralSpin 20s linear infinite;
}

@keyframes spiralSpin {
    to { transform: rotate(360deg); }
}

/* Dream end zone - blink effect */
.dream-end-zone {
    position: relative;
    height: 100vh;
}

.blink-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

.blink-overlay.blinking {
    animation: slowBlink 4s ease-in-out;
}

@keyframes slowBlink {
    0% { opacity: 0; }
    40% { opacity: 0.9; }
    60% { opacity: 0.9; }
    100% { opacity: 0; }
}

/* ============ LOOP TRANSITION ============ */
.section-loop {
    min-height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loop-title-container {
    position: relative;
}

.dissolving-stars-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.15em;
}

.star-letter {
    position: relative;
    color: var(--dream-star);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.star-letter.visible {
    opacity: 1;
}

.star-letter.dissolving {
    animation: letterDissolve 2s ease forwards;
}

@keyframes letterDissolve {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-20px) scale(0.8);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0);
        filter: blur(5px);
    }
}

.star-letter.space {
    width: 0.3em;
}

/* ============ PARTICLE EFFECTS ============ */
.particle-dissolve {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly 2s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 100px), var(--ty, -100px)) scale(0);
    }
}

/* ============ RESPONSIVE ============ */
@media (min-width: 768px) {
    :root {
        --section-height: 400vh;
        --transition-zone-height: 200vh;
    }

    .dog-container {
        width: clamp(300px, 40vw, 600px);
        height: clamp(300px, 40vw, 600px);
    }
}

@media (min-width: 1200px) {
    :root {
        --section-height: 500vh;
        --transition-zone-height: 250vh;
    }
}

/* Scroll snap disabled - GSAP handles scroll behavior */

/* ============ PRINT (disabled) ============ */
@media print {
    body {
        display: none;
    }
}
