/* Design Tokens & Theme Variables */
:root {
    --bg-color: #04A0E3;
    --text-color: #f5f5f7;
    --accent-color: #ff5e3a;
    --accent-blue: #007aff;
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --brand-pink: #ff5e3a;
    --container-width: 1200px;
}

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

body.dark-mode {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
}

/* Scroll Container */
.scroll-height {
    height: 10000vh;
    /* Expanded for final narrative paragraphs */
    position: relative;
}

/* App Wrapper Fix (Sticky Viewport) */
#app {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile stability */
    overflow: hidden;
    background-color: var(--bg-color);
}

/* Section Components */
.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#quote-section,
#description-section,
#dna-section,
#overview-section,
#vespa-section,
#motore-narrativo-section,
#mondo-serie-section {
    opacity: 0;
}

.quote-container {
    padding: 0 10%;
    text-align: center;
    width: 100%;
}

#quote-text,
#description-text {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    opacity: 0;
    transform: scale(0.6);
    font-family: 'Fredoka', sans-serif;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* Logo Video Scrub Section */
#logo-scrub {
    background-color: var(--bg-color);
}

.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

#logo-video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    pointer-events: none;
    will-change: transform;
}

/* Balloons & Scroll Hint */
.balloon {
    position: absolute;
    width: 300px;
    height: auto;
    bottom: -450px;
    z-index: 5;
    pointer-events: none;
}

#balloon-left {
    left: 10%;
}

#balloon-right {
    right: 10%;
}

.scroll-hint {
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    color: white;
    opacity: 0;
    text-align: center;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    width: auto;
    white-space: nowrap;
}

.scroll-hint strong {
    font-weight: 800;
}

/* Description Reveal Elements */
.description-layout-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

#description-section .quote-container {
    height: 50vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
}

.video-frame {
    height: 50vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
    width: 100%;
}

#description-video {
    width: 600px;
    max-width: 85vw;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
}

/* DNA Section (MODERN SWARM STYLES) */
#dna-section {
    background-color: var(--bg-color);
    left: 100vw;
    opacity: 1;
    visibility: hidden;
    pointer-events: none;
    overflow: visible;
}

.dna-belt {
    display: flex;
    align-items: center;
    height: 100vh;
    width: 900vw;
    position: relative;
}

.prop {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    will-change: transform;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.3));
}

#hero-mandolin {
    position: absolute;
    transform: rotate(60deg);
    margin-top: -480px;
    opacity: 1 !important;
    object-fit: contain;
    z-index: 20;
    pointer-events: none;
    will-change: transform;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 1.0));
}

#dna-title {
    position: absolute;
    left: 85vw;
    top: 30%;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 8vw;
    color: white;
    white-space: nowrap;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
    letter-spacing: -0.02em;
}

/* Overview Section Styles (Beat 5) */
#overview-section {
    background-color: var(--bg-color);
    z-index: 30;
    /* Ensure it stays above previous sections if needed */
}

.overview-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#overview-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 8vw;
    color: white;
    white-space: nowrap;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
    letter-spacing: -0.02em;
    transform: translateY(100vh);
    /* Start below the bottom edge */
    opacity: 1;
    /* We control visibility via the section opacity and title transform */
    will-change: transform, opacity;
}

#overview-main-content {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8vh 0 16vh 0;
    /* Raised text and portrait slightly higher */
    pointer-events: none;
    opacity: 0;
    /* Hidden initially */
}

.character-card {
    width: 100%;
    height: 100%;
    background: transparent; /* Removed white box */
    border-radius: 15px;
    padding: 0;              /* Removed padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: none;        /* Removed external shadow */
}

.overview-img {
    height: 55vh;
    width: auto;
    object-fit: contain;
    transform: translateY(100vh);
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.5));
    will-change: transform, opacity;
}

#overview-portrait-angry {
    z-index: 5;
}

