/* ============================================
   ANS — Ателье Нейросетевых Сервисов
   Design System & Components
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;400;600;900&display=swap');

/* --- CSS Variables --- */
:root {
    --bg-base: #162330;
    --accent: #399FB5;
    --text-accent: #ADF0FF;
    --text-white: #FFFFFF;
    --text-muted: #798694;
    --border: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(255, 255, 255, 0.18);
    --glass-bg: rgba(255, 255, 255, 0.035);
    --glass: rgba(22, 35, 48, 0.8);
    --font: 'Inter', sans-serif;
    --cw: 1200px;
    --cp: 40px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-white);
    background: var(--bg-base);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.3s; }
a:hover { opacity: 0.8; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* --- Canvas & Effects --- */
#particle-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9998; pointer-events: none; opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
    position: fixed; border-radius: 50%; filter: blur(100px);
    z-index: 0; pointer-events: none;
    animation: orbFloat 20s infinite ease-in-out alternate;
}
.orb-1 { top: 15%; left: -15%; width: 50vw; height: 50vw; background: radial-gradient(circle, rgba(57,159,181,0.12), transparent 60%); }
.orb-2 { top: 50%; right: -15%; width: 55vw; height: 55vw; background: radial-gradient(circle, rgba(173,240,255,0.08), transparent 60%); animation-delay: -7s; }
.orb-3 { bottom: -10%; left: 25%; width: 60vw; height: 40vw; background: radial-gradient(circle, rgba(57,159,181,0.06), transparent 60%); animation-delay: -14s; }
@keyframes orbFloat { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(4%,8%) scale(1.08); } }

/* --- Container --- */
.container {
    max-width: var(--cw);
    margin: 0 auto;
    padding: 0 var(--cp);
    position: relative;
    z-index: 10;
}

/* --- Section --- */
.section { padding: 100px 0; position: relative; }

