/* globals.css */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&family=Open+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* =========================================================
   GLOBALS — Tokens, Base, Utilities, Global Components,
   Header/Footer, A11y, Global Fallbacks
   ========================================================= */

/* =========================================================
   0) Design Tokens (CSS Variables)
   ========================================================= */
:root {
  /* Colors */
  --bg: #0b1220;
  --bg-2: #0f1629;
  --bg-3: #f2f2f2;

  --text: #ffffff;
  --muted: #ededed;
  --ink: #0b0e15;

  /* Brand / accents */
  --accent-1: #02b8fe;
  --accent-2: #035cce;
  --chip-border: #797979;

  /* Additional brand tokens (origin + yours) */
  --color-midnight-purple: #0e0424;
  --fusion-blue: #0290e9;

  /* Gradients (origin) */
  --fusion-dark-gradient:
    linear-gradient(
      279.01deg,
      rgba(11, 14, 21, 0.8) 8.4%,
      rgba(31, 38, 55, 0.8) 22.6%,
      rgba(11, 14, 21, 0) 32.36%
    ),
    linear-gradient(
      260.06deg,
      rgba(11, 14, 21, 0.8) 57.84%,
      rgba(25, 32, 48, 0.8) 71.19%,
      rgba(11, 14, 21, 0.8) 83.65%
    ),
    #505768;

  --fusion-blue-gradient: linear-gradient(
    199.4deg,
    #02b8fe 5.98%,
    #035cce 85.71%
  );

  --fusion-midnight-gradient:
    linear-gradient(0deg, #0b0e15, #0b0e15),
    linear-gradient(
      260.06deg,
      rgba(11, 14, 21, 0.8) 57.84%,
      rgba(22, 27, 40, 0.8) 71.19%,
      rgba(11, 14, 21, 0.8) 83.65%
    ),
    linear-gradient(
      279.01deg,
      rgba(11, 14, 21, 0.8) 8.4%,
      rgba(22, 27, 40, 0.8) 22.6%,
      rgba(11, 14, 21, 0) 32.36%
    );

  /* Semantic surfaces (origin) */
  --fusion-flash-white: #f2f2f2;
  --fusion-midnight-blue: #0b0e15;
  --white-surface: #ffffff;
  --dark-surface: #575757;

  /* Semantic colors (merged) */
  --color-primary-bg: var(--fusion-flash-white);
  /* light surface */
  --color-secondary-bg: var(--fusion-dark-gradient);
  --color-primary-text: var(--fusion-midnight-blue);
  /* dark text */
  --color-secondary-text: var(--fusion-flash-white);

  --accent: var(--fusion-blue-gradient);
  --color-surface: var(--white-surface);
  --color-surface-dark: var(--fusion-midnight-blue);

  /* Type */
  --font-montserrat:
    'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-sans:
    'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Typography tokens (both naming schemes kept) */
  --font-heading: var(--font-montserrat);
  --font-paragraph: var(--font-sans);

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-100: 1;
  --ls-0: 0;
  --tt-uppercase: uppercase;

  /* “legacy” named color token used in figma heading 2 (keep) */
  --c-fusion-midnight-blue: #0b0e15;

  /* Headings */
  --fs-h1: 4rem;
  /* 64px (overridden on mobile below) */
  --fs-h2: 2rem;
  /* (your value) */
  --fs-h3: 1.75rem;
  /* 28px */
  --fs-h4: 1.25rem;
  /* 20px */

  /* Origin figma aliases (kept for compatibility) */
  --fs-h1-figma: 3.25rem;
  /* 52px */
  --fs-h2-figma: 2.375rem;
  /* 38px */
  --fs-h3-figma: 1.75rem;
  /* 28px */
  --fs-h4-figma: 1.25rem;
  /* 20px */

  /* Paragraph sizes */
  --fs-body: 1rem;
  /* 16px */
  --fs-body-sm: 0.875rem;
  /* 14px */
  --fs-body-figma: 1rem;
  --fs-body-sm-figma: 0.875rem;

  /* Buttons */
  --fs-btn-figma: 0.875rem;
  /* 14px */

  /* A11y scaling helpers */
  --fs-900: clamp(2rem, 1.4rem + 2vw, 2.875rem);
  --fs-800: clamp(1.75rem, 1.2rem + 1.6vw, 2.375rem);
  --fs-700: 1.25rem;
  --fs-600: 1rem;
  --fs-500: 0.875rem;

  /* Layout */
  --container-max: 100rem;
  --gutter: clamp(1rem, 5vw, 10rem);

  /* Site gutter (origin) used by global sections */
  --site-gutter: max(
    clamp(var(--space-1), 0.5vw, var(--space-9)),
    calc((100vw - var(--container-max)) / 2)
  );

  --lh-tight: 1.15;
  --lh-normal: 1.4;

  --paragraph-max-width: 75ch;

  --copy-bottom-pad: clamp(1rem, 4vh, 3rem);

  /* Spacing scale (layout rhythm stays rem-based) */
  --space-0: 0;
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.5rem;
  /* 24px */
  --space-6: 2rem;
  /* 32px */
  --space-7: 2.5rem;
  /* 40px */
  --space-8: 3.5rem;
  /* 56px */
  --space-9: 4.5rem;
  /* 72px */
  --space-10: 6rem;
  /* 96px */
  --space-11: 7rem;
  /* 112px */

  /* Radii */
  --r-2: 0.5rem;
  /* 8px */
  --r-3: 0.75rem;
  /* 12px */
  --r-4: 1rem;
  /* 16px */
  --r-5: 1.5rem;
  /* 24px */
  --r-6: 2rem;
  /* 32px */
  --r-pill: 62.4375rem;
  /* 999px */

  /* Focus */
  --focus-ring: 0 0 0 3px rgba(2, 184, 254, 0.5);
  --focus-halo: 0 0 0 6px rgba(11, 18, 32, 0.85);

  /* Shadows */
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.35);

  /* Nav background (legacy; still used in some blocks) */
  --nav-bg: rgba(11, 14, 21, 0.8);

  /* Buttons */
  --btn-radius: var(--r-2);
  --btn-border-w: 2px;
  --btn-border-1: var(--accent-1);
  --btn-border-2: var(--accent-2);

  /* Header */
  --header-gap: var(--space-6);

  /* DESIGN CHOICE: Midnight Purple (#0E0424) */
  --header-solid-bg: rgba(14, 4, 36, 1);
  --header-solid-blur: blur(10px);

  /* Header slab heights */
  --slab-h: 3.5rem;
  /* desktop */
  --slab-h-sm: 3rem;
  /* mobile */

  /* Optional height tokens (origin) */
  --header-height: 4rem;
  --hero-footer-height: 100px;
  --section-height: clamp(31rem, 58vh, 34rem);

  /* Hero sizing controls */
  --hero-min: 40vh;
  --hero-max: 30rem;
  --hero-gap-max: 20rem;

  /* Chips */
  --chip-h: 33px;

  /* Other reusable variables (origin) */
  --scale: scale(1.02);
  --transition: 0.2s ease-in-out;

  /* Breakpoints (documentation – container queries preferred) */
  --bp-xs: 30rem;
  /* 480px  */
  --bp-sm: 48rem;
  /* 768px  */
  --bp-md: 64rem;
  /* 1024px */
  --bp-lg: 75rem;
  /* 1200px */
  --bp-xl: 87.5rem;
  /* 1400px */

  /* Z-index */
  --z-nav: 10;
  --z-overlay: 20;
}