#overview-text-wrapper {
    width: 95vw;
    /* Almost full width */
    max-width: none;
    text-align: center;
    transform: translateY(100vh);
    /* Start below */
}

#overview-desc-text {
    font-family: var(--font-secondary);
    font-size: 1.4vw;
    /* Large size to fit single row */
    line-height: 1;
    font-weight: 600;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    /* Force single row */
    display: inline-block;
    transform: scaleY(1.3);
    /* Increases height without making it wider */
}

.text-prop-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px;
    border-radius: 16px;
    width: 380px;
    color: white;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    z-index: 15;
}

.text-prop-card h3 {
    margin: 0 0 12px 0;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    text-transform: uppercase;
    color: var(--brand-pink);
    letter-spacing: 0.1em;
}

.text-prop-card p {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 500;
}

/* Vespa Mirror Styles (Beat 6) */
#vespa-section {
    background-color: transparent;
    pointer-events: none;
    z-index: 40;
}

.vespa-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#vespa-mirror {
    position: absolute;
    left: -100vw;
    /* Start far left */
    top: 50%;
    transform: translateY(-50%);
    height: 70vh;
    /* Quite big */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.4));
}

.vespa-narrative-wrapper,
.vespa-narrative-wrapper-2,
.vespa-drive-by-asset {
    position: absolute;
    top: 5%;
    right: calc(5% + 360px);
    width: 450px;
    max-width: 35vw;
    opacity: 0;
    transform: scale(0.5);
    transform-origin: top right;
    will-change: transform, opacity, top;
}

#vespa-old-lady-wrapper {
    top: -100vh;
    /* Start completely off-screen top */
    right: calc(5% - 300px);
    /* 500px to the right from standard start (360px -> -140px) */
    opacity: 1;
}

#vespa-old-lady {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

.vespa-narrative-text {
    font-family: var(--font-secondary);
    color: white;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 500;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#traffic-light-wrapper {
    top: -100vh;
    opacity: 1;
    right: calc(5% + 360px);
    width: 600px;
}

#plaetta {
    position: absolute;
    top: 2%;
    right: -120%;
    /* Start fully off-screen to the right */
    width: 20vw;
    /* 25% smaller than 45vw */
    max-width: 600px;
    height: auto;
    transform: rotate(-45deg);
    /* Pre-tilted anticlockwise */
    transform-origin: top right;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.3));
    will-change: transform, right;
}

#tissue-arm {
    position: absolute;
    top: -5%;
    right: -120%;
    /* Start off-screen */
    width: 100vw;
    max-width: 2500px;
    height: auto;
    transform: rotate(-15deg);
    transform-origin: top right;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    will-change: transform, right;
    z-index: 45;
}

.traffic-light-img {
    width: auto;
    height: 75vh;
    /* Larger size as requested */
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* Motore Narrativo Styles */
#motore-narrativo-section {
    background-color: var(--bg-color);
    z-index: 50;
}

.motore-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Sit on centre-top */
    padding-top: 8vh;
    position: relative;
    overflow: hidden;
}

#motore-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 8vw;
    color: white;
    white-space: nowrap;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
    letter-spacing: -0.02em;
    transform: translateY(-120vh);
    /* Start off-screen top */
    will-change: transform, opacity;
}

#motore-panaro,
.motore-panaro-img {
    position: absolute;
    top: -500vh;
    /* Start off-screen top */
    left: 50%;
    transform: translateX(-50%);
    width: 50vw;
    max-width: 2000px;
    height: auto;
    z-index: 5;
    /* Behind the title */
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    will-change: top;
}

.motore-text-wrapper {
    position: absolute;
    width: 90%;
    max-width: 1400px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1.4vw;
    line-height: 1.6;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    /* Above panaro */

    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    /* Positioned at the bottom of the viewport initially */
    top: 100vh;
    left: 50%;
    transform: translateX(-50%);
    will-change: transform, top, opacity;
}

