/* ========================================
   Layout - Sections, Canvas, Z-layers
   ======================================== */

/* --- Canvas --- */
#scene-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-canvas);
    pointer-events: none;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: var(--z-content);
    min-height: 100vh;
    width: 100%;
}

.section__inner {
    position: relative;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.section__header {
    margin-bottom: var(--space-lg);
    max-width: 700px;
}

.section__label {
    display: inline-block;
    font-family: var(--font-vcr);
    font-size: 0.75rem;
    color: var(--verde-fosforo);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    opacity: 0.8;
}

.section__title {
    margin-bottom: var(--space-sm);
    color: var(--blanco-crudo);
}

.section__intro {
    color: var(--gris-estatica);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.8;
}

/* --- Section heights for scroll --- */
.section--hero {
    height: 300vh;
}

.section--naciste,
.section--tech,
.section--cultura,
.section--deporte,
.section--curiosidades,
.section--cierre {
    min-height: auto;
    padding-bottom: var(--space-xl, 4rem);
}

.section--objetos {
    min-height: auto;
    padding-bottom: var(--space-xl, 4rem);
}


/* --- Loader --- */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-loader);
    background: var(--negro-crt);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s;
}

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

.loader__crt-frame {
    text-align: center;
}

.loader__screen {
    padding: var(--space-md);
}

.loader__text {
    font-family: var(--font-vcr);
    font-size: 1rem;
    color: var(--verde-fosforo);
    margin-bottom: var(--space-sm);
}

.loader__dots {
    animation: blink 1s steps(3) infinite;
}

.loader__bar {
    width: 200px;
    height: 12px;
    border: 2px solid var(--verde-fosforo);
    margin: 0 auto var(--space-xs);
    position: relative;
    overflow: hidden;
}

.loader__bar-fill {
    height: 100%;
    width: 0%;
    background: var(--verde-fosforo);
    transition: width 0.3s linear;
}

.loader__percent {
    font-family: var(--font-vcr);
    font-size: 0.8rem;
    color: var(--verde-fosforo);
}

@keyframes blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Sound Toggle --- */
.sound-toggle {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    z-index: var(--z-ui);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(51, 255, 102, 0.3);
    color: var(--verde-fosforo);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, background 0.3s;
    backdrop-filter: blur(8px);
}

.sound-toggle:hover {
    border-color: var(--verde-fosforo);
    background: rgba(51, 255, 102, 0.1);
}

.sound-toggle__icon {
    width: 20px;
    height: 20px;
}

.sound-toggle__icon--on {
    display: none;
}

.sound-toggle[data-active="true"] .sound-toggle__icon--off {
    display: none;
}

.sound-toggle[data-active="true"] .sound-toggle__icon--on {
    display: block;
}

/* --- Progress Nav --- */
.progress-nav {
    position: fixed;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--z-ui);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.progress-nav__line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
}

.progress-nav__fill {
    width: 100%;
    height: 0%;
    background: var(--verde-fosforo);
    border-radius: 1px;
    transition: height 0.3s var(--ease-out-expo);
}

.progress-nav__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    position: relative;
    z-index: 1;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.progress-nav__dot.active {
    background: var(--verde-fosforo);
    transform: scale(1.5);
    box-shadow: 0 0 8px var(--verde-fosforo);
}

/* --- Fallback mode (no Three.js / SES lockdown) --- */
.fallback-mode #scene-canvas {
    display: none;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: var(--z-content);
    text-align: center;
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__text {
    font-family: var(--font-vcr);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
}

.footer__link {
    color: var(--ambar-calido);
    text-decoration: none;
    transition: color 0.3s;
}

.footer__link:hover {
    color: var(--verde-fosforo);
    text-decoration: underline;
}
