:root {
    --bg: #f4f5f7;
    --bg-alt: #ffffff;
    --text: #10131a;
    --text-soft: #4a5364;
    --accent: #0b1f4d;
    --accent-2: #1f6fff;
    --line: rgba(16, 19, 26, 0.1);
    --glass: rgba(255, 255, 255, 0.68);
    --shadow: 0 20px 48px rgba(16, 19, 26, 0.12);
}

body.dark {
    --bg: #0d1117;
    --bg-alt: #121923;
    --text: #eef4ff;
    --text-soft: #b8c2d8;
    --accent: #90b4ff;
    --accent-2: #7aa1ff;
    --line: rgba(255, 255, 255, 0.12);
    --glass: rgba(19, 25, 35, 0.72);
    --shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top right, rgba(122, 161, 255, 0.12), transparent 40%), var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.35s ease, color 0.35s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    width: min(1140px, calc(100% - 2.5rem));
    margin: 0 auto;
}

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: grid;
    place-items: center;
    z-index: 9999;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(31, 111, 255, 0.25);
    border-top-color: var(--accent-2);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.glass-panel,
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 20px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.brand-mark {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.8rem;
}
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { font-size: 0.95rem; }
.brand-text small { color: var(--text-soft); }

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
}
.site-nav a {
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    color: var(--text-soft);
    font-weight: 500;
}
.site-nav a:hover,
.site-nav a.active {
    background: rgba(31, 111, 255, 0.12);
    color: var(--text);
}

.theme-toggle,
.menu-toggle {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-alt);
    color: var(--text);
    cursor: pointer;
}
.theme-toggle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
}
.menu-toggle {
    display: none;
    width: 42px;
    height: 40px;
    padding: 0;
}
.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 4px auto;
}

.hero {
    min-height: 82svh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(31, 111, 255, 0.12), rgba(11, 31, 77, 0.2));
    transform: translateY(0);
}
.hero-content {
    position: relative;
    z-index: 1;
    padding: 5rem 0;
}
.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-2);
    font-weight: 700;
    font-size: 0.72rem;
}
h1, h2, h3 { line-height: 1.2; margin-top: 0; }
h1 { font-size: clamp(2rem, 6vw, 4rem); max-width: 820px; }
.lead { max-width: 680px; font-size: clamp(1rem, 2.1vw, 1.2rem); color: var(--text-soft); }

.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 12px 24px rgba(31, 111, 255, 0.25);
}
.btn-secondary {
    border-color: var(--line);
    background: var(--bg-alt);
}

.section { padding: 5rem 0; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { max-width: 640px; }

.card-grid {
    display: grid;
    gap: 1rem;
}
.three-col { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.glass-card { padding: 1.5rem; }
.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: rgba(31, 111, 255, 0.15);
    font-weight: 700;
    margin-bottom: 1rem;
}

.accent-section { background: linear-gradient(180deg, transparent, rgba(31, 111, 255, 0.06)); }
.split-layout {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: 1fr;
}
.metric-panel { padding: 1.5rem; display: grid; gap: 1rem; }
.metric-panel div strong { display: block; font-size: 1.7rem; }
.metric-panel div span { color: var(--text-soft); }
.text-link { color: var(--accent-2); font-weight: 600; }

.page-hero { padding: 7rem 0 2rem; }
.small-hero h1 { max-width: 900px; font-size: clamp(1.8rem, 4.5vw, 3rem); }

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}
.project-category {
    color: var(--accent-2);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.contact-layout { align-items: start; }
.contact-meta {
    padding: 0;
    margin: 1rem 0 0;
    list-style: none;
    color: var(--text-soft);
}
.contact-form {
    display: grid;
    gap: 0.75rem;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-alt);
    color: var(--text);
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid rgba(31, 111, 255, 0.35);
    border-color: transparent;
}
.alert {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
}
.alert.success { background: rgba(39, 174, 96, 0.2); border: 1px solid rgba(39, 174, 96, 0.4); }
.alert.error { background: rgba(231, 76, 60, 0.15); border: 1px solid rgba(231, 76, 60, 0.35); }
.alert.warning { background: rgba(241, 196, 15, 0.15); border: 1px solid rgba(241, 196, 15, 0.35); }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.5rem 0 1.6rem;
    margin-top: 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; color: var(--text-soft); }
.footer-bottom {
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.93rem;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-6px); }

@media (max-width: 860px) {
    .menu-toggle { display: inline-block; }
    .site-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        background: var(--glass);
        border: 1px solid var(--line);
        border-radius: 16px;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 0.8rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: 0.25s ease;
    }
    .site-nav.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .site-nav ul { flex-direction: column; }
}

@media (min-width: 768px) {
    .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-layout,
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .split-layout { grid-template-columns: 1.2fr 1fr; }
}
