:root {
    --brand-teal: #054852;
    --brand-red: #D6453F;
    --brand-celeste: #7EC8E8;
    --bg-dark: var(--brand-teal);
    --bg-darker: #043239;
    --accent-cream: #E6D2B0;
    --accent-orange: var(--brand-red);
    --pattern-navy: var(--brand-teal);
    --pattern-cream: #C7AD84;
}

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

/* Safari toma el color de overscroll del fondo de html, no del body.
   Al igualarlo al azul marino, la barra de navegación y el área de rubber-band
   se funden con el hero en lugar de mostrar el crema del .horizontal-wrapper */
html {
    background-color: var(--bg-dark); /* Safari overscroll color must match hero */
}

/* Tipografía de títulos: la misma de la app (Fraunces Black Italic, SIL OFL 1.1,
   licencia en fonts/Fraunces-OFL.txt). Solo títulos y frases cortas; el texto
   largo sigue en Syne. */
@font-face {
    font-family: 'TitleFont';
    src: url('fonts/Fraunces-BlackItalic.woff') format('woff');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

body {
    background-color: var(--bg-dark);
    color: var(--accent-cream);
    font-family: 'Syne', sans-serif;
    overflow-x: hidden;
    min-height: 100dvh;
    position: relative;
    z-index: 0;
}

h1, h2, h3 {
    font-family: 'TitleFont', serif;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    line-height: 1;
}

/* --- HEADER & LOGO --- */
header, .menu-header {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 2rem 4rem; display: flex;
    justify-content: space-between; align-items: center;
    z-index: 100;
}

.logo {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    color: var(--accent-orange);
    text-shadow: 2px 2px 0px var(--bg-darker);
    text-transform: none;
    font-style: normal;
    text-decoration: none;
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

/* Imagen de logo dentro del .logo container */
.logo img {
    height: 104px;
    width: auto;
    display: block;
    object-fit: contain;
}


.menu-open, .menu-close { font-weight: 800; font-size: 0.9rem; letter-spacing: 2px; cursor: pointer; transition: color 0.4s ease, opacity 0.3s ease; }
.menu-open { color: var(--brand-red); }
.menu-open:hover { opacity: 0.7; }
.menu-close:hover { color: var(--brand-red); }

/* --- MENÚ OVERLAY MEJORADO --- */
/* --- MENÚ OVERLAY (Efecto Splash Orgánico / Agua) --- */
.menu-overlay {
    position: fixed; 
    top: 0; left: 0; width: 100vw; height: 100dvh;
    z-index: 200;
    display: flex; flex-direction: column; justify-content: center;
    
    /* Ocultamos el contenedor y los textos al principio */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.5s;
    pointer-events: none;
    
    /* El fondo ya no es un color sólido acá, lo van a hacer las gotas */
    background: transparent; 
}

.menu-overlay.active { 
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease;
    pointer-events: auto; 
}

/* 1. Gota Principal de Agua (Azul Oscuro) */
.menu-overlay::before {
    content: '';
    position: absolute;
    top: 1rem; right: 3rem;
    width: 150px; height: 150px;
    background-color: rgba(5, 72, 82, 0.98);
    
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    
    transform-origin: center;
    transform: scale(0) rotate(0deg);
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), border-radius 1.2s ease;
    z-index: -1; 
}

/* 2. Gota Secundaria del Splash */
.menu-overlay::after {
    content: '';
    position: absolute;
    top: 3rem; right: 5rem;
    width: 80px; height: 80px;
    background-color: rgba(214, 69, 63, 0.5);
    
    /* Otra forma irregular distinta */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    
    transform-origin: center;
    transform: scale(0) rotate(0deg);
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -2; 
}

/* Animación cuando hacés clic en MENÚ + */
.menu-overlay.active::before {
    transform: scale(30) rotate(45deg); /* Inunda toda la pantalla */
    border-radius: 50%; /* Se estabiliza y aplana al final */
}

.menu-overlay.active::after {
    transform: scale(35) rotate(-20deg); /* Salpica por detrás */
}

.menu-content-wrapper {
    display: flex; justify-content: space-between; align-items: flex-end;
    width: 80%; max-width: 1200px; margin: 0 auto;
}

.menu-links { display: flex; flex-direction: column; text-align: left; gap: 1.5rem; }
.menu-links a {
    color: var(--accent-cream); text-decoration: none;
    font-family: 'TitleFont', serif; font-weight: 900; font-size: 4rem; font-style: italic;
    transition: color 0.3s ease, transform 0.3s; transform-origin: left;
}
.menu-links a:hover { color: var(--accent-orange); transform: translateX(15px); }

.menu-info { display: flex; flex-direction: column; gap: 3rem; text-align: right; }
.menu-subtitle { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--accent-orange); margin-bottom: 1rem; font-weight: 800; }
.social-links, .legal-links { display: flex; flex-direction: column; gap: 0.5rem; }
.social-links a, .legal-links a {
    color: var(--accent-cream); text-decoration: none; font-size: 1.1rem;
    transition: color 0.3s;
}
.social-links a:hover, .legal-links a:hover { color: var(--accent-orange); }
.legal-links a { font-size: 0.9rem; opacity: 0.8; }

/* Media Query para el menú en móviles */
@media (max-width: 768px) {
    .menu-content-wrapper { flex-direction: column; align-items: flex-start; gap: 3rem; }
    .menu-info { text-align: left; }
    .menu-links a { font-size: 2.5rem; }
}

