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

:root {
    --color-bg-dark: #1a0a0d;
    --color-bg-card: #2a1215;
    --color-primary: #8b2e2e;
    --color-primary-light: #c94545;
    --color-accent: #5a1a1f;
    --color-text: #f5e8e6;
    --color-text-secondary: #b8a8a3;
    --color-border: #4a2425;
    --color-hover: #a83a3a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, #24151a 100%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-primary) 100%);
    padding: 3rem 2rem;
    border-bottom: 3px solid var(--color-primary-light);
    box-shadow: 0 8px 16px rgba(139, 46, 46, 0.3);
}

header h1 {
    font-size: 2.3rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-light);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

header p {
    color: rgba(245, 232, 230, 0.9);
    font-size: 1.05rem;
}

.timeline-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-accent) 100%);
    transform: translateX(-50%);
    display: none;
}

.timeline-item {
    position: relative;
    background: var(--color-bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--color-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    aspect-ratio: 16 / 9;
}

.timeline-item:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 15px 35px rgba(139, 46, 46, 0.3);
    transform: translateY(-8px);
}

.timeline-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:hover img {
    transform: scale(1.12);
}

.timeline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 46, 46, 0.85) 0%, rgba(90, 26, 31, 0.95) 100%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    text-align: center;
    padding: 2rem;
    gap: 1.2rem;
}

.timeline-item:hover .timeline-overlay {
    opacity: 1;
}

.overlay-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--color-primary-light);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.overlay-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.overlay-text {
    font-size: 0.85rem;
    color: rgba(245, 232, 230, 0.85);
}

.date-badge {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: rgba(139, 46, 46, 0.8);
    color: var(--color-primary-light);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.timeline-item:hover .date-badge {
    background: var(--color-primary-light);
    color: var(--color-bg-dark);
}

.counter-badge {
    position: absolute;
    bottom: 1.2rem;
    right: 1.2rem;
    background: rgba(139, 46, 46, 0.8);
    color: var(--color-primary-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.timeline-item:hover .counter-badge {
    background: var(--color-primary-light);
    color: var(--color-bg-dark);
    transform: scale(1.15);
}

footer {
    background: var(--color-accent);
    color: var(--color-text-secondary);
    text-align: center;
    padding: 2.5rem 2rem;
    border-top: 2px solid var(--color-border);
    font-size: 0.9rem;
}

footer p {
    margin: 0.6rem 0;
}

/* Адаптивный дизайн для планшета */
@media (max-width: 1024px) {
    .timeline-container {
        padding: 2rem 1.5rem;
    }

    header h1 {
        font-size: 1.9rem;
    }

    .timeline {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .overlay-number {
        font-size: 3rem;
    }

    .overlay-title {
        font-size: 1.1rem;
    }
}

/* Адаптивный дизайн для мобильного */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .timeline-container {
        padding: 1.5rem 1rem;
    }

    .timeline {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .timeline-item {
        aspect-ratio: 16 / 10;
    }

    .timeline-overlay {
        padding: 1.5rem;
        gap: 0.8rem;
    }

    .overlay-number {
        font-size: 2.5rem;
    }

    .overlay-title {
        font-size: 1rem;
    }

    .overlay-text {
        font-size: 0.8rem;
    }

    .date-badge {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .counter-badge {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* Адаптивный дизайн для маленького экрана */
@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .timeline-container {
        padding: 1rem 0.8rem;
    }

    .timeline {
        gap: 1rem;
    }

    .timeline-item {
        aspect-ratio: 16 / 11;
    }

    .timeline-overlay {
        padding: 1.2rem;
        gap: 0.6rem;
    }

    .overlay-number {
        font-size: 2rem;
    }

    .overlay-title {
        font-size: 0.95rem;
    }

    .overlay-text {
        font-size: 0.75rem;
    }

    .date-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.9rem;
        top: 0.8rem;
        left: 0.8rem;
    }

    .counter-badge {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
        bottom: 0.8rem;
        right: 0.8rem;
    }

    footer {
        padding: 1.5rem 1rem;
        font-size: 0.85rem;
    }

    footer p {
        margin: 0.4rem 0;
    }
}