/* ==========================================================================
   Base: reset, document rhythm, layout primitives, utilities
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Anchor links must clear the sticky header. */
    scroll-padding-top: calc(var(--header-h) + var(--space-6));
}

body {
    margin: 0;
    background: var(--white);
    color: var(--body);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-4);
    color: var(--heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.022em;
    text-wrap: balance;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); letter-spacing: -0.015em; }
h4 { font-size: var(--text-xl); letter-spacing: -0.01em; }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

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

p:last-child { margin-bottom: 0; }

a {
    color: var(--brand-strong);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

a:hover { color: var(--blue-800); }

ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25rem; }
li { margin-bottom: var(--space-2); }
li:last-child { margin-bottom: 0; }

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

hr {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: var(--space-10) 0;
}

code, pre, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

:where(code):not(pre code) {
    background: var(--surface-brand);
    color: var(--blue-800);
    padding: 0.15em 0.42em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--blue-100);
    white-space: nowrap;
}

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

/* A single visible focus treatment across every interactive element. */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--blue-200);
    color: var(--navy-800);
}

/* ------------------------------------------------------------------ layout */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1.125rem, 4vw, 2rem);
}

.container--narrow { max-width: var(--container-narrow); }

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

.section--tight { padding-block: clamp(3rem, 5vw, 4.5rem); }
.section--tint { background: var(--surface-tint); }
.section--brand-tint { background: linear-gradient(180deg, var(--blue-50) 0%, #f7faff 100%); }

.section--dark {
    background: var(--grad-navy);
    color: rgba(255, 255, 255, 0.76);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--white); }

/* Hairline divider between two same-coloured sections. */
.section--ruled { border-top: 1px solid var(--line-soft); }

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

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Collapse in two stages so 3- and 4-up grids never squeeze on a tablet. */
@media (max-width: 1000px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

@media (max-width: 940px) {
    .split { grid-template-columns: minmax(0, 1fr); }
}

.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* --------------------------------------------------------------- utilities */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue-700);
    margin-bottom: var(--space-4);
}

.eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: var(--radius-full);
    background: var(--grad-brand);
}

.section--dark .eyebrow { color: var(--blue-300); }

.section-head {
    max-width: 720px;
    margin-bottom: clamp(2.5rem, 4vw, 3.75rem);
}

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

.section-head--center .eyebrow { justify-content: center; }

.section-sub {
    font-size: var(--text-lg);
    color: var(--muted);
    margin-bottom: 0;
}

.section--dark .section-sub { color: rgba(255, 255, 255, 0.68); }

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

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

.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.tiny { font-size: var(--text-xs); }
.strong { font-weight: 650; color: var(--heading); }
.mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.full-width { width: 100%; }

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 999;
    background: var(--brand-strong);
    color: var(--white);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    font-weight: 600;
    transition: top var(--dur) var(--ease);
}

.skip-link:focus {
    top: var(--space-4);
    color: var(--white);
}

/* Decorative background glow used behind hero and CTA bands. */
.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.section > .container { position: relative; z-index: 1; }

/* ------------------------------------------------------- scroll reveal */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

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

/* If JavaScript never runs, content must still be visible. */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

@media print {
    .site-header, .site-footer, .cta-band { display: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
}
