/* =========================================================
   Variables y escalado
   ========================================================= */
:root {
    /* Tamaño base de cada cara (ajusta SOLO este ancho) */
    --face-width: 300px;

    /* Relación 4:5 (alto = 1.25 * ancho) */
    --face-height: calc(var(--face-width) * 1.25);

    /* Apotema ≈ (W/2)/tan(30°) = 0.866 * W */
    --apothem: calc(var(--face-width) * 0.866);

    /* Overlay (tinte PNG encima del fondo de cada cara) */
    --overlay-scale: 0.62;
    /* 0.50 = 50% del ancho de la cara; 0.70 = 70% */
    --overlay-offset-y: 0%;
    /* -6% sube, 6% baja */

    /* Fuente/estilo del hint */
    --brand-font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    --hint-color: rgba(0, 0, 0, 0.68);
}

/* =========================================================
     Reset suave / Layout general
     ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* anclado arriba */
    min-height: 100vh;

    padding: clamp(16px, 4vh, 48px) 4vw 0;
    gap: clamp(12px, 2.5vh, 24px);
    /* background: #f6f7f9;  opcional */
}

/* =========================================================
     Logo
     ========================================================= */
.logo-container {
    width: clamp(160px, 20vw, 280px);
    margin-bottom: clamp(10px, 2vh, 20px);
}

.logo-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
     Texto guía (helper)
     ========================================================= */
.helper-hint {
    display: block;
    /* evita saltos raros en iOS */
    font-family: var(--brand-font, sans-serif);
    font-weight: 700;
    text-transform: uppercase;

    letter-spacing: .06em;
    /* tracking moderado y estable */
    line-height: 1.15;
    color: var(--hint-color);
    text-align: center;

    max-width: min(700px, 92vw);
    margin: clamp(6px, 1.5vh, 10px) auto clamp(8px, 2vh, 16px);
    padding: 0 .5rem;

    word-break: normal;
    white-space: normal;
    hyphens: manual;
    -webkit-hyphens: manual;

    /* mejora saltos de línea en navegadores modernos */
    text-wrap: balance;
}

.helper-hint strong {
    font: inherit;
}

.helper-hint .action-word::before {
    content: "Haz clic";
}

@media (hover: none) and (pointer: coarse) {
    .helper-hint .action-word::before {
        content: "Toca";
    }
}

@keyframes hint-breathe {

    0%,
    100% {
        transform: translateY(0);
        opacity: .95;
    }

    50% {
        transform: translateY(-1px);
        opacity: 1;
    }
}

.helper-hint {
    animation: hint-breathe 3.2s ease-in-out infinite;
}

/* =========================================================
     Escena y carrusel
     ========================================================= */
.scene {
    width: var(--face-width);
    height: var(--face-height);
    perspective: 1500px;
    /* resalta el efecto 3D */
    margin-top: clamp(6px, 2vh, 16px);
    cursor: pointer;

    position: relative;
    isolation: isolate;
    /* stacking predecible */
    touch-action: manipulation;
    /* sin pinch propio; taps cómodos */
    user-select: none;
}

.hex-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    /* queda debajo de cualquier control */
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

/* =========================================================
     Caras del hexágono
     ========================================================= */
.carousel-face {
    position: absolute;
    width: var(--face-width);
    height: var(--face-height);

    /* Fondo base */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    backface-visibility: hidden;

    /* Preparar 2 capas: [arriba overlay], [abajo foto] */
    background-repeat: no-repeat, no-repeat;
}

/* --- Fondos y overlay (overlay.png usado en todas las caras) --- */
.face-1 {
    background-image: url('overlay.png'), url('imagen1.jpg');
    background-size: calc(var(--overlay-scale) * 100%) auto, cover;
    background-position: center calc(50% + var(--overlay-offset-y)), center;
}

.face-2 {
    background-image: url('overlay.png'), url('imagen2.jpg');
    background-size: calc(var(--overlay-scale) * 100%) auto, cover;
    background-position: center calc(50% + var(--overlay-offset-y)), center;
}

.face-3 {
    background-image: url('overlay.png'), url('imagen3.jpg');
    background-size: calc(var(--overlay-scale) * 100%) auto, cover;
    background-position: center calc(50% + var(--overlay-offset-y)), center;
}

.face-4 {
    background-image: url('overlay.png'), url('imagen4.jpg');
    background-size: calc(var(--overlay-scale) * 100%) auto, cover;
    background-position: center calc(50% + var(--overlay-offset-y)), center;
}

.face-5 {
    background-image: url('overlay.png'), url('imagen5.jpg');
    background-size: calc(var(--overlay-scale) * 100%) auto, cover;
    background-position: center calc(50% + var(--overlay-offset-y)), center;
}

.face-6 {
    background-image: url('overlay.png'), url('imagen6.jpg');
    background-size: calc(var(--overlay-scale) * 100%) auto, cover;
    background-position: center calc(50% + var(--overlay-offset-y)), center;
}

/* --- Posicionamiento 3D (360/6 = 60°) --- */
.face-1 {
    transform: rotateY(0deg) translateZ(var(--apothem));
}

.face-2 {
    transform: rotateY(60deg) translateZ(var(--apothem));
}

.face-3 {
    transform: rotateY(120deg) translateZ(var(--apothem));
}

.face-4 {
    transform: rotateY(180deg) translateZ(var(--apothem));
}

.face-5 {
    transform: rotateY(240deg) translateZ(var(--apothem));
}

.face-6 {
    transform: rotateY(300deg) translateZ(var(--apothem));
}

/* =========================================================
     Decoración / Flechas
     ========================================================= */
.shadow {
    width: calc(var(--face-width) * 1.1);
    height: 40px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    margin-top: 50px;
}

.navigation-arrows {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.navigation-arrows button {
    border: none;
    padding: 10px 14px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.navigation-arrows button:active {
    transform: translateY(1px);
}

/* =========================================================
     Responsivo: cambia SOLO el ancho; lo demás se recalcula
     ========================================================= */
@media (max-width: 768px) {
    :root {
        --face-width: 240px;
    }

    /* alto => 300px; apotema ≈ 208px */
}

@media (max-width: 480px) {
    :root {
        --face-width: 180px;
    }

    /* alto => 225px; apotema ≈ 156px */
}

/* ==== Fallback (solo si iOS/Safari se pone terco con 3D) ====
  .scene { transform-style: preserve-3d; }
  */