/* --- HERO --- */
.hero {
    position: relative; 
    width: 100%;
    height: 100dvh;    /* fallback para browsers viejos */
    height: 100dvh;   /* dynamic viewport height para Safari */
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    overflow: hidden; text-align: center;
    z-index: 0;
}
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    z-index: -2;
}
.video-background video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(5,72,82,0.3) 0%, rgba(5,72,82,0.95) 100%); z-index: -1;
}
.pre-title { font-size: clamp(0.65rem, 2.8vw, 1rem); font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: var(--accent-cream); opacity: 0.75; margin-bottom: 1.5rem; }
.hero-content { position: relative; z-index: 2; } /* por encima del wave-divider */
.hero-content h1 { font-size: clamp(4rem, 10vw, 8rem); text-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.scroll-indicator { position: absolute; bottom: 90px; font-size: 0.8rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; opacity: 0.7; animation: bounce 2s infinite; z-index: 2; }

/* --- WAVE DIVIDERS --- */
.wave-divider { line-height: 0; overflow: hidden; }
.wave-divider svg { display: block; width: 100%; }

.wave-divider--hero {
    position: absolute;
    bottom: -1px; /* -1px elimina el gap subpixel entre secciones */
    left: 0;
    width: 100%;
    z-index: 1;
}
.wave-divider--hero svg { height: clamp(50px, 6vw, 80px); }

.wave-divider--footer { width: 100%; }
.wave-divider--footer svg { height: 40px; }

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* --- HORIZONTAL SCROLL & PANELS --- */
/* --- REGLA BASE PARA MATAR EL SCROLLBAR --- */
/* overflow-x:hidden solo en body — ponerlo en html también rompe el cálculo de dvh en WebKit */
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* --- HORIZONTAL SCROLL & PANELS --- */
.horizontal-wrapper { 
    background: var(--accent-cream); 
    color: var(--bg-dark); 
    width: 100vw;      /* Forzamos el ancho a la ventana completa */
    max-width: 100%;   /* Evita que se desborde */
    overflow: hidden; 
}

.horizontal-container { 
    display: flex; 
    width: max-content; 
    height: 100dvh; 
}

.panel {
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8vw;
    flex: 0 0 100vw;
    box-sizing: border-box;
    contain: layout style;
    position: relative; /* necesario para ::before patterns */
}

/* El contenido del panel debe flotar sobre el patrón de fondo */
.panel-content {
    position: relative;
    z-index: 1;
}

.panel:nth-child(even) { background: var(--bg-dark); color: var(--accent-cream); }
.panel:last-child { background: var(--bg-darker); color: var(--accent-cream); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; max-width: 1200px; width: 100%; }
.split.reverse .text-block { order: 2; }
.split.reverse .mockup-block { order: 1; }

.text-block h2 { font-size: clamp(2.5rem, 4vw, 4rem); margin-bottom: 1.5rem; }
.highlight { color: var(--accent-orange); }
.text-block p { font-size: 1.2rem; line-height: 1.7; font-weight: 500; margin-bottom: 2rem; opacity: 0.9; }

.feature-tags { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.feature-tags span {
    padding: 7px 15px; border: 1px solid currentColor; border-radius: 30px;
    font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    transition: background-color 0.25s ease, color 0.25s ease;
}
/* Ojo: currentColor en el hover se resuelve con el `color` NUEVO, por eso
   los colores van explícitos (si no, fondo y texto quedaban iguales). */
.feature-tags span {
    border-color: var(--tag-color, currentColor);
}
.feature-tags span:hover {
    background-color: var(--tag-hover-bg, var(--bg-dark));
    color: var(--tag-hover-text, var(--accent-cream));
}
/* Paneles claros (impares): pastilla teal con texto crema */
.panel:nth-child(even) .feature-tags span:hover,
.panel:last-child .feature-tags span:hover {
    background-color: var(--accent-cream);
    color: var(--bg-dark);
}

/* --- MOCKUP iPHONE STYLE --- */
.mockup-block { display: flex; justify-content: center; position: relative; }

/* Fondo tribal maorí cubriendo todo el panel donde aparece el celular.
   La imagen fuente es vertical; en desktop (paneles horizontales) usamos una
   versión pre-rotada 90° para que "cover" no tenga que hacer zoom extremo.
   En mobile (panel angosto y alto) se usa la imagen original vertical. */
.panel:has(.mockup-block)::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--pattern-navy);
    -webkit-mask: url('images/fondomaorifinal-mask-h.png') center / cover no-repeat;
    mask: url('images/fondomaorifinal-mask-h.png') center / cover no-repeat;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

/* Sobre paneles oscuros el patrón pasa a crema para mantener contraste */
.panel:nth-child(even):has(.mockup-block)::before,
.panel:last-child:has(.mockup-block)::before {
    background-color: var(--pattern-cream);
}

.phone-mockup {
    /* Escala con el alto del viewport para que no se corte en pantallas bajas */
    /* Ancho calculado para que el interior (sin el borde de 14px) tenga la
       proporción exacta de las capturas (736x1600) y encuadren sin recortes */
    --phone-h: clamp(400px, 88dvh, 900px);
    height: var(--phone-h);
    width: calc((var(--phone-h) - 28px) * 0.46 + 28px);
    border: 14px solid #111; border-radius: 45px; box-sizing: border-box;
    background-color: #222; overflow: hidden; position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3), inset 0 0 10px rgba(255,255,255,0.1);
    will-change: transform;
}
.phone-mockup::before {
    /* Dynamic Island: píldora flotante separada del borde superior */
    content: ''; position: absolute; top: 1.4%; left: 50%; transform: translateX(-50%);
    width: 31%; aspect-ratio: 125 / 37; /* proporción de la isla de un iPhone real */ background: #000;
    border-radius: 999px; z-index: 10;
}
.app-screen { width: 100%; height: 100%; object-fit: cover; object-position: top center; z-index: 1; }

.float-anim { animation: floating 6s ease-in-out infinite; }
.float-anim-alt { animation: floating 6s ease-in-out infinite alternate-reverse; }

/* =====================================================================
   PHONE MOCKUP CAROUSEL — CSS crossfade entre múltiples pantallas
   El primer .app-screen define el layout (position: static).
   Los siguientes se posicionan absolute encima y animan su opacidad.
   ===================================================================== */
.phone-mockup .app-screen:nth-child(n+2) {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}

/* 2 imágenes — ciclo 8s */
.carousel-2 .app-screen:nth-child(1) { animation: cr2a 8s ease-in-out infinite; }
.carousel-2 .app-screen:nth-child(2) { animation: cr2b 8s ease-in-out infinite; }
@keyframes cr2a { 0%,42%{opacity:1} 50%,92%{opacity:0} 100%{opacity:1} }
@keyframes cr2b { 0%,42%{opacity:0} 50%,92%{opacity:1} 100%{opacity:0} }

/* 3 imágenes — ciclo 9s */
.carousel-3 .app-screen:nth-child(1) { animation: cr3a 9s ease-in-out infinite; }
.carousel-3 .app-screen:nth-child(2) { animation: cr3b 9s ease-in-out infinite; }
.carousel-3 .app-screen:nth-child(3) { animation: cr3c 9s ease-in-out infinite; }
@keyframes cr3a { 0%,28%{opacity:1} 33%,94%{opacity:0} 100%{opacity:1} }
@keyframes cr3b { 0%,33%{opacity:0} 39%,61%{opacity:1} 66%,100%{opacity:0} }
@keyframes cr3c { 0%,66%{opacity:0} 72%,94%{opacity:1} 100%{opacity:0} }

/* 4 imágenes — ciclo 12s */
.carousel-4 .app-screen:nth-child(1) { animation: cr4a 12s ease-in-out infinite; }
.carousel-4 .app-screen:nth-child(2) { animation: cr4b 12s ease-in-out infinite; }
.carousel-4 .app-screen:nth-child(3) { animation: cr4c 12s ease-in-out infinite; }
.carousel-4 .app-screen:nth-child(4) { animation: cr4d 12s ease-in-out infinite; }
@keyframes cr4a { 0%,21%{opacity:1} 25%,96%{opacity:0} 100%{opacity:1} }
@keyframes cr4b { 0%,25%{opacity:0} 29%,46%{opacity:1} 50%,100%{opacity:0} }
@keyframes cr4c { 0%,50%{opacity:0} 54%,71%{opacity:1} 75%,100%{opacity:0} }
@keyframes cr4d { 0%,75%{opacity:0} 79%,96%{opacity:1} 100%{opacity:0} }

/* 5 imágenes — ciclo 15s */
.carousel-5 .app-screen:nth-child(1) { animation: cr5a 15s ease-in-out infinite; }
.carousel-5 .app-screen:nth-child(2) { animation: cr5b 15s ease-in-out infinite; }
.carousel-5 .app-screen:nth-child(3) { animation: cr5c 15s ease-in-out infinite; }
.carousel-5 .app-screen:nth-child(4) { animation: cr5d 15s ease-in-out infinite; }
.carousel-5 .app-screen:nth-child(5) { animation: cr5e 15s ease-in-out infinite; }
@keyframes cr5a { 0%,17%{opacity:1} 20%,97%{opacity:0} 100%{opacity:1} }
@keyframes cr5b { 0%,20%{opacity:0} 23%,37%{opacity:1} 40%,100%{opacity:0} }
@keyframes cr5c { 0%,40%{opacity:0} 43%,57%{opacity:1} 60%,100%{opacity:0} }
@keyframes cr5d { 0%,60%{opacity:0} 63%,77%{opacity:1} 80%,100%{opacity:0} }
@keyframes cr5e { 0%,80%{opacity:0} 83%,97%{opacity:1} 100%{opacity:0} }

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* --- FORMULARIO WAITLIST (CTA) --- */
.text-center { text-align: center; max-width: 700px; margin: 0 auto; }
.waitlist-form {
    display: flex; gap: 10px; margin-top: 3rem; justify-content: center;
    flex-wrap: wrap;
}
.waitlist-input {
    padding: 1.2rem 1.5rem; border-radius: 50px; border: 2px solid transparent;
    outline: none; font-family: 'Syne', sans-serif; font-size: 1rem;
    width: 100%; max-width: 350px; background: rgba(255,255,255,0.1); color: #fff;
    transition: border-color 0.3s;
}
.waitlist-input::placeholder { color: rgba(255,255,255,0.5); }
.waitlist-input:focus { border-color: var(--accent-orange); background: rgba(255,255,255,0.15); }

.btn-primary {
    padding: 1.2rem 2.5rem; background-color: var(--accent-orange); color: var(--bg-dark);
    text-decoration: none; font-weight: 800; font-family: 'Syne', sans-serif; font-size: 1rem; text-transform: uppercase; letter-spacing: 2px;
    border-radius: 8px; transition: transform 0.3s, background-color 0.3s; border: none; cursor: pointer;
}
.btn-primary:hover { background-color: #B83B35; transform: translateY(-4px); box-shadow: 0 12px 28px rgba(214, 69, 63, 0.4); }

/* --- FOOTER --- */
.site-footer { background-color: var(--bg-dark); padding: 4rem 4rem 2rem; text-align: center; }
.footer-tagline {
    font-family: 'TitleFont', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--accent-cream);
    opacity: 0.55;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
}
.footer-links { margin: 0 0 2rem; display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;}
.footer-links a { color: var(--accent-cream); text-decoration: none; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; transition: color 0.3s; letter-spacing: 1px;}
.footer-links a:hover { color: var(--accent-orange); }
.footer-bottom { padding-top: 1.5rem; font-size: 0.8rem; color: rgba(230, 210, 176, 0.45); }


/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {

    /* Ocultar canvases pesados en mobile — JS también los saltea */
    #canvas3d,
    #wind-canvas {
        display: none;
    }

    /* --- Horizontal scroll: desactivado en mobile --- */
    .horizontal-wrapper {
        display: block !important;
        height: auto !important;
        overflow: hidden;
    }

    .horizontal-container {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        height: auto !important;
        transform: none !important;
    }

    /* --- Panels: bloques que respiran --- */
    .panel {
        width: 100%;
        height: auto;
        min-height: 100dvh;
        padding: calc(clamp(4.5rem, 12vw, 6rem) + env(safe-area-inset-top)) clamp(1.25rem, 6vw, 2rem) calc(clamp(3rem, 8vw, 4.5rem) + env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* --- Grid: pasa a flujo vertical centrado --- */
    .split {
        display: flex;
        flex-direction: column;
        gap: clamp(2rem, 6vw, 3rem);
        text-align: center;
    }

    .split .text-block { order: 1; }
    .split .mockup-block { order: 2; }

    /* --- Hero --- */
    .hero-content h1 {
        font-size: clamp(3rem, 14vw, 5rem);
        line-height: 0.95;
    }

    .pre-title {
        letter-spacing: 3px;
    }

    .scroll-indicator {
        font-size: 0.65rem;
        letter-spacing: 3px;
        bottom: 72px;
    }

    /* --- Tipografías de panel con clamp() --- */
    .text-block h2,
    .text-center h2 {
        font-size: clamp(2rem, 8.5vw, 3rem);
        line-height: 1.05;
        margin-bottom: clamp(0.75rem, 3vw, 1.25rem);
    }

    .text-block p,
    .text-center > p {
        font-size: clamp(0.9rem, 3.8vw, 1.1rem);
        line-height: 1.68;
        margin-bottom: clamp(1.25rem, 4vw, 1.75rem);
    }

    .feature-tags {
        justify-content: center;
        gap: 0.5rem;
    }

    .feature-tags span {
        font-size: 0.68rem;
        padding: 6px 13px;
    }

    /* --- Mockup iPhone: proporcional y profundo --- */
    .mockup-block {
        width: 100%;
        display: flex;
        justify-content: center;
        padding-bottom: 0.25rem;
    }

    .panel:has(.mockup-block)::before {
        -webkit-mask-image: url('images/fondomaorifinal-mask.png');
        mask-image: url('images/fondomaorifinal-mask.png');
        opacity: 0.07;
    }

    .phone-mockup {
        width: clamp(145px, 38vw, 190px);
        height: clamp(300px, 80vw, 400px);
        border-width: 10px;
        border-radius: 34px;
        animation: none !important;
        box-shadow:
            0 22px 55px rgba(0, 0, 0, 0.45),
            inset 0 0 8px rgba(255, 255, 255, 0.07);
    }

    /* Normaliza el orden en mobile: siempre texto primero, mockup abajo */
    .split.reverse .text-block { order: 1; }
    .split.reverse .mockup-block { order: 2; }

    .phone-mockup::before {
        top: 1.4%;
        width: 31%;
        height: auto;
    }

    /* --- CTA Panel --- */
    .panel-cta {
        padding-top: clamp(4rem, 10vw, 6rem);
        padding-bottom: clamp(4rem, 10vw, 6rem);
    }

    .panel-cta .text-center {
        width: 100%;
        padding: 0 0.25rem;
    }

    /* --- Waitlist Form --- */
    .waitlist-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.75rem;
        margin-top: 1.75rem !important;
    }

    .waitlist-input {
        max-width: 100%;
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    .btn-primary,
    .btn-submit {
        width: 100%;
        text-align: center;
        padding: 1rem 2rem;
    }

    /* --- Header --- */
    header, .menu-header {
        padding: 1.25rem 1.5rem;
    }

    .logo {
        font-size: 1.7rem;
    }
    .logo img {
        height: 76px;
    }
}


/* --- LOGO BADGE (CTA Panel) --- */
.logo-badge {
    width: clamp(180px, 22vw, 240px);
    height: clamp(180px, 22vw, 240px);
    border-radius: 30%;
    object-fit: cover;
    object-position: center center;
    background-color: var(--bg-darker);
    padding: 0;
    border: 3px solid var(--accent-orange);
    box-shadow: none;
    display: block;
    margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(245, 135, 50, 0.15), 0 18px 45px rgba(0,0,0,0.5); }
    50%       { box-shadow: 0 0 0 12px rgba(245, 135, 50, 0.08), 0 22px 50px rgba(0,0,0,0.6); }
}

@media (max-width: 768px) {
    .logo-badge {
        width: clamp(140px, 36vw, 180px);
        height: clamp(140px, 36vw, 180px);
        margin-bottom: 1.5rem;
    }
}

/* --- APP STORES BUTTONS --- */
.app-stores {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.store-btn {
    background-color: #000;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s, border-color 0.3s;
    min-width: 180px;
}

.store-btn:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: var(--accent-orange);
    box-shadow: 0 14px 32px rgba(245, 135, 50, 0.22);
}

.store-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.store-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.1;
}

