/**
 * MINKA PACHA - Memoria Sonora
 * Sistema de diseño basado en cosmovisión andina
 *
 * Tabla de contenidos:
 * 1. Reset y Base
 * 2. Variables CSS (Design Tokens)
 * 3. Tipografía
 * 4. Layout y Containers
 * 5. Hero Section y Espiral
 * 6. Navegación de Pachas
 * 7. Secciones de Contenido (Pachas)
 * 8. Audio Player
 * 9. Componentes UI
 * 10. Footer
 * 11. Animaciones
 * 12. Responsive Design
 * 13. Accesibilidad
 */

/* ========================================
   1. RESET Y BASE
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0A0A0A;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Fondo con gradiente sutil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, #1A0F0A 0%, #0A0A0A 50%, #000000 100%);
    z-index: -1;
    pointer-events: none;
}

/* ========================================
   2. VARIABLES CSS (DESIGN TOKENS)
   ======================================== */

:root {
    /* Colores de marca */
    --color-terracota: #C17855;
    --color-dorado: #D4A047;
    --color-verde-salvia: #8B9D7E;
    --color-cafe-tierra: #5C4033;

    /* Colores de pachas */
    --color-uyariy: #A44C5E;
    --color-taki: #FFD700;
    --color-rimay: #00F5B8;
    --color-nayra: #FF8C42;

    /* Backgrounds */
    --bg-principal: #0A0A0A;
    --bg-secundario: #1A0F0A;
    --bg-tarjeta: rgba(92, 64, 51, 0.3);

    /* Neutrales */
    --color-blanco: #FFFFFF;
    --color-texto-primario: rgba(255, 255, 255, 0.85);
    --color-texto-secundario: rgba(255, 255, 255, 0.7);
    --color-texto-terciario: rgba(255, 255, 255, 0.6);
    --color-borde: rgba(255, 255, 255, 0.1);

    /* Espaciado (múltiplos de 8px) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 60px;
    --space-xxl: 80px;

    /* Tipografía */
    --font-size-h1: 56px;
    --font-size-h2: 40px;
    --font-size-h3: 24px;
    --font-size-body: 16px;
    --font-size-caption: 14px;

    --line-height-h1: 72px;
    --line-height-h2: 48px;
    --line-height-body: 1.6;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow-terracota: 0 8px 32px rgba(193, 120, 85, 0.4);

    /* Transiciones */
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

    /* Contenedor */
    --container-max-width: 1200px;
    --container-padding: 60px;
}

/* ========================================
   3. TIPOGRAFÍA
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-blanco);
}

h1 {
    font-size: var(--font-size-h1);
    line-height: var(--line-height-h1);
    font-weight: 400;
    letter-spacing: 2px;
}

h2 {
    font-size: var(--font-size-h2);
    line-height: var(--line-height-h2);
    font-weight: 600;
    letter-spacing: 1px;
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: 600;
}

p {
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}

strong {
    color: var(--color-dorado);
    font-weight: 600;
}

/* ========================================
   4. LAYOUT Y CONTAINERS
   ======================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

section {
    padding: var(--space-xxl) 0;
    position: relative;
}

/* ========================================
   5. HERO SECTION Y ESPIRAL
   ======================================== */

.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: var(--space-xxl) 0;
}

.hero-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    animation: fadeInDown 1s ease-out;
}

.main-title {
    color: var(--color-dorado);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    text-shadow: 0 4px 16px rgba(212, 160, 71, 0.3);
    animation: glowPulse 3s ease-in-out infinite;
}

.main-subtitle {
    font-size: 20px;
    color: var(--color-texto-secundario);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Contenedor del espiral - ROTA constantemente */
.espiral-container {
    width: 700px;
    height: 700px;
    position: relative;
    margin: var(--space-xxl) auto;
    animation: fadeIn 1.5s ease-out 0.3s both, rotate-smooth 40s linear infinite;
    will-change: transform;
}

/* Fondo con efecto radial detrás del espiral */
.espiral-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(42, 31, 26, 0.6) 0%, rgba(26, 15, 10, 0.3) 60%, transparent 100%);
    border-radius: 50%;
    box-shadow:
        0 30px 80px rgba(193, 120, 85, 0.3),
        0 15px 40px rgba(0, 0, 0, 0.6),
        inset 0 -20px 40px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* SVG del espiral - posición absoluta dentro del contenedor */
