/* ==========================================================================
   Ghafari v2 — base: tokens, font, reset, typography, layout primitives.
   Reference: design/DESIGN.md (ink navy on cool marble), adapted to the logo colours.
   No build step: this file is served as-is (the host has no npm).
   ========================================================================== */

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../../fonts/v2/manrope-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../../fonts/v2/manrope-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Ink and surfaces (design/DESIGN.md) */
    --ink: #0b3558;
    --slate: #476788;
    --mist: #a6bbd1;
    --cloud: #f8f9fb;
    --paper: #ffffff;
    --pebble: #f0f3f8;
    --hairline: #d4e0ed;

    /* Brand — sampled from the logo (#0064B6 blue, #0DAE00 green) */
    --brand: #0064b6;
    --brand-strong: #00518f;
    --brand-soft: #e6f0fa;
    --brand-ink: #004a87;
    --green: #0dae00;
    --green-ink: #0a7a00;
    --green-soft: #e7f6e5;
    --danger: #b42318;
    --danger-soft: #fdecea;

    --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Type scale: fluid between a 375px phone and a 1280px desktop */
    --text-xs: 0.8125rem;
    --text-sm: 0.9375rem;
    --text-base: 1rem;
    --text-lg: clamp(1.0625rem, 1.02rem + 0.2vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.625rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.9vw, 3.125rem);
    --text-display: clamp(2.375rem, 1.6rem + 3.9vw, 4.5rem);

    /* Spacing: 8px base */
    --s1: 0.5rem;
    --s2: 1rem;
    --s3: 1.5rem;
    --s4: 2rem;
    --s5: 3rem;
    --s6: 4rem;
    --section: clamp(3.5rem, 2rem + 6vw, 7rem);
    --gutter: clamp(1rem, 0.5rem + 2.4vw, 2rem);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;

    /* Blue-tinted elevation, never neutral black */
    --shadow-sm: 0 1px 2px rgba(71, 103, 136, 0.06), 0 4px 10px rgba(71, 103, 136, 0.05);
    --shadow-md: 0 4px 5px rgba(71, 103, 136, 0.04), 0 8px 15px rgba(71, 103, 136, 0.04), 0 15px 30px rgba(71, 103, 136, 0.06);
    --shadow-lg: 0 4px 5px rgba(71, 103, 136, 0.04), 0 8px 15px rgba(71, 103, 136, 0.03), 0 30px 50px rgba(71, 103, 136, 0.1);

    --container: 1200px;
    --header-h: 76px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background: var(--cloud);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.65;
    font-weight: 450;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

body.nav-open {
    overflow: hidden;
}

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

img {
    height: auto;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0 0 var(--s2);
    color: var(--ink);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 { font-size: var(--text-display); letter-spacing: -0.03em; line-height: 1.06; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: var(--text-lg); line-height: 1.3; letter-spacing: -0.01em; }

p {
    margin: 0 0 var(--s2);
    text-wrap: pretty;
}

a {
    color: var(--brand);
    text-decoration: none;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--brand-strong);
}

ul,
ol {
    margin: 0;
    padding: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

/* No double-tap zoom delay on controls; the tap flash uses the brand blue instead of the browser grey. */
a,
button,
summary,
input,
select,
textarea,
label {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 100, 182, 0.15);
}

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--brand);
    color: #fff;
}

.skip-link {
    position: absolute;
    left: var(--s2);
    top: -100px;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.skip-link:focus {
    top: var(--s2);
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Layout primitives ---- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: calc(820px + var(--gutter) * 2);
}

.section {
    padding-block: var(--section);
}

.section--tight {
    padding-block: calc(var(--section) * 0.6);
}

.section--white {
    background: var(--paper);
}

.section--ink {
    background: var(--ink);
    color: #fff;
}

.section--ink h2,
.section--ink h3 {
    color: #fff;
}

.section-head {
    max-width: 680px;
    margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head h2 {
    margin-bottom: var(--s2);
}

.section-head p {
    color: var(--slate);
    font-size: var(--text-lg);
    margin: 0;
}

.section-head--row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--s3);
    max-width: none;
    flex-wrap: wrap;
}

.section-head--row > div {
    max-width: 680px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--s2);
    padding: 0.3rem 0.85rem;
    background: var(--brand-soft);
    color: var(--brand-ink);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.eyebrow::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--green);
    transform: rotate(45deg);
    border-radius: 1px;
}

.lead {
    font-size: var(--text-lg);
    color: var(--slate);
    line-height: 1.65;
}

.grid {
    display: grid;
    gap: var(--s3);
}

.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

.split {
    display: grid;
    gap: clamp(2rem, 1rem + 4vw, 5rem);
    align-items: center;
}

@media (min-width: 900px) {
    .split { grid-template-columns: 1fr 1fr; }
    .split--wide-text { grid-template-columns: 1.15fr 0.85fr; }
}

/* ---- Scroll reveal (progressive: content is visible when JS is off) ---- */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
}

/* An element's own display (flex, grid) must never override the hidden attribute (filters, empty messages). */
[hidden] { display: none !important; }