.store-text small {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.7;
    font-weight: 800;
}

.store-text span {
    font-size: 1.1rem;
    font-weight: 700;
}

.waitlist-hint {
    font-family: 'TitleFont', serif;
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.6;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ajuste para que el formulario no pegue tanto arriba */
.waitlist-form {
    margin-top: 1.5rem !important;
}

@media (max-width: 768px) {
    .app-stores {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .store-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* --- VIDEO INTRO (Panel 1, después del hero) ---
   Fondo crema (default), para que el wave-divider del hero siga integrado
   con el panel de abajo tal como pasaba antes de agregar este panel. */
.panel-video .pre-title {
    color: var(--bg-dark);
    opacity: 0.55;
}

.video-showcase {
    position: relative;
    width: 100%;
    max-width: 820px;
    margin: clamp(2rem, 5vw, 3rem) auto 0;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    background-color: #fff;
    border: 3px solid var(--accent-orange);
    box-shadow:
        0 0 0 6px rgba(214, 69, 63, 0.15),
        0 25px 60px rgba(0, 0, 0, 0.5);
}

.video-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(4, 50, 57, 0.28);
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.video-showcase.playing::before { opacity: 0; }

.intro-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #fff;
}

.intro-video::backdrop {
    background-color: #fff;
}

.intro-video:fullscreen,
.intro-video:-webkit-full-screen {
    object-fit: contain;
    background-color: #fff;
}

.video-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: clamp(60px, 9vw, 90px);
    height: clamp(60px, 9vw, 90px);
    border-radius: 50%;
    border: none;
    background-color: rgba(230, 210, 176, 0.95);
    color: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}

.video-play-btn svg {
    width: 38%;
    height: 38%;
    margin-left: 4%; /* centra ópticamente el triángulo de "play" */
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.08);
    background-color: var(--accent-cream);
}

