/* ==========================================================================
   global.css - reset, base typography, layout primitives
   Depends on variables.css. Load order: variables -> global -> components -> page.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--sp-5));
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--ff-ui);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-ui);
  color: var(--c-ink);
  background-color: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--c-blue-600);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

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

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

/* ---------- Base typography ------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--c-ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-display-lg); }
h2 { font-size: var(--fs-h1); }
h3 { font-size: var(--fs-h2); }
h4 { font-size: var(--fs-h3); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

p {
  text-wrap: pretty;
}

strong, b {
  font-weight: var(--fw-semibold);
}

/* ---------- Layout primitives ---------------------------------------------- */

/* Centred content column. The Figma frame is 1920 wide with ~60px gutters. */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--container-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

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

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

/* Vertical rhythm for full-width bands. */
.section {
  position: relative;
  padding-block: var(--sp-14);
}

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

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

.section--alt {
  background-color: var(--c-surface-alt);
}

.section--dark {
  background: var(--g-midnight);
  color: var(--c-white);
}

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

/* Section heading cluster: eyebrow + title + optional lede. */
.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
  margin-bottom: var(--sp-12);
}

.section-head--start {
  align-items: flex-start;
  text-align: left;
}

.section-head__eyebrow {
  font-family: var(--ff-body);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-blue-600);
}

.section-head__title {
  font-family: var(--ff-display);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  color: var(--c-ink);
  /* No character cap: the Figma headings run wide and break only where the
     markup says so. Sections that need a narrower measure set their own. */
  max-width: none;
}

.section-head--start .section-head__title {
  max-width: 34ch;
}

.section-head__lede {
  font-family: var(--ff-body);
  font-size: var(--fs-lg);
  line-height: var(--lh-loose);
  color: var(--c-ink-500);
  max-width: 72ch;
}

/* Responsive grid used by most card sections. */
.grid {
  display: grid;
  gap: var(--sp-7);
}

.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)); }

/* Two-column feature row: copy beside media. */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: var(--sp-13);
}

.split--reverse > :first-child {
  order: 2;
}

/* ---------- Decorative layer ------------------------------------------------ */

/* The Figma pages sit on large blurred blobs and outline shapes. These are
   purely ornamental: they never receive focus and are hidden from AT. */
.decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: var(--z-decor);
}

.decor__blob {
  position: absolute;
  border-radius: var(--r-circle);
  filter: blur(var(--blur-blob));
  opacity: 0.6;
}

.decor__ring {
  position: absolute;
  border-radius: var(--r-circle);
  border: var(--bw-thin) solid var(--c-white-a28);
}

/* ---------- Scroll-reveal --------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  will-change: opacity, transform;
}

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

/* Stagger children of a revealed group. */
.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Utilities -------------------------------------------------------- */
/* Screen-reader-only text. Note: it is absolutely positioned, so inside an
   overflow-x container its containing block may be an ancestor *outside* that
   container - it then escapes the clipping and creates page overflow. Don't
   place it inside a horizontally scrolling table. */
.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;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-overlay);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-white);
  color: var(--c-ink);
  border-radius: var(--r-xs);
  box-shadow: var(--sh-md);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

.no-scroll {
  overflow: hidden;
}

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

  .split {
    gap: var(--sp-10);
  }
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--sp-13);
  }

  .section-head {
    margin-bottom: var(--sp-10);
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-9);
  }

  /* Media always follows copy once stacked, whatever the desktop order. */
  .split--reverse > :first-child {
    order: 0;
  }

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

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

@media (max-width: 480px) {
  .section-head__title {
    max-width: none;
  }
}