.section-glass {
    background: var(--glass-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* --- Section Titles --- */
.section-label {
    font-size: 17px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-white); margin-bottom: 16px;
}

.section-subtitle {
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 900; color: var(--text-accent);
    margin-bottom: 50px; max-width: 100%; line-height: 1.15;
}

/* --- Scroll Reveal --- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.35s ease;
}
.header.scrolled {
    background: var(--glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    width: 100%; max-width: var(--cw);
    display: flex; align-items: center; justify-content: space-between;
    padding: 23px var(--cp); transition: padding 0.35s ease;
}
.header.scrolled .header-inner { padding-top: 18px; padding-bottom: 18px; }

.header-logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-white); font-weight: 900; font-size: 18px;
    text-decoration: none;
}
.header-logo img { height: 44px; width: auto; }

.header-nav { display: flex; align-items: center; gap: 36px; }
.header-nav a {
    color: var(--text-white); font-size: 14px; font-weight: 600;
    letter-spacing: 0.05em; text-transform: uppercase;
    text-decoration: none; transition: color 0.3s;
}
.header-nav a:hover { color: var(--accent); opacity: 1; }

.header-cta {
    display: inline-block; padding: 10px 24px;
    background: var(--accent); color: var(--text-white) !important;
    font-size: 14px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    border: none; cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}
.header-cta:hover { background: #2d8094; transform: translateY(-1px); opacity: 1; }

.burger {
    display: none; flex-direction: column; gap: 5px;
    cursor: pointer; background: none; border: none; padding: 4px;
}
.burger span { display: block; width: 24px; height: 2px; background: var(--text-white); transition: all 0.3s; }

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    padding-top: 100px; padding-bottom: 60px; position: relative;
}
.hero-content { max-width: 100%; }

.hero-title {
    font-size: clamp(42px, 6.5vw, 78px);
    font-weight: 900; line-height: 1.05;
    margin-bottom: 36px; color: var(--text-accent);
}

.hero-desc {
    font-size: clamp(20px, 2.8vw, 34px);
    font-weight: 900; color: var(--text-white);
    margin-bottom: 44px; max-width: 75%; line-height: 1.3;
    margin-right: 0;
}

.hero-cta {
    display: inline-block; padding: 16px 40px;
    background: var(--accent); color: var(--text-white);
    font-size: 16px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    border: none; cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-bottom: 40px;
}
.hero-cta:hover { background: #2d8094; transform: translateY(-2px); opacity: 1; }

.hero-bullets { display: flex; flex-direction: column; gap: 10px; }
.hero-bullets li {
    font-size: 18px; font-weight: 600; color: var(--text-muted);
    padding-left: 24px; position: relative;
}
.hero-bullets li::before {
    content: ''; position: absolute; left: 0; top: 9px;
    width: 8px; height: 8px; background: var(--accent);
}

/* ============================================
   FOR WHOM (ДЛЯ КОГО)
   ============================================ */
.for-whom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.for-whom-card {
    background: var(--glass-bg); border: 1px solid var(--border);
    padding: 36px 30px; transition: border-color 0.3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.for-whom-card:hover { border-color: var(--accent); }

.for-whom-card h3 {
    font-size: 22px; font-weight: 900; margin-bottom: 16px;
    color: var(--text-white); transition: color 0.3s;
}
.for-whom-card p {
    font-size: 18px; color: var(--text-muted);
    line-height: 1.7; transition: color 0.3s;
}
.for-whom-card:hover h3 { color: var(--text-accent); }
.for-whom-card:hover p { color: var(--text-white); }

/* ============================================
   FUNCTIONS (ФУНКЦИИ)
   ============================================ */
.bento-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.bento-card {
    background: var(--glass-bg); border: 1px solid var(--border);
    padding: 40px 36px; position: relative;
    transition: border-color 0.3s; transform-style: preserve-3d;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bento-card:hover { border-color: var(--border-glow); }
.bento-card.col-5, .bento-card.col-7, .bento-card.col-6,
.bento-card.col-4, .bento-card.col-8, .bento-card.col-12 { grid-column: span 1; }

.bento-icon { width: 60px; height: 60px; margin-bottom: 24px; display: flex; align-items: center; justify-content: center; }
.bento-icon svg { width: 60px; height: 60px; stroke: var(--accent); fill: none; stroke-width: 1.5; }

.bento-card h3 {
    font-size: 40px; font-weight: 900; margin-bottom: 12px;
    color: var(--text-white); transition: color 0.3s;
}
.bento-card p {
    font-size: 22px; color: var(--text-muted);
    line-height: 1.7; transition: color 0.3s;
}
.bento-card:hover h3 { color: var(--text-accent); }
.bento-card:hover p { color: var(--text-white); }

/* ============================================
   PORTFOLIO (ПОРТФОЛИО) — Carousel
   ============================================ */
.portfolio-carousel { position: relative; overflow: hidden; }
.portfolio-track { display: flex; gap: 24px; transition: transform 0.5s ease; }

.portfolio-card {
    min-width: calc(33.333% - 16px);
    background: var(--glass-bg); border: 1px solid var(--border);
    overflow: hidden; cursor: pointer;
    transition: border-color 0.3s, transform 0.3s;
    text-decoration: none; color: var(--text-white); display: block;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.portfolio-card:hover { border-color: var(--accent); transform: translateY(-4px); opacity: 1; }

.portfolio-card-img { width: 100%; aspect-ratio: 1/1; overflow: hidden; background: var(--bg-base); }
.portfolio-card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s; }
.portfolio-card:hover .portfolio-card-img img { transform: scale(1.05); }

.portfolio-card-body { padding: 24px; }
.portfolio-card-body h3 {
    font-size: 20px; font-weight: 900; line-height: 1.4;
    color: var(--text-white); transition: color 0.3s;
}
.portfolio-card:hover .portfolio-card-body h3 { color: var(--text-accent); }

.portfolio-arrows { display: flex; gap: 12px; margin-top: 32px; }
.portfolio-arrow {
    width: 48px; height: 48px;
    background: var(--glass-bg); border: 1px solid var(--border);
    color: var(--text-white); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: border-color 0.3s, background 0.3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.portfolio-arrow:hover { border-color: var(--accent); background: var(--accent); }
.portfolio-arrow svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ============================================
   HOW WE WORK (КАК ЭТО РАБОТАЕТ)
   ============================================ */
.process-grid { display: grid; grid-template-columns: 80px 1fr; gap: 0; }

.process-item {
    display: contents;
}

.process-icon {
    width: 60px; height: 60px;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 36px;
}
.process-icon svg { width: 48px; height: 48px; stroke: var(--accent); fill: none; stroke-width: 1.5; }

.process-line {
    border-left: 2px solid var(--border);
    margin-left: 30px; padding-left: 50px;
    padding-bottom: 48px; position: relative;
}
.process-line::before {
    content: ''; position: absolute; left: -7px; top: 54px;
    width: 12px; height: 12px; background: var(--bg-base);
    border: 2px solid var(--accent);
    box-shadow: 0 0 10px rgba(57,159,181,0.4);
}
.process-item:last-child .process-line { padding-bottom: 0; }

.process-num {
    font-size: 13px; font-weight: 600; color: var(--accent);
    letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px;
}
.process-line h3 { font-size: 40px; font-weight: 900; margin-bottom: 8px; }
.process-line p { font-size: 22px; color: var(--text-muted); line-height: 1.7; max-width: 100%; }

/* ============================================
   MODELS (МОДЕЛИ СОТРУДНИЧЕСТВА)
   ============================================ */
.models-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.models-card {
    background: var(--glass-bg); border: 1px solid var(--border);
    padding: 32px 28px; transition: border-color 0.3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.models-card:hover { border-color: var(--accent); }
.models-card h3 { font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.models-card p { font-size: 22px; color: var(--text-muted); line-height: 1.7; }

.models-examples { margin-top: 24px; }
.models-examples h3 {
    font-size: 22px; font-weight: 900; margin-bottom: 16px;
    color: var(--text-accent);
}
.models-examples-list {
    display: flex; flex-direction: column; gap: 12px;
}
.models-examples-list li {
    font-size: 18px; color: var(--text-muted); line-height: 1.7;
    padding-left: 20px; position: relative;
}
.models-examples-list li::before {
    content: ''; position: absolute; left: 0; top: 9px;
    width: 6px; height: 6px; background: var(--accent);
}

/* ============================================
   WHY US (ПОЧЕМУ МЫ)
   ============================================ */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.why-card {
    background: var(--glass-bg); border: 1px solid var(--border);
    padding: 32px 28px; transition: border-color 0.3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.why-card:hover { border-color: var(--accent); }
.why-card h3 { font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.why-card p { font-size: 22px; color: var(--text-muted); line-height: 1.7; }

/* ============================================
   FAQ — Accordion
   ============================================ */
.faq-list { width: 100%; }
.faq-item { border-bottom: 1px solid var(--border); }

.faq-question {
    width: 100%; background: none; border: none;
    color: var(--text-white); font-family: var(--font);
    font-size: 22px; font-weight: 600; text-align: left;
    padding: 24px 0; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; transition: color 0.3s;
}
.faq-question:hover { color: var(--accent); }

.faq-icon { font-size: 24px; font-weight: 400; transition: transform 0.3s, color 0.3s; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); color: var(--text-accent); }
.faq-item.open .faq-question { color: var(--text-accent); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-item.open .faq-answer { max-height: 400px; }
.faq-answer-inner { padding-bottom: 24px; font-size: 22px; color: var(--text-white); line-height: 1.7; }

/* ============================================
   CONTACT (КОНТАКТЫ)
   ============================================ */
.contact-grid { display: grid; grid-template-columns: 2.4fr 1fr; gap: 40px; align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: flex; gap: 12px; }

.form-input, .form-textarea {
    width: 100%; background: rgba(0,0,0,0.2);
    border: 1px solid var(--border); padding: 16px 20px;
    color: var(--text-white); font-family: var(--font);
    font-size: 18px; outline: none; transition: border-color 0.3s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }

.form-select-group { display: flex; gap: 0; }
.form-select-btn {
    flex: 1; padding: 14px 12px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    color: var(--text-muted); font-family: var(--font);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.3s; text-align: center;
}
.form-select-btn.active { background: var(--accent); color: var(--text-white); border-color: var(--accent); }
.form-select-btn:not(:last-child) { border-right: none; }

.form-checkbox {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer; font-size: 14px; color: var(--text-muted); line-height: 1.5;
}
.form-checkbox input[type="checkbox"] { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.form-checkbox a { color: var(--accent); }

.form-submit {
    display: inline-block; padding: 16px 40px;
    background: var(--accent); color: var(--text-white);
    font-family: var(--font); font-size: 17px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    border: none; cursor: pointer;
    transition: background 0.3s, transform 0.2s; align-self: flex-start;
}
.form-submit:hover { background: #2d8094; transform: translateY(-2px); }

.form-success { display: none; padding: 40px; border: 1px solid var(--accent); text-align: center; }
.form-success.show { display: block; }
.form-success h3 { font-size: 24px; font-weight: 900; margin-bottom: 12px; }
.form-success p { color: var(--text-muted); font-size: 18px; }

.contact-info { padding-top: 10px; }
.contact-info h3 { font-size: 28px; font-weight: 900; margin-bottom: 28px; }

.contact-info-item { margin-bottom: 24px; display: flex; align-items: flex-start; gap: 14px; }
.contact-info-icon { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.5; flex-shrink: 0; margin-top: 2px; }
.contact-info-text .value { font-size: 18px; color: var(--text-white); }
.contact-info-text .value a { color: var(--text-white); }
.contact-info-text .value a:hover { color: var(--accent); }

.form-legal {
    font-size: 13px; color: var(--text-muted);
    line-height: 1.6; margin-top: 8px;
}
.form-legal + .form-legal { margin-top: 0; }
.form-legal a { color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */
.footer { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; }
.footer p { font-size: 14px; color: var(--text-muted); }
.footer a { color: var(--text-white); }

/* ============================================
   CASE PAGE
   ============================================ */
.case-page { padding-top: 120px; padding-bottom: 80px; }
.case-back {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--accent); font-size: 14px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 40px;
    text-decoration: none;
}
.case-back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.case-hero-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; margin-bottom: 48px; border: 1px solid var(--border); max-height: none; }
.case-title { font-size: clamp(32px, 5vw, 52px); font-weight: 900; margin-bottom: 40px; line-height: 1.15; }
.case-content { width: 100%; }
.case-content h3 { font-size: 28px; font-weight: 900; margin-bottom: 12px; margin-top: 40px; color: var(--text-accent); line-height: 1.2; }
.case-content p { font-size: 17px; color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }
.case-content strong { color: var(--text-white); font-weight: 600; }
.case-list { margin: 0 0 12px 0; padding: 0; }
.case-list li {
    font-size: 17px; color: var(--text-muted); line-height: 1.7;
    padding-left: 20px; position: relative; margin-bottom: 6px;
    list-style: none;
}
.case-list li::before {
    content: ''; position: absolute; left: 0; top: 9px;
    width: 6px; height: 6px; background: var(--accent);
}

/* ============================================
   PRIVACY PAGE
   ============================================ */
.privacy-page { padding-top: 120px; padding-bottom: 80px; }
.privacy-page h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; margin-bottom: 40px; line-height: 1.1; }
.privacy-content { width: 100%; }
.privacy-content h2 { font-size: 28px; font-weight: 900; margin-top: 40px; margin-bottom: 12px; color: var(--text-accent); line-height: 1.2; }
.privacy-content p { font-size: 17px; color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }
.privacy-list { margin: 0 0 12px 0; padding: 0; }
.privacy-list li {
    font-size: 16px; color: var(--text-muted); line-height: 1.8;
    padding-left: 20px; position: relative; margin-bottom: 4px;
    list-style: none;
}
.privacy-list li::before {
    content: ''; position: absolute; left: 0; top: 10px;
    width: 6px; height: 6px; background: var(--accent);
}
.privacy-kv { margin: 16px 0; }
.privacy-kv-row {
    display: flex; gap: 12px; margin-bottom: 8px;
    font-size: 16px; color: var(--text-muted); line-height: 1.8;
}
.privacy-kv-label {
    font-weight: 600; color: var(--text-white);
    min-width: 200px; flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .portfolio-card { min-width: calc(50% - 12px); }
    .contact-grid { grid-template-columns: 1.5fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    :root { --cp: 20px; }
    .header-nav {
        display: none; position: fixed; top: 0; left: 0;
        width: 100%; height: 100vh; background: var(--bg-base);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 32px; z-index: 999;
    }
    .header-nav.open { display: flex; }
    .header-nav a { font-size: 20px; }
    .burger { display: flex; z-index: 1001; }
    .burger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
    .burger.open span:nth-child(2) { opacity: 0; }
    .burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .section { padding: 60px 0; }
    .for-whom-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .models-grid { grid-template-columns: 1fr; }
    .portfolio-card { min-width: 100%; }

    .process-grid { grid-template-columns: 1fr; }
    .process-icon { display: none; }
    .process-line { border-left: none; margin-left: 0; padding-left: 0; }

    .hero { min-height: auto; padding-top: 120px; padding-bottom: 40px; }
    .form-row { flex-direction: column; }
    .form-select-group { flex-direction: column; }
    .form-select-btn:not(:last-child) { border-right: 1px solid var(--border); border-bottom: none; }
}
