/* General Setup */
:root {
    --yellow: #FFC700;
    --dark-bg: #121212;
    --light-text: #EAEAEA;
    --sans-font: 'Helvetica', 'Arial', sans-serif;
}

html {
    /* Increase base font size for sitewide text scaling */
    font-size: 110%; 
}

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

body {
    background-color: var(--dark-bg);
    color: var(--light-text);
    font-family: var(--sans-font);
    overscroll-behavior: none;
}

/* Scene Styling */
.scene {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Scene 0: Title Sequence */
.title-sequence {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.title-group {
    opacity: 0; /* Initially hidden, fade in with JS */
}

.title-group h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    color: var(--yellow);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin-bottom: 0.5rem;
}

.title-group .subtitle {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: var(--light-text);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.title-group .author {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--yellow);
}

.bus-container {
    position: relative;
    width: 90%;
    /* Make bus larger */
    max-width: 800px; 
    display: flex;
    justify-content: center;
    align-items: center;
    /* Add some vertical space */
    min-height: 40vh; 
}

.bus-container img {
    width: 100%;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bus-outline {
    z-index: 2;
}

.yellow-bus {
    z-index: 1;
    opacity: 0; /* Initially hidden */
}

.team-names {
    opacity: 0; /* Initially hidden */
    padding: 1rem;
}

.team-names .presented-by {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: #aaa;
    margin-bottom: 0.5rem;
}

.team-names p {
    font-size: clamp(0.85rem, 3vw, 1.1rem);
    letter-spacing: 1px;
}

/* --- Reusable Scene Components --- */
.scene-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
}

.scene-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    opacity: 0;
    text-align: center;
}

.scene-text p {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    line-height: 1.6;
}

/* --- Scene 1: Problem & Invitation --- */
.problem-invitation {
    display: flex;
    justify-content: center;
    align-items: center;
}

#office-bg.blurred {
    filter: blur(8px) brightness(0.7);
    transition: filter 0.5s ease-in-out;
}

/* This is a specific override for Scene 1 to move the text up */
#scene-1-text {
    top: 30%;
}

#stressed-character {
    position: absolute;
    /* Move character up from the bottom */
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    /* Set the new, larger final size */
    width: 60%;
    max-width: 525px; /* 50% larger than 350px */
    height: auto;
    opacity: 0;
}

#yellow-bus-scene1 {
    position: absolute;
    width: 60%;
    max-width: 500px;
    bottom: 5%;
    /* Start off-screen to the right */
    right: -100%;
}

/* --- New Rules-Intro Scene --- */
#rules-intro {
    background-color: #2c3e50; /* A calm, dark blue */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    color: var(--light-text);
}

#joy-img {
    width: 30%;
    max-width: 350px;
    height: auto;
    border-radius: 15px;
    opacity: 0; /* Fade in with GSAP */
    transform: translateX(-50px);
}

.rules-container {
    width: 60%;
    max-width: 800px;
    opacity: 0; /* Fade in with GSAP */
    transform: translateX(50px);
}

.rules-container h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--yellow);
    margin-bottom: 2rem;
    text-align: center;
}

.rules-list {
    list-style-type: none;
    counter-reset: rule-counter;
    padding-left: 0;
}

.rules-list li {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    padding: 0.75rem 0 0.75rem 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    opacity: 0; /* Stagger in with GSAP */
}

.rules-list li:before {
    counter-increment: rule-counter;
    content: counter(rule-counter);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--yellow);
    font-weight: bold;
    font-size: 1.5rem;
    width: 2rem;
    text-align: right;
    margin-right: 1rem;
}

.rules-list li:last-child {
    border-bottom: none;
}

/* --- Scene 2: Rule 1 --- */
.driver-view {
    background-color: #000; /* Fallback for image load */
}

#driver-road-bg {
    object-fit: cover;
    /* We can animate this position later to simulate movement */
}

.hud-text {
    /* Glassmorphism effect for legibility */
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    max-width: 700px;
    padding: 2rem; /* Ensure padding is consistent */
}

.hud-text h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--yellow);
    margin-bottom: 1rem;
}