/* =========================================================
   1) Base / Reset
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--color-primary-bg);
  font-family: var(--font-montserrat);
  text-size-adjust: 100%;

  &.nav-open {
    overflow: hidden;
  }
}

button {
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  container-type: inline-size;
  container-name: content;
}

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

/* =========================================================
   2) Utilities — spacing, layout, typography
   ========================================================= */
:where(.flex) {
  display: flex;
}

:where(.inline-flex) {
  display: inline-flex;
}

:where(.grid) {
  display: grid;
}

:where(.place-center) {
  place-items: center;
}

:where(.items-center) {
  align-items: center;
}

:where(.justify-center) {
  justify-content: center;
}

:where(.justify-between) {
  justify-content: space-between;
}

:where(.content-center) {
  align-content: center;
}

:where(.stack) {
  display: grid;
  gap: var(--space-3);
}

:where(.stack-lg) {
  display: grid;
  gap: var(--space-6);
}

:where(.row) {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

:where(.cols-1) {
  grid-template-columns: 1fr;
}

:where(.cols-2) {
  grid-template-columns: repeat(2, 1fr);
}

:where(.cols-3) {
  grid-template-columns: repeat(3, 1fr);
}

:where(.cols-4) {
  grid-template-columns: repeat(4, 1fr);
}

:where(.cols-autofit-16) {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

:where(.cols-autofit-20) {
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

:where(.gap-1) {
  gap: var(--space-1);
}

:where(.gap-2) {
  gap: var(--space-2);
}

:where(.gap-3) {
  gap: var(--space-3);
}

:where(.gap-4) {
  gap: var(--space-4);
}

:where(.gap-5) {
  gap: var(--space-5);
}

:where(.gap-6) {
  gap: var(--space-6);
}

:where(.p-0) {
  padding: 0;
}

:where(.p-4) {
  padding: var(--space-4);
}

:where(.px-4) {
  padding-inline: var(--space-4);
}

:where(.py-4) {
  padding-block: var(--space-4);
}

:where(.px-6) {
  padding-inline: var(--space-6);
}

:where(.py-6) {
  padding-block: var(--space-6);
}

:where(.m-0) {
  margin: 0;
}

:where(.my-4) {
  margin-block: var(--space-4);
}

:where(.mt-4) {
  margin-block-start: var(--space-4);
}

:where(.h1) {
  font-size: var(--fs-900);
  line-height: var(--lh-tight);
}

:where(.h2) {
  font-size: var(--fs-800);
  line-height: var(--lh-tight);
}

h1 {
  font-size: clamp(2.7rem, 10vw, var(--fs-h1));
  font-weight: 300;
}

h2 {
  font-size: clamp(1.6rem, 5vw, var(--fs-h2));
  font-weight: 500;
}

h4 {
  font-size: var(--fs-h4);
  font-weight: 500;
}

p {
  max-width: var(--paragraph-max-width);
}

:where(.lead) {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.7rem + 0.6vw, 1.25rem);
  line-height: 1.35;
}

:where(.text-muted) {
  color: var(--muted);
}

:where(.fw-600) {
  font-weight: 600;
}

:where(.fw-700) {
  font-weight: 700;
}

:where(.ratio-1) {
  aspect-ratio: 1;
}

:where(.object-cover) {
  object-fit: cover;
}

:where(.ring-focus:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 184, 254, 0.25);
}

/* =========================================================
   3) Components — shared pieces
   ========================================================= */

.btn {
  /* Component padding should scale with text size (em) */
  --btn-pad-b: 0.85em;
  --btn-pad-i: 1.35em;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--btn-pad-b) var(--btn-pad-i);

  font: 600 var(--fs-btn-figma) / 1 var(--font-sans);
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--fw-bold);
  text-decoration: none;

  transition:
    transform 0.06s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    opacity 0.09s ease;

  width: max-content;
  max-width: 100%;
  z-index: 1;
  border-radius: var(--r-6);

  &.btn--primary {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(
      180deg,
      rgba(0, 162, 224, 1) 0%,
      rgba(74, 31, 216, 1) 100%
    );

    color: #fff;
    border: 0;

    transition:
      transform 0.06s ease,
      box-shadow 0.15s ease,
      filter 0.25s ease;

    &:hover {
      filter: brightness(0.92);
    }

    &:active {
      transform: translateY(1px);
    }
  }

  &.btn--secondary {
    border: 1px solid #747474;
    color: #2d2d2d;
    background: var(--muted);
    max-height: 33px;

    &:hover {
      border: 1px solid #252525;
    }
  }
}