.video-showcase.playing .video-play-btn {
    opacity: 0;
    pointer-events: none;
}



/* --- PRELOADER ---
   Dos mitades teal tapan la pantalla mientras carga el video del hero (así no se ve
   negro). Cuando está listo, main.js las abre desde el medio con GSAP: la de arriba
   sube y la de abajo baja. Si main.js no llega a correr, plFailsafe la oculta a los
   9 s para que la página nunca quede trabada. */
html.pl-lock,
html.pl-lock body { overflow: hidden; }

.preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: plFailsafe 0.6s 9s ease forwards;
}

.pl-half {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50.5%; /* se pisan un poco para que no aparezca una raya en el medio */
    will-change: transform;
}
/* El degradé es más claro hacia el centro: al abrirse parece que entra luz */
.pl-half--top {
    top: 0;
    background: radial-gradient(130% 120% at 50% 100%, #0b6470 0%, var(--brand-teal) 45%, var(--bg-darker) 100%);
}
.pl-half--bottom {
    bottom: 0;
    background: radial-gradient(130% 120% at 50% 0%, #0b6470 0%, var(--brand-teal) 45%, var(--bg-darker) 100%);
}

.pl-seam {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    margin-top: -1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-cream) 30%, #fff 50%, var(--accent-cream) 70%, transparent 100%);
    box-shadow: 0 0 18px 2px rgba(230, 210, 176, 0.55);
    transform: scaleX(0);
    opacity: 0;
    z-index: 1;
}

.pl-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1.5rem;
}