/* Mondo della Serie Styles (Section 8) */
#mondo-serie-section {
    background-color: var(--bg-color);
    z-index: 60;
}

.mondo-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    justify-content: flex-start;
    /* Start from top */
    align-items: center;
    /* Center horizontally */
    padding-top: 1vh;
    /* Pulled up further */
    position: relative;
    overflow: hidden;
}

#mondo-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 6.5vw;
    /* Slightly smaller to fit width */
    color: white;
    text-align: center;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 20;
    letter-spacing: -0.02em;
    line-height: 0.8;
    /* Pulls top of letters up */
    margin-top: 0;
    /* Resetting to prevent clipping */
    opacity: 0;
    will-change: opacity;
}

#mondo-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.3vw;
    /* Reduced to fit in single row */
    font-weight: 500;
    color: white;
    width: 95%;
    max-width: none;
    white-space: nowrap;
    /* Enforce single row */
    text-align: center;
    line-height: 1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-top: 1vh;
    /* Brought up closer to title */
    opacity: 0;
    transform: translateY(-30px);
    /* Tighter slide distance */
    will-change: transform, opacity;
    margin-bottom: 2vh;
}

/* Rows Sequence Styles */
.mondo-rows-container {
    width: 100%;
    flex: 1;
    /* Fills remaining height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Pulled up */
    gap: 0.2vh;
    /* Tighter gap */
    padding-bottom: 2vh;
}

.mondo-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4vw;
    padding: 0 5vw;
}

.mondo-row.row-reverse {
    flex-direction: row-reverse;
}

.mondo-image-side {
    width: 12%;
    /* Significant reduction to allow text to expand fully */
    display: flex;
    justify-content: center;
}

.mondo-prop {
    height: 18vh;
    /* Unified smaller base */
    width: auto;
    object-fit: contain;
    /* DIRECTIONAL SHADOW: matched to Sfogliatella bottom-right offset - Increased */
    filter: drop-shadow(80px 80px 60px rgba(0, 0, 0, 0.65)) drop-shadow(15px 15px 20px rgba(0, 0, 0, 0.9));
    opacity: 0;
    /* Fade in via JS */
    will-change: opacity;
}

/* Specific Control for Moka */
#mondo-row-1 .mondo-prop {
    height: 31vh;
    /* Increased by 25% from 25vh */
    margin-top: 5vh;
}

/* Specific Control for Sfogliatella */
#mondo-row-3 .mondo-prop {
    height: 25vh;
    margin-top: 5vh;
}

.mondo-text-side {
    width: fit-content;
    /* Shrink-to-fit content */
    max-width: 85%;
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* Glassmorphism Upgrade */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 1.2vh 2.5vw;
    /* Tightened padding */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    opacity: 0;
    /* Container fades in first */
}

/* Unique wide hit for the characters card to prevent 'coerenza' wrap */
#mondo-row-3 .mondo-text-side {
    max-width: 95%;
    margin-left: -5vw;
    /* Slight overlap allowance */
}

.mondo-line {
    font-family: var(--font-secondary);
    font-size: 1.2vw;
    /* Unified size slightly reduced */
    color: white;
    line-height: 1.6;
    /* Increased for readability */
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    width: 100%;
    /* Use full width of card */
    will-change: transform, opacity;
}

/* Line variants - UNIFIED SIZE, hierarchy via weight */
.mondo-line.bullet {
    font-weight: 700;
    margin-left: 1vw;
}

.mondo-line.highlight {
    font-weight: 800;
}

.mondo-line.mondo-small {
    font-size: 1.1vw;
    /* Surgical reduction for layout fit */
}

.mondo-line.small {
    font-weight: 400;
    font-size: 1.1vw;
}

.mondo-line.spacer {
    height: 1.2vh;
}

/* Re-optimized for vertical fit */

/* Characters Cards Section (Beat 10) */
#characters-section {
    background-color: var(--bg-color);
    z-index: 70;
    opacity: 0;
}

.cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 4vw;
    gap: 3vw;
    perspective: 2000px;
    /* High perspective for cinematic feel */
}

.card-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    transform-style: preserve-3d;
}

.character-card {
    position: absolute;
    width: 25vw;
    height: 82vh;
    object-fit: contain;
    transform: translateY(-120vh);
    opacity: 0;
    will-change: transform, opacity;
}

.info-card {
    position: absolute;
    width: 25vw;
    height: 82vh;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    transform: translateY(-120vh);
    opacity: 0;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 3vh 2vw; /* Increased breathing space */
    border: 1px solid rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
}

.card-text-content {
    font-family: var(--font-secondary);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Changed from space-between for consistent rhythm */
    height: 100%;
}

.card-text-content h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6vw;
    color: var(--brand-pink);
    margin-bottom: 2vh;
    text-align: center;
    padding-top: 1vh;
    /* Alignment height calibration */
}

.card-text-content p {
    font-size: 0.85vw;
    line-height: 1.45;
    margin-bottom: 1.2vh;
    font-weight: 500;
    color: var(--bg-color);
}

.card-footer {
    margin-top: 1.2vh;
    font-size: 0.8vw;
    font-weight: 700;
    font-style: italic;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1vh;
    color: var(--bg-color);
    /* Matches paragraph color */
}

/* Architettura della Stagione Section (Beat 11) */
#architettura-section {
    background-color: var(--bg-color);
    z-index: 80;
    opacity: 0;
}

.architettura-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#architettura-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 800;
    font-size: 7.5vw;
    color: white;
    text-align: center;
    line-height: 0.9;
    white-space: nowrap;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    /* Start far TOP */
    position: absolute;
    top: -50vh;
    left: 50%;
    transform: translate(-50%, -50%);
    will-change: top, opacity;
    z-index: 10;
}

#escalator-glass {
    width: 140vw;
    height: auto;
    object-fit: contain;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    z-index: 5;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.4));
}

.escalator-block {
    position: absolute;
    width: 380px;
    padding: 2.5vh 2vw;
    background: rgba(4, 160, 227, 0.9) !important; /* Brand blue background */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transform: rotate(26deg);
    will-change: transform, opacity;
    z-index: 999 !important;
    opacity: 1 !important;
    isolation: isolate !important;
    transform-style: preserve-3d;
    pointer-events: none;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

#escalator-text-2 {
    width: 650px;
    /* Much wider as requested */
}

.escalator-content {
    font-family: var(--font-secondary);
    color: white !important; /* White text for contrast */
}

.escalator-content h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--brand-pink);
    font-size: 1.8vw;
    margin-bottom: 0.5vh;
    text-transform: uppercase;
}

.escalator-content h4 {
    font-size: 1.2vw;
    margin-bottom: 1.5vh;
    font-weight: 700;
}

.escalator-content p {
    font-size: 1vw;
    line-height: 1.4;
    margin-bottom: 1vh;
    font-weight: 500;
}

.escalator-list {
    list-style: none;
    padding: 0;
    margin: 1vh 0 1.5vh 0;
}

.escalator-list li {
    font-size: 0.95vw;
    line-height: 1.4;
    margin-bottom: 0.4vh;
    font-weight: 600;
    padding-left: 0.5vw;
}

/* Personaggi Architettura Section */
#personaggi-arch-section {
    background-color: var(--bg-color); /* Signature Brand Blue */
    z-index: 90; /* Higher than previous section */
    opacity: 0;
}

.personaggi-arch-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#personaggi-arch-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 800;
    font-size: 100vh; /* As tall as the whole viewport */
    line-height: 0.8;
    color: white;
    white-space: nowrap;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Will start off-screen right via GSAP */
    will-change: transform, left;
    margin: 0;
    padding: 0;
}

#personaggi-arch-intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw; /* Expanded to allow much longer sentences per row */
    text-align: center;
    color: white;
    opacity: 0; /* Hidden by default */
    z-index: 20;
    pointer-events: none;
    will-change: opacity;
}

