/* ==========================================================================
   FUENTES AUTO-HOSPEDADAS (SELF-HOSTED FONTS FOR GLOBAL/CHINA RELIABILITY)
   ========================================================================== */
@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/inter-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/inter-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/inter-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/inter-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/outfit-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/outfit-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/outfit-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/outfit-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('assets/fonts/playfair-display-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('assets/fonts/playfair-display-italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('assets/fonts/playfair-display-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* ==========================================
   SISTEMA DE DISEÑO Y CONFIGURACIÓN GENERAL
   ========================================== */
:root {
    /* Paleta de colores HSL Premium */
    --bg-dark: hsl(230, 45%, 7%);
    --bg-dark-glow: hsl(240, 35%, 12%);
    --text-primary: hsl(210, 25%, 92%);
    --text-secondary: hsl(215, 15%, 72%);
    
    --accent-red: hsl(350, 95%, 58%);
    --accent-red-glow: hsla(350, 95%, 58%, 0.4);
    --accent-gold: hsl(43, 90%, 65%);
    --accent-gold-glow: hsla(43, 90%, 65%, 0.3);
    
    --glass-bg: rgba(13, 17, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    /* Tipografías */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-romantic: 'Playfair Display', serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 30%, var(--bg-dark-glow) 0%, var(--bg-dark) 70%);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background 3s ease;
}

body.time-noche {
    background-color: hsl(230, 45%, 7%);
    background-image: radial-gradient(circle at 50% 30%, hsl(240, 35%, 12%) 0%, hsl(230, 45%, 7%) 70%);
}

body.time-amanecer {
    background-color: hsl(250, 40%, 14%);
    background-image: radial-gradient(circle at 50% 20%, hsl(20, 70%, 35%) 0%, hsl(250, 45%, 16%) 45%, hsl(230, 45%, 9%) 100%);
}

body.time-dia {
    background-color: hsl(210, 45%, 20%);
    background-image: radial-gradient(circle at 50% 15%, hsl(205, 55%, 38%) 0%, hsl(220, 45%, 18%) 55%, hsl(230, 45%, 10%) 100%);
}

body.time-atardecer {
    background-color: hsl(260, 40%, 12%);
    background-image: radial-gradient(circle at 50% 25%, hsl(350, 65%, 32%) 0%, hsl(280, 40%, 18%) 45%, hsl(230, 45%, 8%) 100%);
}

/* Canvas del fondo estrellado */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    transition: opacity 3s ease;
}

body.time-dia #starfield {
    opacity: 0.25;
}
body.time-amanecer #starfield,
body.time-atardecer #starfield {
    opacity: 0.55;
}

/* ==========================================
   ESTILOS DE CONTENEDORES GLASSMORPHISM
   ========================================== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-glow);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 75, 110, 0.25);
    box-shadow: 0 12px 40px 0 rgba(255, 75, 110, 0.15);
}

.glass-button {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.glass-button:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 0 15px var(--accent-red-glow);
    transform: translateY(-2px);
}

/* ==========================================
   CONTROLES FLOTANTES SUPERIORES (IDIOMA Y MÚSICA)
   ========================================== */
#floating-header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; /* Dejamos pasar clics en el fondo */
}

#language-switcher {
    pointer-events: auto; /* Reactivamos clics para los paneles */
}

#language-switcher {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 30px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 8px var(--accent-red-glow);
    transform: scale(1.05);
}



/* ==========================================
   1. SECCIÓN HERO
   ========================================== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.badge {
    background: rgba(255, 75, 110, 0.12);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(255, 75, 110, 0.2);
}

.romantic-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 30%, var(--accent-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 40px auto;
}

/* Imagen Hero */
.hero-image-wrapper {
    position: relative;
    max-width: 550px;
    margin: 0 auto 40px auto;
    border-radius: 24px;
    padding: 6px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255, 75, 110, 0.4));
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.hero-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-image-wrapper:hover .hero-img {
    transform: scale(1.02);
}

.hero-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    box-shadow: inset 0 0 20px rgba(255, 75, 110, 0.3), 0 0 30px rgba(255, 75, 110, 0.15);
    pointer-events: none;
}