.hud-text p {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Scene 3: Rule 2 --- */
.vision-grid {
    background-color: #FFFFFF;
    color: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    align-items: center;
}

.text-column {
    opacity: 0; /* Fade in with GSAP */
}

.text-column h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #333;
    margin-bottom: 1rem;
}

.text-column p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.6;
    color: #555;
}

.image-column {
    position: relative;
    min-height: 500px; /* Ensure space for collage */
}

.vision-image {
    position: absolute;
    width: 60%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    opacity: 0; /* Fade in with GSAP */
    transform: scale(0.9);
}

#vision-park {
    top: 5%;
    left: 0;
    width: 65%; /* Base size */
    z-index: 1;
    transform: rotate(-8deg) scale(0.9);
}

#vision-business {
    top: 25%;
    left: 25%;
    width: 75%; /* Larger */
    z-index: 2; /* On top of park */
    transform: rotate(2deg) scale(0.9);
}

#vision-school {
    top: 45%;
    left: 10%;
    width: 75%; /* Larger */
    z-index: 3; /* On top of everything */
    transform: rotate(10deg) scale(0.9);
}

/* Responsive Grid for Scene 3 */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .image-column {
        min-height: 400px;
        margin-top: 2rem;
    }
}

/* --- Scene 4: Rule 3 --- */
.fuel-scene {
    background-color: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.fuel-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    width: 100%;
    max-width: 1200px;
    align-items: center;
}

.fuel-text-column {
    opacity: 0; /* Animate in */
}

.fuel-text-column h3 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--yellow);
    margin-bottom: 1.5rem;
}

.fuel-text-column p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.7;
    color: var(--light-text);
}

.gauge-animation-column {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* Center the container in the grid cell */
}

/* This pseudo-element forces the container to have a 1:1 aspect ratio */
.gauge-animation-column::before {
    content: '';
    display: block;
    padding-top: 100%;
}

#gauge-base,
#gauge-top-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure image fits within the container */
}

#gauge-top-fill {
    /* All positioning is now handled by the shared rule above */
    filter: drop-shadow(0 0 0px rgba(255, 199, 0, 0)); /* Initially no glow */
    /* Start as a tiny circle at the gauge needle's origin */
    clip-path: circle(0% at 50% 50%);
    -webkit-clip-path: circle(0% at 50% 50%); /* Safari */
    opacity: 0; /* Start hidden */
}

/* Responsive Grid for Scene 4 */
@media (max-width: 768px) {
    .fuel-content-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .gauge-animation-column {
        margin-top: 3rem;
    }
}

/* --- Scene 5: Rule 4 --- */
.horizontal-scroll-scene {
    background-color: #2c3e50; /* New background color */
    overflow: hidden; 
}

#bus-scene-5 {
    position: absolute;
    top: 60%;
    left: -50vw; /* Start off-screen left */
    transform: translateY(-50%);
    z-index: 10;
    width: 45%;
    max-width: 500px;
    opacity: 1; /* Bus is visible when it drives in */
}

.passenger {
    position: absolute;
    width: 11vw; 
    max-width: 160px; 
    min-width: 120px; 
    height: auto;
    opacity: 0;
    bottom: 32%; /* Aligned with the bus height */
    left: -20vw; /* Start off-screen */
    z-index: 11; /* In front of the bus */
}

#scene-5-text-static {
    position: absolute;
    z-index: 20; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    max-width: 700px;
    color: var(--light-text);
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2.5rem;
    border-radius: 12px;
    opacity: 0; 
    text-align: center;
}

#scene-5-text-static h4 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--yellow);
}

#scene-5-text-static p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
}

#vision-map-container {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center; 
    opacity: 0;
    z-index: 15; /* Above the bus, below text */
}

#vision-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--light-text);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-top: 1rem;
    opacity: 0;
}

#vision-map-container .vision-map-icon {
    width: 280px; /* Final, large, and impactful size */
    height: auto;
    filter: drop-shadow(0 5px 35px rgba(255, 223, 102, 0.6));
}

