/*
  Congregate landing page styles.
  Source of truth: docs/developer_handoff.md (tokens, type, layout, components).

  Layers, lowest priority first. Unlayered rules (none on purpose) would beat all of these.
*/
@layer reset, tokens, base, layout, components, utilities;

/* ---------------------------------------------------------------------------
   Fonts - self-hosted woff2, latin + latin-ext subsets, swap over system-ui.
   IBM Plex Sans is one variable file covering 400-700.
   --------------------------------------------------------------------------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/poppins-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/poppins-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/poppins-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/poppins-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
   Reset - targeted element resets only, no "*" rules.
   --------------------------------------------------------------------------- */
@layer reset {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; }
  :where(h1, h2, h3, p, ul, ol, figure) { margin: 0; }
  :where(ul, ol)[role="list"] { padding: 0; list-style: none; }
  :where(img, svg) { display: block; max-inline-size: 100%; }
  :where(input, textarea, button) { font: inherit; color: inherit; }
  :where(input, textarea, button, .button, .card, .skip-link) { box-sizing: border-box; }
}

/* ---------------------------------------------------------------------------
   Design tokens - exactly the values in the handoff tables.

   Each color has a raw -light and -dark value. The theme is picked in three steps:
   1. Fallback for every browser: light by default, dark via prefers-color-scheme,
      and [data-theme] on <html> overrides the system preference.
   2. Where light-dark() is supported, the same tokens resolve through color-scheme,
      so a [data-theme] (or color-scheme) on any element re-themes its subtree.
   Tokens are deliberately not registered as <color> so light-dark() stays live.
   --------------------------------------------------------------------------- */