.espiral-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 0 20px rgba(193, 120, 85, 0.6));
}

/* Path del espiral con efecto de dibujo inicial */
.espiral-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawSpiral 2.5s ease-out 0.5s forwards;
}

/* Texto instructivo ESTÁTICO (fuera del contenedor giratorio) */
.espiral-instruction-static {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--color-texto-terciario);
    font-size: var(--font-size-caption);
    font-weight: 300;
    letter-spacing: 1px;
    animation: pulse 2s ease-in-out infinite;
    /* NO tiene animación de rotación */
}

/* ========================================
   6. BOTONES DE NAVEGACIÓN EN EL ESPIRAL
   ======================================== */

/* Botones posicionados en el espiral - COUNTER-ROTAN */
.pacha-button {
    position: absolute;
    width: 100px;
    height: 100px;
    cursor: pointer;
    z-index: 10;
    outline: none;
    background: transparent;
    border: none;
    padding: 0;
    transform-origin: center center;
    /* Counter-rotación para mantener botones derechos */
    animation: counter-rotate 40s linear infinite;
    will-change: transform;
}

/* Inner container que mantiene el diseño visual */
.pacha-button-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2.5px solid var(--pacha-color);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Hover effects - mantiene estética actual */
.pacha-button:hover .pacha-button-inner,
.pacha-button:focus .pacha-button-inner {
    transform: scale(1.15);
    background: var(--pacha-color-alpha);
    box-shadow: 0 10px 40px var(--pacha-color-shadow);
    border-width: 3px;
}

.pacha-button:active .pacha-button-inner {
    transform: scale(1.05);
}

/* Colores específicos de cada pacha - MANTENER NEONES */
.pacha-uyariy {
    --pacha-color: var(--color-uyariy);
    --pacha-color-alpha: rgba(217, 70, 217, 0.15);
    --pacha-color-shadow: rgba(217, 70, 217, 0.6);
}

.pacha-taki {
    --pacha-color: var(--color-taki);
    --pacha-color-alpha: rgba(233, 30, 140, 0.15);
    --pacha-color-shadow: rgba(233, 30, 140, 0.6);
}

.pacha-rimay {
    --pacha-color: var(--color-rimay);
    --pacha-color-alpha: rgba(59, 157, 217, 0.15);
    --pacha-color-shadow: rgba(59, 157, 217, 0.6);
}

.pacha-nayra {
    --pacha-color: var(--color-nayra);
    --pacha-color-alpha: rgba(139, 69, 217, 0.15);
    --pacha-color-shadow: rgba(139, 69, 217, 0.6);
}

/* Íconos con colores vibrantes */
.pacha-icon {
    color: var(--pacha-color);
    transition: transform var(--transition-base);
    filter: drop-shadow(0 0 8px var(--pacha-color-shadow));
}

.pacha-button:hover .pacha-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px var(--pacha-color));
}

/* Labels de botones */
.pacha-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-blanco);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ========================================
   7. SECCIONES DE CONTENIDO (PACHAS)
   ======================================== */

.pacha-content {
    min-height: 100vh;
    padding: var(--space-xxl) 0;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.pacha-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Botón volver al espiral */
.back-to-spiral {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 12px 24px;
    background: var(--bg-tarjeta);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    color: var(--color-blanco);
    font-size: var(--font-size-caption);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-bottom: var(--space-lg);
}

.back-to-spiral:hover,
.back-to-spiral:focus {
    background: rgba(193, 120, 85, 0.2);
    border-color: var(--color-terracota);
    transform: translateX(-4px);
}

.back-to-spiral svg {
    width: 20px;
    height: 20px;
    color: var(--color-terracota);
}

/* Header de pacha */
.pacha-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-borde);
}