/* Indicador de Scroll */
.scroll-indicator {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator p {
    font-size: 0.9rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.scroll-indicator i {
    font-size: 1.2rem;
    color: var(--accent-red);
    filter: drop-shadow(0 0 5px var(--accent-red));
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* ==========================================
   SECCIONES COMUNES
   ========================================== */
section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.section-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 12px;
    font-weight: 700;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 60px auto;
    font-size: 1.05rem;
}

/* ==========================================
   2. SECCIÓN RELOJES Y CONTADOR
   ========================================== */
.clocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.clock-card {
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.clock-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sun-icon i {
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px var(--accent-gold-glow));
    animation: pulseGlowGold 3s infinite ease-in-out;
}

.moon-icon i {
    color: hsl(200, 80%, 75%);
    filter: drop-shadow(0 0 10px rgba(100, 200, 255, 0.3));
    animation: pulseGlowBlue 3s infinite ease-in-out;
}

@keyframes pulseGlowGold {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--accent-gold-glow)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 18px var(--accent-gold)); }
}

@keyframes pulseGlowBlue {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(100, 200, 255, 0.2)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(100, 200, 255, 0.5)); }
}

.clock-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.time-display {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.date-display {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.location-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.06);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Estilos del Contador */
.counter-container {
    padding: 40px 30px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.counter-container h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.counter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.counter-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 20px 10px;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.counter-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 75, 110, 0.2);
}

.counter-number {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-red-glow);
    line-height: 1;
    margin-bottom: 5px;
}

.counter-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.counter-footer {
    font-family: var(--font-romantic);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--accent-gold);
}

/* ==========================================
   3. SECCIÓN LÍNEA DE TIEMPO
   ========================================== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px 0;
}

/* El Hilo Rojo de fondo */
.timeline-thread-bg {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 75, 110, 0.08);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-thread-progress {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent-red), hsl(350, 100%, 70%));
    box-shadow: 0 0 12px var(--accent-red), 0 0 20px var(--accent-red-glow);
    transform: translateX(-50%);
    border-radius: 2px;
    height: 0; /* JS la controlará con scroll */
    transition: height 0.1s linear;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

/* El punto de conexión (Nodo) */
.timeline-dot {
    position: absolute;
    right: -16px;
    top: 30px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--accent-red);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red);
    font-size: 0.75rem;
    box-shadow: 0 0 10px var(--accent-red-glow);
    transition: all 0.3s ease;
}

.timeline-item.visible .timeline-dot {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 15px var(--accent-red);
    transform: scale(1.1);
}

.timeline-item.right .timeline-dot {
    left: -16px;
}

/* Contenido de cada Hito */
.timeline-content {
    padding: 30px;
    position: relative;
}

.timeline-date {
    display: inline-block;
    background: rgba(255, 75, 110, 0.1);
    color: var(--accent-red);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.timeline-content h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 10px;
    color: #fff;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Foto opcional dentro de cada hito de la línea de tiempo.
   Si la imagen no existe todavía, el navegador simplemente no la muestra
   (usa onerror para ocultar el hueco roto en vez de mostrar el ícono feo). */
.timeline-img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 14px;
    margin-top: 16px;
    border: 1px solid var(--glass-border);
}

/* ==========================================
   SECCIÓN: PLAYLIST COMPARTIDA
   ========================================== */
#playlist-section {
    padding: 100px 20px;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.playlist-container {
    padding: 24px;
    margin-top: 20px;
}


.playlist-note {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.playlist-note i {
    color: var(--accent-gold);
    margin-right: 6px;
}

.custom-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px;
}

.player-play-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent-red);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-red-glow);
    transition: all 0.3s ease;
}

.player-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px var(--accent-red);
}

.player-info {
    flex-grow: 1;
}

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

.player-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    border-radius: 10px;
    transition: width 0.1s linear;
}

.player-time {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#distance-section {
    padding: 100px 20px;
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
}

.distance-container {
    padding: 40px 20px;
}

.distance-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 20px auto;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(13, 17, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.world-map-bg {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.65;
    transition: opacity 0.5s ease;
}

#thread-map-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#connecting-thread {
    stroke-dashoffset: 1000;
    stroke-dasharray: 1000;
    animation: drawThread 3s ease forwards;
}