@layer tokens {
  :root {
    /* Raw palette: light / dark pairs */
    --bg-light: #EDF1F6;             --bg-dark: #172a40;
    --surface-light: #FFFFFF;        --surface-dark: #2e5077;
    --surface-sunken-light: #F4F7FB; --surface-sunken-dark: #213a57;
    --hero-light: #2e5077;           --hero-dark: #0f1e2e;
    --text-light: #13263d;           --text-dark: #ebebd3;
    --text-2-light: #33465c;         --text-2-dark: #d9d9c4;
    --text-3-light: #4d5f73;         --text-3-dark: #c9c9b4;
    --on-hero-light: #FFFFFF;        --on-hero-dark: #ebebd3;
    --on-hero-2-light: #E3ECF5;      --on-hero-2-dark: #E3ECF5;
    --primary-light: #2e5077;        --primary-dark: #63adf2;
    --on-primary-light: #FFFFFF;     --on-primary-dark: #13263d;
    --accent-light: #63adf2;         --accent-dark: #63adf2;
    --on-accent-light: #13263d;      --on-accent-dark: #13263d;
    --link-light: #2e5077;           --link-dark: #9fcdf7;
    --link-hover-light: #1d3552;     --link-hover-dark: #cfe6fb;
    /* --border light darkened from #82a0bc to #6d8aa8 so inputs reach 3:1 on white (approved). */
    --border-light: #6d8aa8;         --border-dark: #82a0bc;
    --divider-light: #D6E0EA;        --divider-dark: #3a5f88;
    --chip-ok-bg-light: #EEF3F8;     --chip-ok-bg-dark: #3a5f88;
    --chip-ok-fg-light: #2e5077;     --chip-ok-fg-dark: #9fcdf7;
    --chip-muted-bg-light: #D6E0EA;  --chip-muted-bg-dark: #24405f;
    --chip-muted-fg-light: #33465c;  --chip-muted-fg-dark: #d9d9c4;
    /* Form fields: white in light, --surface-sunken in dark (TextField spec). */
    --field-bg-light: #FFFFFF;       --field-bg-dark: #213a57;
    --error-border-light: #B45309;   --error-border-dark: #B45309;
    --error-text-light: #8A4B06;     --error-text-dark: #f6c77e;
    /* Logo mark: navy on light surfaces, cream on the dark theme's navy header. */
    --logo-mark-light: #2e5077;      --logo-mark-dark: #ebebd3;
    /* Focus ring: --accent is 2.4:1 on white, so light surfaces use navy (approved). */
    --focus-light: #2e5077;          --focus-dark: #63adf2;
    --shadow-light: 0 1px 2px rgba(46, 80, 119, 0.06);
    --shadow-dark: 0 1px 2px rgba(0, 0, 0, 0.25);

    /* Step 1: fallback resolution (light) */
    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --surface-sunken: var(--surface-sunken-light);
    --hero: var(--hero-light);
    --text: var(--text-light);
    --text-2: var(--text-2-light);
    --text-3: var(--text-3-light);
    --on-hero: var(--on-hero-light);
    --on-hero-2: var(--on-hero-2-light);
    --primary: var(--primary-light);
    --on-primary: var(--on-primary-light);
    --accent: var(--accent-light);
    --on-accent: var(--on-accent-light);
    --link: var(--link-light);
    --link-hover: var(--link-hover-light);
    --border: var(--border-light);
    --divider: var(--divider-light);
    --chip-ok-bg: var(--chip-ok-bg-light);
    --chip-ok-fg: var(--chip-ok-fg-light);
    --chip-muted-bg: var(--chip-muted-bg-light);
    --chip-muted-fg: var(--chip-muted-fg-light);
    --field-bg: var(--field-bg-light);
    --error-border: var(--error-border-light);
    --error-text: var(--error-text-light);
    --logo-mark: var(--logo-mark-light);
    --focus: var(--focus-light);
    --shadow: var(--shadow-light);

    color-scheme: light dark;

    /* Type */
    --font-body: "IBM Plex Sans", system-ui, sans-serif;
    --font-heading: "Poppins", "IBM Plex Sans", system-ui, sans-serif;
    /* Fluid sizes land exactly on the doc's values at the 390 px and 1440 px boards. */
    --fs-display: clamp(2rem, 1.6286rem + 1.5238vw, 3rem);       /* 32 -> 48 */
    --fs-h2: clamp(1.625rem, 1.4393rem + 0.7619vw, 2.125rem);    /* 26 -> 34 */
    --fs-lead: clamp(1rem, 0.9536rem + 0.1905vw, 1.125rem);      /* 16 -> 18 */
    --fs-eyebrow: clamp(0.75rem, 0.7268rem + 0.0952vw, 0.8125rem); /* 12 -> 13 */
    --fs-h3: 1.25rem;        /* 20 */
    --fs-h3-sm: 1.125rem;    /* 18: steps, form title */
    --fs-body: 1rem;         /* 16 */
    --fs-small: 0.9375rem;   /* 15 */
    --fs-list: 0.875rem;     /* 14 */
    --fs-caption: 0.8125rem; /* 13 */
    --fs-tag: 0.75rem;       /* 12 */

    /* Spacing scale (px in the doc, rem here) */
    --s-4: 0.25rem;  --s-6: 0.375rem; --s-8: 0.5rem;   --s-10: 0.625rem;
    --s-12: 0.75rem; --s-14: 0.875rem; --s-16: 1rem;   --s-18: 1.125rem;
    --s-20: 1.25rem; --s-22: 1.375rem; --s-24: 1.5rem; --s-28: 1.75rem;
    --s-32: 2rem;    --s-36: 2.25rem; --s-48: 3rem;    --s-72: 4.5rem;
    --s-80: 5rem;

    /* Radius */
    --r-tag: 0.375rem;   /* 6 */
    --r-input: 0.5625rem; /* 9 */
    --r-button: 0.625rem; /* 10, also icon tiles */
    --r-row: 0.75rem;    /* 12 */
    --r-card: 0.875rem;  /* 14 */

    /* Layout */
    --content-max: 72.5rem; /* 1160 */
    --gutter: var(--s-24);
    --control-md: 2.625rem; /* 42 */
    --control-lg: 3rem;     /* 48 */
    --field-h: 2.75rem;     /* 44 */
    --tile: 2.75rem;        /* 44 */
    --icon: 1.375rem;       /* 22 */
    --touch: 2.75rem;       /* 44 minimum touch target */
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: var(--bg-dark);
      --surface: var(--surface-dark);
      --surface-sunken: var(--surface-sunken-dark);
      --hero: var(--hero-dark);
      --text: var(--text-dark);
      --text-2: var(--text-2-dark);
      --text-3: var(--text-3-dark);
      --on-hero: var(--on-hero-dark);
      --on-hero-2: var(--on-hero-2-dark);
      --primary: var(--primary-dark);
      --on-primary: var(--on-primary-dark);
      --accent: var(--accent-dark);
      --on-accent: var(--on-accent-dark);
      --link: var(--link-dark);
      --link-hover: var(--link-hover-dark);
      --border: var(--border-dark);
      --divider: var(--divider-dark);
      --chip-ok-bg: var(--chip-ok-bg-dark);
      --chip-ok-fg: var(--chip-ok-fg-dark);
      --chip-muted-bg: var(--chip-muted-bg-dark);
      --chip-muted-fg: var(--chip-muted-fg-dark);
      --field-bg: var(--field-bg-dark);
      --error-border: var(--error-border-dark);
      --error-text: var(--error-text-dark);
      --logo-mark: var(--logo-mark-dark);
      --focus: var(--focus-dark);
      --shadow: var(--shadow-dark);
    }
  }

  :root[data-theme="light"] { color-scheme: light; }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-sunken: var(--surface-sunken-dark);
    --hero: var(--hero-dark);
    --text: var(--text-dark);
    --text-2: var(--text-2-dark);
    --text-3: var(--text-3-dark);
    --on-hero: var(--on-hero-dark);
    --on-hero-2: var(--on-hero-2-dark);
    --primary: var(--primary-dark);
    --on-primary: var(--on-primary-dark);
    --accent: var(--accent-dark);
    --on-accent: var(--on-accent-dark);
    --link: var(--link-dark);
    --link-hover: var(--link-hover-dark);
    --border: var(--border-dark);
    --divider: var(--divider-dark);
    --chip-ok-bg: var(--chip-ok-bg-dark);
    --chip-ok-fg: var(--chip-ok-fg-dark);
    --chip-muted-bg: var(--chip-muted-bg-dark);
    --chip-muted-fg: var(--chip-muted-fg-dark);
    --field-bg: var(--field-bg-dark);
    --error-border: var(--error-border-dark);
    --error-text: var(--error-text-dark);
    --logo-mark: var(--logo-mark-dark);
    --focus: var(--focus-dark);
    --shadow: var(--shadow-dark);
  }

  /* Step 2: light-dark() where supported. Placed last so it wins over step 1 at equal specificity. */
  @supports (color: light-dark(white, black)) {
    :root, :root[data-theme] {
      --bg: light-dark(var(--bg-light), var(--bg-dark));
      --surface: light-dark(var(--surface-light), var(--surface-dark));
      --surface-sunken: light-dark(var(--surface-sunken-light), var(--surface-sunken-dark));
      --hero: light-dark(var(--hero-light), var(--hero-dark));
      --text: light-dark(var(--text-light), var(--text-dark));
      --text-2: light-dark(var(--text-2-light), var(--text-2-dark));
      --text-3: light-dark(var(--text-3-light), var(--text-3-dark));
      --on-hero: light-dark(var(--on-hero-light), var(--on-hero-dark));
      --on-hero-2: light-dark(var(--on-hero-2-light), var(--on-hero-2-dark));
      --primary: light-dark(var(--primary-light), var(--primary-dark));
      --on-primary: light-dark(var(--on-primary-light), var(--on-primary-dark));
      --accent: light-dark(var(--accent-light), var(--accent-dark));
      --on-accent: light-dark(var(--on-accent-light), var(--on-accent-dark));
      --link: light-dark(var(--link-light), var(--link-dark));
      --link-hover: light-dark(var(--link-hover-light), var(--link-hover-dark));
      --border: light-dark(var(--border-light), var(--border-dark));
      --divider: light-dark(var(--divider-light), var(--divider-dark));
      --chip-ok-bg: light-dark(var(--chip-ok-bg-light), var(--chip-ok-bg-dark));
      --chip-ok-fg: light-dark(var(--chip-ok-fg-light), var(--chip-ok-fg-dark));
      --chip-muted-bg: light-dark(var(--chip-muted-bg-light), var(--chip-muted-bg-dark));
      --chip-muted-fg: light-dark(var(--chip-muted-fg-light), var(--chip-muted-fg-dark));
      --field-bg: light-dark(var(--field-bg-light), var(--field-bg-dark));
      --error-border: light-dark(var(--error-border-light), var(--error-border-dark));
      --error-text: light-dark(var(--error-text-light), var(--error-text-dark));
      --logo-mark: light-dark(var(--logo-mark-light), var(--logo-mark-dark));
      --focus: light-dark(var(--focus-light), var(--focus-dark));
      /* Shadows are not colors, so they keep the step 1 switch. */
    }
  }

  /* Phone treatment: one breakpoint at 640 px (40em = 640 px at the default text size). */
  @media (max-width: 40em) {
    :root { --gutter: var(--s-16); }
  }
}