#personaggi-arch-intro p {
    font-size: 1.75vw; /* Decreased slightly to fit within 2 rows */
    line-height: 1.5;
    margin-bottom: 3vh;
    font-family: var(--font-secondary);
    font-weight: 500;
}

#rolling-volleyball {
    position: absolute;
    height: 100vh;
    width: auto;
    object-fit: contain;
    top: 50%;
    transform: translateY(-50%);
    left: -100vw; /* Initial state, deep offscreen left */
    will-change: left, transform;
    pointer-events: none;
    z-index: 15; /* Just below the text if they overlap at all */
}

#livello-1-title, #livello-2-title, #livello-3-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    opacity: 0;
    will-change: bottom, opacity;
    z-index: 25;
}

#livello-1-title h3, #livello-2-title h3, #livello-3-title h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5vw;
    font-weight: 800;
    margin-bottom: 0.5vh;
    letter-spacing: 0.05em;
}

#livello-1-title p, #livello-2-title p, #livello-3-title p {
    font-family: var(--font-secondary);
    font-size: 1.3vw;
    font-weight: 500;
    opacity: 0.85;
}

/* Character Wheel Animation System */
#character-wheel-container {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    pointer-events: none;
}

.char-bio {
    position: absolute;
    top: 5vh; /* Brought significantly higher */
    left: 50%;
    transform: translateX(-50%);
    width: 95vw; /* Full width to allow single-line sentences */
    text-align: center;
    color: white;
    opacity: 0;
    z-index: 30;
    will-change: opacity;
}

.char-bio h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 3.5vw;
    margin-bottom: 0vh; /* Reduced space between title and subtitle */
    letter-spacing: 0.05em;
}

.char-bio h4 {
    font-family: var(--font-secondary);
    font-size: 1.6vw;
    font-weight: 700;
    margin-bottom: 1.5vh; /* Reduced space before bio text */
    color: var(--brand-pink);
}

.char-bio .bio-text p {
    font-family: var(--font-secondary);
    font-size: 1.25vw; /* Slightly decreased to ensure fit */
    margin-bottom: 1vh;
    opacity: 0.95;
    line-height: 1.4;
}

.char-img {
    position: absolute;
    bottom: 14vh; /* Just above Livello 1 */
    left: 50%;
    height: 60vh;
    width: auto;
    object-fit: contain;
    opacity: 0;
    z-index: 20;
    will-change: transform, opacity;
}

#designer-ui {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999;
}

/* =========================================================================
   SOSTENIBILITÀ E POSIZIONAMENTO SECTION
   ========================================================================= */

#sostenibilita-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 20;
    overflow: visible; /* Override .section overflow:hidden so balloons can fly in from outside */
}

.balloon-container {
    position: fixed; /* Fixed to viewport directly — bypasses overflow:hidden on parent */
    width: 40vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: top, transform;
    top: 130vh; /* Start off-screen below viewport */
}

.balloon-container.left {
    left: 6vw;
}

.balloon-container.right {
    right: 6vw;
    align-items: center;
}

.leafloon {
    width: 14vw;
    margin-bottom: -3vh;
    z-index: 2;
    filter: drop-shadow(4px 10px 15px rgba(0,0,0,0.4));
}

.balloon-container .glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2vh;
    padding: 3vh 3vw;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: auto;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.balloon-container .glass-card h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8vw;
    font-weight: 800;
    margin-bottom: 2vh;
    letter-spacing: 0.05em;
    color: var(--brand-pink);
}

.balloon-container .glass-card p {
    font-family: var(--font-secondary);
    font-size: 1.25vw;
    line-height: 1.4;
    margin-bottom: 1.5vh;
}

.balloon-container .glass-card ul {
    list-style-type: disc;
    margin-left: 2vw;
    margin-bottom: 1.5vh;
    color: white;
}

