/*
 * Components — nav, footer, buttons, cards, form fields.
 *
 * Every value references a semantic token from tokens.css.
 */

@layer components {
  /* ────────────────────────────────────────────────────────────────── */
  /* Site header / nav                                                   */
  /* ────────────────────────────────────────────────────────────────── */

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-canvas);
    border: 1px solid transparent;
    margin-inline: 0;
    border-radius: 0;
    transition:
      top var(--duration-normal) var(--ease-out),
      margin var(--duration-normal) var(--ease-out),
      padding var(--duration-normal) var(--ease-out),
      background var(--duration-normal) var(--ease-out),
      backdrop-filter var(--duration-normal) var(--ease-out),
      -webkit-backdrop-filter var(--duration-normal) var(--ease-out),
      border-color var(--duration-normal) var(--ease-out),
      border-radius var(--duration-normal) var(--ease-out),
      box-shadow var(--duration-normal) var(--ease-out);
  }

  .site-header.is-scrolled {
    border-bottom-color: var(--border-default);
  }

  /* Pill-mode nav — active while the video hero is in view. Floats above
     the hero with an inset on each side, glass-blur background, and light
     nav text so it reads against the Ink-tinted overlay. */
  body.has-video-hero.hero-in-view .site-header {
    top: var(--sp-sm);
    margin-inline: var(--sp-lg);
    border-radius: 9999px;
    background: rgba(250, 247, 242, 0.12);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-color: rgba(250, 247, 242, 0.22);
    box-shadow: 0 4px 28px rgba(20, 28, 40, 0.18);
  }

  body.has-video-hero.hero-in-view .site-header.is-scrolled {
    border-bottom-color: rgba(250, 247, 242, 0.22);
  }

  body.has-video-hero.hero-in-view .site-header .nav__links a,
  body.has-video-hero.hero-in-view .site-header .nav__toggle-current,
  body.has-video-hero.hero-in-view .site-header .nav__toggle-sep,
  body.has-video-hero.hero-in-view .site-header .nav__toggle-link {
    color: var(--text-inverse);
  }

  /* Burger bars go light on the pill. NOTE: do NOT include the icon
     container itself — it has intrinsic width/height (22×14) and would
     paint as a solid white rectangle, obscuring the bars. */
  body.has-video-hero.hero-in-view .site-header .nav__burger-icon::before,
  body.has-video-hero.hero-in-view .site-header .nav__burger-icon::after {
    background: var(--text-inverse);
  }

  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    min-height: 4rem;
    padding-block: var(--sp-base-sm);
  }

  .nav__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-base-sm);
    color: inherit;
    text-decoration: none;
  }

  .nav__brand:hover {
    color: var(--text-primary);
  }

  .nav__wordmark {
    height: 1.75rem;
    width: auto;
  }

  /* Responsive brand: comma-only mark on mobile, full wordmark on desktop. */
  .nav__wordmark--full { display: none; }
  .nav__wordmark--mark { display: inline-block; height: 1.75rem; width: auto; }

  @media (min-width: 48rem) {
    .nav__wordmark--full { display: inline-block; }
    .nav__wordmark--mark { display: none; }
  }

  /* Bilingual nav — homepage and contact.
     Layout: [EN links LEFT] [Human, wordmark CENTER, enlarged] [ZH links RIGHT]
     No language toggle, no CTA button (per Figma). */
  .nav--bilingual {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--sp-md);
  }

  .nav--bilingual .nav__links--en {
    justify-self: start;
  }
  .nav--bilingual .nav__links--zh {
    justify-self: end;
  }

  .nav--bilingual .nav__brand {
    justify-self: center;
  }

  .nav--bilingual .nav__wordmark--full {
    height: 2.5rem;
  }

  /* Bilingual nav on mobile inherits the shared grid from .nav above.
     Burger at col 1, brand centered at col 2, col 3 empty (no CTA in
     bilingual). No overrides needed here. */

  .nav__links {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--sp-md-lg);
  }

  @media (min-width: 48rem) {
    .nav__links {
      display: flex;
      align-items: center;
    }
  }

  .nav__links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: var(--fw-medium);
    padding-block: var(--sp-sm);
    transition: color var(--duration-fast) var(--ease-out);
  }

  .nav__links a:hover {
    color: var(--action-primary);
  }

  .nav__links a[aria-current="page"] {
    color: var(--action-primary);
  }

  .nav__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
  }

  /* Mobile layout: three-column grid with brand pinned left, burger
     pinned right, and the middle column reserved for the page CTA
     (non-bilingual pages only — the bilingual homepage and contact
     page leave it empty). `.nav__actions` becomes display: contents
     so its children (cta, burger) are laid out as direct grid items.
     The header-level toggle is hidden on mobile; the same markup is
     re-rendered inside the drawer. */
  @media (max-width: 47.99rem) {
    .nav {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: var(--sp-sm);
    }
    .nav__brand {
      grid-column: 1;
      justify-self: start;
    }
    /* The unconditional `.nav--bilingual .nav__brand { justify-self: center }`
       (0,2,0) out-specifies the plain `.nav__brand` rule above on mobile,
       which otherwise leaves the comma offset to the left-quarter instead
       of flush with the container padding like the non-bilingual pages.
       Scope a matching-specificity override here. */
    .nav--bilingual .nav__brand {
      justify-self: start;
    }
    .nav__burger {
      grid-column: 3;
      justify-self: end;
    }
    .nav__links {
      display: none;
    }
    .nav:not(.nav--bilingual) .nav__actions {
      display: contents;
    }
    /* Only the header-level toggle is hidden on mobile; the one
       re-rendered inside the drawer must stay visible. */
    .nav:not(.nav--bilingual) .nav__actions .nav__toggle {
      display: none;
    }
    .nav:not(.nav--bilingual) .nav__cta {
      grid-column: 2;
      justify-self: center;
      display: inline-flex;
    }
  }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
    padding: var(--sp-sm) var(--sp-base-sm);
    min-height: 2.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
  }

  .nav__toggle-current {
    color: var(--text-primary);
    font-weight: var(--fw-semibold);
  }

  .nav__toggle-sep {
    color: var(--text-tertiary);
  }

  .nav__toggle-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0 var(--sp-xs);
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) var(--ease-out);
  }

  .nav__toggle-link:hover {
    color: var(--text-primary);
  }

  /* Mobile toggle button */
  .nav__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-md);
  }

  @media (min-width: 48rem) {
    .nav__burger {
      display: none;
    }
  }

  /* Inner-page CTA: visible on md+ only; mobile uses the drawer */
  .nav__cta {
    display: none;
  }

  @media (min-width: 48rem) {
    .nav__cta {
      display: inline-flex;
    }
  }

  /* Burger icon: two lines that collapse into an × when open. Icon has no
     background box — just the two bars against the page. */
  .nav__burger,
  .nav__burger:hover,
  .nav__burger:active,
  .nav__burger:focus-visible {
    background: transparent;
    border: 0;
  }

  .nav__burger-icon {
    position: relative;
    width: 22px;
    height: 14px;
  }

  .nav__burger-icon::before,
  .nav__burger-icon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition:
      transform var(--duration-fast) var(--ease-out),
      top var(--duration-fast) var(--ease-out),
      bottom var(--duration-fast) var(--ease-out);
  }

  .nav__burger-icon::before { top: 0; }
  .nav__burger-icon::after  { bottom: 0; }

  .nav.is-open .nav__burger-icon::before {
    top: 6px;
    transform: rotate(45deg);
  }
  .nav.is-open .nav__burger-icon::after {
    bottom: 6px;
    transform: rotate(-45deg);
  }

  /* Full-viewport mobile menu. The drawer covers everything — including
     the top bar — and fades in while sliding down. The burger sits under
     the drawer once open; a dedicated close button anchored top-left
     handles dismissal so the trigger doesn't visually leap between the
     burger's in-flow position and a fixed close-button position. */
  .nav__drawer {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: var(--bg-canvas);
    padding: 4.5rem var(--sp-lg) var(--sp-lg);
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-sm);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12%);
    transition:
      opacity var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out),
      visibility 0s linear var(--duration-normal);
  }

  .nav.is-open .nav__drawer {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
      opacity var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out),
      visibility 0s linear 0s;
  }

  @media (min-width: 48rem) {
    .nav__drawer {
      display: none !important;
    }
    .nav__drawer-close {
      display: none !important;
    }
  }

  body.nav-open {
    overflow: hidden;
  }

  /* backdrop-filter on the pill establishes a new containing block for
     position: fixed descendants, which traps the drawer inside the pill.
     Scope the override to the same class chain as the pill rule (plus
     .nav-open) so specificity wins: pill is 0,3,1 and this is 0,4,1.
     Also swap the transition list so backdrop-filter doesn't animate —
     if it did, the browser would interpolate through non-none blur
     values for 280 ms and the containing block would persist for the
     duration of the open animation. */
  body.has-video-hero.hero-in-view.nav-open .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition:
      top var(--duration-normal) var(--ease-out),
      margin var(--duration-normal) var(--ease-out),
      background var(--duration-normal) var(--ease-out),
      border-color var(--duration-normal) var(--ease-out),
      border-radius var(--duration-normal) var(--ease-out),
      box-shadow var(--duration-normal) var(--ease-out);
  }

  /* Drawer items are large display-type links. Each one fades in and rises
     slightly; transition-delay per :nth-child makes the list stagger from
     top to bottom. On close the delays reset so everything fades together. */
  .nav__drawer > li {
    width: 100%;
    opacity: 0;
    transform: translateY(-10px);
    transition:
      opacity var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out);
  }

  .nav.is-open .nav__drawer > li {
    opacity: 1;
    transform: translateY(0);
  }

  .nav.is-open .nav__drawer > li:nth-child(1) { transition-delay: 120ms; }
  .nav.is-open .nav__drawer > li:nth-child(2) { transition-delay: 180ms; }
  .nav.is-open .nav__drawer > li:nth-child(3) { transition-delay: 240ms; }
  .nav.is-open .nav__drawer > li:nth-child(4) { transition-delay: 300ms; }
  .nav.is-open .nav__drawer > li:nth-child(5) { transition-delay: 360ms; }
  .nav.is-open .nav__drawer > li:nth-child(6) { transition-delay: 420ms; }

  .nav__drawer > li > a {
    display: block;
    width: 100%;
    padding: var(--sp-base-sm) 0;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
    font-weight: var(--fw-medium);
    line-height: 1.15;
    min-height: auto;
  }

  .nav__drawer > li > a:hover,
  .nav__drawer > li > a[aria-current="page"] {
    background: transparent;
    color: var(--action-primary);
  }

  /* Language switcher pinned at the bottom-left of the drawer. */
  .nav__drawer-lang {
    margin-top: auto;
    padding-top: var(--sp-xl);
  }

  .nav__drawer-lang > a,
  .nav__drawer-lang .nav__toggle {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 0.95rem + 0.7vw, 1.375rem);
    font-weight: var(--fw-regular);
    color: var(--text-secondary);
    padding: var(--sp-xs) 0;
    min-height: auto;
    gap: var(--sp-xs);
  }

  .nav__drawer-lang .nav__toggle-current,
  .nav__drawer-lang .nav__toggle-link {
    font-size: inherit;
    padding: 0;
  }

  /* Dedicated × close button, visible only while the drawer is open.
     Positioned to sit exactly where the burger was so the icon doesn't
     leap. With box-sizing: border-box the nav's min-height (4rem)
     already includes the 0.75rem top/bottom padding, and a 2.75rem
     burger fills the 2.5rem content area — so the burger's top edge
     lands at exactly var(--sp-base-sm) from the viewport. Pill variant
     adds the pill's own insets (sp-sm top, sp-lg horizontal). */
  .nav__drawer-close {
    position: fixed;
    top: var(--sp-base-sm);
    right: var(--sp-md);
    z-index: 200;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity var(--duration-fast) var(--ease-out),
      visibility 0s linear var(--duration-fast);
  }

  body.has-video-hero.hero-in-view .nav__drawer-close {
    top: calc(var(--sp-sm) + var(--sp-base-sm));
    right: calc(var(--sp-lg) + var(--sp-md));
  }

  .nav.is-open .nav__drawer-close {
    opacity: 1;
    visibility: visible;
    transition-delay: 80ms, 0s;
  }

  .nav__drawer-close-icon {
    position: relative;
    width: 22px;
    height: 22px;
  }

  .nav__drawer-close-icon::before,
  .nav__drawer-close-icon::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
  }

  .nav__drawer-close-icon::before { transform: rotate(45deg); }
  .nav__drawer-close-icon::after  { transform: rotate(-45deg); }

  /* ────────────────────────────────────────────────────────────────── */
  /* Buttons                                                             */
  /* ────────────────────────────────────────────────────────────────── */

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: 0.75rem 1.5rem;
    min-height: 2.75rem;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: var(--fw-medium);
    line-height: 1.2;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition:
      background var(--duration-instant) var(--ease-out),
      color var(--duration-instant) var(--ease-out),
      border-color var(--duration-instant) var(--ease-out),
      transform var(--duration-instant) var(--ease-out),
      box-shadow var(--duration-instant) var(--ease-out);
  }

  .button:active {
    transform: translateY(1px);
  }

  .button:disabled,
  .button[aria-disabled="true"] {
    background: var(--neutral-200);
    color: var(--neutral-400);
    border-color: transparent;
    cursor: not-allowed;
    transform: none;
  }

  .button--primary {
    background: var(--action-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-xs);
  }

  .button--primary:hover:not(:disabled) {
    background: var(--action-primary-hover);
    color: var(--text-inverse);
  }

  .button--secondary {
    background: var(--action-secondary);
    color: var(--text-inverse);
  }

  .button--secondary:hover:not(:disabled) {
    background: var(--action-secondary-hover);
    color: var(--text-inverse);
  }

  .button--outline {
    background: var(--bg-canvas);
    color: var(--text-primary);
    border-color: var(--border-default);
  }

  .button--outline:hover:not(:disabled) {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    color: var(--text-primary);
  }

  .button--ghost {
    background: transparent;
    color: var(--text-link);
  }

  .button--ghost:hover:not(:disabled) {
    background: var(--bg-surface);
    color: var(--text-link);
  }

  /* Stacked bilingual button: EN on top, ZH below in smaller size */
  .button--stacked {
    flex-direction: column;
    gap: 2px;
    padding-block: 0.6rem;
    line-height: 1.1;
  }

  .button--stacked .button__en {
    font-size: var(--fs-body);
    font-weight: var(--fw-medium);
  }

  .button--stacked .button__zh {
    font-size: var(--fs-caption);
    font-weight: var(--fw-regular);
    /* Kept at full opacity so WCAG AA contrast holds (4.95:1 on terracotta-deep).
       Hierarchy carried by size/weight, not tone. */
  }

  .button--lg {
    padding: 1rem 1.75rem;
    min-height: 3rem;
    font-size: var(--fs-body-lg);
  }

  .button--sm {
    padding: 0.5rem 1rem;
    min-height: 2.25rem;
    font-size: var(--fs-caption);
  }

  /* Link-looking buttons / CTA text links */
  .link-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    font-weight: var(--fw-medium);
    color: var(--text-link);
    text-decoration: none;
    transition:
      color var(--duration-fast) var(--ease-out),
      gap var(--duration-fast) var(--ease-out);
  }

  .link-cta:hover {
    color: var(--text-link);
    gap: var(--sp-sm);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Pill / badge                                                        */
  /* ────────────────────────────────────────────────────────────────── */

  .pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: 4px 12px;
    font-size: var(--fs-label);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-primary);
  }

  .pill--brand {
    background: var(--terracotta-light);
    color: var(--terracotta);
  }

  .pill--stamp {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-default);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    font-weight: var(--fw-bold);
  }

  .pill--stamp::before {
    content: "•";
    color: var(--accent);
    margin-right: var(--sp-xs);
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Cards                                                               */
  /* ────────────────────────────────────────────────────────────────── */

  .card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
  }

  .card--canvas {
    background: var(--bg-canvas);
    border: 1px solid var(--border-default);
  }

  .card--bordered {
    background: transparent;
    border: 1px solid var(--border-default);
  }

  .card__eyebrow {
    color: var(--text-secondary);
  }

  .card__title {
    font-weight: var(--fw-semibold);
  }

  .card__body {
    color: var(--text-secondary);
  }

  .card__meta {
    display: flex;
    gap: var(--sp-sm);
    font-size: var(--fs-caption);
    color: var(--text-tertiary);
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Forms                                                               */
  /* ────────────────────────────────────────────────────────────────── */

  .field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
  }

  .field__label {
    display: flex;
    flex-direction: column;
    font-size: var(--fs-body-lg);
    font-weight: var(--fw-medium);
    color: var(--text-primary);
  }

  .field__label > [lang="zh-Hant"] {
    font-size: var(--fs-small);
  }

  .field__required {
    color: var(--text-secondary);
    font-weight: var(--fw-regular);
  }

  .input,
  .textarea,
  .select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--bg-canvas);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    transition:
      border-color var(--duration-fast) var(--ease-out),
      box-shadow var(--duration-fast) var(--ease-out);
  }

  /* Strip native select chrome so height matches .input exactly,
     then paint a chevron via SVG. The hex below mirrors --neutral-600
     (--text-secondary); SVG fills can't read CSS variables, so update
     both together if the neutral palette shifts. */
  .select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: var(--sp-xl);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%236B655C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-md) center;
    background-size: 0.75rem 0.5rem;
  }

  .textarea {
    min-height: 7rem;
    resize: vertical;
  }

  .input:hover,
  .textarea:hover,
  .select:hover {
    border-color: var(--border-strong);
  }

  .input:focus,
  .textarea:focus,
  .select:focus {
    border-color: var(--focus-ring);
    outline: 2px solid var(--focus-ring-soft);
    outline-offset: 0;
  }

  .input::placeholder,
  .textarea::placeholder {
    color: var(--text-placeholder);
  }

  .field--error .input,
  .field--error .textarea,
  .field--error .select {
    border-color: var(--status-error-fg);
  }

  .field__help {
    font-size: var(--fs-caption);
    color: var(--text-secondary);
  }

  .field__error {
    display: flex;
    align-items: start;
    gap: var(--sp-xs);
    font-size: var(--fs-caption);
    color: var(--status-error-fg);
  }

  .field__error::before {
    content: "⚠";
    font-size: 1.1em;
    line-height: 1.2;
  }

  /* Spinner on submit button */
  .spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: var(--radius-full);
    animation: spin 0.7s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .spinner {
      animation: none;
      border-top-color: currentColor;
      opacity: 0.6;
    }
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Footer                                                              */
  /* ────────────────────────────────────────────────────────────────── */

  .site-footer {
    background: var(--bg-warm);
    color: var(--text-primary);
    padding-block: var(--sp-3xl) var(--sp-xl);
    border-top: 1px solid var(--border-default);
  }

  /* Used on 404-style minimal footers where the wordmark sits above a
     plain bottom row. Grid-based footers inline the wordmark at the top
     of the Site column (.footer__col--with-wordmark) — no wrapper needed. */
  .footer__lockup {
    margin-bottom: var(--sp-xl);
  }

  /* Stacked bilingual lockup SVG (457×360 canvas, left-aligned).
     HTML width/height attributes control rendered size; CSS lets it scale
     down responsively on narrow columns. */
  .footer__wordmark {
    display: block;
    max-width: 100%;
    height: auto;
  }

  .footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-xl);
    padding-block: var(--sp-xl);
  }

  @media (min-width: 40rem) {
    .footer__grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 64rem) {
    .footer__grid {
      /* (wordmark + site) | services (wider) | contact+based-in stacked */
      grid-template-columns: 1fr 1.3fr 1fr;
      align-items: start;
    }
  }

  .footer__col {
    display: flex;
    flex-direction: column;
    gap: var(--sp-base-sm);
  }

  /* Stacked column: Contact on top half, Based in on bottom half. */
  .footer__col--stacked {
    gap: var(--sp-lg);
  }

  .footer__col--stacked > div {
    display: flex;
    flex-direction: column;
    gap: var(--sp-base-sm);
  }

  @media (min-width: 64rem) {
    .footer__col--stacked {
      display: grid;
      grid-template-rows: 1fr 1fr;
    }
  }

  .footer__heading {
    font-size: var(--fs-label);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .footer__tools {
    display: flex;
    flex-direction: column;
    gap: var(--sp-base-sm);
    padding-block: var(--sp-lg);
    border-block-start: 1px solid var(--border-subtle);
  }

  .footer__list--inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-md);
  }

  .footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
  }

  .footer__list a {
    color: var(--text-primary);
    text-decoration: none;
  }

  .footer__list a:hover {
    color: var(--action-primary);
  }

  .footer__bottom {
    padding-top: var(--sp-xl);
    border-top: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    font-size: var(--fs-caption);
    color: var(--text-secondary);
  }

  @media (min-width: 48rem) {
    .footer__bottom {
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Details / Accordion (FAQ)                                           */
  /* ────────────────────────────────────────────────────────────────── */

  .faq-group + .faq-group {
    margin-top: var(--sp-xl);
  }

  .faq-group__heading {
    font-size: var(--fs-label);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--sp-md);
  }

  .faq-item {
    border-top: 1px solid var(--border-default);
    padding-block: var(--sp-md);
  }

  .faq-item:last-child {
    border-bottom: 1px solid var(--border-default);
  }

  .faq-item > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-md);
    font-family: var(--font-display);
    font-size: var(--fs-h4);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    min-height: 44px;
  }

  .faq-item > summary::-webkit-details-marker {
    display: none;
  }

  .faq-item > summary::after {
    content: "+";
    font-size: 1.25em;
    font-weight: var(--fw-regular);
    color: var(--text-secondary);
    transition: transform var(--duration-fast) var(--ease-out);
  }

  .faq-item[open] > summary::after {
    content: "−";
    transform: rotate(0deg);
  }

  .faq-item__body {
    padding-top: var(--sp-sm);
    color: var(--text-secondary);
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Video (no border-radius, autoplay, full-bleed)                      */
  /* ────────────────────────────────────────────────────────────────── */

  .media-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--bg-surface);
    display: block;
    border-radius: var(--radius-lg);
    border: 2px solid var(--accent);
  }

  /* ────────────────────────────────────────────────────────────────── */
  /* Scroll animations (respect prefers-reduced-motion)                  */
  /* ────────────────────────────────────────────────────────────────── */

  [data-animate] {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity var(--duration-slow) var(--ease-out),
      transform var(--duration-slow) var(--ease-out);
  }

  [data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  @media (prefers-reduced-motion: reduce) {
    [data-animate] {
      opacity: 1;
      transform: none;
      transition: opacity 100ms linear;
    }
  }
}
