/* ==========================================================================
   layout.css — page shell: header, footer, section scaffolding
   ========================================================================== */

/* --------------------------------------------------------------------------
   Containers & sections
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* A narrower measure for sections that are mostly prose. */
.wrap--narrow {
  max-width: 68rem;
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* Alternating tone gives the page a rhythm instead of one flat white run. */
.section--alt {
  background: var(--c-surface-alt);
}

/* Heading block that opens a section. */
.section__head {
  max-width: 48rem;
  margin-bottom: var(--block);
}

.section__head--wide {
  max-width: 62rem;
}

.section__head p {
  margin-top: var(--stack);
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.45;
  color: var(--c-muted);
}

.section--media .section__head p {
  color: rgba(255, 255, 255, 0.88);
}

/* --------------------------------------------------------------------------
   Media sections

   These are composited the way the original does it: a flat colour underlay
   with the photo or video laid over it at reduced opacity. That is what
   darkens the photography — there is no gradient scrim anywhere on the site.
   The measured opacity is noted on each modifier.
   -------------------------------------------------------------------------- */
.section--media {
  position: relative;
  display: flex;
  align-items: center;
  padding-block: calc(var(--section-y) * 1.15);
  color: var(--c-inverse);
  isolation: isolate;
  /* Brand navy rather than flat black, so the darkened photography carries a
     hint of the logo colour. */
  background: var(--c-brand-deep);
  --c-heading: var(--c-inverse);
}

.section--media .section__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.section__bg img,
.section__bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* How much of the photo shows through the black underlay. Lower = darker, so
   long-form copy stays readable over busy imagery. */
.section--dim-70 .section__bg { opacity: 0.7; }
.section--dim-55 .section__bg { opacity: 0.55; }
.section--dim-40 .section__bg { opacity: 0.4; }
.section--dim-30 .section__bg { opacity: 0.3; }

/* --------------------------------------------------------------------------
   Site header — fixed, transparent over the hero, opaque once scrolled
   -------------------------------------------------------------------------- */
/* The grey bar is the DEFAULT, not something JavaScript switches on. A fixed
   bar with no background lets page copy scroll through it, so that state has to
   be the enhancement — see .site-header--overlay below. */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  color: var(--c-inverse);
}

/* The bar itself lives on a pseudo-element. backdrop-filter on .site-header
   would make it a containing block for fixed descendants, which would trap the
   mobile drawer inside the 65px bar instead of letting it cover the viewport. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c-header-scrolled);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.3s var(--ease);
}

/* The header sits on a narrower gutter than the page content (44px at 1440). */
.site-header .wrap.site-header__inner {
  padding-inline: clamp(1.25rem, 3.05vw, 3.5rem);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

/* On the home page the bar drops out over the hero photo, then the grey
   returns once the hero scrolls past. Both halves of that need scripts: the
   `js-on` flag is set by the inline boot script and withdrawn if the modules
   never load, and nav.js adds `is-scrolled`. If either fails the rule below
   never applies and the default grey bar stands. */
.js-on .site-header--overlay:not(.is-scrolled)::before {
  opacity: 0;
}

/* ...but never while the drawer is open — the bar has to stay solid then. */
.js-on .site-header--overlay:not(.is-scrolled):has(.nav-check:checked)::before {
  opacity: 1;
}

.wordmark {
  font-family: var(--font-sans);
  font-size: var(--fs-wordmark);
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Primary navigation
   -------------------------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 5.2vw, 5rem);
}

.nav__link {
  position: relative;
  font-size: var(--fs-nav);
  font-weight: 300;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-block: 0.25rem;
}

/* The hover rule is the brand cyan rather than the link colour — it is the one
   place in the header where the accent gets to show. */
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

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

/* The demo link is drawn as an outlined pill in the comps, which separates the
   one action in the bar from the four navigation links. */
.nav__link--cta {
  padding: 0.5rem 1.15rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
}

.nav__link--cta::after {
  content: none;
}

.nav__link--cta:hover,
.nav__link--cta:focus-visible {
  background: var(--c-inverse);
  color: var(--c-brand);
  border-color: var(--c-inverse);
}