/* --- Scene 6: Rule 5 --- */
.bus-passing-scene {
    background: linear-gradient(to bottom, #a1c4fd, #c2e9fb); /* Soft sky gradient */
    overflow: hidden;
}

.landscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%; /* The green area */
    background: linear-gradient(to top, #6b8e23, #8fbc8f); /* More vibrant green */
    z-index: 1;
}
.landscape::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%; /* Road takes up top half of landscape area */
    background: #5a5a5a;
    border-bottom: 3px solid #444;
}
.landscape::after {
    content: '';
    position: absolute;
    top: 25%; /* Middle of the road */
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    background: repeating-linear-gradient(to right, #E0E0E0, #E0E0E0 30px, transparent 30px, transparent 75px);
    animation: moveRoadLines 0.8s linear infinite; /* Slowed down animation */
}

@keyframes moveRoadLines {
    from { background-position-x: 0; }
    to { background-position-x: -75px; }
}

#bus-scene-6 {
    position: absolute;
    bottom: 15%; /* Adjusted to be on the road */
    right: -50%; /* Start off-screen on the RIGHT */
    width: 40%;
    max-width: 400px;
    z-index: 5; /* Increased z-index to ensure it's on top of the landscape */
}

/* Override the general yellow-bus opacity for scenes where it should be visible */
#bus-scene-5,
#bus-scene-6,
#bus-scene-8 {
    opacity: 1;
}

.bus-stop {
    position: absolute;
    bottom: 10%; /* Lowered to be on the road */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2; /* Behind the bus but on top of landscape */
}

#disinterested-chars {
    width: 100%;
    max-width: 350px;
    transition: opacity 0.5s ease, filter 0.5s ease; /* For the fade/desaturate effect */
}

#scene-6-text {
    top: 25%;
    color: var(--dark-bg);
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10; /* Ensure text is on top of everything */
}

#scene-6-text h5 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #333;
    margin-bottom: 1rem;
}

/* --- Scene 7: Rule 6 --- */
.vampire-scene {
    overflow: hidden;
}

#thorny-forest, #green-forest {
    z-index: -2;
}

#green-forest {
    opacity: 0; /* Hidden initially */
}

#vampire-sign {
    position: absolute;
    width: clamp(250px, 30vw, 450px); /* Responsive sizing */
    max-width: none; /* Override the old max-width */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: 20; /* Ensure it's on top */
    filter: drop-shadow(0 0 0px rgba(255, 255, 0, 0)); /* Base for glow animation */
}

.shield-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vw; /* Make it large enough to cover the screen */
    height: 150vh;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.6), rgba(255, 255, 255, 0.1) 40%, transparent 60%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    z-index: 15; /* Below the sign but above vampires */
    bottom: 20%;
}

.energy-vampire {
    position: absolute;
    width: 18%; /* Slightly smaller for better spacing */
    max-width: 180px;
    bottom: 5%;
    z-index: 5;
    transition: opacity 0.5s, transform 0.5s; /* Smooth transition for exit */
}

#vampire-1 {
    left: 10%;
    bottom: 25%;
}
#vampire-2 {
    left: 40%;
    bottom: 10%;
}
#vampire-3 {
    right: 15%;
    bottom: 20%;
}

#scene-7-text {
    top: 15%; /* Moved up for better balance */
    text-align: center;
    background: rgba(18, 18, 18, 0.7); /* Same as other text boxes */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Safari */
    padding: 2rem;
    border-radius: 10px;
    width: 60%;
    max-width: 800px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25; /* Above everything */
}

#scene-7-text h6 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--light-text);
    margin-bottom: 1rem;
}

/* --- Scene 8: Rule 7 --- */
.enthusiasm-scene {
    background-color: #E8F8FF; /* Bright, optimistic sky blue */
    overflow: hidden;
}

#bus-scene-8 {
    position: absolute;
    width: 40%;
    max-width: 450px;
    top: 50%;
    left: -50%; /* Start off-screen */
    transform: translateY(-50%);
    z-index: 10;
}

#particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to go through */
    z-index: 5;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--yellow);
    border-radius: 50%;
    opacity: 0.7;
}

#enthusiastic-team {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 750px;
    z-index: 5;
    opacity: 0;
}

#scene-8-text {
    width: 80%;
    max-width: 900px;
    left: 50%;
    transform: translateX(-50%);
    top: 15%;
    color: var(--dark-bg);
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 2rem;
    opacity: 0; /* Animate in with JS */
    z-index: 10;
}