.pl-emblem-wrap {
    width: clamp(96px, 26vw, 150px);
    aspect-ratio: 1;
    opacity: 0;
    animation: plLogoIn 0.9s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}
/* La rosa de los vientos oscila como una brújula buscando el norte */
.pl-emblem {
    display: block;
    width: 100%;
    height: 100%;
    animation: plCompass 3.4s 1s ease-in-out infinite;
}

.pl-wordmark {
    display: block;
    width: clamp(150px, 40vw, 230px);
    height: auto;
    margin-top: clamp(0.8rem, 2.5vw, 1.2rem);
    opacity: 0;
    animation: plRise 0.8s 0.4s ease both;
}

.pl-progress {
    position: relative;
    width: clamp(140px, 36vw, 200px);
    height: 3px;
    margin-top: 1.6rem;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(230, 210, 176, 0.16);
    opacity: 0;
    animation: plFadeIn 0.6s 0.7s ease both;
}
.pl-progress span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: var(--accent-orange);
    animation: plSweep 1.3s ease-in-out infinite;
}
/* main.js agrega .is-ready cuando todo cargó: la barra se completa antes de abrir */
.preloader.is-ready .pl-progress span {
    animation: none;
    transform: none;
    width: 100%;
    transition: width 0.35s ease-out;
}

.pl-tagline {
    font-family: 'TitleFont', serif;
    font-style: italic;
    color: var(--accent-cream);
    font-size: clamp(0.9rem, 2.6vw, 1.05rem);
    margin-top: 0.9rem;
    letter-spacing: 0.04em;
    opacity: 0;
    animation: plFadeIn 0.8s 0.9s ease both;
}

@keyframes plLogoIn {
    from { opacity: 0; transform: scale(0.8) translateY(14px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes plRise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes plFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes plCompass {
    0%, 100% { transform: rotate(-9deg); }
    50%      { transform: rotate(9deg); }
}
@keyframes plSweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(250%); }
}
@keyframes plFailsafe {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pl-emblem,
    .pl-progress span { animation: none; }
}

/* --- OCULTAR MARCA DE AGUA SPLINE --- */
a[href*="spline.design"],
div[class*="logo"][style*="position"],
#spline-watermark {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- CANVASES & 3D --- */
#canvas3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 90;
    pointer-events: none;
}

#wind-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 80;
    pointer-events: none;
    opacity: 0.4;
}

/* --- OCULTAR SCROLLBAR --- */

/* Para Chrome, Safari y Opera */
::-webkit-scrollbar {
    display: none;
}

/* Para Firefox, IE y Edge */
body {
    -ms-overflow-style: none;  /* IE y Edge */
    scrollbar-width: none;  /* Firefox */
}


/* El contenedor padre que aplica la física líquida */
.liquid-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url('#gooey'); /* AQUÍ se aplica el ID del SVG */
    z-index: -1;
}