.pacha-title {
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--color-dorado) 0%, var(--color-terracota) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pacha-subtitle {
    font-size: 20px;
    color: var(--color-texto-secundario);
    font-weight: 300;
    font-style: italic;
}

/* Cuerpo de pacha */
.pacha-body {
    max-width: 800px;
}

.pacha-description {
    margin-bottom: var(--space-xl);
    font-size: 18px;
    line-height: 1.8;
}

.pacha-description p {
    margin-bottom: var(--space-md);
}

/* Sección de audio */
.audio-section {
    margin-top: var(--space-xl);
}

.section-heading {
    margin-bottom: var(--space-lg);
    color: var(--color-terracota);
}

/* ========================================
   8. AUDIO PLAYER
   ======================================== */

.audio-player {
    background: var(--bg-tarjeta);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: var(--space-lg) 0;
    transition: all var(--transition-base);
}

.audio-player:hover {
    border-color: rgba(193, 120, 85, 0.4);
    box-shadow: var(--shadow-glow-terracota);
}

/* Ocultar el elemento audio nativo */
.audio-player audio {
    display: none;
}

/* Botón play/pause */
.play-pause-btn {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-terracota) 0%, var(--color-dorado) 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    box-shadow: 0 4px 16px rgba(193, 120, 85, 0.4);
}

.play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(193, 120, 85, 0.6);
}

.play-pause-btn:active {
    transform: scale(0.95);
}

.play-pause-btn svg {
    color: var(--color-blanco);
    transition: opacity 0.2s ease;
}

.play-pause-btn .hidden {
    display: none;
}

/* Información del audio */
.audio-info {
    flex-shrink: 0;
    min-width: 200px;
}

.narrator-name {
    font-weight: 600;
    color: var(--color-blanco);
    font-size: 16px;
    margin-bottom: 4px;
}

.audio-meta {
    font-size: var(--font-size-caption);
    color: var(--color-texto-terciario);
}

/* Barra de progreso */
.progress-bar-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-terracota) 0%, var(--color-dorado) 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
    box-shadow: 0 0 8px rgba(193, 120, 85, 0.6);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-texto-terciario);
    font-variant-numeric: tabular-nums;
}

/* Control de volumen */
.volume-control {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.mute-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--color-texto-secundario);
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-blanco);
}

.mute-btn .hidden {
    display: none;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--color-dorado);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(212, 160, 71, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--color-dorado);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(212, 160, 71, 0.4);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* ========================================
   9. COMPONENTES UI
   ======================================== */

/* Transcripción collapsible */
.transcript {
    margin-top: var(--space-lg);
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.transcript summary {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--color-dorado);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-base);
    user-select: none;
}

.transcript summary::-webkit-details-marker {
    display: none;
}

.transcript summary::after {
    content: '+';
    font-size: 24px;
    font-weight: 300;
    transition: transform var(--transition-base);
}

.transcript[open] summary::after {
    transform: rotate(45deg);
}

.transcript summary:hover {
    background: rgba(193, 120, 85, 0.1);
}

.transcript-content {
    padding: var(--space-md);
    border-top: 1px solid var(--color-borde);
    animation: slideDown 0.3s ease-out;
}

.transcript-content p {
    color: var(--color-texto-secundario);
    font-size: 15px;
    line-height: 1.7;
}

.transcript-content em {
    color: var(--color-texto-terciario);
    font-style: italic;
}

/* ========================================
   10. FOOTER
   ======================================== */

.site-footer {
    padding: var(--space-xl) 0 var(--space-lg);
    border-top: 1px solid var(--color-borde);
    margin-top: var(--space-xxl);
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: var(--color-texto-secundario);
    font-size: var(--font-size-caption);
    margin-bottom: var(--space-xs);
}

.footer-credits {
    color: var(--color-texto-terciario);
    font-size: 12px;
    margin-top: var(--space-sm);
}