.chip {
  /* Component padding should scale with text size (em) */
  --chip-pad-b: 0.55em;
  --chip-pad-i: 1.05em;

  inline-size: max-content;
  min-block-size: var(--chip-h);
  padding: var(--chip-pad-b) var(--chip-pad-i);

  border: 1px solid var(--chip-border);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;

  &:is(:hover, :focus-visible) {
    border-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);

    &.ring-focus:focus-visible {
      box-shadow: var(--focus-ring), var(--focus-halo);
    }
  }

  &.is-active,
  &[aria-pressed='true'] {
    border-width: 1.2px;
    border-color: #fff;
  }
}

/* Origin-only responsive tweaks (kept; referenced by sections below) */
@media (width < 83rem) {
  main {
    .site-section--book-demo {
      img {
        opacity: 0.4;
      }
    }
  }
}

@media (width < 64rem) {
  main {
    .btn {
      width: 100%;
    }

    .site-section--features {
      flex-direction: column-reverse;
      padding: var(--site-gutter);

      img:nth-of-type(1) {
        transform: translateY(0);
      }

      img:nth-of-type(2) {
        display: none;
      }

      .section-content {
        border-radius: var(--r-6);
        position: static;
        transform: translateY(-130px);
      }
    }
  }
}

.btn-text--mobile {
  display: none;
}

@media (width < 30rem) {
  .btn-text--desktop {
    display: none;
  }

  .btn-text--mobile {
    display: inline;
  }
}

/* =========================================================
   4) Global Layout — Header
   ========================================================= */