/* Estilo base de las gotas */
.drop {
    position: absolute;
    top: 2rem;
    right: 4rem; /* Nacen desde el botón de MENÚ */
    background-color: var(--bg-dark);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- MENÚ OVERLAY (VINTAGE PREMIUM EQUILIBRADO) --- */

/* 1. Fondo del Agua */
.drop-1 { width: 100px; height: 100px; transition-delay: 0s; background-color: rgba(5, 72, 82, 0.98); }
.drop-2 { width: 150px; height: 150px; transition-delay: 0.1s; background-color: var(--brand-teal); }
.drop-3 { width: 120px; height: 120px; transition-delay: 0.2s; background-color: var(--brand-red); opacity: 0.5; }

/* 2. Cabecera */
.menu-header {
    position: absolute; top: 0; left: 0; width: 100%;
    padding: 2rem 4rem; display: flex; justify-content: space-between; align-items: center;
    z-index: 210;
}
.menu-header .menu-close { 
    color: var(--accent-cream); font-family: 'Syne', sans-serif; 
    font-weight: 700; letter-spacing: 2px; font-size: 0.8rem; transition: color 0.3s; 
    cursor: pointer;
}
.menu-header .menu-close:hover { color: var(--brand-red); }

/* 3. Contenedor Central (Acomodado para que no se corte abajo) */
.menu-content-wrapper {
    display: flex; flex-direction: column; justify-content: space-between; align-items: center;
    width: 100%; height: 100dvh; 
    padding: 6rem 4rem 2rem; /* Achicamos los márgenes para que todo entre perfecto */
    box-sizing: border-box;
    max-width: 1200px; margin: 0 auto;
}

/* 4. Links Principales: Tipografía de títulos más chica y centrada */
.menu-links {
    display: flex; flex-direction: column; text-align: center; gap: 0.8rem;
    margin-top: auto; margin-bottom: auto; /* Centra el bloque verticalmente */
}

.menu-links a {
    color: var(--accent-cream);
    text-decoration: none;
    font-family: 'TitleFont', serif;
    font-size: clamp(2rem, 4vw, 3.5rem); /* Tamaños medidos y proporcionales */
    font-style: italic;
    font-weight: 900;
    line-height: 1.1;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

/* Hover "Vintage": Rotación y sombra serigráfica */
.menu-links a:hover {
    color: var(--brand-red);
    transform: scale(1.05) rotate(-2deg);
    text-shadow: -3px 3px 0px rgba(126, 200, 232, 0.6);
    z-index: 10;
}

/* 5. Footer del Menú (Redes y Legales bien ubicados abajo) */
.menu-info {
    display: flex; flex-direction: row; justify-content: space-between; align-items: center;
    width: 100%; border-top: 1px solid rgba(244, 236, 216, 0.15);
    padding-top: 1.5rem;
}

.social-links, .legal-links { display: flex; gap: 1.5rem; flex-direction: row; }
.menu-subtitle { display: none; } /* Mantenemos limpio sin el título "Conectemos" */

.social-links a, .legal-links a {
    color: rgba(244, 236, 216, 0.6); font-family: 'Syne', sans-serif;
    font-weight: 600; font-size: 0.8rem; text-decoration: none; 
    text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s;
}

.social-links a:hover, .legal-links a:hover { color: var(--accent-cream); }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .menu-header { padding: 1.5rem 2rem; }
    .menu-content-wrapper { padding: 6rem 2rem 2rem; }
    .menu-links { gap: 1rem; }
    .menu-links a { font-size: 2.2rem; }
    .menu-info { flex-direction: column; align-items: center; gap: 1.5rem; border-top: none; }
    .social-links, .legal-links { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 1rem; }
}

/* Patrones decorativos — pendiente rediseño */

/* =====================================================================
   GUARDIANES DECORATIVOS (::after)
   Elementos adicionales por encima de los patrones maoríes (::before).
   Todos con pointer-events: none y z-index: 0 (debajo de .panel-content).
   ===================================================================== */

/* Ola flotante — #clima (bottom-left, navy) */
#clima::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: clamp(80px, 12vmin, 130px);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 80' preserveAspectRatio='none'%3E%3Cpath fill='none' stroke='%23054852' stroke-width='3' stroke-linecap='round' d='M0,60 C50,20 100,70 150,40 C200,10 250,58 300,30'/%3E%3Cpath fill='none' stroke='%23054852' stroke-width='2' stroke-linecap='round' opacity='0.5' d='M0,72 C60,48 110,76 170,55 C220,36 265,66 300,48'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

/* Hibisco tribal — #marketplace, detrás del texto (cream) */
#marketplace::after {
    content: '';
    position: absolute;
    right: 4%;
    top: 50%;
    width: clamp(180px, 26vmin, 300px);
    height: clamp(180px, 26vmin, 300px);
    /* centrado vertical sin transform para máx compatibilidad con contain:layout */
    margin-top: calc(-1 * clamp(90px, 13vmin, 150px));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg transform='translate(60,60)'%3E%3Cpath fill='none' stroke='%23E6D2B0' stroke-width='2' d='M0,-42 C-10,-28 -10,-14 0,0 C10,-14 10,-28 0,-42 Z' transform='rotate(0)'/%3E%3Cpath fill='none' stroke='%23E6D2B0' stroke-width='2' d='M0,-42 C-10,-28 -10,-14 0,0 C10,-14 10,-28 0,-42 Z' transform='rotate(72)'/%3E%3Cpath fill='none' stroke='%23E6D2B0' stroke-width='2' d='M0,-42 C-10,-28 -10,-14 0,0 C10,-14 10,-28 0,-42 Z' transform='rotate(144)'/%3E%3Cpath fill='none' stroke='%23E6D2B0' stroke-width='2' d='M0,-42 C-10,-28 -10,-14 0,0 C10,-14 10,-28 0,-42 Z' transform='rotate(216)'/%3E%3Cpath fill='none' stroke='%23E6D2B0' stroke-width='2' d='M0,-42 C-10,-28 -10,-14 0,0 C10,-14 10,-28 0,-42 Z' transform='rotate(288)'/%3E%3Ccircle r='10' fill='none' stroke='%23E6D2B0' stroke-width='2.5'/%3E%3Cline x1='0' y1='-10' x2='0' y2='-28' stroke='%23E6D2B0' stroke-width='2' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

/* Sol tribal grande — #stats (centrado de fondo, navy) */
#stats::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Ccircle r='38' fill='none' stroke='%23054852' stroke-width='3.5'/%3E%3Ccircle r='24' fill='none' stroke='%23054852' stroke-width='2.5'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-72' stroke='%23054852' stroke-width='4' stroke-linecap='round'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-59' stroke='%23054852' stroke-width='2.5' stroke-linecap='round' transform='rotate(45)'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-72' stroke='%23054852' stroke-width='4' stroke-linecap='round' transform='rotate(90)'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-59' stroke='%23054852' stroke-width='2.5' stroke-linecap='round' transform='rotate(135)'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-72' stroke='%23054852' stroke-width='4' stroke-linecap='round' transform='rotate(180)'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-59' stroke='%23054852' stroke-width='2.5' stroke-linecap='round' transform='rotate(225)'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-72' stroke='%23054852' stroke-width='4' stroke-linecap='round' transform='rotate(270)'/%3E%3Cline x1='0' y1='-44' x2='0' y2='-59' stroke='%23054852' stroke-width='2.5' stroke-linecap='round' transform='rotate(315)'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: clamp(260px, 42vmin, 480px);
    background-position: center center;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

/* --- SOL ICON (inline, sección Clima) --- */
.sol-icon {
    display: block;
    margin-bottom: 0.8rem;
}
.sol-icon svg {
    width: 28px;
    height: 28px;
}

/* --- TRIBE ICONS (separador CTA) --- */
.tribe-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    margin: 1.5rem 0 0.75rem;
    opacity: 0.5;
}
/* Líneas decorativas a los lados */
.tribe-icons::before,
.tribe-icons::after {
    content: '';
    flex: 1;
    max-width: 70px;
    height: 1px;
    background: rgba(230, 210, 176, 0.35);
}
.tribe-icon {
    width: clamp(18px, 2.2vw, 26px);
    height: clamp(18px, 2.2vw, 26px);
    color: var(--accent-cream);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .sol-icon { display: flex; justify-content: center; }
    .tribe-icons { gap: 0.85rem; }
    .tribe-icons::before, .tribe-icons::after { max-width: 40px; }
    .tribe-icon { width: 20px; height: 20px; }
}


