/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    --bg:          #0a0c10;
    --surface:     #12151c;
    --surface-2:   #181c26;
    --border:      #1e2435;
    --border-2:    #2a3148;
    --accent:      #4f8ef7;
    --accent-2:    #00c9a7;
    --accent-glow: rgba(79, 142, 247, 0.15);
    --text:        #dde1ec;
    --text-2:      #7c879d;
    --text-3:      #3e4a5c;
    --radius:      10px;
    --radius-lg:   18px;
    --shadow:      0 4px 24px rgba(0,0,0,0.4);
    --transition:  0.22s ease;
    --max-width:   1160px;
    --header-h:    84px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition), opacity var(--transition);
}
a:hover { color: #7aabff; }

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

ul { list-style: none; }

/* ============================================================
   Layout Utilities
   ============================================================ */
.container {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section {
    padding-block: clamp(5rem, 10vw, 8rem);
}

.section-divider {
    border: none;
    height: 1px;
    background: var(--border);
    max-width: var(--max-width);
    margin-inline: auto;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-eyebrow, .hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: #6b9fff;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79, 142, 247, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border-2);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-3);
    background: var(--surface);
}

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

/* ============================================================
   Footer — language / flag switcher
   ============================================================ */
.footer-lang {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.footer-lang-link {
    display: inline-flex;
    align-items: center;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.38;
    transition: opacity var(--transition), transform var(--transition);
    text-decoration: none;
    color: inherit;
}
.footer-lang-link:hover  { opacity: 0.72; transform: scale(1.1); color: inherit; }
.footer-lang-link.active { opacity: 1; }

/* Half US 🇺🇸 + half UK 🇬🇧 combined flag for the EN option */
.flag-combo {
    display: inline-block;
    position: relative;
    width: 1.33em;
    height: 1em;
    overflow: hidden;
    vertical-align: middle;
}
.flag-combo > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    line-height: 1;
}
.flag-combo > span:first-child { clip-path: inset(0 50% 0 0); }
.flag-combo > span:last-child  { clip-path: inset(0 0 0 50%); }

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity var(--transition);
}
.logo:hover { opacity: 0.8; }

.logo svg {
    height: 74px;
    width: auto;
    display: block;
    overflow: visible;
}

.footer-brand .logo svg {
    height: 58px;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.45rem 0.85rem;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--surface);
}

.btn-nav {
    margin-left: 0.5rem;
    background: var(--accent);
    color: #fff !important;
    padding: 0.45rem 1.1rem;
}
.btn-nav:hover { background: #6b9fff; }
.btn-nav.active { background: #6b9fff; }

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    padding-block: clamp(5rem, 12vw, 9rem);
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-eyebrow { display: block; }

.hero-headline {
    margin-bottom: 1.25rem;
    color: var(--text);
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-2);
    max-width: 480px;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Hero visual */
.hero-visual {
    position: relative;
    height: 340px;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 36px 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}
.hero-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 60% 40%, var(--accent-glow) 0%, transparent 60%);
}

.hero-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
}
.card-icon { font-size: 1rem; color: var(--accent); }

.card-1 { top: 16%;  left: 10%; }
.card-2 { top: 44%;  right: 8%; }
.card-3 { bottom: 16%; left: 20%; }

/* ============================================================
   Services Grid (home)
   ============================================================ */