.site-header {
  position: fixed;
  isolation: isolate;
  inset: 0 0 auto 0;
  z-index: var(--z-overlay);

  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--space-3);

  display: grid;
  grid-template-columns: minmax(100px, 200px) 1fr auto;
  align-items: center;
  gap: var(--space-6);

  background: transparent;
  pointer-events: auto;

  container-type: inline-size;
  container-name: slab;

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
  }

  .brand__mark {
    block-size: 2rem;
    display: block;
  }

  /* Make brand mark 1.25rem on mobile slab */
  @container slab (max-width: 48rem) {
    .brand__mark {
      block-size: 1.25rem;
    }
  }

  .brand__text {
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 13px;
    white-space: nowrap;
  }

  /* NAV PANEL (desktop layout) */
  .nav-panel {
    justify-self: center;
    min-width: 0;
  }

  /* PRIMARY NAV */
  .primary-nav {
    /* Text-driven paddings use em */
    --nav-link-pad-b: 0.25em;
    --nav-link-pad-b2: 0.55em;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);

    .primary-nav__list {
      display: flex;
      align-items: center;
      gap: var(--space-6);
      padding: 0;
      margin: 0;
      list-style: none;
      flex-wrap: nowrap;
      white-space: nowrap;
      overflow: visible;

      > li {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
      }
    }

    a {
      position: relative;
      text-decoration: none;
      opacity: 0.9;
      transition: opacity 0.15s;
      font-weight: 600;
      line-height: 1.5;
      color: #fff;

      padding-block: var(--nav-link-pad-b);
      padding-block-end: var(--nav-link-pad-b2);

      &:is(:hover, :focus-visible) {
        opacity: 1;
        outline: none;
      }

      &.is-active,
      &[aria-current='page'] {
        opacity: 1;
      }

      &[aria-current='page']::after {
        content: none;
      }
    }

    .nav-item--has-submenu {
      position: relative;
    }

    @container slab (min-width: 48.001rem) {
      .nav-item--has-submenu::after {
        content: '';
        position: absolute;
        left: -0.5rem;
        right: -0.5rem;
        top: 100%;
        height: 0.75rem;
        background: transparent;
      }
    }

    .nav-link.submenu-toggle {
      appearance: none;
      border: 0;
      background: transparent;
      color: #fff;
      font: inherit;
      font-weight: 600;
      line-height: 1.5;

      padding-block: var(--nav-link-pad-b);
      padding-block-end: var(--nav-link-pad-b2);

      cursor: pointer;
      opacity: 0.9;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;

      &:is(:hover, :focus-visible) {
        opacity: 1;
        outline: none;
      }
    }

    .submenu-caret {
      inline-size: 0.5rem;
      block-size: 0.5rem;
      border-right: 2px solid rgba(255, 255, 255, 0.9);
      border-bottom: 2px solid rgba(255, 255, 255, 0.9);
      transform: rotate(45deg);
      margin-top: -2px;
      transition: transform 0.15s ease;
    }

    .submenu {
      list-style: none;
      margin: 0;

      /* This is a menu surface padding (layout-ish), rem is fine */
      padding: 0.75rem;

      border-radius: 0 0 1rem 1rem;
      background: var(--header-solid-bg);
      transition: background 0.25s ease;
      box-shadow: var(--shadow-soft);

      display: grid;
      gap: 0.5rem;
    }

    .submenu a {
      /* Link padding scales with link font-size */
      --submenu-link-pad-b: 0.6em;
      --submenu-link-pad-i: 0.75em;

      display: block;
      padding: var(--submenu-link-pad-b) var(--submenu-link-pad-i);

      border-radius: 0.75rem;
      text-decoration: none;
      color: #fff;
      opacity: 0.92;

      &:is(:hover, :focus-visible) {
        opacity: 1;
        outline: none;
        background: rgba(255, 255, 255, 0.08);
      }
    }

    @container slab (min-width: 48.001rem) {
      .submenu {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 0.5rem;
        min-inline-size: 14rem;

        display: none;
        z-index: var(--z-overlay);
      }

      .nav-item--has-submenu:is(:hover, :focus-within) .submenu {
        display: grid;
      }
    }

    @container slab (max-width: 48rem) {
      .primary-nav__list {
        width: 100%;
      }

      .nav-item--has-submenu {
        width: 100%;
      }

      .nav-link.submenu-toggle {
        /* Button padding scales with text */
        --mobile-item-pad-b: 0.85em;
        --mobile-item-pad-i: 0.95em;

        width: 100%;
        justify-content: space-between;
        padding: var(--mobile-item-pad-b) var(--mobile-item-pad-i);

        border-radius: 0.85rem;
        background: rgba(255, 255, 255, 0.06);
      }

      .submenu {
        display: none;
        position: static;
        font-size: 0.875rem;

        margin-top: 0.5rem;
        padding: 0.25rem 0 0.25rem;

        background: transparent;
        backdrop-filter: none;
        box-shadow: none;

        gap: 0.5rem;

        padding-left: 0.75rem;
      }

      .submenu-toggle[aria-expanded='true'] + .submenu {
        display: grid;
      }

      .submenu-toggle[aria-expanded='true'] .submenu-caret {
        transform: rotate(225deg);
      }

      .submenu a {
        /* Link padding scales with text */
        --mobile-link-pad-b: 0.85em;
        --mobile-link-pad-i: 0.95em;

        padding: var(--mobile-link-pad-b) var(--mobile-link-pad-i);

        border-radius: 0.85rem;
        background: rgba(255, 255, 255, 0.06);
      }
    }
  }

  /* Desktop CTA */
  .site-header .header-cta {
    grid-column: 3;
    justify-self: end;
    min-inline-size: 8.5rem;
  }

  /* Mobile toggle button */
  .nav-toggle {
    appearance: none;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    position: relative;
    cursor: pointer;
    display: none;
    grid-column: 3;
    justify-self: end;
    align-self: center;

    --burger-pad: 0.75rem;
    /* layout-ish, keep rem */
    --burger-bar: 2px;

    &::before,
    &::after,
    span {
      content: '';
      position: absolute;
      left: var(--burger-pad);
      right: var(--burger-pad);
      height: var(--burger-bar);
      background: #fff;
      transition:
        transform 0.2s ease,
        opacity 0.2s ease;
    }

    &::before {
      top: 0.85rem;
    }

    span {
      top: 1.2rem;
    }

    &::after {
      top: 1.55rem;
    }

    &[aria-expanded='true'] {
      &::before {
        transform: translateY(0.35rem) rotate(45deg);
      }

      &::after {
        transform: translateY(-0.35rem) rotate(-45deg);
      }

      span {
        opacity: 0;
      }
    }
  }
}

