/* =============================
   Personal Shape — Desktop + Adaptive
   ============================= */

/* ---------- Base / Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    color: var(--text);
    background: var(--page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Tokens ---------- */
:root {
    --page: #f6f7fb;
    --text: #0f172a;
    --muted: #475569;
    --nav-bg: #ffffffee;
    --card: #ffffff;
    --primary: #7c3aed;
    --primary-2: #6366f1;
    --hero-from: #3b82f6;
    --hero-to: #a855f7;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 6px 20px rgba(2, 6, 23, .08);
    --shadow-lg: 0 30px 60px rgba(2, 6, 23, .15);
    --ring: 0 0 0 4px rgba(99, 102, 241, .15);
}

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
}

section {
    scroll-margin-top: 96px;
}

/* ---------- Навигация ---------- */
#navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: saturate(120%) blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    font-weight: 800;
    font-size: 28px;
    letter-spacing: .2px;
    line-height: 1;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 36px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-weight: 600;
    color: #111827;
    padding: 10px 0;
    position: relative;
    transition: color .2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    border-radius: 999px;
    transition: width .25s ease;
}

.nav-links a:hover {
    color: #0b1324;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Бургер (скрыт на ПК) */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 6px;
    cursor: pointer;
}

.hamburger {
    display: block;
    width: 26px;
    height: 2px;
    margin: 6px 0;
    background: #0f172a;
    border-radius: 999px;
    transition: transform .25s ease, opacity .25s ease;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------- HERO (#home) ---------- */
#home {
    position: relative;
    min-height: 92vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(1200px 800px at 90% 90%, rgba(255, 255, 255, .08), transparent 60%),
        linear-gradient(135deg, rgba(59, 130, 246, .95), rgba(168, 85, 247, .95));
}

#home::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .15) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: .25;
    pointer-events: none;
}

.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    max-width: 980px;
    padding: 0 28px;
}

.hero .eyebrow {
    margin: 0 0 8px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .9;
}

.hero h1 {
    margin: 0 0 22px;
    font-weight: 900;
    letter-spacing: .2px;
    line-height: 1.05;
    font-size: clamp(48px, 7.5vw, 92px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .28);
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .1));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .08);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    filter: saturate(105%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

/* ---------- Titles ---------- */
.section-title {
    margin: 0 0 18px;
    font-size: 44px;
    font-weight: 800;
    text-align: center;
    color: var(--primary);
}

.section-title::after {
    content: "";
    display: block;
    width: 84px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

/* ---------- About ---------- */
#about {
    background: var(--page);
    padding: 100px 0 120px;
}

.about-grid {
    margin-top: 34px;
    display: grid;
    grid-template-columns: 1.05fr 1.25fr;
    gap: 48px;
    align-items: center;
}

.about-image img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.about-text p {
    font-size: 18px;
    color: var(--muted);
}

.about-text p+p {
    margin-top: 12px;
}

/* ---------- Portfolio ---------- */
#portfolio {
    background: var(--page);
    padding: 90px 0 140px;
}

.gallery {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
}

.gallery img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    filter: saturate(96%);
    transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
    background: var(--card);
}

.gallery img:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    filter: saturate(105%);
}

/* ---------- Contact ---------- */
#contact {
    position: relative;
    padding: 120px 0 140px;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(900px 700px at 12% 15%, rgba(255, 255, 255, .08), transparent 60%),
        radial-gradient(1100px 800px at 88% 88%, rgba(255, 255, 255, .06), transparent 60%),
        linear-gradient(135deg, rgba(67, 56, 202, .95), rgba(168, 85, 247, .95));
}

#contact::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: .22;
    pointer-events: none;
}

/* Карточка формы */
.contact-card {
    position: relative;
    z-index: 1;
    margin: 28px auto 0;
    max-width: 860px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    padding: 28px;
}

/* Сама форма */
.contact-form {
    color: #0f172a;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 8px;
    opacity: .9;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(2, 6, 23, .12);
    border-radius: 16px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.form-field textarea {
    resize: vertical;
    min-height: 140px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #94a3b8;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--primary-2);
    box-shadow: var(--ring);
}

/* Кнопка в форме */
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.form-actions .btn {
    border-color: rgba(99, 102, 241, .35);
    background: linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .12));
    color: #fff;
}

/* ---------- Accessibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-2);
    outline-offset: 3px;
}

/* ===================================
   Адаптив
   =================================== */

/* Планшет ≤ 1024px */
@media (max-width: 1024px) {
    .nav-links {
        gap: 24px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .about-image {
        max-width: 520px;
        margin: 0 auto;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

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

/* Мобильные ≤ 768px */
@media (max-width: 768px) {
    .content {
        padding: 0 20px;
    }

    /* Бургер показываем, меню прячем */
    .mobile-menu-toggle {
        display: inline-block;
    }

    .nav-links {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--nav-bg);
        display: none;
        flex-direction: column;
        gap: 4px;
        padding: 12px 20px 16px;
        border-bottom: 1px solid rgba(15, 23, 42, .06);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li a {
        padding: 10px 6px;
    }

    .hero h1 {
        font-size: clamp(34px, 9vw, 48px);
    }

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

    .contact-card {
        padding: 20px;
    }
}