/* ========================================
   11. ANIMACIONES
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de rotación suave del contenedor */
@keyframes rotate-smooth {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Counter-rotación para botones (dirección opuesta) */
@keyframes counter-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

/* Efecto de dibujo del espiral al cargar */
@keyframes drawSpiral {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 4px 16px rgba(212, 160, 71, 0.3);
    }
    50% {
        text-shadow: 0 4px 32px rgba(212, 160, 71, 0.6);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   12. RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 1023px) */
@media screen and (max-width: 1023px) {
    :root {
        --container-padding: 40px;
        --space-xxl: 60px;
        --font-size-h1: 48px;
        --font-size-h2: 32px;
        --line-height-h1: 60px;
        --line-height-h2: 40px;
    }

    .espiral-container {
        width: 560px;
        height: 560px;
    }

    .pacha-nav-point {
        width: 90px;
        height: 90px;
    }
}

/* Mobile (375px - 767px) */
@media screen and (max-width: 767px) {
    :root {
        --container-padding: 24px;
        --space-lg: 32px;
        --space-xl: 48px;
        --space-xxl: 40px;
        --font-size-h1: 36px;
        --font-size-h2: 28px;
        --font-size-h3: 20px;
        --line-height-h1: 44px;
        --line-height-h2: 36px;
    }

    .main-subtitle {
        font-size: 16px;
    }

    /* Espiral más pequeño y rotación MÁS LENTA para mobile */
    .espiral-container {
        width: 370px;
        height: 370px;
        margin: var(--space-lg) auto;
        animation: fadeIn 1.5s ease-out 0.3s both, rotate-smooth 60s linear infinite;
    }

    /* Botones más grandes para táctil */
    .pacha-button {
        width: 85px;
        height: 85px;
        animation: counter-rotate 60s linear infinite;
    }

    .pacha-label {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .pacha-icon {
        width: 24px;
        height: 24px;
    }

    /* Audio player vertical */
    .audio-player {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: var(--space-sm);
    }

    .audio-info {
        min-width: auto;
        text-align: center;
    }

    .play-pause-btn {
        align-self: center;
    }

    .volume-control {
        justify-content: center;
    }

    /* Descripción de pacha */
    .pacha-description {
        font-size: 16px;
    }

    /* Botón volver */
    .back-to-spiral {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile pequeño (< 375px) */
@media screen and (max-width: 374px) {
    .espiral-container {
        width: 320px;
        height: 320px;
    }

    .pacha-nav-point {
        width: 70px;
        height: 70px;
    }

    .pacha-icon {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   13. ACCESIBILIDAD
   ======================================== */

/* Modo de movimiento reducido - ACCESIBILIDAD */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Detener rotación del espiral */
    .espiral-container {
        animation: fadeIn 1.5s ease-out 0.3s both !important;
    }

    /* Detener counter-rotación de botones */
    .pacha-button {
        animation: none !important;
    }

    /* Mostrar path del espiral sin animación */
    .espiral-path {
        stroke-dasharray: none !important;
        stroke-dashoffset: 0 !important;
        animation: none !important;
    }

    /* Posicionar botones estáticamente en versión reducida */
    .pacha-button {
        position: relative !important;
        display: inline-block !important;
        margin: 20px !important;
    }

    .espiral-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }
}

/* Estados de foco para teclado */
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-dorado);
    outline-offset: 4px;
}

/* Asegurar contraste en textos */
::selection {
    background-color: var(--color-terracota);
    color: var(--color-blanco);
}

/* Skip to content link (para navegación por teclado) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-dorado);
    color: var(--bg-principal);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Mejorar área de clic en mobile */
@media (hover: none) and (pointer: coarse) {
    button,
    a,
    summary {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Estados de carga para audio */
.audio-player.loading {
    opacity: 0.6;
    pointer-events: none;
}

.audio-player.error {
    border-color: rgba(255, 0, 0, 0.3);
}

/* Indicador de reproducción activa */
.audio-player.playing .play-pause-btn {
    box-shadow: 0 6px 24px rgba(193, 120, 85, 0.8), 0 0 0 4px rgba(193, 120, 85, 0.2);
}

/* Smooth scroll para navegación */
html {
    scroll-padding-top: 80px;
}

/* ========================================
   BOTÓN DE CONTROL DE AUDIO DE FONDO
   ======================================== */

/* Botón de control de audio - discreto pero elegante */
.audio-control-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(193, 120, 85, 0.2);
    border: 2px solid #D4A047;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.audio-control-btn:hover {
    transform: scale(1.1);
    background: rgba(193, 120, 85, 0.3);
    box-shadow: 0 8px 24px rgba(212, 160, 71, 0.4);
}

/* Estado playing - animación de ondas pulsantes */
.audio-control-btn.playing::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #D4A047;
    border-radius: 50%;
    animation: audio-pulse 2s ease-out infinite;
}

@keyframes audio-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Iconos SVG del botón */
.audio-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #D4A047;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.audio-icon path[fill="currentColor"] {
    fill: #D4A047;
    stroke: none;
}

/* ========================================
   SECCIÓN DE BIENVENIDA
   ======================================== */

.welcome-section {
    max-width: 900px;
    margin: 40px auto 60px;
    padding: 0 40px;
}

.welcome-content p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    text-align: justify;
}