.section-header {
    text-align: center;
    max-width: 640px;
    margin-inline: auto;
    margin-bottom: 3.5rem;
}
.section-sub {
    color: var(--text-2);
    font-size: 1.05rem;
    margin-top: 0.75rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.service-card:hover {
    border-color: var(--border-2);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.service-icon {
    width: 56px;
    height: 56px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.service-card h3 { margin-bottom: 0.5rem; }
.service-card p { color: var(--text-2); font-size: 0.95rem; margin-bottom: 1.25rem; }

.card-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
}
.card-link:hover { color: #7aabff; }

/* ============================================================
   CTA Section
   ============================================================ */
.section-cta { padding-top: 0; }

.cta-box {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-box::before {
    content: '';
    position: absolute;
    top: -60%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}
.cta-box h2 { margin-bottom: 0.75rem; }
.cta-box p { color: var(--text-2); margin-bottom: 1.75rem; font-size: 1.05rem; }

/* ============================================================
   Page Hero (inner pages)
   ============================================================ */
.page-hero {
    padding-block: clamp(4rem, 8vw, 7rem);
    border-bottom: 1px solid var(--border);
}
.page-hero h1 { margin-bottom: 1rem; }
.page-hero-sub {
    font-size: 1.1rem;
    color: var(--text-2);
    max-width: 560px;
}

/* ============================================================
   Services (detail page)
   ============================================================ */
.service-detail {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: start;
}
.service-detail.reverse {
    grid-template-columns: 1fr auto;
    direction: ltr;
}

.service-detail-content h2 { margin-bottom: 1rem; }
.service-detail-content > p { color: var(--text-2); margin-bottom: 1.5rem; }

.feature-list {
    margin-bottom: 2rem;
}
.feature-list li {
    padding: 0.4rem 0;
    padding-left: 1.4rem;
    color: var(--text-2);
    font-size: 0.95rem;
    position: relative;
}
.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.service-detail-badges {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
}

.tech-badge {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.tech-badge strong { font-size: 0.95rem; color: var(--text); }
.tech-badge span { font-size: 0.8rem; color: var(--text-2); }

/* ============================================================
   About Page
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-content h2 { margin-bottom: 1.25rem; }
.about-content p {
    color: var(--text-2);
    margin-bottom: 1rem;
}

.about-values {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 1rem;
}

.value-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.value-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-top: 2px;
}
.value-item h4 { margin-bottom: 0.2rem; }
.value-item p { color: var(--text-2); font-size: 0.9rem; margin: 0; }

/* ============================================================
   Contact Page
   ============================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h2 { margin-bottom: 1rem; }
.contact-info > p { color: var(--text-2); margin-bottom: 2rem; }

.contact-item {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.contact-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}
.contact-item a, .contact-item span { color: var(--text); font-size: 0.95rem; }

/* Form */
.contact-form-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-3);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
}

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

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.alert-success {
    background: rgba(0, 201, 167, 0.1);
    border: 1px solid rgba(0, 201, 167, 0.3);
    color: var(--accent-2);
}
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 4rem 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { color: var(--text-2); font-size: 0.9rem; max-width: 240px; }
.footer-brand .logo-wordmark { font-size: 2rem; }

.footer-links h4 {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 1rem;
}
.footer-links ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--text-2); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }

.footer-contact h4 {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 1rem;
}
.footer-contact p { font-size: 0.9rem; }
.footer-contact a { color: var(--text-2); }
.footer-contact a:hover { color: var(--text); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}
.footer-bottom p { color: var(--text-3); font-size: 0.85rem; }

/* ============================================================
   404 Page
   ============================================================ */
.error-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    padding: 2rem;
}
.error-code {
    font-size: 7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.error-page h1 { font-size: 1.8rem; }
.error-page p { color: var(--text-2); margin-bottom: 0.5rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .services-grid { grid-template-columns: 1fr; }

    .hero .container { grid-template-columns: 1fr; }
    .hero-visual { display: none; }

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

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

    .service-detail,
    .service-detail.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    .service-detail-badges { flex-direction: row; flex-wrap: wrap; min-width: unset; }
    .tech-badge { flex: 1; min-width: 140px; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
    .site-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.25rem;
        display: none;
    }
    .site-nav.open { display: flex; }
    .nav-link { padding: 0.75rem 1rem; }
    .btn-nav { margin-left: 0; text-align: center; }

    .nav-toggle { display: flex; }

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

    .contact-form-wrap { padding: 1.5rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }
}
