@layer layout {
  .container {
    width: min(100% - 2 * var(--space-m), var(--container));
    margin-inline: auto;
  }

  .section {
    padding-block: var(--space-2xl);

    &.alt {
      background: var(--color-surface-alt);
    }
  }

  .section-head {
    display: grid;
    gap: var(--space-xs);
    margin-block-end: var(--space-l);
  }

  .eyebrow {
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
  }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-h);
    background: rgb(251 250 247 / 0.8);
    backdrop-filter: blur(12px) saturate(1.4);
    border-block-end: 1px solid var(--color-line);
    /* Keeps the header still during page view transitions */
    view-transition-name: site-header;

    & .container {
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-m);
    }

    & .logo img {
      height: calc(var(--header-h) - 1.5rem);
      width: auto;
    }
  }

  /* Desktop: logo ............ nav  [Message us] */
  .site-nav {
    margin-inline-start: auto;
  }

  .nav-toggle {
    display: none;
    padding: var(--space-xs);
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
  }

  .site-nav ul {
    display: flex;
    gap: var(--space-l);
    padding: 0;
    list-style: none;
  }

  .site-nav a {
    position: relative;
    padding-block: var(--space-2xs);
    color: var(--color-ink);
    font-weight: 500;
    text-decoration: none;

    /* Underline that grows from the center */
    &::after {
      content: "";
      position: absolute;
      inset-inline: 0;
      bottom: 0;
      height: 2px;
      background: var(--color-accent);
      scale: 0 1;
      transition: scale 0.3s var(--ease-out);
    }

    &:hover::after,
    &[aria-current="page"]::after {
      scale: 1 1;
    }
  }

  /* Mobile nav: the menu opens whenever the header *contains* an expanded
     toggle. :has() lets a parent react to a child's state, with no extra class needed. */
  @media (width < 48rem) {
    .nav-toggle {
      display: block;
    }

    /* Phones: the nav is out of the flow (dropdown), so the CTA takes over
       pushing right: logo ...... [Message us] Menu */
    .header-cta {
      margin-inline-start: auto;
    }

    .site-nav {
      position: absolute;
      inset: var(--header-h) 0 auto 0;
      background: var(--color-surface);
      border-block-end: 1px solid var(--color-line);
      box-shadow: var(--shadow-m);
      display: none;

      & ul {
        flex-direction: column;
        gap: 0;
        padding: var(--space-s) var(--space-m);
      }

      & a {
        display: block;
        padding-block: var(--space-s);
      }
    }

    .site-header:has(.nav-toggle[aria-expanded="true"]) .site-nav {
      display: block;
    }
  }

  /* ---------- Footer ---------- */
  .site-footer {
    padding-block: var(--space-xl);
    background: var(--color-ink);
    color: rgb(255 255 255 / 0.75);
    font-size: var(--step--1);

    & .container {
      display: grid;
      gap: var(--space-l);
      grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    }

    & h3 {
      color: #fff;
      font-size: var(--step-0);
      margin-block-end: var(--space-xs);
    }

    & a {
      color: inherit;
    }

    & ul {
      padding: 0;
      list-style: none;
      display: grid;
      gap: var(--space-2xs);
    }

    & .copyright {
      grid-column: 1 / -1;
      padding-block-start: var(--space-m);
      border-block-start: 1px solid rgb(255 255 255 / 0.15);
    }
  }

  /* ---------- Page hero (Pricing / Photos) ---------- */
  .page-hero {
    padding-block: var(--space-xl) var(--space-l);

    & p {
      color: var(--color-ink-soft);
      font-size: var(--step-1);
      margin-block-start: var(--space-s);
    }
  }
}