.welcome-content strong {
    color: #D4A047;
    font-weight: 600;
}

/* ========================================
   SECCIONES DE PACHAS (CONTENIDO OFICIAL)
   ======================================== */

.pacha-section {
    max-width: 1000px;
    margin: 80px auto;
    padding: 0 40px;
}

.pacha-header {
    text-align: center;
    margin-bottom: 40px;
}

.pacha-header .pacha-title {
    font-size: 48px;
    font-weight: 600;
    color: #D4A047;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.pacha-header .pacha-subtitle {
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

.pacha-intro p,
.pacha-description p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    text-align: justify;
}

/* Subsecciones de Nayra Pacha */
.nayra-subsections {
    margin-top: 40px;
}

.subsection {
    margin-bottom: 40px;
    padding: 24px;
    background: rgba(26, 15, 10, 0.4);
    border-left: 3px solid #C17855;
    border-radius: 4px;
}

.subsection-title {
    font-size: 22px;
    font-weight: 600;
    color: #D4A047;
    margin-bottom: 16px;
}

.subsection p {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    text-align: justify;
}

/* Audio section placeholder */
.audio-section {
    margin-top: 60px;
    padding: 40px;
    background: rgba(193, 120, 85, 0.1);
    border: 2px dashed rgba(212, 160, 71, 0.3);
    border-radius: 8px;
    text-align: center;
}

.audio-note {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* ========================================
   FOOTER LEGAL
   ======================================== */

.legal-footer {
    background: rgba(26, 15, 10, 0.8);
    padding: 60px 40px;
    margin-top: 100px;
    border-top: 1px solid rgba(212, 160, 71, 0.3);
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
}

.legal-content h4 {
    font-size: 24px;
    font-weight: 600;
    color: #D4A047;
    margin-bottom: 24px;
    text-align: center;
}

.legal-content p {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    text-align: justify;
}

.legal-warning {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    background: rgba(193, 120, 85, 0.1);
    padding: 16px;
    border-radius: 4px;
    border-left: 3px solid #C17855;
}

.legal-content strong {
    color: #FFFFFF;
}

/* ========================================
   RESPONSIVE PARA NUEVO CONTENIDO
   ======================================== */

@media (max-width: 767px) {
    /* Botón de audio */
    .audio-control-btn {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }

    .audio-icon {
        width: 20px;
        height: 20px;
    }

    /* Welcome section */
    .welcome-section {
        padding: 0 24px;
    }

    .welcome-content p {
        font-size: 15px;
        text-align: left;
    }

    /* Secciones de pachas */
    .pacha-section {
        padding: 0 24px;
        margin: 60px auto;
    }

    .pacha-header .pacha-title {
        font-size: 36px;
    }

    .pacha-header .pacha-subtitle {
        font-size: 18px;
    }

    .pacha-intro p,
    .pacha-description p,
    .subsection p {
        text-align: left;
    }

    .subsection {
        padding: 20px;
    }

    /* Footer legal */
    .legal-footer {
        padding: 40px 24px;
    }

    .legal-content p {
        text-align: left;
    }
}

/* ===================================
   INTRO CINEMATOGRÁFICO - VERSIÓN SIMPLIFICADA Y SEGURA
   =================================== */

.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1s ease-out;
    overflow: hidden;
}

