/* Dark is the site default, whatever the visitor's OS prefers.
   Light applies only when they pick it with the toggle. */
:root {
    --teal: #48c0c8;
    --violet: #6058a0;
    --deep: #086078;

    color-scheme: dark;

    --bg: #10151a;
    --surface: #171e26;
    --border: #28323d;
    --ink: #e8edf2;
    --ink-soft: #a3b1bf;
    --accent: var(--teal);

    /* Soft red for the "Closed" tag on vacancies: a tint to notice, not an alarm. */
    --closed: #f2a3a3;
    --closed-bg: #3a2327;

    --art-bg: transparent;
    --art-border: transparent;
    --hero-art: url(images/hero-dark.webp);
    --team-art: url(images/team-dark.webp);
    --logo-art: url(images/logo-dark.png);
    --contact-art: url(images/contact-dark.webp);
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #f8f9fa;
    --surface: #ffffff;
    --border: #e3e7eb;
    --ink: #1b2733;
    --ink-soft: #5b6b7b;
    --accent: var(--deep);

    --closed: #a83a3a;
    --closed-bg: #fbe9e9;

    --art-bg: #ffffff;
    --art-border: var(--border);
    --hero-art: url(images/hero.webp);
    --team-art: url(images/team.webp);
    --logo-art: url(images/logo.png);
    --contact-art: url(images/contact.webp);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

h1, h2 {
    line-height: 1.15;
    color: var(--ink);
    margin: 0;
}

h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 700; }

p { margin: 16px 0 0; color: var(--ink-soft); }

.lede { font-size: clamp(1.05rem, 2.5vw, 1.3rem); }

.rule {
    width: 72px;
    height: 4px;
    margin-top: 24px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--teal), var(--violet));
}

/* Header — stacked and left-aligned on narrow screens, one row once it fits. */
.site-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 0 8px;
}

@media (min-width: 760px) {
    .site-header { flex-direction: row; align-items: center; gap: 14px 28px; }
    .site-nav { margin-left: auto; }
}

/* The wordmark is line art: a white chip in light mode, bare strokes in dark.
   `align-self` centres it horizontally in the stacked mobile header and
   vertically once the header becomes a row. */
.brand {
    display: block;
    align-self: center;
    width: 132px;
    height: 120px;
    background-color: var(--art-bg);
    background-image: var(--logo-art);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-origin: content-box;
    border: 1px solid var(--art-border);
    border-radius: 14px;
    padding: 8px 14px;
}

/* Two levels of navigation. `.site-nav` in the header moves between pages and is the
   same everywhere; `.page-nav` is the strip under the landing page's header that jumps
   to its sections, and exists only there. */
.site-nav,
.page-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.site-nav a,
.page-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.site-nav a { font-size: 1.05rem; font-weight: 700; }

/* `aria-current` is "page" on the page itself and "true" on Articles while reading one. */
.site-nav a:hover,
.site-nav a[aria-current],
.page-nav a:hover { color: var(--ink); border-bottom-color: var(--teal); }

.page-nav {
    margin-top: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

@media (min-width: 760px) {
    .page-nav { justify-content: flex-end; }
}

.header-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--teal); }

.theme-toggle svg { width: 20px; height: 20px; }

/* The button shows the theme it switches to, so dark-by-default shows the sun. */
.theme-toggle .icon-moon { display: none; }

:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Hero */
.hero {
    display: grid;
    gap: 32px;
    align-items: center;
    padding: 24px 0 8px;
}

@media (min-width: 860px) {
    .hero { grid-template-columns: 1fr 1.05fr; gap: 48px; padding: 40px 0 24px; }
}

/* Illustrations are line art. Light mode sits them on a white card; dark mode uses
   knocked-out copies with no card, so they stop looking like pasted-in rectangles. */
.art {
    background-color: var(--art-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-origin: content-box;
    border: 1px solid var(--art-border);
    border-radius: 14px;
    padding: 12px;
}

.art-hero {
    aspect-ratio: 1100 / 976;
    background-image: var(--hero-art);
}

.art-team {
    aspect-ratio: 1122 / 374;
    background-image: var(--team-art);
}

/* The contact illustration is drawn twice, and the dark copy carries its own gradient
   background instead of a knocked-out one, so it fills the rounded box edge to edge. */
.art-contact {
    aspect-ratio: 1100 / 976;
    background-image: var(--contact-art);
    background-size: cover;
    padding: 0;
}

/* Sections */
section + section { margin-top: 56px; }

main section { scroll-margin-top: 24px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: clamp(24px, 4vw, 40px);
}

.panel p { max-width: 64ch; }

.section-intro { margin-bottom: 28px; }

/* Certifications */
.cert-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.cert-grid li {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}

.cert-grid img {
    flex: 0 0 auto;
    width: 64px;
    height: auto;
}

/* Services */
.service-grid,
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.service-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.service-grid li,
.steps li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
}

