/* ========== CSS Variables & Theme ========== */
:root {
    --bg: #f5f6fa;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --bg-dark: #1a1d2e;
    --text: #1a1d2e;
    --text-secondary: #5a5f7a;
    --text-muted: #8b8fa3;
    --heading: #0d0f1a;
    --border: #e2e4ed;
    --border-light: #f0f1f5;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --accent: #8b5cf6;
    --gold: #d4a853;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%);
    --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.1);
    --shadow-glow: 0 0 30px rgba(37,99,235,0.25), 0 0 60px rgba(139,92,246,0.15);
    --shadow-gold: 0 0 25px rgba(212,168,83,0.3);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0d0f1a;
    --bg-alt: #131628;
    --bg-card: #1a1d2e;
    --bg-dark: #0a0c14;
    --text: #e2e4ed;
    --text-secondary: #a0a4b8;
    --text-muted: #6b6f85;
    --heading: #f0f1f5;
    --border: #2a2d3e;
    --border-light: #1f2133;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(37,99,235,0.4), 0 0 60px rgba(139,92,246,0.25);
    --shadow-gold: 0 0 25px rgba(212,168,83,0.4);
}

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

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

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

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

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

a:hover {
    color: var(--primary-light);
}

/* ========== Container ========== */
.container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== Header ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background var(--transition), border-color var(--transition);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--heading);
}

.logo__icon {
    font-size: 28px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo__text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo__accent {
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav__link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav__link:hover {
    color: var(--primary);
    background: rgba(37,99,235,0.06);
}

.header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__phone {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    white-space: nowrap;
}

.header__phone i {
    color: var(--primary);
    margin-right: 6px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* ========== Hero ========== */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-dark);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 80% at 20% 50%, rgba(37,99,235,0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(139,92,246,0.1) 0%, transparent 50%),
        radial-gradient(ellipse 40% 60% at 50% 80%, rgba(212,168,83,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 2;
    padding: 100px 24px 60px;
    text-align: center;
}

.hero__title {
    font-size: clamp(36px, 6vw, 60px);
    font-weight: 800;
    line-height: 1.15;
    color: #f0f1f5;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero__accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 18px;
    color: #a0a4b8;
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero__stats {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 0 24px 80px;
}

.stat {
    text-align: center;
}

.stat__number {
    display: block;
    font-size: 40px;
    font-weight: 800;
    color: #f0f1f5;
    letter-spacing: -1px;
}

.stat__label {
    font-size: 14px;
    color: #a0a4b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 36px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn--primary {
    background: var(--gradient-primary);
    color: #fff;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.btn--glow {
    box-shadow: 0 0 20px rgba(37,99,235,0.3);
}

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

/* ========== Section Titles ========== */
.section-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: var(--heading);
    text-align: center;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    max-width: 600px;
    margin: 0 auto 48px;
}

/* ========== Services ========== */
.services {
    padding: 100px 0;
}

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

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}

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

.service-card:hover::before {
    opacity: 1;
}

.service-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.service-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-card__title {
    font-size: 19px;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 10px;
}

.service-card__desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.service-card__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-card__list li {
    font-size: 13px;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
}

.service-card__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.service-card--more {
    border-color: var(--accent);
}

.service-card--more::before {
    background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
}

.service-card--more .service-card__list li::before {
    background: var(--accent);
}

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

.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about__lead {
    font-size: 18px;
    color: var(--heading);
    margin-bottom: 16px;
    line-height: 1.5;
}

.about__text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.7;
}

.about__features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.about__features li {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about__features i {
    color: #10b981;
    font-size: 16px;
}

.about__map-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about__map-title i {
    color: var(--primary);
}

.map-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

.map-wrapper iframe {
    display: block;
}

/* ========== Letters ========== */
.letters {
    padding: 100px 0;
}

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

.letter-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition);
    aspect-ratio: 1.3 / 1;
}

.letter-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.letter-card:hover img {
    transform: scale(1.05);
}

/* ========== Callback ========== */
.callback {
    padding: 80px 0 100px;
    background: var(--bg-alt);
    transition: background var(--transition);
}

.callback__card {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.callback__card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.callback__card:hover::after {
    opacity: 1;
}

.callback__card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.callback__title {
    font-size: 28px;
    font-weight: 800;
    color: var(--heading);
    text-align: center;
    margin-bottom: 8px;
}

.callback__subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.callback__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: #ef4444;
}

.form-input-wrapper {
    position: relative;
}

.form-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color var(--transition);
}

.form-icon--top {
    top: 16px;
    transform: none;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input:focus + .form-icon,
.form-input:focus ~ .form-icon {
    color: var(--primary);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b8fa3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 12px;
    cursor: pointer;
    padding-right: 48px;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    padding-top: 14px;
}

.form-agreement {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: -4px;
}

.form-agreement a {
    color: var(--primary);
    text-decoration: underline;
}

/* ========== Contact ========== */
.contact {
    padding: 100px 0;
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact__info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.contact-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateX(4px);
}

.contact-item__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.contact-item__text h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 4px;
}

.contact-item__text p,
.contact-item__text a {
    font-size: 15px;
    color: var(--text-secondary);
    display: block;
}

.contact-item__text a:hover {
    color: var(--primary);
}

.contact__map .map-wrapper {
    height: 100%;
}

.contact__map .map-wrapper iframe {
    height: 100%;
    min-height: 450px;
}

/* ========== Footer ========== */
.footer {
    background: var(--bg-dark);
    color: #a0a4b8;
    padding: 60px 0 0;
    transition: background var(--transition);
}

.footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
}

.footer__desc {
    font-size: 14px;
    color: #6b6f85;
    margin-top: 12px;
    max-width: 320px;
    line-height: 1.6;
}

.footer__title {
    font-size: 15px;
    font-weight: 700;
    color: #e2e4ed;
    margin-bottom: 16px;
}

.footer__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__links a {
    font-size: 14px;
    color: #6b6f85;
    transition: color var(--transition);
}

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

.footer__bottom {
    border-top: 1px solid #2a2d3e;
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: #6b6f85;
}

.logo--footer .logo__text {
    color: #e2e4ed;
}

/* ========== Lightbox ========== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lightbox--active {
    opacity: 1;
    visibility: visible;
}

.lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.lightbox--active .lightbox__img {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 10;
}

.lightbox__close:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

/* ========== Form Success Message ========== */
.form-success {
    display: none;
    text-align: center;
    padding: 32px 0;
}

.form-success--active {
    display: block;
}

.form-success__icon {
    font-size: 56px;
    color: #10b981;
    margin-bottom: 16px;
}

.form-success__text {
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .letters__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .about__grid,
    .contact__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .header__phone {
        font-size: 12px;
    }

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

    .letters__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero__stats {
        gap: 32px;
    }

    .stat__number {
        font-size: 28px;
    }

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

    .callback__card {
        padding: 32px 24px;
    }

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

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

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

/* ========== Animations ========== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.letter-card,
.contact-item {
    animation: fadeUp 0.6s ease backwards;
}

.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.15s; }
.service-card:nth-child(4) { animation-delay: 0.2s; }
.service-card:nth-child(5) { animation-delay: 0.25s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }
.service-card:nth-child(7) { animation-delay: 0.35s; }
.service-card:nth-child(8) { animation-delay: 0.4s; }
.service-card:nth-child(9) { animation-delay: 0.45s; }