/* =====================================================================
   PANEL TEMAS ("Hacela Tuya")
   JS setea --t-bg / --t-surface / --t-accent y data-mode en #temas;
   todo el panel se re-colorea con el tema elegido.
   ===================================================================== */
#temas {
    --t-bg: #0C1627;
    --t-surface: #112345;
    --t-accent: #FF6A2B;
    --t-text: #F3EEE6;
    background-color: var(--t-bg);
    color: var(--t-text);
    transition: background-color 0.6s ease, color 0.6s ease;
}
#temas[data-mode="light"] { --t-text: #1C1F26; }

#temas .highlight { color: var(--t-accent); transition: color 0.6s ease; }
/* Más aire para la grilla de temas, el celular ocupa menos columna */
#temas .split { grid-template-columns: 1.25fr 0.75fr; gap: 3rem; }
#temas .text-block h2 { margin-bottom: 1.5rem; }

#temas.panel:has(.mockup-block)::before {
    background-color: var(--t-text);
    opacity: 0.05;
    transition: background-color 0.6s ease;
}

.theme-picker { display: flex; flex-direction: column; gap: 1.1rem; }

.theme-filter {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--t-text) 22%, transparent);
}
.theme-filter button {
    font-family: 'Syne', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: inherit;
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}
.theme-filter button:hover { opacity: 1; }
.theme-filter button.active {
    background-color: var(--t-text);
    color: var(--t-bg);
    opacity: 1;
}

.theme-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

/* Tema original de la app: ocupa dos celdas y lleva etiqueta */
.theme-chip--main { grid-column: span 2; }
.theme-tag {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    background-color: var(--chip-accent);
    color: #fff;
}

.theme-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 7px 10px;
    border-radius: 12px;
    font-family: 'Syne', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: inherit;
    text-align: left;
    background-color: color-mix(in srgb, var(--t-text) 5%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--t-text) 14%, transparent);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.3s ease, background-color 0.3s ease;
}
.theme-chip[hidden] { display: none; }
.theme-chip:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--t-text) 35%, transparent); }
.theme-chip.active {
    border-color: var(--t-accent);
    background-color: color-mix(in srgb, var(--t-accent) 16%, transparent);
    font-weight: 800;
}
.theme-chip:focus-visible,
.theme-filter button:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; }

.theme-swatch {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chip-bg) 50%, var(--chip-surface) 50%);
    box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.4);
}
.theme-swatch::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background-color: var(--chip-accent);
}

.theme-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.theme-phone { background-color: var(--t-bg); transition: background-color 0.6s ease; }
.theme-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.theme-screen.active { opacity: 1; }

@media (max-width: 768px) {
    /* min-width:0 evita que la fila de chips (nowrap) ensanche toda la columna */
    #temas .text-block,
    .theme-picker { min-width: 0; width: 100%; }
    #temas .split { gap: clamp(1.5rem, 5vw, 2.5rem); }
    .theme-filter { align-self: center; }

    /* Fila horizontal deslizable para que el celular quede a la vista mientras se elige */
    .theme-list {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        margin: 0 calc(-1 * clamp(1.25rem, 6vw, 2rem));
        padding: 4px clamp(1.25rem, 6vw, 2rem) 6px;
        scrollbar-width: none;
    }
    .theme-chip { flex: 0 0 auto; scroll-snap-align: start; }
}