/* Full-bleed header background layer.
   Default stays transparent; becomes solid via body classes */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;

  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;

  background: transparent;
  transition: background 0.25s ease;
  z-index: -1;
}

/* 1) Dark when scrolled */
body.scrolled {
  .site-header::before {
    background: var(--header-solid-bg);
  }
}

/* 2) Dark when mobile menu is open */
body.nav-open {
  .site-header::before {
    background: var(--header-solid-bg);
  }
}

/* 3) Dark when Solutions dropdown is active (desktop hover/focus) */
body:not(.scrolled):not(.nav-open) {
  .site-header:has(.nav-item--has-submenu:is(:hover, :focus-within))::before {
    background: var(--header-solid-bg);
  }
}

/* Header slab container-driven thresholds */
@container slab (max-width: 64rem) {
  .site-header {
    .primary-nav,
    .primary-nav__list {
      gap: clamp(0.75rem, 3cqw, var(--space-6));
    }
  }
}

/* Mobile mode: hide inline nav + CTA, show burger */
@container slab (max-width: 48rem) {
  .site-header {
    .nav-panel,
    > .header-cta {
      display: none;
    }

    .nav-toggle {
      display: inline-flex;
    }
  }

  body.nav-open {
    .site-header {
      .nav-panel {
        display: grid;
        position: fixed;
        top: calc(var(--slab-h-sm) + 12px);
        left: 0;
        right: auto;
        bottom: auto;

        width: 100%;
        max-height: calc(100dvh - (var(--slab-h-sm) + 24px));
        overflow: auto;

        padding: 1rem;
        border-radius: 0 0 1.25rem 0;

        background: var(--header-solid-bg);
        transition: background 0.25s ease;
        box-shadow: var(--shadow-soft);

        z-index: var(--z-overlay);
      }

      .primary-nav__list {
        display: grid;
        gap: 12px;
        white-space: normal;
      }

      .primary-nav__list > li > a {
        /* Link padding scales with text */
        --drawer-link-pad-b: 0.85em;
        --drawer-link-pad-i: 0.95em;

        display: block;
        padding: var(--drawer-link-pad-b) var(--drawer-link-pad-i);

        border-radius: 0.85rem;
        background: rgba(255, 255, 255, 0.06);
      }
    }
  }
}

/* -----------------------------------------
   Mobile CTA inside menu panel
------------------------------------------ */
.site-header {
  .nav-panel .nav-cta {
    display: none;
  }
}

@container slab (max-width: 48rem) {
  body.nav-open {
    .site-header {
      .nav-panel .nav-cta {
        display: inline-flex;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        margin-top: 2rem;
      }
    }
  }
}

/* Viewport fallback when container queries aren’t supported */
@supports not (container-type: inline-size) {
  @media (max-width: 48rem) {
    .site-header {
      .brand__mark {
        block-size: 1.25rem;
      }

      gap: var(--space-3);

      .nav-panel,
      > .header-cta {
        display: none;
      }

      .nav-toggle {
        display: inline-flex;
      }
    }

    body.nav-open {
      .site-header {
        .nav-panel {
          display: grid;
          position: fixed;
          top: calc(var(--slab-h-sm) + 12px);
          left: 16px;
          right: auto;
          bottom: auto;

          width: min(20rem, calc(100vw - 32px));
          max-height: calc(100dvh - (var(--slab-h-sm) + 24px));
          overflow: auto;

          padding: 1rem;
          border-radius: 1.25rem;

          background: var(--header-solid-bg);
          transition: background 0.25s ease;
          box-shadow: var(--shadow-soft);
        }

        .primary-nav__list {
          display: grid;
          gap: 12px;
        }

        .primary-nav__list > li > a {
          --drawer-link-pad-b: 0.85em;
          --drawer-link-pad-i: 0.95em;

          display: block;
          padding: var(--drawer-link-pad-b) var(--drawer-link-pad-i);

          border-radius: 0.85rem;
          background: rgba(255, 255, 255, 0.06);
        }
      }
    }
  }
}

