/* ===== HISTORY PAGE STYLES ===== */

.history-container {
    min-height: 100vh;
    padding: 80px 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header"
        "content timeline"
        "footer footer";
    gap: 2.5rem;
    position: relative;
}

/* Header */
.history-header {
    grid-area: header;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 0;
}

.history-title-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    line-height: 1.2;
    color: #ffffff;
    margin: 0;
    white-space: pre;
    user-select: none;
    text-align: left;
    display: inline-block;
    padding: 0;
    background: none;
    border: none;
}

/* Main Content */
.history-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.history-section {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2rem;
    position: relative;
    z-index: 1;
    will-change: transform;
}

/* ИСПРАВЛЕНИЕ 1: Убрали sticky и сделали заголовки фиксированными */
.history-section h2 {
    color: #00ff00;
    font-family: 'Silkscreen', monospace;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    background: rgba(20, 20, 20, 0.9);
    z-index: 1;
    padding-top: 0.5rem;
    margin-top: -0.5rem;
}

.history-section p {
    color: #ccc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.history-section a {
    color: #00ff00;
    text-decoration: none;
    border-bottom: 1px dotted #00ff00;
    transition: color 0.2s ease;
}

.history-section a:hover {
    color: #ffffff;
    border-bottom-style: solid;
}

.section-intro {
    font-size: 1rem;
    color: #ffffff;
    background: rgba(0, 255, 0, 0.05);
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid #00ff00;
}

/* ASCII Art Frames */
.ascii-art-frame {
    background: #000000;
    border: 1px solid #333;
    border-radius: 4px;
    margin: 2rem 0;
    overflow: hidden;
}

.ascii-art-frame.large {
    max-height: none;
    overflow: visible;
}

.ascii-art-frame.center {
    text-align: center;
}

.ascii-art-header {
    background: rgba(30, 30, 30, 0.95);
    border-bottom: 1px solid #333;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Silkscreen', monospace;
    font-size: 0.8rem;
    color: #888;
}

.ascii-art-header span:first-child {
    color: #00ff00;
}

.ascii-art-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.2;
    color: #ffffff;
    margin: 0;
    padding: 1.5rem;
    white-space: pre;
    user-select: all;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.ascii-art-caption {
    background: rgba(30, 30, 30, 0.95);
    border-top: 1px solid #333;
    padding: 0.8rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    font-style: italic;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.resource-card {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1.5rem;
}

.resource-card h3 {
    color: #00ff00;
    font-family: 'Silkscreen', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin: 0 0 1rem 0;
}

.resource-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-card li {
    margin-bottom: 0.5rem;
}

.resource-card a {
    color: #ccc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    text-decoration: none;
    display: block;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.resource-card a:hover {
    color: #ffffff;
    background: rgba(0, 255, 0, 0.1);
    padding-left: 0.8rem;
}

/* Timeline */
.history-timeline {
    grid-area: timeline;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1.5rem;
    height: 500px;
    position: sticky;
    top: 100px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #333;
    /* ИСПРАВЛЕНИЕ 3: Плавные переходы для растворения */
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
    transform: translateY(0);
    visibility: visible;
}

/* ИСПРАВЛЕНИЕ: Убрали промежуточные состояния, оставили только видимый и скрытый */
.history-timeline.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    visibility: hidden;
}

.history-timeline::-webkit-scrollbar {
    width: 6px;
}

.history-timeline::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

.history-timeline::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 3px;
}

.history-timeline h3 {
    color: #00ff00;
    font-family: 'Silkscreen', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1.5rem 0;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: rgba(20, 20, 20, 0.95);
    z-index: 10;
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-bottom: 1px dashed #333;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
    margin-bottom: 0.3rem;
}

.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.timeline-item:hover {
    background: rgba(0, 255, 0, 0.05);
    border-color: #00ff00;
}

.timeline-item.active {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    border-left: 4px solid #00ff00;
}

.timeline-year {
    color: #00ff00;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    min-width: 50px;
}

.timeline-event {
    color: #ccc;
    font-size: 0.85rem;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

/* ===== STUDIO FOOTER ===== */
.studio-footer {
    grid-area: footer;
    position: relative;
    background-color: #000000;
    padding: 1.5rem 0 2rem;
    margin-top: 2rem;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
}

.studio-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #333;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-project-name {
    font-family: 'Silkscreen', monospace;
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    text-align: center;
}

.footer-copyright {
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    margin-top: 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-link {
    color: #ffffff;
    font-family: 'Silkscreen', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    padding: 0.5rem;
}

.footer-link:hover {
    color: #00ff00;
}

/* ===== ИСПРАВЛЕНИЕ 3: Ограничиваем sticky позиционирование таймлайна ===== */
@media (min-width: 1201px) {
    .history-timeline {
        align-self: flex-start;
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 200px);
        transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .history-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        grid-template-areas:
            "header"
            "timeline"
            "content"
            "footer";
        gap: 2rem;
        padding: 70px 1.5rem 1.5rem;
    }

    .history-timeline {
        position: static;
        height: 300px;
        margin-bottom: 1rem;
        max-height: none !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .ascii-art-content {
        font-size: 10px;
        padding: 1rem;
    }

    .studio-footer {
        padding: 1rem 0 1.5rem;
        margin-top: 1.5rem;
    }

    .footer-container {
        padding: 0 1rem;
    }

    .footer-project-name {
        font-size: 1.3rem;
        text-align: center;
    }

    .footer-copyright {
        font-size: 0.85rem;
        text-align: center;
    }

    .footer-links {
        gap: 1.5rem;
        margin-top: 0.8rem;
    }

    .footer-link {
        font-size: 0.85rem;
        padding: 0.3rem;
    }
}

@media (max-width: 768px) {
    .history-container {
        padding: 60px 1rem 1rem;
        gap: 1.5rem;
        grid-template-rows: auto auto 1fr auto;
    }

    .history-title-logo {
        font-size: 8px;
    }

    .history-section {
        padding: 1.5rem;
    }

    .ascii-art-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .ascii-art-content {
        font-size: 9px;
        padding: 0.8rem;
    }

    .history-timeline {
        height: 250px;
    }

    .studio-footer {
        padding: 0.8rem 0 1.2rem;
        margin-top: 1rem;
    }

    .footer-container {
        padding: 0 0.5rem;
    }

    .footer-project-name {
        font-size: 1.1rem;
    }

    .footer-copyright {
        font-size: 0.8rem;
    }

    .footer-links {
        gap: 1rem;
        margin-top: 0.6rem;
        flex-wrap: wrap;
    }

    .footer-link {
        font-size: 0.8rem;
        padding: 0.2rem;
    }
}

@media (max-width: 480px) {
    .history-container {
        padding: 50px 0.5rem 0.5rem;
    }

    .history-title-logo {
        font-size: 7px;
    }

    .history-section {
        padding: 1rem;
    }

    .ascii-art-content {
        font-size: 8px;
        padding: 0.6rem;
    }

    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        padding: 0.6rem;
    }

    .timeline-event {
        text-align: left;
        margin-left: 0;
    }

    .studio-footer {
        padding: 0.5rem 0 1rem;
        margin-top: 0.8rem;
    }

    .footer-container {
        padding: 0 0.3rem;
    }

    .footer-project-name {
        font-size: 1rem;
    }

    .footer-copyright {
        font-size: 0.75rem;
    }

    .footer-links {
        gap: 0.8rem;
        margin-top: 0.5rem;
    }

    .footer-link {
        font-size: 0.75rem;
        padding: 0.1rem;
    }
}