/* =========================================
   1. VARIABLES & BASE (Общие настройки)
   ========================================= */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-dark: #2d3748;
    --text-light: #718096;
    --accent: #667eea;
}

body {
    background: var(--primary-gradient);
    background-attachment: fixed;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Общие элементы (Панель, бейджи, флаги) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 50px;
}

.tech-badge {
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(118, 75, 162, 0.08);
    color: #764ba2;
    font-weight: 600;
    display: inline-block;
    margin: 3px 3px 3px 0;
    border: 1px solid rgba(118, 75, 162, 0.1);
}

.fi {
    width: 1.2em;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    vertical-align: text-bottom;
}

/* =========================================
   2. INDEX PAGE (Главная страница)
   ========================================= */
.profile-header {
    text-align: center;
    padding: 3rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
}

.avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.avatar:hover { transform: scale(1.05) rotate(2deg); }

.social-btn {
    width: 45px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    font-size: 1.2rem;
    margin: 0 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.social-btn:hover { transform: translateY(-3px); color: white; border-color: transparent; }
.social-btn.tg:hover { background: #0088cc; }
.social-btn.vk:hover { background: #0077ff; }
.social-btn.gh:hover { background: #333; }
.social-btn.cf:hover { background: #b41e1e; }

/* Timeline */
.timeline-section { padding: 2.5rem; }
.timeline { position: relative; padding-left: 2rem; border-left: 3px solid rgba(102, 126, 234, 0.3); }
.timeline-item { position: relative; margin-bottom: 2.5rem; opacity: 0; animation: fadeIn 0.6s ease forwards; }
.timeline-dot {
    position: absolute; left: -2.6rem; top: 0.2rem; width: 1rem; height: 1rem;
    background: var(--accent); border: 3px solid white; border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}
.date-label {
    font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--accent); margin-bottom: 0.35rem; display: block;
}

.event-card {
    background: rgba(255, 255, 255, 0.6); border-radius: 16px; padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; text-decoration: none; display: block; color: inherit;
}
.event-card:hover {
    background: white; transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); border-color: rgba(255, 255, 255, 0.9);
}
.read-more { margin-top: 1rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); display: flex; align-items: center; }
.read-more i { transition: transform 0.2s ease; }
.event-card:hover .read-more i { transform: translateX(5px); }

/* Анимации */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

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

/* =========================================
   3. EVENT PAGE (Страница события)
   ========================================= */
.article-header {
    padding: 2.5rem 2.5rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
}

.article-body {
    padding: 2.5rem; font-size: 1.05rem; line-height: 1.7; color: #4a5568;
}

.article-body h2, .article-body h3 {
    color: var(--text-dark); font-weight: 700; margin-top: 2rem; margin-bottom: 1rem;
}

.article-body img {
    max-width: 100%; border-radius: 12px; margin: 1.5rem 0; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.back-link {
    color: var(--text-light); text-decoration: none; font-weight: 600;
    font-size: 0.9rem; display: inline-flex; align-items: center; transition: all 0.2s ease; margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--accent); transform: translateX(-5px); }

.action-btn {
    background: var(--primary-gradient); border: none; color: white;
    padding: 10px 24px; border-radius: 50px; font-weight: 600; transition: transform 0.2s, box-shadow 0.2s;
}
.action-btn:hover {
    transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4); color: white;
}

/* =========================================
   4. COUNTER PAGE (Страница счётчика)
   ========================================= */
.counter-page {
    padding-bottom: 0;
}

.counter-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.counter-panel {
    margin-top: 0;
    min-height: min(72vh, 680px);
    padding: clamp(2rem, 7vw, 5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.8));
}

.counter-title {
    max-width: 900px;
    margin: 0 0 clamp(2rem, 6vh, 4rem);
    font-size: clamp(1.8rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.counter-value {
    max-width: 100%;
    color: var(--accent);
    font-size: clamp(6rem, 25vw, 18rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.07em;
    line-height: 0.8;
    overflow-wrap: anywhere;
    text-shadow: 0 10px 35px rgba(102, 126, 234, 0.22);
}

.counter-value-updated {
    animation: counterPulse 0.45s ease;
}

@keyframes counterPulse {
    50% { transform: scale(1.04); color: #764ba2; }
}

/* =========================================
   5. MEDIA QUERIES (Адаптив)
   ========================================= */
@media (max-width: 576px) {
    /* Главная */
    .timeline-section { padding: 1.5rem; }
    .timeline { padding-left: 1.5rem; }
    .timeline-dot { left: -2.1rem; }
    .avatar { width: 120px; height: 120px; }

    /* Статья */
    .article-header, .article-body { padding: 1.5rem; }

    /* Счётчик */
    .counter-container { padding: 1rem; }
    .counter-panel { min-height: calc(100vh - 2rem); }
}

@media (prefers-reduced-motion: reduce) {
    .counter-value-updated { animation: none; }
}
