/* ==========================================================================
   Secured by web — base.css
   0. Font   1. Design tokens   2. Reset   3. Typography   4. Layout   5. Motion
   ========================================================================== */

/* 0. Font (self-hosted: no requests to third parties) -------------------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 1. Design tokens ------------------------------------------------------- */
:root {
  /* Colour: one canvas colour for every page; panels sit on top of it */
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface-sunk: #F5F5F2;
  --ink: #0B1424;
  --ink-2: #4A5367;
  --ink-3: #686E80;            /* quiet text: 4.6:1 on the canvas (WCAG AA) */
  --line: rgba(11, 20, 36, .08);

  --navy: #1F3F73;
  --navy-700: #183462;
  --navy-900: #0C1A34;
  --green: #7DB343;            /* logo green: buttons, icons, highlights */
  --green-600: #6FA83A;        /* button hover */
  --green-700: #427A20;        /* green text on the light canvas: 4.8:1 (WCAG AA) */
  --green-tint: rgba(125, 179, 67, .14);
  --accent: var(--green);
  --accent-text: var(--green-700);
  --ns-yellow: #FFC917;
  --alert: #E5534B;

  --on-dark: #FFFFFF;
  --on-dark-2: rgba(255, 255, 255, .74);
  --on-dark-3: rgba(255, 255, 255, .5);
  --on-dark-line: rgba(255, 255, 255, .12);

  /* Shape */
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 12px;
  --frame: 12px;               /* inset of framed hero panels */

  /* Layout */
  --measure: 64ch;             /* body and lead text: one line holds a full thought */
  --measure-title: 22ch;       /* display titles: wide enough for two-line headlines */
  --container: 1320px;
  --gutter: 32px;
  --section: 128px;
  --gap: 16px;                 /* gap between panels and cards */

  /* Type */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(44px, 6vw, 92px);
  --fs-h1: clamp(40px, 4.8vw, 72px);
  --fs-h2: clamp(30px, 3.2vw, 46px);
  --fs-h3: clamp(20px, 1.6vw, 24px);
  --fs-lead: 19px;
  --fs-body: 17px;
  --fs-small: 14px;
  --fs-xs: 13px;

  /* Motion */
  --ease: cubic-bezier(.22, .7, .15, 1);
}

/* 2. Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  overflow-x: hidden;
}
::selection { background: var(--navy); color: var(--on-dark); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; color: inherit; }

/* 3. Typography ---------------------------------------------------------- */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
h1 { font-size: var(--fs-h1); letter-spacing: -.045em; line-height: 1; }
h2 { font-size: var(--fs-h2); letter-spacing: -.04em; }
h3 { font-size: var(--fs-h3); letter-spacing: -.02em; line-height: 1.2; }

.lead { font-size: var(--fs-lead); color: var(--ink-2); max-width: var(--measure); }

/* 4. Layout -------------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.section + .section { padding-top: 0; }   /* consistent rhythm: one gap between sections */
[id], [data-contact] { scroll-margin-top: 96px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 5. Motion -------------------------------------------------------------- */
/* Sections fade in on scroll. Hidden only when JavaScript runs (html.js),
   so without JavaScript every section is simply visible. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* Responsive tokens ------------------------------------------------------ */
@media (max-width: 1000px) {
  :root { --gutter: 24px; --section: 96px; }
}
@media (max-width: 600px) {
  :root { --gutter: 20px; --section: 80px; --frame: 8px; --fs-lead: 17px; --r-lg: 22px; }
}