.service-grid h3,
.steps h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
}

.service-grid p,
.steps p { margin-top: 8px; font-size: 0.97rem; }

/* Process — numbers come from a counter so the markup stays plain */
.steps { counter-reset: step; }

@media (min-width: 760px) {
    .steps { grid-template-columns: repeat(2, 1fr); }
}

.steps li {
    position: relative;
    padding-left: 70px;
}

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 24px;
    top: 22px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--violet));
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

/* Team — copy runs the full width of the section at every size, with the
   illustration always underneath it. */
.team-copy { margin-bottom: 28px; }

.team-copy p { max-width: none; }

.team-copy p + p { margin-top: 14px; }

/* Contact */
.contact { text-align: center; }

.contact p { margin-left: auto; margin-right: auto; }

/* The office address under the button: plain text, not the browser default italic. */
.contact address { margin-top: 20px; font-style: normal; font-size: 0.95rem; color: var(--ink-soft); }

/* The label is an email address, so the pill has to survive narrow screens:
   it may shrink and, as a last resort, break rather than escape its panel. */
.btn {
    display: inline-block;
    max-width: 100%;
    margin-top: 28px;
    padding: 15px clamp(16px, 5vw, 32px);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal), var(--violet));
    color: #ffffff;
    font-size: clamp(0.85rem, 3.4vw, 1.05rem);
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.btn:hover { filter: brightness(1.08); }

/* Articles — the listing and every article share one narrow reading column. */
.reading {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 24px;
}

.reading .panel { margin-top: 56px; }

/* On the contact page the panel opens the column right under the hero, so it sits closer. */
.reading > .panel:first-child { margin-top: 8px; }

.meta { margin: 0 0 8px; font-size: 0.9rem; }

.back {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.back:hover { border-bottom-color: var(--teal); }

.article-list {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.article-list li {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
}

.article-list li:hover { border-color: var(--teal); }

.article-list h2 { font-size: 1.25rem; line-height: 1.3; }

.article-list a { color: inherit; text-decoration: none; }

/* Stretches the title link over the whole card, so the card is one click target. */
.article-list a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
}

.article-list p:not(.meta) { margin-top: 8px; font-size: 0.97rem; }

/* Long-form copy reads in full-strength ink; the soft tone is kept for the lede and meta. */
.prose { font-size: 1.05rem; }

.prose h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }

.prose h2 { margin-top: 44px; font-size: clamp(1.3rem, 3.4vw, 1.6rem); }

.prose p,
.prose li,
.prose td { color: var(--ink); }

.prose .lede,
.prose .meta { color: var(--ink-soft); }

.prose a,
.reading > p a { color: var(--accent); }

.prose ul,
.prose ol { margin: 16px 0 0; padding-left: 1.3em; }

.prose li + li { margin-top: 8px; }

.prose code,
.prose pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.prose code {
    font-size: 0.88em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 5px;
}

/* Code never wraps; a long line scrolls inside its own block instead of the page. */
.prose pre {
    margin: 20px 0 0;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.5;
    tab-size: 4;
    overflow-x: auto;
}

.prose pre code {
    font-size: inherit;
    background: none;
    border: 0;
    padding: 0;
}

.prose table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: 0.97rem;
}

.prose th,
.prose td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.prose th { color: var(--ink-soft); }

/* Careers — the vacancy list reuses `.article-list` and a vacancy page reuses `.prose`;
   only the open/closed status is its own. */
.status {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 10px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-open { color: var(--accent); }

.status-closed { color: var(--closed); background: var(--closed-bg); }

.prose .notice {
    margin-top: 28px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--violet);
    border-radius: 12px;
}

:is(.btn, .theme-toggle, .site-nav a, .page-nav a, a.brand, .back, .article-list a, .prose a, .reading > p a, .prose pre):focus-visible {
    outline: 3px solid var(--violet);
    outline-offset: 3px;
}

/* Footer */
footer {
    margin-top: 72px;
    padding: 28px 0 40px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--ink-soft);
}

footer a { color: inherit; }

footer address { margin-top: 8px; font-style: normal; }

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