.intro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Fondo con estrellas animadas */
.stars-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(2px 2px at 15% 95%, white, transparent),
        radial-gradient(1px 1px at 70% 40%, white, transparent),
        radial-gradient(2px 2px at 45% 15%, white, transparent),
        radial-gradient(1px 1px at 95% 85%, white, transparent);
    background-size: 200% 200%, 180% 180%, 220% 220%, 190% 190%, 210% 210%,
                     200% 200%, 180% 180%, 220% 220%, 190% 190%, 210% 210%;
    background-position: 0% 0%, 100% 100%, 50% 50%, 20% 80%, 80% 20%,
                         40% 60%, 60% 40%, 30% 70%, 70% 30%, 50% 50%;
    animation: twinkle 8s ease-in-out infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        background-position: 0% 0%, 100% 100%, 50% 50%, 20% 80%, 80% 20%,
                             40% 60%, 60% 40%, 30% 70%, 70% 30%, 50% 50%;
    }
    50% {
        opacity: 0.5;
        background-position: 100% 100%, 0% 0%, 60% 60%, 30% 70%, 70% 30%,
                             50% 50%, 50% 50%, 40% 60%, 60% 40%, 60% 60%;
    }
}

/* Contenedor principal - SIN OVERFLOW */
.intro-content {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Display de texto - Con margen de seguridad */
.text-display {
    max-width: 85vw;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

/* Prevenir scroll en body cuando intro está activo */
body.intro-active {
    overflow: hidden;
}

/* ===================================
   PANTALLA INICIAL CON BOTÓN PLAY
   =================================== */

.intro-start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.intro-start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 90vw;
}

.start-title {
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(2rem, 10vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    animation: glow-title 3s ease-in-out infinite;
    text-align: center;
    line-height: 1.2;
    word-break: keep-all;
}

@keyframes glow-title {
    0%, 100% {
        text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    }
    50% {
        text-shadow: 0 0 60px rgba(255, 255, 255, 0.5);
    }
}

.start-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(1rem, 4vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    text-align: center;
    line-height: 1.4;
    padding: 0 1rem;
}

.play-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin: 1rem 0;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.4);
}

.play-button:active {
    transform: scale(1.05);
}

.play-icon {
    width: 48px;
    height: 48px;
    color: #ffffff;
    margin-left: 6px;
}

.start-hint {
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    animation: pulse-hint 2s ease-in-out infinite;
}