/* --- SECUENCIA EN MOCKUP (capturas + video, controlada por main.js) --- */
.phone-sequence .app-screen {
    opacity: 0;
    transition: opacity 0.6s ease;
}
.phone-sequence .app-screen.active { opacity: 1; }
.phone-sequence video.app-screen { display: block; background-color: #0C1627; }

/* =====================================================================
   APPLE WATCH MOCKUP (Panel "Tu Reloj")
   --watch-w es el ancho de la pantalla; el video está recortado a 400x490.
   ===================================================================== */
.watch-combo { align-items: center; }
.watch-combo .phone-mockup {
    --phone-h: clamp(400px, 68dvh, 720px);
    flex-shrink: 0;
}

.watch-mockup {
    --watch-w: clamp(150px, 14vw, 210px);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    /* separado del celular, sin superponerse */
    margin-left: clamp(0.75rem, 2.5vw, 2rem);
    filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}

.watch-band {
    width: 62%;
    height: calc(var(--watch-w) * 0.42);
    margin: 0 auto;
    background: linear-gradient(90deg, #a8332e, #D6453F 50%, #a8332e);
}
.watch-band--top    { border-radius: 14px 14px 4px 4px; margin-bottom: -6px; }
.watch-band--bottom { border-radius: 4px 4px 14px 14px; margin-top: -6px; }

.watch-case {
    position: relative;
    z-index: 1;
    padding: calc(var(--watch-w) * 0.07);
    background: linear-gradient(145deg, #4a4e55, #1c1d20 55%, #2c2e33);
    border-radius: 26% / 22%;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.watch-screen {
    width: var(--watch-w);
    aspect-ratio: 400 / 490;
    border-radius: 20% / 16%;
    overflow: hidden;
    background: #000;
    border: calc(var(--watch-w) * 0.035) solid #000;
}
.watch-screen video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.watch-crown {
    position: absolute;
    right: calc(var(--watch-w) * -0.045);
    top: 24%;
    width: calc(var(--watch-w) * 0.06);
    height: 15%;
    border-radius: 4px;
    background: linear-gradient(90deg, #2a2b2f, #6a6e75 60%, #3a3c41);
}
.watch-button {
    position: absolute;
    right: calc(var(--watch-w) * -0.025);
    top: 50%;
    width: calc(var(--watch-w) * 0.035);
    height: 20%;
    border-radius: 3px;
    background: #2f3135;
}

@media (max-width: 768px) {
    .watch-mockup {
        --watch-w: clamp(105px, 30vw, 150px);
        animation: none;
    }
}

/* =====================================================================
   AJUSTES MOBILE GENERALES (≤768px)
   Va al final para ganarle a las reglas mobile anteriores.
   ===================================================================== */
@media (max-width: 768px) {

    /* --- Header: barra compacta con fondo al scrollear --- */
    header {
        padding: calc(0.6rem + env(safe-area-inset-top)) 1.25rem 0.6rem;
        transition: background-color 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
    }
    header .logo img { height: 80px; transition: height 0.35s ease; }
    /* Sin backdrop-filter: el blur se recalculaba en cada frame al aparecer la barra
       scrolleando para arriba y trababa el scroll en celulares */
    header.scrolled {
        background-color: rgba(5, 72, 82, 0.97);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    }
    header.scrolled .logo img { height: 58px; }
    .menu-header .logo img { height: 80px; }

    /* --- Panels: espacio arriba para la barra fija.
       flex:auto anula el `flex: 0 0 100vw` de escritorio, que en columna fijaba el alto
       y hacía que el contenido largo se desbordara sobre el panel siguiente --- */
    .panel {
        flex: 0 0 auto;
        padding-top: calc(5.5rem + env(safe-area-inset-top));
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
    }

    /* --- Celulares más grandes: el mockup es el protagonista en mobile --- */
    /* Alto explícito a partir del ancho (pantalla 0.46 + bordes de 9px): sin aspect-ratio,
       así el marco nunca se estira ni invade el panel siguiente */
    .mockup-block { align-items: center; }
    .phone-mockup {
        --pw: clamp(190px, 58vw, 250px);
        width: var(--pw);
        height: calc((var(--pw) - 18px) / 0.46 + 18px);
        flex-shrink: 0;
        border-width: 9px;
        border-radius: 34px;
    }
    /* Con alto por aspect-ratio, todas las pantallas van absolutas para no estirar el marco */
    .phone-mockup .app-screen { position: absolute; inset: 0; }

    /* Panel del reloj: celular y reloj lado a lado sin superponerse */
    .watch-combo .phone-mockup { --pw: clamp(150px, 44vw, 210px); }
    .watch-mockup {
        --watch-w: clamp(105px, 29vw, 150px);
        margin-left: clamp(0.6rem, 3vw, 1.25rem);
    }

    /* --- Texto un poco más cómodo de leer --- */
    .text-block p,
    .text-center > p {
        font-size: clamp(0.95rem, 4vw, 1.05rem);
        line-height: 1.6;
    }

    /* --- Botones de tiendas: sin cortes de línea --- */
    .store-btn {
        max-width: 260px;
        padding: 0.75rem 1.25rem;
    }
    .store-text small,
    .store-text span { white-space: nowrap; }
    .store-text span { font-size: 1rem; }

    /* --- Footer compacto --- */
    .site-footer { padding: 2.5rem 1.5rem 1.5rem; }
    .footer-links { gap: 0.9rem 1.5rem; margin-bottom: 1rem; }
    .footer-links a { font-size: 0.72rem; }
    .footer-bottom { padding-top: 0.75rem; font-size: 0.72rem; }

    /* --- Menú: los links escalan con el alto para que entre todo en celulares chicos --- */
    .menu-content-wrapper { padding: calc(5rem + env(safe-area-inset-top)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); }
    .menu-links { gap: 0.5rem; }
    .menu-links a { font-size: clamp(1.4rem, min(7.5vw, 4.4dvh), 2.2rem); }
    .menu-info { gap: 0.9rem; padding-top: 1rem; }
}

/* --- HEADER que se esconde al bajar y aparece al subir (clase puesta por main.js) --- */
header {
    transition: transform 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}
/* Sube su alto completo + margen y sin sombra: si no, la sombra asomaba como una franja arriba */
header.header-hidden,
header.scrolled.header-hidden {
    transform: translateY(calc(-100% - 40px));
    box-shadow: none;
    /* Safari (iOS) tiñe la zona de la hora con el color de la barra fija de arriba:
       al esconderse queda transparente e invisible para que no deje la franja azul */
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    visibility: hidden;
    transition: transform 0.35s ease, background-color 0.2s ease, visibility 0s linear 0.35s;
}