.balloon-container .glass-card li {
    font-family: var(--font-secondary);
    font-size: 1.25vw;
    line-height: 1.4;
    margin-bottom: 0.8vh;
    margin-bottom: 0.8vh;
}

/* =========================================================================
   SECTION 13: DICHIARAZIONE FINALE (REPEATED DNA SWARM)
   ========================================================================= */

#final-swarm-section {
    background-color: var(--bg-color);
    left: 0; /* Centered initially, use opacity to reveal */
    top: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: visible;
    z-index: 9999; /* Absolute top */
}

#final-belt {
    display: flex;
    align-items: center;
    height: 100vh;
    width: 2000vw;
    position: relative;
}

#final-hero-mandolin {
    position: absolute;
    transform: rotate(60deg);
    margin-top: -480px;
    opacity: 1 !important;
    object-fit: contain;
    z-index: 20;
    pointer-events: none;
    will-change: transform;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 1.0));
}



#final-dna-title {
    position: absolute;
    left: 85vw;
    top: 30%;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 8vw;
    color: white;
    white-space: nowrap;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
    letter-spacing: -0.02em;
}

.finale-stream-card {
    width: auto !important; /* Allow the inline 400vw to take over */
    max-width: none !important;
    white-space: nowrap; /* Forces the single row stream effect */
    background: rgba(255, 255, 255, 0.05) !important; /* Lighter for long stream */
    padding: 2vh 4vw !important;
    border-radius: 100px !important; /* Pill shape for the stream */
}

.finale-stream-card p {
    font-size: 2.5vw !important; /* Larger text for the final statement */
    font-weight: 600 !important;
    margin: 0 !important;
}

#closing-credits-section {
    background-color: var(--bg-color);
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
}

.closing-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; 
    justify-content: flex-start;
    align-items: center;
    padding-top: 5vh;
    position: relative; /* Base for absolute logo */
}

#final-closing-img {
    height: 42.5vh; /* Reduced by half as requested */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.3));
    margin-bottom: 5vh;
}

#final-captions-container {
    position: relative;
    width: 100%;
    height: 20vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.final-caption {
    position: absolute;
    font-family: 'Fredoka', sans-serif;
    color: white;
    font-size: 2.8vw;
    font-weight: 500;
    opacity: 0;
    text-align: center;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.caption-group {
    position: absolute;
    display: flex;
    gap: 1.5vw;
    opacity: 0;
    justify-content: center;
    align-items: center;
}

.caption-group .final-caption {
    position: relative;
    opacity: 0; /* Changed to 0 so we can control them individually in GSAP */
}

.main-title-caption {
    font-size: 6vw;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-video-final {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 60vw;
    height: auto;
    opacity: 0;
    z-index: 25000; /* Decisively over img and captions */
}



/* Orientation Enforcement Styled */
#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 9999999;
    display: none; 
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.orientation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rotate-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
    animation: rotateDevice 2s ease-in-out infinite;
}

.rotate-icon svg {
    width: 100%;
    height: 100%;
}

#orientation-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
}

@keyframes rotateDevice {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(-90deg); }
    70% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

/* Mobile Landscape Optimization */
@media screen and (max-width: 1024px) and (max-height: 550px) {
    /* Sigla Video Section Adjustments */
    .description-layout-wrapper {
        justify-content: flex-start !important; 
        padding-top: 12vh !important; 
    }

    #description-section .quote-container {
        height: auto; 
        display: flex;
        align-items: flex-end;
        padding-bottom: 1.5rem; 
    }

    .video-frame {
        height: 65vh; 
        padding-top: 0.5rem;
    }

    #description-video {
        width: 65vh; 
        max-width: 80vw;
    }

    #description-text, #quote-text {
        font-size: 1.3rem !important; 
        line-height: 1.1;
    }
}

/* Mobile Portrait Protection */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    #orientation-overlay {
        display: flex;
    }
    #app {
        visibility: hidden;
    }
}