/* Footer & nav spacing tighten when the content container is narrower */
@container content (max-width: 64rem) {
  .site-header {
    .primary-nav,
    .primary-nav__list {
      gap: clamp(12px, 3cqw, var(--space-6));
      justify-content: flex-start;
    }
  }
}

/* =========================================================
   5) Global Layout — Footer
   ========================================================= */
.site-footer {
  color: #fff;
  padding-block: var(--space-8);
  background: linear-gradient(0deg, #0e0424 0%, #18093c 100%);

  .container {
    display: grid;
    gap: var(--space-6);
  }

  .footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 0.8fr 1fr;
    gap: clamp(var(--space-5), 4vw, 42px);
    align-items: start;
  }

  .col {
    color: #fff;
  }

  .col-brand {
    display: grid;
    gap: var(--space-3);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
  }

  .brand-head {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
  }

  .brand__mark {
    block-size: 2rem;
    display: block;
  }

  .brand-name {
    margin: 0;
    font-weight: 700;
    font-size: 0.8125rem;
    line-height: 1.1;
    letter-spacing: 0.08em;
    color: var(--muted);
  }

  .brand-blurb {
    margin: 0;
    font-weight: 500;
    font-size: 0.75rem;
    line-height: var(--lh-normal);
    max-inline-size: 75ch;
  }

  .col-news {
    display: grid;
    gap: var(--space-3);

    h2 {
      margin: 0;
      font-weight: 600;
      font-size: 1.125rem;
    }
  }

  .news-form {
    .input-wrap {
      display: grid;
      grid-template-columns: 1fr auto;
      block-size: 41px;
    }
  }

  input[type='email'] {
    /* Control padding scales with control text size */
    --control-pad-b: 0.8em;
    --control-pad-i: 0.65em;

    min-width: 0;
    border: 1px solid #b8b8b8;
    border-right: 0;
    border-radius: var(--r-2) 0 0 var(--r-2);

    padding: var(--control-pad-b) var(--control-pad-i);

    background: #fff;
    color: #0b0e15;
    font-family: var(--font-sans);
    font-size: 0.875rem;

    &::placeholder {
      color: #9bb0c9;
    }

    &:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(2, 184, 254, 0.25);
    }
  }

  .subscribe-btn {
    /* Button padding scales with text size */
    --sub-pad-b: 0.8em;
    --sub-pad-i: 1.1em;

    display: inline-grid;
    place-items: center;
    padding: var(--sub-pad-b) var(--sub-pad-i);

    border: 2px solid transparent;
    border-radius: 0 var(--r-2) var(--r-2) 0;
    background:
      linear-gradient(#0c0f17, #0c0f17) padding-box,
      linear-gradient(199.4deg, var(--accent-1) 6%, var(--accent-2) 86%)
        border-box;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition:
      transform 0.06s,
      box-shadow 0.15s;

    &:is(:hover, :focus-visible) {
      transform: translateY(-1px);
      outline: none;
      box-shadow: 0 0 0 3px rgba(2, 184, 254, 0.25);
    }
  }

  .col-links,
  .col-about {
    display: grid;
    gap: var(--space-3);
    justify-items: start;

    h2 {
      margin: 0;
      font-weight: 600;
      font-size: 1rem;
    }
  }

  .link-list {
    list-style: none;
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;

    a {
      position: relative;
      font-family: var(--font-sans);
      line-height: var(--lh-normal);
      color: #fff;
      text-decoration: none;
      opacity: 1;
      transition: opacity 0.15s;

      &:is(:hover, :focus-visible) {
        opacity: 1;
        outline: none;
        text-decoration: underline;
        text-underline-offset: 2px;
      }

      &[aria-current='page'] {
        opacity: 1;
      }

      &[aria-current='page']::after {
        content: none;
      }
    }
  }

  .footer-rule {
    display: none;
  }

  .footer-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-6);
  }

  .copyright {
    margin: 0;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    line-height: var(--lh-normal);
  }

  .social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 12px;
  }

  .social-link {
    display: inline-grid;
    place-items: center;
    inline-size: 2rem;
    block-size: 2rem;
    border-radius: 6px;
    background: transparent;
    text-decoration: none;

    &:is(:hover, :focus-visible) {
      outline: none;
      box-shadow: 0 0 0 3px rgba(2, 184, 254, 0.25);
    }

    svg,
    img {
      inline-size: 100%;
      block-size: 100%;
      display: block;
    }
  }
}