/* Language switch — the active language is plain text, the other a link. */
.nav__lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav__lang .is-active {
  font-weight: 700;
}

.nav__lang .sep {
  opacity: 0.45;
}

.nav__lang a {
  opacity: 0.75;
  transition: opacity 0.2s var(--ease);
}

.nav__lang a:hover,
.nav__lang a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Hamburger ----------------------------------------------------------------
   The checkbox is the state; the label is the button. No script involved, so
   the drawer opens whether or not the modules loaded. */
.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

/* Spacing comes from the parent's gap, not margins — sibling margins collapse
   and used to strand the bars in the top half of the button. */
.nav-toggle__bar {
  display: block;
  width: 26px;
  height: 2px;
  margin: 0;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

/* The checkbox is off-screen, so surface its focus ring on the bars instead. */
.nav-check:focus-visible + .nav-toggle {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.nav-check:checked + .nav-toggle .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-check:checked + .nav-toggle .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-check:checked + .nav-toggle .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile drawer ------------------------------------------------------------ */
@media (max-width: 60rem) {
  /* Burger first, wordmark beside it, both hard against the left gutter. */
  .site-header__inner {
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    order: -2;
    position: relative;
    z-index: 2;
    margin-left: -0.65rem; /* optically align the bars with the gutter */
  }

  .wordmark {
    order: -1;
    position: relative;
    z-index: 2;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    padding: calc(var(--header-h) + 1.5rem) var(--gutter) var(--gutter);
    background: var(--c-brand);
    color: var(--c-inverse);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1.5rem);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
      visibility 0.3s;
  }

  /* The whole open/close mechanism, in one selector. */
  .nav-check:checked ~ .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__link {
    width: 100%;
    padding-block: 1.15rem;
    font-size: 1.3125rem;
    letter-spacing: 0.04em;
  }

  /* The hover rule doubles as a permanent hairline, so the drawer reads as a
     list rather than four words floating on a flat panel. */
  .nav__link::after {
    height: 1px;
    background: var(--c-line-inverse);
    transform: none;
  }

  .nav__link:hover::after,
  .nav__link:focus-visible::after {
    height: 2px;
    background: var(--c-accent);
  }

  /* Requesting a demo is the one action in here, so it takes the pill. */
  .nav__link:last-child {
    width: auto;
    margin-top: 2.25rem;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-pill);
    background: var(--c-surface);
    color: var(--c-brand);
    font-size: 1rem;
    letter-spacing: 0.02em;
  }

  .nav__link:last-child::after {
    content: none;
  }

  /* The drawer covers the viewport, so the bar's own contents need the light
     treatment its dark panel calls for. */
  .site-header:has(.nav-check:checked) .wordmark,
  .site-header:has(.nav-check:checked) .nav-toggle {
    color: var(--c-inverse);
  }

  /* Scroll lock without script; nav.js also sets .is-locked as a fallback. */
  body:has(.nav-check:checked) {
    overflow: hidden;
  }
}

/* Above the breakpoint the nav is always visible and the control is gone. */
@media (min-width: 60.0625rem) {
  .nav-check {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Site footer — light grey panel, three columns
   -------------------------------------------------------------------------- */
.site-footer {
  padding-block: clamp(3rem, 11.5vw, 11rem) clamp(3rem, 7vw, 7rem);
  background: var(--c-surface-alt);
  color: var(--c-ink);
}

.site-footer__grid {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .site-footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.site-footer__nav li + li {
  margin-top: 0.85rem;
}

.site-footer__nav a {
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer__title {
  margin-bottom: 0.75rem;
  font-size: var(--fs-micro);
  font-weight: 700;
}

.site-footer__list {
  font-size: var(--fs-micro);
}

.site-footer__list li + li {
  margin-top: 1.25rem;
}

.site-footer__list a:hover,
.site-footer__list a:focus-visible,
.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__privacy {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__badge {
  width: min(12.375rem, 100%);  /* the original renders it 198px wide */
  margin-bottom: 1rem;
}

.site-footer__legal {
  font-size: var(--fs-micro);
  line-height: 1.7;
}
