/* =============================================================================
   ICD International S.A.L. — base.css
   Design tokens, reset, typography, utilities.
   Load order: base.css -> layout.css -> components.css
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. DESIGN TOKENS
   The navy scale is sampled from the ICD logo (brand navy = --navy-700 #241C50).
   Amber is the single accent: use it only on interactive or emphasis elements.
   -------------------------------------------------------------------------- */
:root {
  /* Brand navy scale */
  --navy-900: #100d24; /* deepest — hero / footer base */
  --navy-800: #1a1440; /* dark section base */
  --navy-700: #241c50; /* brand navy, matches logo */
  --navy-600: #33285f; /* elevated card on dark */
  --navy-500: #463a78; /* borders / hairlines on dark */

  /* Neutrals */
  --graphite: #2a3140; /* body text on light */
  --slate-600: #545f76; /* secondary text on light */
  --slate-400: #646e85; /* muted text and captions — dark enough for AA at 12px */
  --paper: #f5f6f8; /* light section base */
  --paper-alt: #eceef2; /* light section, one step down */
  --white: #ffffff;

  /* Accent.
     amber-500 is the brand accent and is only used for fills, rules, icons
     and large numerals. amber-600 is the darker text-safe variant: it clears
     WCAG AA (4.5:1) on white, on --paper and on --amber-050, which the
     lighter amber does not at the 12-15px sizes used for eyebrows and links. */
  --amber-600: #96650f; /* amber text on light backgrounds */
  --amber-500: #d99a2b; /* primary accent */
  --amber-400: #e8b457; /* hover / on-dark emphasis */
  --amber-050: #fbf4e6; /* accent wash */

  /* Lines & shadows */
  --line: rgba(16, 13, 36, 0.1);
  --line-strong: rgba(16, 13, 36, 0.18);
  --line-dark: rgba(255, 255, 255, 0.13);
  --line-dark-strong: rgba(255, 255, 255, 0.24);
  --shadow-sm: 0 1px 2px rgba(16, 13, 36, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(16, 13, 36, 0.18);
  --shadow-lg: 0 26px 60px -22px rgba(16, 13, 36, 0.32);

  /* Typography */
  --font-display: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Fluid type scale — no breakpoint jumps */
  --fs-display: clamp(2.5rem, 1.6rem + 3.9vw, 4.5rem);
  --fs-h1: clamp(2.125rem, 1.55rem + 2.5vw, 3.375rem);
  --fs-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 1.12rem + 0.55vw, 1.5rem);
  --fs-h4: clamp(1.0625rem, 1.01rem + 0.25vw, 1.1875rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  --fs-body: 1rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-eyebrow: 0.75rem;

  /* Spacing — 4px base */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;
  --sp-9: 4rem;
  --sp-10: 5rem;
  --section-y: clamp(3.5rem, 2rem + 6vw, 6.5rem);

  /* Layout */
  --container: 1200px;
  --container-narrow: 860px;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --header-h: 76px;
  --radius: 4px;
  --radius-lg: 8px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 160ms;
  --t-base: 260ms;
}

/* -----------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keeps anchored sections clear of the sticky header */
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--graphite);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* -----------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  text-wrap: balance;
  /* Long unbroken words must never push a layout wider than its container */
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.012em;
}
h4 {
  font-size: var(--fs-h4);
  line-height: 1.35;
  letter-spacing: -0.008em;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--navy-900);
}

/* Small uppercase label that sits above a heading */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-600);
  margin-bottom: var(--sp-4);
}

/* Short accent rule that precedes eyebrow text */
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--amber-500);
  flex: none;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--slate-600);
}

/* -----------------------------------------------------------------------------
   4. DARK CONTEXT
   Any section with .on-dark flips text colours for a navy background.
   -------------------------------------------------------------------------- */
.on-dark {
  color: rgba(255, 255, 255, 0.76);
}

.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4,
.on-dark h5,
.on-dark h6,
.on-dark strong {
  color: var(--white);
}

.on-dark .lead {
  color: rgba(255, 255, 255, 0.78);
}

.on-dark .eyebrow {
  color: var(--amber-400);
}

/* -----------------------------------------------------------------------------
   5. ACCESSIBILITY
   -------------------------------------------------------------------------- */

/* Jump link — visually hidden until focused */
.skip-link {
  position: absolute;
  top: 0;
  left: var(--sp-4);
  z-index: 200;
  transform: translateY(-120%);
  padding: var(--sp-3) var(--sp-5);
  background: var(--amber-500);
  color: var(--navy-900);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: transform var(--t-fast) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--amber-500);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-dark :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--amber-400);
}

/* Screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -----------------------------------------------------------------------------
   6. SCROLL REVEAL
   reveal.js adds .is-visible when the element enters the viewport.
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 500ms var(--ease),
    transform 500ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Respect the OS "reduce motion" setting: no transitions, nothing hidden. */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* -----------------------------------------------------------------------------
   7. UTILITIES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.text-center {
  text-align: center;
}

.no-wrap {
  white-space: nowrap;
}

/* Accent-coloured run of text inside a heading */
.accent {
  color: var(--amber-500);
}

/* Blueprint grid motif — engineering texture for dark panels. */
.grid-motif {
  position: relative;
  isolation: isolate;
}

.grid-motif::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.055) 0 1px,
      transparent 1px 80px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.055) 0 1px,
      transparent 1px 80px
    );
  /* Fades the grid out toward the bottom so it never competes with content */
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    rgba(0, 0, 0, 0.55) 60%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    rgba(0, 0, 0, 0.55) 60%,
    transparent 100%
  );
}

/* Same motif for light backgrounds */
.grid-motif--light::before {
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(16, 13, 36, 0.045) 0 1px,
      transparent 1px 80px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(16, 13, 36, 0.045) 0 1px,
      transparent 1px 80px
    );
}