/* =========================================================
   TEMP — Footer: hide unfinished areas (newsletter, placeholder links, social)
   Remove when pages/features are ready.
   ========================================================= */
.site-footer {
  .col-news,
  .col-links {
    display: none;
  }

  .social {
    display: none;
  }

  .footer-top {
    grid-template-columns: 3fr 2fr;
    /* brand + about */
  }
}

/* Footer responsiveness */
@container content (max-width: 48rem) {
  .site-footer {
    .footer-top {
      grid-template-columns: 1fr;
    }

    .col-brand,
    .col-about {
      grid-column: 1 / -1;
    }
  }
}

@container content (max-width: 36.25rem) {
  .site-footer {
    .footer-top {
      grid-template-columns: 1fr;
      gap: var(--space-7);
    }

    .col-brand,
    .col-about {
      grid-column: 1 / -1;
    }

    .footer-bottom {
      grid-template-columns: 1fr;
    }
  }
}

@container content (max-width: 30rem) {
  .site-footer {
    .footer-top {
      grid-template-columns: 1fr;
    }

    .col-brand,
    .col-about {
      grid-column: 1;
    }

    .footer-bottom {
      grid-template-columns: 1fr;
    }
  }
}

/* =========================================================
   6) Global Accessibility — Skip link + Focus + Touch targets
   ========================================================= */
.skip-link {
  /* Link padding scales with text size */
  --skip-pad-b: 0.6em;
  --skip-pad-i: 0.9em;

  position: fixed;
  left: 1rem;
  top: 1rem;
  transform: translateY(-200%);
  z-index: 9999;

  background: #fff;
  color: #000;
  padding: var(--skip-pad-b) var(--skip-pad-i);

  border-radius: var(--r-2);
  box-shadow: var(--shadow-soft);

  text-decoration: underline;
  text-underline-offset: 0.2em;

  &:focus,
  &:focus-visible {
    transform: translateY(0);
  }
}

/* =========================================================
   7) Global Accessibility — Focus & Touch Targets
   ========================================================= */
:where(
  a,
  button,
  [role='button'],
  input,
  select,
  textarea,
  [tabindex]
):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 184, 254, 0.5);
  border-radius: 8px;
}

:where(button, .btn, .chip, .subscribe-btn) {
  min-block-size: 2.75rem;
}

/* =========================================================
   8) Global Preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}

@media (max-width: 26.25rem) {
  html {
    font-size: 1rem;
  }

  .site-header {
    .primary-nav {
      justify-content: flex-start;
    }
  }
}

@media (forced-colors: active) {
  :where(
    a,
    button,
    [role='button'],
    input,
    select,
    textarea,
    [tabindex]
  ):focus-visible {
    outline: 2px solid CanvasText;
    outline-offset: 2px;
    box-shadow: none;
  }

  .skip-link {
    border: 2px solid CanvasText;
  }
}

/* =========================================================
   9) Global Site Section
   ========================================================= */
.site-section {
  display: grid;
  width: 100%;
  padding-inline: calc(var(--site-gutter) + var(--gutter));
  padding-block: var(--space-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 31rem), 1fr));
  gap: var(--space-4);
  place-items: center;
  overflow-x: hidden;

  color: var(--color-primary-text);
  background: var(--color-primary-bg);

  .section-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
  }

  .section-media {
    object-fit: contain;
    aspect-ratio: auto;
    width: clamp(min(350px, 85%), 40dvw, 450px);
  }
}

.site-section:has(> .section-media:first-child) > .section-media {
  justify-self: start;
}

.site-section:has(> .section-media:last-child) > .section-media {
  justify-self: end;
}

@media (max-width: 64rem) {
  .site-section {
    .section-media {
      grid-row: 1;
    }
  }

  .site-section:has(> .section-media:first-child) > .section-media {
    justify-self: center;
  }

  .site-section:has(> .section-media:last-child) > .section-media {
    justify-self: center;
  }
}

/* =========================================================
   9) Global Site Section Hero (origin)
   ========================================================= */
.site-section--subpage-hero {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: end;
  min-height: var(--section-height);
  color: var(--color-secondary-text);
}

/* =========================================================
   9) Global Card Grid (merged)
   ========================================================= */
.card-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: clamp(var(--space-4), 2vw, var(--space-6));
  color: var(--color-secondary-text);

  .card {
    display: flex;
    background-repeat: no-repeat;
    background-size: cover;
    flex-direction: column;
    justify-content: end;
    border-radius: var(--r-3);
    padding: var(--space-6);

    min-height: 16rem;

    img {
      width: 100%;
      height: 14rem;
      object-fit: cover;
      object-position: 50% 30%;
      display: block;
      border-top-left-radius: var(--r-3);
      border-top-right-radius: var(--r-3);
    }

    h4 {
      padding-top: var(--space-2);
      font-size: var(--fs-h4);
    }
  }
}

