:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --accent: #2563eb;
    --accent-gradient: linear-gradient(135deg, #2563eb, #7c3aed);
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-blur: blur(10px);
    --card-bg: #ffffff;
    --card-shadow: 0 4px 24px rgba(0,0,0,0.06);
    --footer-bg: #0f172a;
    --footer-text: #e2e8f0;
    --modal-bg: #ffffff;
    --modal-overlay: rgba(15, 23, 42, 0.6);
    --button-secondary-bg: transparent;
    --button-secondary-border: #2563eb;
    --button-secondary-text: #2563eb;
    --input-bg: #f8fafc;
    --input-border: #cbd5e1;
    --input-text: #0f172a;
    --watermark-opacity: 0.03;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --header-bg: rgba(15, 23, 42, 0.85);
    --header-blur: blur(10px);
    --card-bg: #1e293b;
    --card-shadow: 0 4px 24px rgba(0,0,0,0.3);
    --footer-bg: #020617;
    --footer-text: #94a3b8;
    --modal-bg: #1e293b;
    --modal-overlay: rgba(0,0,0,0.7);
    --button-secondary-bg: transparent;
    --button-secondary-border: #3b82f6;
    --button-secondary-text: #3b82f6;
    --input-bg: #0f172a;
    --input-border: #334155;
    --input-text: #e2e8f0;
    --watermark-opacity: 0.05;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
}

.watermark {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--watermark-opacity);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 50px, rgba(37,99,235, 0.2) 50px, rgba(37,99,235, 0.2) 52px);
    mix-blend-mode: multiply;
}

/* Прелоадер */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s;
}
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-logo {
    animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* Кастомный курсор */
.cursor {
    display: none;
    position: fixed;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    z-index: 9998;
    mix-blend-mode: difference;
}
@media (pointer: fine) {
    .cursor { display: block; }
}
.cursor.hover {
    width: 32px;
    height: 32px;
    background: rgba(37,99,235,0.2);
}

/* Шапка */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: var(--header-blur);
    -webkit-backdrop-filter: var(--header-blur);
    transition: background 0.3s;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 1001;
}
.logo__text {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Навигация */
.nav__burger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}
.nav__burger span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}
.nav__list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}
.nav__link {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}
.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s;
}
.nav__link:hover::after,
.nav__link:focus::after { width: 100%; }

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 1001;
}
.theme-toggle:hover { background: var(--bg-secondary); }

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero__parallax {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at 30% 40%, rgba(37,99,235,0.15), transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(124,58,237,0.15), transparent 50%);
    will-change: transform;
    transform: translateZ(0);
}
.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.hero__title {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 8vw, 4rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}
.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}
.btn--primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(37,99,235,0.4);
}
.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.6);
}
.btn--secondary {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: 2px solid var(--button-secondary-border);
}
.btn--secondary:hover {
    background: var(--button-secondary-border);
    color: white;
}
.hero__scroll-down {
    display: block;
    margin: 2rem auto 0;
    width: 24px;
    height: 24px;
    color: var(--accent);
    animation: bounce 2s infinite;
    transform: translateY(0);
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Секции */
.section {
    padding: 5rem 0;
}
.section__title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.8rem);
    text-align: center;
    margin-bottom: 3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* About */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.about__text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
}
.about__visual {
    display: flex;
    justify-content: center;
}
.about__placeholder {
    max-width: 100%;
    height: auto;
}

/* Product */
.product__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.product-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.product-card__icon { font-size: 3rem; margin-bottom: 1rem; }
.product-card__title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}
.product-card p { color: var(--text-secondary); }
.product__timeline {
    text-align: center;
    font-weight: 500;
    color: var(--accent);
    font-size: 1.1rem;
}

/* Team */
.team__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.team-member {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}
.team-member__photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-secondary);
    margin: 0 auto 1rem;
    border: 3px solid var(--accent);
}
.team-member__name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
}
.team-member__role { color: var(--accent); font-weight: 600; margin-bottom: 0.3rem; }
.team-member__uni { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.8rem; }

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2.5rem 0;
}
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: center;
}
.footer__socials { display: flex; gap: 1rem; }
.footer__socials a { color: var(--footer-text); transition: color 0.3s; }
.footer__socials a:hover { color: white; }

/* ========== МОДАЛЬНЫЕ ОКНА (только CSS :target) ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    pointer-events: none; /* когда окно скрыто, клики проходят сквозь */
}
.modal:target {
    visibility: visible;
    opacity: 1;
    pointer-events: auto; /* клики внутри окна работают */
}
.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    display: block;
}
.modal__content {
    position: relative;
    background: var(--modal-bg);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.modal__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1;
}
.modal__title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.modal__info p { margin-bottom: 0.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--input-text);
    font-family: inherit;
    font-size: 1rem;
}
.form-group--checkbox { display: flex; align-items: flex-start; gap: 0.5rem; }
.form-group--checkbox input { width: auto; margin-top: 0.2rem; }
.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

/* Анимация появления */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Бургер-меню (mobile) */
@media (max-width: 768px) {
    .nav__burger { display: flex; }
    .nav__list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 100px 2rem 2rem;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        transition: right 0.3s ease;
        gap: 2rem;
        z-index: 1000;
    }
    .nav__list.active { right: 0; }
    .nav__burger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav__burger.active span:nth-child(2) { opacity: 0; }
    .nav__burger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    .about__grid,
    .product__cards,
    .team__grid { grid-template-columns: 1fr; }
    .hero__actions { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .section { padding: 3rem 0; }
}
