/* ---------- Themes: light is the default ---------- */
:root {
    --bg: #f6f8fd;
    --bg-alt: #edf1fa;
    --panel: #ffffff;
    --panel-2: #e6ecf8;
    --text: #17213c;
    --muted: #5b6885;
    --accent: #3d7bff;
    --accent-2: #7c4dff;
    --grad: linear-gradient(120deg, #3d7bff, #7c4dff);
    --radius: 16px;
    --shadow: 0 12px 36px rgba(23, 43, 99, .13);
    --border: rgba(23, 33, 60, .09);
    --border-strong: rgba(23, 33, 60, .22);
    --nav-bg: rgba(246, 248, 253, .82);
    --badge-bg: rgba(61, 123, 255, .11);
    --badge-text: #2b62d9;
    --hero-glow-1: rgba(61, 123, 255, .14);
    --hero-glow-2: rgba(124, 77, 255, .12);
    --close-bg: rgba(23, 33, 60, .08);
    --close-bg-hover: rgba(23, 33, 60, .16);
    --backdrop: rgba(18, 26, 48, .55);
}

[data-theme="dark"] {
    --bg: #0b1020;
    --bg-alt: #0f1630;
    --panel: #151d3a;
    --panel-2: #1a2447;
    --text: #e8ecf8;
    --muted: #9aa5c4;
    --accent: #4f8cff;
    --accent-2: #8b5cf6;
    --grad: linear-gradient(120deg, #4f8cff, #8b5cf6);
    --shadow: 0 10px 40px rgba(0, 0, 0, .35);
    --border: rgba(255, 255, 255, .06);
    --border-strong: rgba(255, 255, 255, .25);
    --nav-bg: rgba(11, 16, 32, .8);
    --badge-bg: rgba(79, 140, 255, .12);
    --badge-text: #a9c6ff;
    --hero-glow-1: rgba(79, 140, 255, .18);
    --hero-glow-2: rgba(139, 92, 246, .16);
    --close-bg: rgba(255, 255, 255, .1);
    --close-bg-hover: rgba(255, 255, 255, .2);
    --backdrop: rgba(4, 7, 16, .78);
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; line-height: 1.15; }

img { max-width: 100%; }

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

.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; }

.btn {
    display: inline-block;
    background: var(--grad);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 13px 28px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(61, 123, 255, .35); }
.btn-ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-sm { padding: 9px 20px; font-size: .9rem; }

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.25rem; }
.brand img { height: 36px; width: auto; }
.brand em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.btn { color: #fff; }
.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.theme-toggle:hover { background: var(--close-bg); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 110px 0 90px;
    overflow: hidden;
    background:
        radial-gradient(700px 400px at 15% 0%, var(--hero-glow-1), transparent 60%),
        radial-gradient(700px 400px at 85% 20%, var(--hero-glow-2), transparent 60%);
}
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 800; margin: 8px 0 18px; }
.hero-cta { display: flex; gap: 14px; margin: 30px 0 60px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; max-width: 780px; }
.hero-stats div { border-left: 2px solid var(--border-strong); padding-left: 16px; }
.hero-stats b { display: block; font-family: 'Sora', sans-serif; font-size: 2rem; font-weight: 800; }
.hero-stats b::after { content: "+"; color: var(--accent); }
.hero-stats span { color: var(--muted); font-size: .85rem; }

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 34px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .25s, border-color .25s, box-shadow .25s, background .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(61, 123, 255, .45); box-shadow: var(--shadow); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service { padding: 28px; }
.service .ico { font-size: 1.8rem; margin-bottom: 14px; }
.service h3 { font-size: 1.1rem; margin-bottom: 8px; }
.service p { color: var(--muted); font-size: .93rem; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filters button {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.filters button:hover { color: var(--text); border-color: var(--accent); }
.filters button.active { background: var(--grad); border-color: transparent; color: #fff; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-card { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.project-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--panel-2); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.project-card:hover .project-thumb img { transform: scale(1.05); }
.project-thumb .ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Sora', sans-serif; font-size: 2.6rem; font-weight: 800; color: rgba(255, 255, 255, .9);
}
.project-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body h3 { font-size: 1.12rem; }
.project-body .cat { color: var(--accent); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.project-body p { color: var(--muted); font-size: .9rem; flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge {
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: .74rem;
    font-weight: 500;
}

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.member { padding: 22px 16px; text-align: center; }
.member img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; border: 3px solid rgba(61, 123, 255, .4); }
.member h3 { font-size: .98rem; margin-bottom: 4px; }
.member p { color: var(--muted); font-size: .82rem; }

/* Clients */
.clients-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; align-items: center; }
.clients-grid a { display: block; }
.clients-grid img {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    height: 92px;
    object-fit: contain;
    opacity: .92;
    transition: opacity .2s, transform .2s;
}
.clients-grid img:hover { opacity: 1; transform: translateY(-3px); }

/* Partners */
.partners-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.partner-card { padding: 30px 24px; text-align: center; text-decoration: none; color: var(--text); display: block; }
.partner-logo {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}
.partner-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.partner-name-fallback {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.partner-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.partner-card p { color: var(--muted); font-size: .85rem; }

.store-badges { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #10131c;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 22px;
    border: 1px solid rgba(255, 255, 255, .18);
    transition: transform .2s, box-shadow .2s;
}
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.store-badge .store-ico { font-size: 1.5rem; }
.store-badge small { display: block; font-size: .68rem; opacity: .75; line-height: 1.2; }
.store-badge b { font-size: 1.02rem; font-family: 'Sora', sans-serif; }

/* Contact */
.contact-inner { text-align: center; }
.contact-inner .lead { margin: 0 auto; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 820px; margin: 40px auto 0; }
.contact-card { padding: 30px 20px; text-decoration: none; color: var(--text); }
.contact-card .ico { font-size: 1.7rem; margin-bottom: 10px; }
.contact-card h3 { font-size: 1rem; margin-bottom: 6px; }
.contact-card p { color: var(--muted); font-size: .92rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 34px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); font-size: .88rem; text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: var(--backdrop); backdrop-filter: blur(4px); }
.modal-panel {
    position: relative;
    max-width: 880px;
    margin: 5vh auto;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.modal-close {
    position: sticky;
    top: 14px;
    float: right;
    margin: 14px 18px 0 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 0;
    background: var(--close-bg);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2;
}
.modal-close:hover { background: var(--close-bg-hover); }
.modal-body { padding: 34px 38px 40px; }
.modal-body .cat { color: var(--accent); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.modal-body h2 { font-size: 1.8rem; margin: 6px 0 14px; }
.modal-body .client-line { color: var(--muted); font-size: .92rem; margin: -6px 0 12px; }
.modal-body .client-line b { color: var(--text); font-weight: 600; }
.modal-hero { border-radius: 14px; overflow: hidden; margin: 18px 0; background: var(--panel-2); }
.modal-hero img { width: 100%; display: block; }
.modal-body h4 { font-family: 'Sora', sans-serif; margin: 24px 0 10px; font-size: 1.05rem; }
.modal-body .desc p { color: var(--muted); margin-bottom: 12px; font-size: .96rem; }
.modal-body ul.features { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.modal-body ul.features li { color: var(--muted); font-size: .92rem; padding-left: 22px; position: relative; }
.modal-body ul.features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.modal-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.modal-gallery img { border-radius: 10px; width: 100%; aspect-ratio: 16/10; object-fit: cover; cursor: zoom-in; background: var(--panel-2); }
.modal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.modal-link { margin-top: 26px; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 120;
    background: rgba(8, 12, 24, .92);
    display: none; align-items: center; justify-content: center;
    cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .services-grid, .projects-grid, .contact-cards { grid-template-columns: repeat(2, 1fr); }
    .partners-grid { grid-template-columns: repeat(3, 1fr); }
    .team-grid { grid-template-columns: repeat(3, 1fr); }
    .clients-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 640px) {
    .services-grid, .projects-grid, .contact-cards, .partners-grid { grid-template-columns: 1fr; }
    .team-grid, .clients-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-links {
        display: none;
        position: absolute;
        top: 68px; left: 0; right: 0;
        background: var(--bg-alt);
        flex-direction: column;
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-burger { display: flex; }
    .modal-body { padding: 24px 20px 30px; }
    .modal-body ul.features { grid-template-columns: 1fr; }
    .modal-gallery { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: 70px 0 60px; }
}
