:root {
    /* Colors - Modern Deep Tech */
    --bg-dark: #0f172a;
    --bg-light: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.7);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));

    --white: #ffffff;
    --nav-bg: rgba(15, 23, 42, 0.85);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

    /* Layout */
    --header-h: 76px;
    --spacer-sm: 1.5rem;
    --spacer-md: 3rem;
    --spacer-lg: 5rem;
    --spacer-xl: 7rem;

    /* Decor */
    --radius: 12px;
    --card-border: 1px solid rgba(255, 255, 255, 0.07);
    --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.55);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.08), transparent 25%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4 {
    color: var(--white);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

a {
    text-decoration: none;
    color: var(--accent-primary);
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

ul,
ol {
    list-style: none;
}

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

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hidden SVG sprite */
.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Honeypot - hidden from humans, catches bots */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ---------- Accessibility ---------- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    background: var(--accent-primary);
    color: #04121f;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 6px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Scroll reveal (JS only; no-JS shows everything) ---------- */
.js .section,
.js .philosophy-card,
.js .service-card,
.js .process-step,
.js .cert-group {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.js .is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
        border-color 0.25s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #04121f;
    border: none;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--white);
    padding: 0.7rem 1.4rem;
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.12);
}

.btn-block {
    display: block;
    width: 100%;
    border: none;
    font-size: 1.05rem;
}

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

/* ---------- Header ---------- */
.header {
    height: var(--header-h);
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 44px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.04);
}

.nav {
    display: flex;
    gap: 2.25rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--white);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 26px;
    height: 2px;
    background-color: var(--white);
    margin: 6px 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: calc(var(--header-h) + 2rem);
    padding-bottom: 4rem;
}

.hero-content {
    max-width: 950px;
    z-index: 2;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.hero-headline {
    font-size: clamp(2.25rem, 5.5vw, 5rem);
    margin-bottom: 1.75rem;
    line-height: 1.12;
}

.hero-subheadline {
    font-size: clamp(1rem, 2vw, 1.3rem);
    max-width: 650px;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-trust li {
    position: relative;
    padding-left: 1.1rem;
}

.hero-trust li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.hero-trust strong {
    color: var(--white);
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 80%);
    pointer-events: none;
}

/* ---------- Sections ---------- */
.section {
    padding: var(--spacer-xl) 0;
}

.section-header {
    margin-bottom: var(--spacer-lg);
}

.section-title {
    font-size: clamp(1.9rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0;
}

/* ---------- Philosophy ---------- */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
}

.philosophy-card {
    background-color: var(--bg-glass);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: var(--card-border);
}

.philosophy-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.philosophy-card.highlight {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

.philosophy-card h3 {
    margin-bottom: 1.25rem;
    font-size: 1.35rem;
}

.philosophy-card p:last-child {
    margin-bottom: 0;
}

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1.75rem;
}

.service-card {
    background: var(--bg-glass);
    backdrop-filter: blur(5px);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: var(--card-border);
    transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease,
        opacity 0.6s ease-out;
}

.service-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
    transform: translateY(-5px);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin-bottom: 1.75rem;
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: var(--accent-primary);
}

.service-icon svg {
    width: 30px;
    height: 30px;
}

.service-card h3 {
    font-size: 1.3rem;
}

.service-intro {
    margin-bottom: 1.5rem;
}

.service-list {
    font-size: 0.95rem;
}

.service-list li {
    margin-bottom: 0.9rem;
    padding-left: 1.6rem;
    position: relative;
    color: var(--text-secondary);
}

.service-list li:last-child {
    margin-bottom: 0;
}

.service-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent-gradient);
}

.service-list strong {
    color: var(--white);
    font-weight: 600;
}

/* ---------- Expertise ---------- */
.matrix-container {
    background: var(--bg-glass);
    border-radius: var(--radius);
    border: var(--card-border);
    padding: 0.5rem;
    overflow-x: auto;
}

.expertise-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.expertise-table th,
.expertise-table td {
    padding: 1.35rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.expertise-table thead th {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.expertise-table tbody th {
    color: var(--white);
    font-weight: 600;
    white-space: nowrap;
}

.expertise-table td:last-child {
    color: var(--text-secondary);
    white-space: nowrap;
}

.expertise-table tbody tr:last-child th,
.expertise-table tbody tr:last-child td {
    border-bottom: none;
}

.expertise-table tbody tr:hover th,
.expertise-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.025);
}

.tech-tag {
    display: inline-block;
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    margin: 0 4px 5px 0;
}

/* ---------- About / Certifications ---------- */
.about-intro {
    max-width: 780px;
    margin-bottom: 3.5rem;
}