/* ---------------------------------------------------------------------------
   Base - element defaults.
   --------------------------------------------------------------------------- */
@layer base {
  html {
    /* Keep in-page targets (#services, #contact, #content) clear of the sticky header. */
    scroll-padding-block-start: 4.25rem; /* 68 */
    background: var(--bg);
    accent-color: var(--primary);

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

  body {
    min-block-size: 100dvb;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    text-align: start;
  }

  :where(h1, h2, h3) {
    font-family: var(--font-heading);
    font-weight: 700;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }

  p, li { text-wrap: pretty; overflow-wrap: break-word; }

  a {
    color: var(--link);
    text-underline-offset: 0.15em;

    &:hover { color: var(--link-hover); }
  }

  /* One focus treatment for everything that can take keyboard focus. */
  :where(a, button, input, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  /* Skip-link targets are focused programmatically; no ring on the heading itself. */
  [tabindex="-1"]:focus { outline: none; }

  /* Sections scrolled to from the header links clear a little space above them. */
  :where([id]) { scroll-margin-block-start: var(--s-16); }
}

/* ---------------------------------------------------------------------------
   Layout - bands and the shared content box.
   --------------------------------------------------------------------------- */
@layer layout {
  .container {
    inline-size: min(100% - 2 * var(--gutter), var(--content-max));
    margin-inline: auto;
  }

  .band--services { padding-block: var(--s-72); }
  .band--steps { padding-block: 0 var(--s-72); }
  .band--contact { padding-block: 0 var(--s-80); }
}

/* ---------------------------------------------------------------------------
   Components
   --------------------------------------------------------------------------- */
@layer components {
  /* Skip link: first focusable element, visible only on focus. */
  .skip-link {
    position: absolute;
    inset-block-start: var(--s-8);
    inset-inline-start: var(--s-8);
    z-index: 10;
    padding: var(--s-10) var(--s-16);
    border-radius: var(--r-button);
    background: var(--surface);
    color: var(--link);
    font-weight: 600;
    box-shadow: var(--shadow);

    &:where(:not(:focus-visible, :active)) {
      clip-path: inset(50%);
      inline-size: 1px;
      block-size: 1px;
      overflow: hidden;
      padding: 0;
      white-space: nowrap;
    }
  }

  /* Logo */
  .logo {
    display: block;
    flex-shrink: 0;
    block-size: var(--logo-h, 2rem);
    inline-size: auto;
    aspect-ratio: 340 / 64;

    &.logo--h24 { --logo-h: 1.5rem; }
    &.logo--h32 { --logo-h: 2rem; }
    &.logo--h34 { --logo-h: 2.125rem; }

    .logo__line { fill: none; stroke: var(--logo-mark); }
    .logo__dot { fill: var(--logo-mark); }
    .logo__head { fill: var(--accent); }
    .logo__word {
      fill: var(--text);
      font-family: var(--font-heading);
      font-weight: 700;
    }

    &.logo--on-dark {
      .logo__line { stroke: var(--on-hero); }
      .logo__dot, .logo__word { fill: var(--on-hero); }
    }
  }
  .logo__link {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--touch);
    color: inherit;
    text-decoration: none;
  }

  /* Icons (symbols live in IconSprite) */
  .icon {
    inline-size: var(--icon);
    block-size: var(--icon);
    flex-shrink: 0;
  }
  .icon-sprite {
    position: absolute;
    inline-size: 0;
    block-size: 0;
    overflow: hidden;
  }

  .icon-tile {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    inline-size: var(--tile);
    block-size: var(--tile);
    border-radius: var(--r-button);
    background: var(--chip-ok-bg);
    color: var(--primary);
  }

  /* StatusTag */
  .tag {
    display: inline-block;
    padding: var(--s-4) var(--s-8);
    border-radius: var(--r-tag);
    font-size: var(--fs-tag);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;

    &.tag--ok { background: var(--chip-ok-bg); color: var(--chip-ok-fg); }
    &.tag--muted { background: var(--chip-muted-bg); color: var(--chip-muted-fg); }
  }

  /* Button */
  .button {
    --button-bg: var(--primary);
    --button-fg: var(--on-primary);
    --button-border: transparent;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-8);
    min-block-size: var(--control-md);
    padding: 0 var(--s-16);
    border: 1px solid var(--button-border);
    border-radius: var(--r-button);
    background: var(--button-bg);
    color: var(--button-fg);
    font-size: var(--fs-body);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;

    &:hover { color: var(--button-fg); }

    &.button--lg { min-block-size: var(--control-lg); padding: 0 var(--s-22); }

    &.button--accent {
      --button-bg: var(--accent);
      --button-fg: var(--on-accent);
      font-weight: 700;
    }
    &.button--ghost {
      --button-bg: transparent;
      --button-fg: var(--on-hero);
      --button-border: rgba(255, 255, 255, 0.55);
    }
    &.button--secondary {
      --button-bg: var(--surface);
      --button-fg: var(--text);
      --button-border: var(--border);
    }

    /* Hover 8% darker, active 2% more (Primary and Accent). */
    &:where(.button--primary, .button--accent) {
      &:hover:not(:disabled) { background: color-mix(in srgb, var(--button-bg), #000 8%); }
      &:active:not(:disabled) { background: color-mix(in srgb, var(--button-bg), #000 10%); }
    }
    &.button--ghost:hover { background: rgba(255, 255, 255, 0.08); }

    &:disabled { cursor: not-allowed; opacity: 0.75; }
  }

  /* Header */
  .site-header {
    /* Sticky: stays at the top while the page scrolls. Below the skip link (z-index 10). */
    position: sticky;
    inset-block-start: 0;
    z-index: 5;
    background: var(--surface);
    box-shadow: inset 0 -1px 0 var(--divider); /* divider drawn inside, so the bar is exactly 68/60 px */

    .container {
      display: flex;
      flex-wrap: wrap;
      align-items: safe center;
      justify-content: space-between;
      gap: var(--s-16);
      min-block-size: 4.25rem; /* 68 */
    }
  }
  .site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-10);
    font-size: var(--fs-small);
  }
  /* Services, Contact and Sign in: same shape as the Sign up button. No background at rest;
     a soft tint appears on hover and deepens on press. */
  .site-nav__link,
  .site-nav__signin {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--control-md);
    padding: 0 var(--s-16);
    border-radius: var(--r-button);
    background: transparent;
    color: var(--text);
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 0.15s ease;

    &:hover {
      color: var(--text);
      background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    }
    &:active { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
  }
  .site-nav .button { font-size: var(--fs-small); }

  /* Hero */
  .hero {
    /* On the navy hero, the accent ring has enough contrast (doc value). */
    --focus: var(--accent);
    padding-block: var(--s-72);
    background: var(--hero);
    color: var(--on-hero);

    .container {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: var(--s-48);
    }
  }
  .hero__copy {
    flex: 1 1 28.75rem; /* 460 */
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-20);
  }
  .hero__title {
    font-size: var(--fs-display);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--on-hero);
  }
  .hero__lead {
    max-inline-size: 32.5rem; /* 520 */
    font-size: var(--fs-lead);
    line-height: 1.6;
    color: var(--on-hero-2);
  }
  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-12);
  }
  .hero__apps {
    flex: 1 1 22.5rem; /* 360 */
    min-inline-size: 0;
    max-inline-size: 27.5rem; /* 440 */
  }

  /* Cards share surface, radius and shadow. */
  .card {
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    color: var(--text);
  }

  /* "Your apps" card in the hero */
  .apps-card {
    /* The card is light on the navy hero: use the page's ring, not the hero's accent ring. */
    --focus: var(--primary);
    display: flex;
    flex-direction: column;
    gap: var(--s-10);
    padding: var(--s-18);
  }
  .apps-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-12);
  }
  .apps-card__title { font-size: var(--fs-list); font-weight: 700; }
  .apps-card__note { font-size: var(--fs-tag); color: var(--text-3); }

  /* AppRow */
  .app-row {
    position: relative; /* containing block for a live app's stretched link */
    display: flex;
    align-items: center;
    gap: var(--s-12);
    padding: var(--s-12);
    border-radius: var(--r-row);
    background: var(--surface-sunken);
  }
  .app-row__text {
    flex: 1 1 auto;
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
  }
  .apps-card__list {
    display: flex;
    flex-direction: column;
    gap: var(--s-10);
  }
  .app-row__name,
  .app-row__link { font-size: var(--fs-small); font-weight: 700; }

  /* A live app's row is one link: the name link stretches over the row. */
  .app-row:has(.app-row__link) {
    &:hover { background: color-mix(in srgb, var(--surface-sunken), var(--text) 6%); }
  }
  .app-row__link {
    color: inherit;
    text-decoration: none;

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: var(--r-row);
    }
    &:focus-visible { outline: none; }
    &:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
  }
  .app-row__line { font-size: var(--fs-tag); color: var(--text-3); }

  /* Section intro (eyebrow, h2, body) */
  .section-intro {
    display: flex;
    flex-direction: column;
    gap: var(--s-8);
    max-inline-size: 40rem; /* 640 */
  }
  .eyebrow {
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
  }
  .section-title {
    font-size: var(--fs-h2);
    line-height: 1.2;
  }
  .section-body {
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--text-2);
  }

  /* Services band */
  .services {
    display: flex;
    flex-direction: column;
    gap: var(--s-28);
  }

  .service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.75rem), 1fr)); /* 300 */
    gap: var(--s-18);
  }

  /* ServiceCard: four rows (top, title, body, bullets) share tracks across the row via subgrid. */
  .service-card {
    position: relative;
    grid-row: span 4;
    display: grid;
    grid-template-rows: auto auto auto 1fr; /* fallback without subgrid */
    grid-template-rows: subgrid;
    row-gap: var(--s-14);
    padding: var(--s-24);
  }
  .service-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-12);
  }
  .service-card__title {
    font-size: var(--fs-h3);
    line-height: 1.3;
  }
  /* A live app's card is one big link: the title link stretches over the card. */
  .service-card__link {
    color: inherit;
    text-decoration: none;

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: var(--r-card);
    }
    &:focus-visible { outline: none; }
    &:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
  }
  /* Hover cue for a live (linked) card, matching the hero app rows. */
  .service-card:has(.service-card__link):hover {
    background: color-mix(in srgb, var(--surface), var(--text) 4%);
  }
  .service-card__body {
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--text-2);
  }
  .bullets {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    font-size: var(--fs-list);
    line-height: 1.5;
    color: var(--text-2);

    li {
      display: flex;
      gap: var(--s-8);

      &::before {
        content: "\00B7";
        content: "\00B7" / ""; /* decorative: hidden from screen readers where supported */
        color: var(--primary);
        font-weight: 700;
      }
    }
  }

  /* Shared strip */
  .shared-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.75rem), 1fr)); /* 220 */
    gap: var(--s-18);
    padding-block-start: var(--s-24);
    border-block-start: 1px solid var(--divider);
  }
  .shared-point {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
  }
  .shared-point__title { font-size: var(--fs-body); font-weight: 700; line-height: 1.4; }
  .shared-point__text { font-size: var(--fs-list); line-height: 1.5; color: var(--text-2); }

  /* How it works */
  .steps-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-24);
    padding: var(--s-36);
  }
  .steps {
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); /* 240 */
    gap: var(--s-28);
  }
  .step {
    display: flex;
    flex-direction: column;
    gap: var(--s-10);
  }
  .step__number {
    display: grid;
    place-items: center;
    inline-size: 2.25rem; /* 36 */
    block-size: 2.25rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
    line-height: 1;
  }
  .step__title { font-size: var(--fs-h3-sm); line-height: 1.3; }
  .step__text { font-size: var(--fs-small); line-height: 1.55; color: var(--text-2); }

  /* Contact band */
  .contact {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--s-32);
  }
  .contact__text {
    flex: 1 1 22.5rem; /* 360 */
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-20);
  }
  .contact__form {
    flex: 1 1 26.25rem; /* 420 */
    min-inline-size: 0;
  }

  /* ContactRow */
  .contact-row {
    display: flex;
    align-items: center;
    gap: var(--s-14);
  }
  .contact-row__text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
    line-height: 1.45;
  }
  .contact-row__label { font-size: var(--fs-caption); color: var(--text-3); }
  .contact-row__value {
    font-size: var(--fs-body);
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  a.contact-row__value {
    /* 44 px touch target without changing the row's layout */
    padding-block: var(--s-10);
    margin-block: calc(-1 * var(--s-10));
    color: var(--text);
    text-decoration: none;

    &:hover { color: var(--text); text-decoration: underline; }
  }

  /* ContactForm */
  .form-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-14);
    padding: var(--s-24);
  }
  .form-card__title { font-size: var(--fs-h3-sm); line-height: 1.3; }

  /* Turnstile (Cloudflare draws the widget in an iframe; only its size and theme can be set). */
  .turnstile {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
  }
  .turnstile__widget {
    min-block-size: 4.0625rem; /* 65: the widget's height, reserved so the form doesn't jump */
  }
  .turnstile__note {
    font-size: var(--fs-small);
    color: var(--text-2);
  }
  /* The flexible widget needs 300 px. Below 380 px wide the form is narrower than that, so shrink
     it to 80% (240 px). Browsers without zoom let the widget scroll sideways instead of overflowing. */
  @media (max-width: 23.75em) {
    .turnstile__widget { overflow-x: auto; }
    @supports (zoom: 0.8) {
      .turnstile__widget { overflow-x: visible; zoom: 0.8; }
    }
  }
  .contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-14);
  }

  /* Toast (ContactForm, after a send). Fixed to the bottom of the viewport, out of the layout. One
     animation runs its whole life: in, hold, out, then hidden (visibility removes it from the
     accessibility tree and the tab order). No timer on the server and no script. Hovering or
     focusing it pauses the clock, so nobody loses it mid-read. */
  .toasts {
    position: fixed;
    inset-inline: var(--s-16);
    inset-block-end: max(var(--s-16), env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    justify-items: center;
    pointer-events: none;
  }
  .toast {
    --icon: 1.375rem;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: var(--s-12);
    inline-size: min(100%, 26rem);
    padding: var(--s-12) var(--s-8) var(--s-12) var(--s-16);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--divider);
    border-radius: var(--r-card);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
    font-size: var(--fs-small);
    line-height: 1.5;
    animation: toast-life 6s ease both;

    &:hover, &:focus-within { animation-play-state: paused; }
    > .icon { margin-block-start: 0.0625rem; color: var(--primary); }
  }
  .toast__text { flex: 1; padding-block: 0.125rem; }
  .toast__close {
    --icon: 1.125rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    inline-size: 2rem;
    block-size: 2rem;
    margin-block: -0.125rem;
    border: 0;
    border-radius: var(--r-button);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;

    &:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
    &:active { background: color-mix(in srgb, var(--primary) 18%, transparent); }
  }
  @keyframes toast-life {
    0%   { opacity: 0; translate: 0 0.75rem; }
    5%   { opacity: 1; translate: 0 0; }
    92%  { opacity: 1; translate: 0 0; }
    100% { opacity: 0; translate: 0 0.25rem; visibility: hidden; }
  }
  /* Same timing, no movement. */
  @keyframes toast-life-still {
    0%, 92% { opacity: 1; }
    100%    { opacity: 0; visibility: hidden; }
  }
  @media (prefers-reduced-motion: reduce) {
    .toast { animation-name: toast-life-still; }
  }
  .form-status {
    font-size: var(--fs-small);
    line-height: 1.55;

    /* Empty: stays in the accessibility tree (so updates are announced) but takes no space. */
    &:empty {
      position: absolute;
      inline-size: 1px;
      block-size: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }
    &.form-status--error { color: var(--error-text); font-weight: 600; }
    &.form-status--sent {
      --icon: 1.125rem;
      display: flex;
      align-items: center;
      gap: var(--s-6);
      color: var(--text-2);
      > .icon { color: var(--primary); }
    }
  }

  /* TextField */
  .field {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
  }
  .field__label { font-size: var(--fs-list); font-weight: 600; }
  .field__input {
    inline-size: 100%;
    min-inline-size: 0;
    min-block-size: var(--field-h);
    padding: 0 var(--s-12);
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    background: var(--field-bg);
    color: var(--text);
    /* 16 px, not the doc's 15, so iOS does not zoom on focus (approved). */
    font-size: max(1rem, 1em);
    line-height: 1.5;

    &::placeholder { color: var(--text-3); opacity: 1; }

    &:is(textarea) {
      padding-block: var(--s-10);
      resize: vertical;
    }

    &[aria-invalid="true"] { border-color: var(--error-border); }
  }
  .field__error {
    font-size: var(--fs-caption);
    line-height: 1.45;
    color: var(--error-text);
  }

  /* Footer */
  .site-footer {
    background: var(--surface);
    border-block-start: 1px solid var(--divider);
    color: var(--text-3);
    font-size: var(--fs-list);

    .container {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: var(--s-16);
      padding-block: var(--s-24);
    }
  }
  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-18);

    a {
      display: inline-flex;
      align-items: center;
      min-block-size: var(--touch);
      color: var(--text-3);

      &:hover { color: var(--text); }
    }
  }

  /* Simple pages (404, error) */
  .simple-page {
    padding-block: var(--s-72);

    .container {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: var(--s-16);
    }
  }

  /* ---------------------------------------------------------------------
     Phone treatment, 640 px and below (mobile board, 390 wide)
     --------------------------------------------------------------------- */
  @media (max-width: 40em) {
    html { scroll-padding-block-start: 3.75rem; }        /* 60, the phone header */
    .site-header .container { min-block-size: 3.75rem; } /* 60 */
    .site-header .logo.logo { --logo-h: 1.75rem; }       /* 28; doubled class beats .logo--h32 */
    .site-nav__link { display: none; }                   /* Services and Contact dropped */
    .site-nav { gap: var(--s-8); }
    .site-nav .button,
    .site-nav__signin {
      position: relative;
      min-block-size: 2.375rem;  /* 38 */
      font-size: var(--fs-list); /* 14 */

      /* 3 px of extra hit area on each side keeps the target at 44 px. */
      &::after {
        content: "";
        position: absolute;
        inset: -3px;
      }
    }

    /* Below 360 px the 28 px logo and both header buttons no longer fit on one row. */
    @media (max-width: 22.5em) {
      .site-header .container { gap: var(--s-12); }
      .site-nav .button,
      .site-nav__signin { padding-inline: var(--s-12); }
      .site-header .logo.logo { --logo-h: 1.375rem; } /* 22 */
    }

    .hero { padding-block: var(--s-72) var(--s-36); }
    .hero .container { inline-size: min(100% - 2 * var(--s-20), var(--content-max)); }
    .hero__lead { line-height: 1.55; }
    .hero__actions {
      flex-direction: column;
      gap: var(--s-18);

      .button { inline-size: 100%; }
    }

    .service-grid { gap: var(--s-14); }
    .shared-strip {
      gap: var(--s-14);
      padding-block-start: 0;
      border-block-start: 0;
    }

    .steps-card { padding: var(--s-22); }

    .site-footer .container {
      flex-direction: column;
      align-items: flex-start;
      padding-block: var(--s-20);
    }
  }
}

/* ---------------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------------- */
@layer utilities {
  .visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}