@keyframes drawThread {
    to { stroke-dashoffset: 0; }
}

.map-pulse {
    animation: mapPulse 2.5s ease-in-out infinite;
}

@keyframes mapPulse {
    0% { r: 1.5; opacity: 0.8; }
    100% { r: 8; opacity: 0; }
}

.map-labels {
    display: flex;
    justify-content: space-between;
    max-width: 500px;
    margin: 0 auto 24px auto;
    font-family: var(--font-heading);
    font-weight: 600;
}

.map-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.distance-number {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.distance-number span#distance-km {
    color: var(--accent-red);
}

.distance-footer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Responsivo para móviles en Línea de Tiempo */
@media (max-width: 768px) {
    .timeline-thread-bg, .timeline-thread-progress {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 60px;
        padding-right: 20px;
        text-align: left !important;
    }
    
    .timeline-dot {
        left: 14px !important;
        right: auto !important;
    }

    #floating-header {
        position: absolute;
        top: 15px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        pointer-events: none;
    }

    #language-switcher {
        pointer-events: auto;
    }

    .lang-btn {
        padding: 10px 14px; /* Aumenta el área táctil */
        font-size: 0.9rem;
    }
}

/* ==========================================
   4. EL NUDO DE AMOR Y CARTA OCULTA
   ========================================== */
#knot-section {
    text-align: center;
    overflow: hidden;
}

.knot-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.knot-interactive-wrapper {
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.knot-interactive-wrapper:hover {
    transform: scale(1.08);
}

.knot-interactive-wrapper svg {
    filter: drop-shadow(0 0 10px var(--accent-red-glow));
    transition: filter 0.3s ease;
}

.knot-interactive-wrapper:hover svg {
    filter: drop-shadow(0 0 20px var(--accent-red));
}

#knot-instruction {
    margin-top: 15px;
    font-family: var(--font-heading);
    color: var(--accent-red);
    font-size: 0.95rem;
    letter-spacing: 1px;
    animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* El anillo pulsante detrás del nudo */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    background: rgba(255, 75, 110, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    animation: pulseOuter 2.5s infinite;
}

@keyframes pulseOuter {
    0% {
        width: 120px;
        height: 120px;
        opacity: 0.6;
    }
    100% {
        width: 220px;
        height: 220px;
        opacity: 0;
    }
}

/* ==========================================
   ESTILOS DE LA CARTA OCULTA
   ========================================== */
.letter-container {
    max-width: 650px;
    margin: 40px auto 0 auto;
    padding: 50px 40px;
    text-align: left;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 75, 110, 0.1);
    position: relative;
    overflow: hidden;
}

.letter-container.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.letter-container.hidden {
    display: none;
}

.letter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.letter-icon {
    font-size: 1.8rem;
    color: var(--accent-red);
}

.letter-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
}

.letter-content {
    font-family: var(--font-romantic);
    font-size: 1.15rem;
    color: hsl(210, 15%, 85%);
    line-height: 1.8;
}

.letter-date {
    font-size: 0.95rem;
    font-family: var(--font-heading);
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.letter-signature {
    display: block;
    margin-top: 30px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--accent-red);
    text-align: right;
}

.letter-footer {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
}

/* Animación de Typewriter (JavaScript añade esta clase) */
.typing-text {
    border-right: 2px solid transparent;
    white-space: pre-line;
}

/* ==========================================
   FOOTER Y DETALLES DE PÁGINA
   ========================================== */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 80px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer p {
    font-family: var(--font-heading);
}

/* Animaciones y utilidades de carga */
.fade-in {
    animation: fadeIn 1.2s ease-out forwards;
}

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

/* Animaciones para el nudo desatándose */
.knot-untied {
    animation: unravel 1.5s forwards ease-in-out;
}

@keyframes unravel {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
        filter: drop-shadow(0 0 30px var(--accent-red));
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
        visibility: hidden;
    }
}

/* ==========================================
   RESPONSIVIDAD Y AJUSTES EXTRA
   ========================================== */
@media (max-width: 480px) {
    .counter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .clock-card {
        padding: 30px 15px;
    }
    
    .time-display {
        font-size: 2.4rem;
    }
    
    .letter-container {
        padding: 30px 20px;
    }
}