.about-intro p {
    font-size: 1.08rem;
}

.about-intro strong {
    color: var(--white);
    font-weight: 600;
}

.cert-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

/* Four groups balance as 2x2 rather than 3 + 1 orphan */
@media (min-width: 900px) {
    .cert-groups {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cert-group {
    background: var(--bg-glass);
    border: var(--card-border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: border-color 0.35s ease, opacity 0.6s ease-out, transform 0.6s ease-out;
}

.cert-group:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

.cert-group h3 {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cert-glyph {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--accent-primary);
}

.cert-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.85rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cert-list li:last-child {
    margin-bottom: 0;
}

.cert-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

/* ---------- Process ---------- */
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.process-step {
    position: relative;
    padding: 2rem 1.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    transition: border-color 0.3s ease, background 0.3s ease, opacity 0.6s ease-out,
        transform 0.6s ease-out;
}

.process-step:hover {
    border-left-color: var(--accent-primary);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent);
}

.step-number {
    display: block;
    font-family: var(--font-mono);
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.9rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.process-step h3 {
    font-size: 1.2rem;
}

.process-step p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: start;
}

.contact-headline {
    font-size: clamp(1.9rem, 4vw, 3rem);
    background: linear-gradient(180deg, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.25rem;
}

.contact-points {
    margin-bottom: 2.5rem;
}

.contact-points li {
    position: relative;
    padding-left: 1.9rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.contact-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 18px;
    height: 10px;
    border-left: 2px solid var(--accent-primary);
    border-bottom: 2px solid var(--accent-primary);
    transform: rotate(-45deg) scale(0.8);
}

.contact-direct {
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.contact-direct p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.contact-direct strong {
    color: var(--white);
}

.contact-form-wrap {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--card-border);
    border-radius: var(--radius);
    padding: 2.5rem;
}

.form-title {
    font-size: 1.3rem;
    margin-bottom: 1.75rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.req {
    color: var(--accent-primary);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--accent-primary) 50%),
        linear-gradient(135deg, var(--accent-primary) 50%, transparent 50%);
    background-position: calc(100% - 20px) 1.15rem, calc(100% - 14px) 1.15rem;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #64748b;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: #f87171;
}

.field-error {
    display: block;
    color: #fca5a5;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.form-note {
    font-size: 0.8rem;
    text-align: center;
    margin: 1rem 0 0;
}

.form-status {
    margin: 1rem 0 0;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    font-size: 0.92rem;
    display: none;
}

.form-status.is-success {
    display: block;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--text-primary);
}

.form-status.is-error {
    display: block;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fecaca;
}

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4rem 0 2rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand img {
    height: 42px;
    width: auto;
    margin-bottom: 1.25rem;
}

.footer-brand p {
    font-size: 0.92rem;
    max-width: 340px;
    margin-bottom: 0;
}

.footer-nav h2,
.footer-contact h2 {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-secondary);
    margin-bottom: 1.25rem;
}

.footer-nav a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 0.65rem;
}

.footer-nav a:hover,
.footer-contact a:hover {
    color: var(--accent-primary);
}

.footer-contact p {
    font-size: 0.92rem;
    margin-bottom: 0.65rem;
}

.footer-contact a {
    color: var(--text-secondary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-bottom p {
    font-size: 0.85rem;
    margin-bottom: 0;
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 64px;
        --spacer-xl: 4.5rem;
        --spacer-lg: 3rem;
    }

    .container {
        padding: 0 1.25rem;
    }

    .logo img {
        height: 36px;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Mobile drawer - driven by a class so it cannot leak to desktop */
    .nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0;
        width: 100%;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 1.25rem;
        /* Solid, and no backdrop-filter: nesting one inside the header's own
           backdrop-filter makes the panel composite as translucent in Chromium. */
        background-color: var(--bg-dark);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 40px -14px rgba(2, 12, 27, 0.8);
    }

    .nav.is-open {
        display: flex;
    }

    .nav-link {
        padding: 0.9rem 0.5rem;
        font-size: 1.05rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-btn {
        margin-top: 0.9rem;
        text-align: center;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--header-h) + 3rem);
        padding-bottom: 3.5rem;
    }

    .hero-cta-group .btn {
        width: 100%;
    }

    .hero-trust {
        gap: 0.5rem 1.5rem;
        font-size: 0.85rem;
    }

    .philosophy-card,
    .service-card,
    .contact-form-wrap,
    .cert-group {
        padding: 1.75rem;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .process-step {
        padding: 1.5rem 1.25rem;
    }

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .section,
    .js .philosophy-card,
    .js .service-card,
    .js .process-step,
    .js .cert-group {
        opacity: 1;
        transform: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