/* =========================================================
   9) Global Book Demo Section (merged)
   ========================================================= */
.site-section--book-demo {
  color: var(--color-primary-text);
  justify-items: start;
  padding-block: 0;
  position: relative;
  overflow: hidden;
  z-index: 1;

  min-block-size: 31rem;

  .book-demo-content {
    display: grid;
    gap: var(--space-5);
    border-radius: var(--r-4);
    z-index: 3;

    h2 {
      font-size: var(--fs-h2);
    }

    h2,
    p {
      color: var(--color-primary-text);
      max-width: var(--paragraph-max-width);
      font-family: var(--font-sans);
      font-weight: 500;
    }
  }

  img {
    position: absolute;
    right: -420px;
    top: -44px;
    z-index: 2;
    width: 1094px;
    height: 884px;
    object-fit: cover;
    transform: rotate(2.63deg);
    pointer-events: none;
    user-select: none;
  }
}

/* =========================================================
   9) Global Features Section (origin)
   ========================================================= */
.site-section--features {
  background: var(--fusion-flash-white);
  color: var(--color-primary-text);
  min-height: var(--section-height);

  display: flex;
  position: relative;
  justify-content: center;
  padding-top: 0px;
  padding-bottom: 20rem;
  overflow: hidden;

  img:nth-of-type(1) {
    transform: translateY(var(--space-10));
  }

  img {
    width: clamp(min(450px, 100%), 43dvw, 550px);
  }

  .section-content {
    background: white;
    box-shadow: 0px 0px 129.5px 0px #00000040;
    border-radius: var(--r-6);
    padding: clamp(var(--space-6), 6dvw, var(--space-8));
    position: absolute;
    top: 60%;
    z-index: 2;
    width: clamp(min(41rem, 100%), 57dvw, 45rem);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);

    h2 {
      i {
        font-weight: 400;
      }
    }
  }
}

/* =========================================================
   9) Global FAQ Section
   ========================================================= */
.site-section--faq {
  place-items: stretch;

  .section-content {
    background: #ffffff;
    border-radius: var(--r-3);
    gap: 0;

    h2 {
      padding-top: var(--space-6);
      padding-bottom: var(--space-3);
      padding-inline: var(--space-6);
      margin: 0;
    }
  }

  .faq-item {
    border: 0;
    margin: 0;

    &:not(:last-child) {
      border-bottom: 1px solid #ededed;
    }
    &:last-child {
      padding-bottom: var(--space-3);
    }
  }

  .faq-question {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-4);

    padding-block: var(--space-6);
    padding-inline: var(--space-6);

    cursor: pointer;
    user-select: none;

    font-weight: 400;
    color: var(--ink, #0b0e15);

    &::-webkit-details-marker {
      display: none;
    }

    &::after {
      content: '';
      inline-size: 1rem;
      block-size: 1rem;
      background: url('../../assets/icons/ui/arrow-down.svg') no-repeat center /
        contain;
      transition: transform 0.2s ease;
    }

    &:hover {
      cursor: pointer;
    }
  }

  .faq-item[open] {
    .faq-question {
      font-weight: var(--fw-semibold);
    }

    .faq-question::after {
      transform: rotate(180deg);
    }
  }

  .faq-answer {
    padding-inline: var(--space-6);
    padding-bottom: var(--space-6);

    display: grid;
    gap: var(--space-4);

    p {
      margin: 0;
      font-family: var(--font-sans);
      line-height: 1.5;
      color: var(--ink, #0b0e15);
    }
  }

  .faq-link {
    color: var(--accent-1);
    font-weight: 600;
    text-decoration: none;
    position: relative;
  }

  .faq-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0.6);
    transform-origin: left;
    transition: transform 0.2s ease;
  }

  .faq-link:hover::after,
  .faq-link:focus-visible::after {
    transform: scaleX(1);
  }

  .faq-link:focus-visible {
    outline: none;
  }
}

/* =========================================================
   HERO helpers (your .section--hero overrides kept)
   ========================================================= */
.section--hero {
  .hero.container {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: start;
  }

  .hero__title {
    font-size: var(--fs-h1);
    line-height: var(--lh-tight);
    font-weight: 300;
  }

  .hero__body {
    font-family: var(--font-paragraph);
    font-size: var(--fs-body);
    line-height: 1.55;
  }
}

/* =========================================================
   Mobile bundle (kept together)
   ========================================================= */
@media (max-width: 48rem) {
  :root {
    --fs-h1: 3.25rem;
    --fs-body: 0.875rem;
  }

  .section--contact {
    p:not(.form-disclaimer) {
      font-size: var(--fs-body-sm);
    }
  }
}