@keyframes pulse-hint {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ===================================
   TEXTO Y CONTENIDO
   =================================== */

/* Fragmento de texto base */
.text-fragment {
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(1.8rem, 4.5vw, 3.5rem);
    line-height: 1.5;
    color: #ffffff;
    white-space: pre-line;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;

    /* Limitar máximo de líneas por seguridad */
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-fragment.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Variantes de tamaño */
.text-fragment.size-xlarge {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.text-fragment.size-large {
    font-size: clamp(2rem, 5.5vw, 4rem);
    font-weight: 400;
}

/* Variantes de tipo */
.text-fragment.type-title {
    letter-spacing: 0.1em;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}

.text-fragment.type-subtitle {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    opacity: 0.85;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.text-fragment.type-emphasis {
    color: #F59E0B;
    text-shadow:
        0 0 20px rgba(245, 158, 11, 0.8),
        0 0 40px rgba(245, 158, 11, 0.4);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(245, 158, 11, 0.8),
            0 0 40px rgba(245, 158, 11, 0.4);
    }
    50% {
        text-shadow:
            0 0 30px rgba(245, 158, 11, 1),
            0 0 60px rgba(245, 158, 11, 0.6);
    }
}

/* ===================================
   CONTROLES
   =================================== */

/* Botón Skip Intro */
.skip-button {
    position: fixed;
    top: 30px;
    right: 30px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.skip-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    color: rgba(255, 255, 255, 1);
}

/* Control de Audio */
.audio-control {
    position: fixed;
    top: 30px;
    right: 140px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.audio-control:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.audio-control .audio-icon {
    display: block;
    transition: opacity 0.2s;
}

.audio-control .audio-icon.hidden {
    display: none;
}

/* Barra de Progreso */
.progress-bar-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    z-index: 10001;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #F59E0B);
    width: 0%;
    transition: width 0.4s ease-out;
}

/* ===================================
   MOMENTOS VISUALES
   =================================== */

/* Animación del Espiral */
.spiral-animation {
    animation: rotate 4s linear infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spiral-animation svg {
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.6));
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Grid de Pachas */
.pachas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.pacha-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.pacha-item.visible {
    opacity: 1;
    transform: scale(1);
}

.pacha-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.pacha-circle:hover {
    transform: scale(1.1);
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

.pacha-name {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.05em;
    text-align: center;
    margin: 0;
}

.pacha-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin: 0;
}

/* Botón Final "INICIAR VIAJE" */
.final-button {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 20px 50px;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Open Sans', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.final-button.visible {
    opacity: 1;
    transform: scale(1);
}

.final-button:hover {
    background: white;
    color: black;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.final-button:active {
    transform: scale(1);
}

/* ===================================
   RESPONSIVE (MOBILE)
   =================================== */

@media (max-width: 768px) {
    .text-fragment {
        font-size: clamp(1.3rem, 5vw, 2.5rem) !important;
        -webkit-line-clamp: 6;
    }

    .text-display {
        max-width: 90vw;
        max-height: 70vh;
        padding: 15px;
    }

    .pachas-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 100%;
    }

    .progress-bar-container {
        width: 200px;
        bottom: 30px;
    }

    .skip-button {
        top: 20px;
        right: 20px;
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .audio-control {
        top: 20px;
        right: 110px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .final-button {
        padding: 16px 40px;
        font-size: 1.1rem;
    }

    .spiral-animation svg {
        width: 150px;
        height: 150px;
    }

    /* Pantalla inicial mobile */
    .start-content {
        gap: 1rem;
        padding: 1.5rem;
    }

    .start-title {
        font-size: clamp(1.8rem, 12vw, 3.5rem);
        letter-spacing: 0.05em;
    }

    .start-subtitle {
        font-size: clamp(0.9rem, 4.5vw, 1.5rem);
    }

    .play-button {
        width: 90px;
        height: 90px;
        margin: 0.5rem 0;
    }

    .play-icon {
        width: 36px;
        height: 36px;
    }

    .start-hint {
        font-size: clamp(0.8rem, 3.5vw, 1rem);
    }
}

/* Ajustes específicos para iPhone y dispositivos muy pequeños */
@media (max-width: 480px) {
    .intro-start-screen {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }

    .start-content {
        gap: 0.8rem;
        max-width: 95vw;
    }

    .start-title {
        font-size: clamp(1.5rem, 13vw, 2.8rem);
        letter-spacing: 0.04em;
    }

    .start-subtitle {
        font-size: clamp(0.85rem, 4.5vw, 1.3rem);
        max-width: 85vw;
    }

    .play-button {
        width: 80px;
        height: 80px;
        border-width: 2px;
    }

    .play-icon {
        width: 32px;
        height: 32px;
        margin-left: 4px;
    }

    .start-hint {
        font-size: 0.85rem;
    }
}

/* ===================================
   ACCESSIBILITY: REDUCED MOTION
   =================================== */

@media (prefers-reduced-motion: reduce) {
    .stars-background,
    .spiral-animation,
    .glow-pulse,
    .pulse-glow {
        animation: none !important;
    }

    .text-fragment,
    .pacha-item,
    .final-button {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}


/* ========================================
   OCULTAR SECCIONES DE CONTENIDO DEL INDEX
   Solo mostrar espiral + footer legal
   ======================================== */

/* Ocultar todas las secciones de pacha con contenido descriptivo */
#nayra-pacha,
#uyariy-pacha,
#taki-pacha,
#rimay-pacha {
    display: none !important;
}

/* Asegurar que el hero section con el espiral sea visible y ocupe viewport */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer legal siempre visible */
.legal-footer {
    display: block !important;
}

