/*
 * Superior Enclosure — design tokens and base styles.
 * Direction: "Engineered Fit" (docs/DESIGN_SYSTEM.md). Brand colour Egyptian
 * blue #1034A6 and Poppins confirmed by the client 2026-10-10 (ROADMAP
 * decision log). Every text/background pair below was measured for WCAG AA.
 *
 * Contrast rule baked into the system: Egyptian blue on the navy shell is
 * only 1.69:1, so blue buttons only ever sit on white/light surfaces. On
 * navy, the primary action is inverted (white fill, blue text, 10.2:1).
 */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-latin-700.woff2") format("woff2");
}

:root {
  /* Brand — Egyptian blue scale */
  --blue-950: #060f33;   /* footer, deepest shell */
  --blue-900: #081747;   /* header, hero, dark bands */
  --blue-800: #0c2a88;   /* primary hover/pressed (white text 12.3:1) */
  --blue-700: #1034a6;   /* Egyptian blue — primary (white text 10.2:1) */
  --blue-500: #3a5fd0;   /* decorative strokes on navy */
  --blue-200: #a9bcf5;   /* eyebrows/accents on navy (9.2:1) */
  --blue-100: #d6e0fb;   /* decorative tints */
  --blue-50: #e9eefb;    /* icon tiles, soft highlights (blue text 8.8:1) */

  /* Neutrals */
  --ink-900: #14171f;    /* body text (17.9:1 on white) */
  --slate-600: #535c6b;  /* secondary text (6.8:1 on white, 6.2:1 on paper) */
  --slate-400: #8590a2;  /* input borders (3.2:1 UI contrast) */
  --line: #dde2ea;       /* decorative dividers only */
  --paper: #f4f6fb;      /* alternate light sections */
  --white: #ffffff;

  /* On-dark text */
  --on-dark: #ffffff;
  --on-dark-muted: #b8c2d9; /* 9.6:1 on blue-900 */
  --line-dark: rgba(255, 255, 255, 0.12);

  /* Semantic (always paired with an icon or text, never colour alone) */
  --success-700: #157a42;
  --success-50: #e8f5ee;
  --error-700: #b42318;
  --error-50: #fdecea;
  --warning-700: #8a4b00;
  --warning-50: #fff4e5;

  /* Type */
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --fs-display: clamp(2.25rem, 1.55rem + 3vw, 4rem);
  --fs-h2: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --fs-h3: clamp(1.2rem, 1.12rem + 0.45vw, 1.5rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.75rem;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --section-pad: clamp(56px, 40px + 5vw, 112px);

  /* Shape & depth */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(8, 23, 71, 0.06);
  --shadow-md: 0 6px 16px rgba(8, 23, 71, 0.08);
  --shadow-lg: 0 18px 44px rgba(8, 23, 71, 0.14);
  --shadow-console: 0 30px 80px rgba(3, 10, 40, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 220ms;

  /* Focus: blue on light, white on dark (see .se-on-dark) */
  --focus-color: var(--blue-700);

  --container: 1200px;
  --header-h: 68px;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 900px) {
  body {
    font-size: 1.0625rem;
  }
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  color: inherit;
  margin: 0 0 var(--space-4);
}

h1 {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 var(--space-4);
  max-width: 68ch;
}

a {
  color: var(--blue-700);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

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

img {
  height: auto;
}

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

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

/* Visible focus everywhere (docs/DESIGN_SYSTEM.md section 6) — never removed. */
:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
  border-radius: 6px;
}

.se-on-dark {
  --focus-color: var(--white);
}

.se-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.se-muted {
  color: var(--slate-600);
}

.se-small {
  font-size: var(--fs-small);
}

.se-lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
}

.se-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-700);
  margin: 0 0 var(--space-3);
}

.se-on-dark .se-eyebrow {
  color: var(--blue-200);
}

.se-eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.se-visually-hidden {
  position: absolute !important; /* must win over any component rule */
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.se-skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  color: var(--blue-700);
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

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

.se-icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  display: inline-block;
}

/* Respect reduced motion (docs/RULES.md section 5). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important; /* user preference must override every component */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