#scene-8-text h7 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #333;
    margin-bottom: 1rem;
}

/* --- Scene 9: Rule 8 --- */
.collaboration-scene {
    background-color: #1a1a1a;
}

@keyframes subtle-pink-glow {
    0% { box-shadow: 0 0 15px rgba(255, 105, 180, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 105, 180, 0.6); }
    100% { box-shadow: 0 0 15px rgba(255, 105, 180, 0.3); }
}

#sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #FFD700; /* A warm, golden color */
    border-radius: 50%;
    box-shadow: 0 0 8px #FFD700, 0 0 12px #FFD700;
    opacity: 0;
}

.vignette-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

#collaboration-vignette {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Animate in */
}

#scene-9-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45%; /* Adjusted for center alignment */
    max-width: 600px;
    z-index: 10;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Safari */
    padding: 2.5rem;
    border-radius: 10px;
    color: var(--light-text);
    opacity: 0;
}

#scene-9-text.glowing {
    animation: subtle-pink-glow 4s ease-in-out infinite;
}

#scene-9-text h8 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--yellow);
    margin-bottom: 1rem;
}

/* --- FINALE SEQUENCE (SCENES 10 & 11) --- */

.finale-sequence {
    overflow: hidden;
    background-color: #87ceeb; /* Start with a daytime sky blue */
}

/* --- Part 1: Purpose --- */

.purpose-content {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 1; /* Starts visible */
}

#bus-scene-10 {
    position: absolute;
    width: 30%;
    max-width: 350px;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.skyline-reveal-container {
    position: absolute;
    bottom: 25%; /* Position where skyline appears */
    left: 0;
    width: 100%;
    height: 50%; /* Adjust height as needed */
    -webkit-mask-image: linear-gradient(to top, black 60%, transparent 100%);
    mask-image: linear-gradient(to top, black 60%, transparent 100%);
}

#mesa-skyline {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateY(100%); /* Start below the mask */
}

#scene-10-text {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    opacity: 0; /* Animate in */
}

#scene-10-text h9 {
    display: block;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--yellow);
    margin-bottom: 1rem;
    text-align: center;
}

/* --- Part 2: Celebration --- */

.celebration-content {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-color: #0c1445;
    display: flex; /* Use flexbox for robust centering */
    align-items: center;
    justify-content: center;
}

#fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
}

.final-text-container {
    width: 90%;
    max-width: 1100px;
    height: 80vh; /* Give the container a defined height */
    position: relative; /* Anchor for the absolutely positioned children */
    color: #fff;
    text-shadow: 2px 2px 8px #000;
}

.final-text {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.final-text h10 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--yellow);
    display: block;
    margin-bottom: 2rem;
}

.final-text p {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.celebration-firework-img {
    display: block;
    margin: 2rem auto 0;
    width: 45%;
    max-width: 280px;
    opacity: 0;
    transform: scale(0);
}

.final-team-names {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #ccc;
    letter-spacing: 1px;
}

.mesa-logo {
    display: block;
    margin: 0 auto 2rem;
    width: 80%;
    max-width: 500px; /* Made 3x larger */
}

/* Override the general yellow-bus opacity for scenes where it should be visible */
#bus-scene-6,
#bus-scene-8,
#bus-scene-10 {
    opacity: 1;
}

/* --- Responsive Adjustments for Desktops --- */

/* For smaller desktop screens and laptops (~1024px - 1200px) */
@media (max-width: 1200px) {
    /* Reduce some of the padding and gaps to save space */
    .grid-container, .fuel-content-grid {
        gap: 2rem;
    }

    /* Make some text containers a bit smaller to avoid cramping */
    .hud-text {
        width: 60%;
    }
}

/* For very wide screens (e.g., 1440p and up) */
@media (min-width: 1800px) {
    html {
        font-size: 120%; /* Increase the base font size for better readability */
    }

    /* Allow content containers to be a bit wider to better use the space */
    .bus-container, .scene-text {
        max-width: 900px;
    }
    .hud-text {
        max-width: 800px;
    }
     .grid-container, .fuel-content-grid {
        max-width: 1400px;
    }
    #scene-9-text {
        max-width: 700px;
    }
} 