:root {
    --primary-blue: #4a9eff;
    --accent-blue: #6bb6ff;
    --light-blue: #1a2332;
    --text-dark: #e0e6ff;
    --text-muted: #7d8aa8;
    --bg-white: #0d1117;
    --border-color: #2d3748;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    /* Stop iOS inflating body text when a phone is turned sideways. */
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.6;
    /* A long unbroken token (URL, email) must wrap rather than widen the page. */
    overflow-wrap: break-word;
}

img,
video,
iframe {
    max-width: 100%;
}

/* The hidden attribute has to beat any display rule set further down, or
   scripts that hide a finished form get ignored. */
[hidden] {
    display: none !important;
}

a {
    color: var(--primary-blue);
}

header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 0.65rem 2rem;
    flex-wrap: wrap;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.brand-logo-mark {
    height: 48px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    display: block;
    /* Vertical padding rather than margin, so the tap target is a full-height
       strip instead of just the glyphs. */
    padding: 0.4rem 0;
    text-decoration: none;
    /* The header bar stays white regardless of theme, so this is pinned to
       black rather than the theme text color, which turns near-white (and
       invisible) in dark mode. */
    color: #000000;
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--primary-blue);
}

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

/* Contact popover in the nav — a lightweight name+email capture that lives
   on every page, rather than a page-level form visitors have to navigate to. */
.nav-contact-item {
    position: relative;
}

.nav-contact-toggle {
    font: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0;
    color: #000000;
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-contact-toggle:hover,
.nav-contact-toggle[aria-expanded="true"] {
    color: var(--primary-blue);
}

.nav-contact-panel {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(270px, calc(100vw - 2.5rem));
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.35);
    z-index: 200;
}

.nav-contact-panel form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-contact-panel input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-dark);
    background-color: var(--light-blue);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.nav-contact-panel input:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 1px;
}

.nav-contact-panel .btn {
    width: 100%;
    padding: 0.55rem 0.9rem;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
}

.nav-contact-panel .btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.nav-contact-status:empty {
    display: none;
}

.nav-contact-status {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.nav-contact-status.is-ok {
    color: var(--primary-blue);
    font-weight: 600;
}

.nav-contact-status.is-error {
    color: #b3261e;
}

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

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary-blue);
    color: var(--bg-white);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: var(--accent-blue);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--light-blue);
}

/* Sections */
section {
    padding: 3.5rem 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 82, 204, 0.3);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--light-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

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

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Page intro (sub-pages) */
.page-intro {
    padding: 3rem 0 0;
}

.page-intro h1 {
    font-size: 2.1rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.page-intro p {
    color: var(--text-muted);
    max-width: 720px;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Phones -------------------------------------------------------------
   The desktop gutters and section padding eat roughly a third of a 390px
   screen. Every page-specific layout already collapses to a single column
   by this width, so this only reclaims spacing. */
@media (max-width: 600px) {
    .container,
    .nav-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .nav-container {
        gap: 0.5rem 1.25rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .brand-logo {
        font-size: 1.2rem;
    }

    section {
        padding: 2.25rem 0;
    }

    .section-header {
        margin-bottom: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card-icon {
        margin-bottom: 1rem;
    }

    .grid-auto {
        gap: 1.25rem;
    }

    .page-intro {
        padding-top: 2rem;
    }

    .page-intro h1 {
        font-size: 1.8rem;
    }

    footer {
        padding: 2.25rem 0;
    }
}
