/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #1a5fb4;
    --blue-light: #3584e4;
    --blue-dark: #0d3b7a;
    --gold: #c8a84e;
    --gold-light: #f5e6b8;
    --bg: #fafbfd;
    --bg-warm: #f8f6f2;
    --text: #1a1a2e;
    --text-light: #555;
    --text-muted: #888;
    --white: #ffffff;
    --border: #e8e8ec;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* === Header === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.header--scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo__icon {
    font-size: 1.5rem;
    color: var(--gold);
}

.logo__text {
    color: var(--blue-dark);
}

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

.nav__link {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
}

.nav__link:hover {
    color: var(--blue);
    background: rgba(26,95,180,0.06);
}

.nav__link--accent {
    background: var(--blue);
    color: var(--white) !important;
}

.nav__link--accent:hover {
    background: var(--blue-dark);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.burger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* === Hero === */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26,95,180,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(200,168,78,0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 80%, rgba(26,95,180,0.05) 0%, transparent 50%);
    z-index: 0;
}

.hero__bg::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 5%;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(200,168,78,0.15);
    border-radius: 50%;
    animation: pulse 8s ease-in-out infinite;
}

.hero__bg::after {
    content: '';
    position: absolute;
    bottom: 15%;
    left: 10%;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(26,95,180,0.1);
    border-radius: 50%;
    animation: pulse 10s ease-in-out infinite 2s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
}

.hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 24px;
}

.hero__highlight {
    color: var(--blue);
    position: relative;
}

.hero__highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--gold-light);
    z-index: -1;
    border-radius: 4px;
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 80px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn--primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(26,95,180,0.3);
}

.btn--primary:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26,95,180,0.4);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn--outline:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.hero__stats {
    display: flex;
    justify-content: center;
    gap: 64px;
}

.hero__stat {
    text-align: center;
}

.hero__stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--blue);
    line-height: 1;
    margin-bottom: 8px;
}

.hero__stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Section Title === */
.section__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text);
}

.section__title--left {
    text-align: left;
}

.section__desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 48px;
}

/* === Olympiads === */
.olympiads {
    padding: 100px 0;
    background: var(--white);
}

.olympiads__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: var(--transition);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card--opk::before { background: linear-gradient(90deg, #1a5fb4, #3584e4); }
.card--ovio::before { background: linear-gradient(90deg, #c8a84e, #e8c84e); }
.card--aksios::before { background: linear-gradient(90deg, #26a269, #57e389); }
.card--tests::before { background: linear-gradient(90deg, #9141ac, #c061cb); }
.card--pstgu::before { background: linear-gradient(90deg, #a51d2d, #e01b24); }
.card--kolokol::before { background: linear-gradient(90deg, #986a44, #c8a84e); }

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card__icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card__desc {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.card__links span {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--white);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.card__arrow {
    position: absolute;
    top: 32px;
    right: 32px;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.card:hover .card__arrow {
    transform: translateX(4px);
    color: var(--blue);
}

/* === News === */
.news {
    padding: 100px 0;
    background: var(--bg);
}

.news__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.news-card {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.news-card__badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
    align-self: flex-start;
}

.news-card__badge--opk {
    background: rgba(26,95,180,0.1);
    color: var(--blue);
}

.news-card__badge--ovio {
    background: rgba(200,168,78,0.15);
    color: #9a7a1e;
}

.news-card__badge--aksios {
    background: rgba(38,162,105,0.1);
    color: #26a269;
}

.news-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.news-card__date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === About === */
.about {
    padding: 100px 0;
    background: var(--white);
}

.about__inner {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 64px;
    align-items: center;
}

.about__text {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about__features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.about__feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.about__feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.about__feature strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.about__feature p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.about__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about__visual-card {
    width: 320px;
    height: 400px;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.about__visual-cross {
    font-size: 5rem;
    color: var(--gold);
    margin-bottom: 24px;
    line-height: 1;
}

.about__visual-card p {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* === Partners === */
.partners {
    padding: 80px 0;
    background: var(--bg-warm);
}

.partners__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.partner {
    display: flex;
    flex-direction: column;
    padding: 28px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
}

.partner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.partner__name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--blue-dark);
}

.partner__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* === Footer === */
.footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: 64px 0 0;
}

.footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo--footer .logo__text {
    color: var(--white);
}

.footer__desc {
    margin-top: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 280px;
}

.footer__links h4 {
    color: var(--white);
    font-size: 0.9rem;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer__links a {
    display: block;
    font-size: 0.9rem;
    padding: 4px 0;
    color: rgba(255,255,255,0.6);
}

.footer__links a:hover {
    color: var(--white);
}

.footer__bottom {
    padding: 24px 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* === Animations === */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .olympiads__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about__inner {
        grid-template-columns: 1fr;
    }
    .about__visual {
        order: -1;
    }
    .about__visual-card {
        width: 100%;
        height: 280px;
    }
    .section__title--left {
        text-align: center;
    }
    .about__features {
        grid-template-columns: 1fr 1fr;
    }
    .footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 24px 24px;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        gap: 4px;
    }

    .nav--open {
        right: 0;
    }

    .nav__link {
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .burger {
        display: flex;
        z-index: 101;
    }

    .burger--open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .burger--open span:nth-child(2) {
        opacity: 0;
    }

    .burger--open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }

    .hero__stats {
        gap: 32px;
    }

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

    .hero__actions {
        margin-bottom: 48px;
    }

    .olympiads__grid,
    .news__grid {
        grid-template-columns: 1fr;
    }

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

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

    .footer__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .hero__stats {
        flex-direction: column;
        gap: 24px;
    }

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

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero__actions {
        flex-direction: column;
    }
}
