:root {
    --bg-color: #e9ebec;
    --blue: #1a36e0;
    --shadow: rgba(0, 0, 0, 0.2);
    --shadow-light: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-texto {
    max-width: 320px;
    height: auto;
}

.logo {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: auto;
}

/* Timeline */
.timeline-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.tl-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #bdc3c7, #95a5a6, #bdc3c7);
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 1;
}

.tl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.tl-row:last-child {
    justify-content: center;
}

.tl-card {
    width: 130px;
    padding: 24px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 4px 5px 10px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    position: relative;
}

.tl-card:hover {
    transform: scale(1.08);
    box-shadow: 6px 8px 20px rgba(0,0,0,0.25);
}

.card-1973 { background: #f5d5c6; color: #333; }
.card-1975 { background: #fdf5e6; color: #333; }
.card-1976 { background: #ffffff; color: #333; }
.card-1977 { background: #4a4a4a; color: #fff; }
.card-1979 { background: #d4e6f1; color: #333; }

/* Connector dots */
.tl-card::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #666;
    border: 3px solid #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
    transform: translateY(-50%);
    z-index: 3;
}

.tl-card:nth-child(odd)::after {
    right: -32px;
}

.tl-card:nth-child(even)::after {
    left: -32px;
}

/* Animation */
.tl-card.animate-activate {
    animation: cardBounce 0.8s ease-in-out forwards;
}

@keyframes cardBounce {
    0% { transform: scale(1); filter: brightness(1); }
    40% { transform: scale(1.12); filter: brightness(1.2); }
    60% { transform: scale(1.05); }
    100% { transform: scale(1.08); filter: brightness(1.1); }
}

/* Instructions Button */
.instructions-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-instrucciones {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #000;
    padding: 0.8rem 2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.btn-instrucciones:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-instrucciones:active {
    transform: translateY(0);
}

@media (max-width: 400px) {
    .tl-card { width: 100px; font-size: 1.6rem; padding: 18px 8px; }
    .tl-card:nth-child(odd)::after { right: -26px; }
    .tl-card:nth-child(even)::after { left: -26px; }
}

/* ============================================
   INTRO OVERLAY ANIMATION
   ============================================ */

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.intro-bg {
    position: absolute;
    inset: 0;
    background: url('inicio.png') center center / cover no-repeat;
    z-index: 0;
}
.intro-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

/* Líquido WebGL (Canvas UI) sobre la foto de la intro */
.intro-liquid {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.9;
}

.intro-liquid .liquid-canvas {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.intro-title {
    position: relative;
    z-index: 2;
    font-family: 'Caveat', cursive;
    font-size: clamp(2.6rem, 10vw, 4.2rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.1;
    text-shadow: 0 2px 18px rgba(0,0,0,0.7);
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInTitle 1s ease 0.3s forwards;
}

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

.squares-scene {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 420px;
    padding: 0 16px;
}

.sq-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.5);
}

.sq-group.reveal {
    animation: squarePop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes squarePop {
    0%   { opacity: 0; transform: scale(0.4); }
    60%  { opacity: 1; transform: scale(1.18); }
    80%  { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.sq-box {
    width: clamp(40px, 13vw, 58px);
    height: clamp(40px, 13vw, 58px);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    box-shadow: 0 0 22px rgba(255,255,255,0.18), inset 0 0 10px rgba(255,255,255,0.08);
    position: relative;
    transition: box-shadow 0.3s;
}

.sq-group.reveal .sq-box {
    box-shadow: 0 0 30px rgba(100, 200, 255, 0.5), inset 0 0 14px rgba(255,255,255,0.12);
    border-color: #85d8f0;
}

.sq-year {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 5vw, 1.7rem);
    font-weight: 700;
    color: #fff;
    margin-top: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
}

.sq-group.reveal .sq-year {
    opacity: 1;
    transform: translateY(0);
}

.sq-line {
    position: absolute;
    top: calc(clamp(40px, 13vw, 58px) / 2 - 2px);
    height: 3px;
    background: linear-gradient(to right, rgba(133, 216, 240, 0.9), rgba(255,255,255,0.5));
    border-radius: 2px;
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0;
}

.sq-line-right {
    left: calc(100% + 1px);
    width: clamp(6px, 3vw, 18px);
}

.sq-group.reveal .sq-line-right {
    animation: lineGrow 0.35s ease 0.3s forwards;
}

@keyframes lineGrow {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}

.intro-tap-hint {
    position: absolute;
    bottom: 40px;
    z-index: 2;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.5px;
    animation: blinkHint 1.5s ease-in-out infinite;
}

@keyframes blinkHint {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1; }
}

.intro-overlay.fade-out {
    animation: overlayFadeOut 0.9s ease forwards;
    pointer-events: none;
}

@keyframes overlayFadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

body.intro-active .container {
    opacity: 0;
    pointer-events: none;
}

/* Logo Tala al pie de la pagina */
.tala-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 2.5rem 1rem 1rem;
}

.tala-logo {
    width: 240px;
    max-width: 80%;
    height: auto;
    opacity: 0.92;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}
