/* ==========================================================================
   layout.css — Containers, sections, site header, site footer, grids
   ========================================================================== */

/* ---- Containers ---------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--content {
  max-width: var(--max-content);
}

.container--narrow {
  max-width: 760px;
}

.prose {
  max-width: var(--max-prose);
  color: var(--text-soft);
  line-height: var(--lh-loose);
}

.prose > * + * {
  margin-top: var(--sp-4);
}

/* ---- Sections ------------------------------------------------------------ */

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

.section--tight {
  padding-block: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section--tinted {
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--bg) 65%);
}

.section--deep {
  background: var(--grad-deep);
  border-block: 1px solid var(--line);
}

/* ---- Section headings ---------------------------------------------------- */

.section-head {
  max-width: 58ch;
  margin-bottom: clamp(1.75rem, 1.25rem + 1.8vw, 2.75rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .eyebrow {
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 620;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-700);
}

.eyebrow::before {
  content: "";
  width: 1.8em;
  height: 1px;
  background: var(--blue-500);
}

.section-head__lead {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead);
  line-height: var(--lh-loose);
  color: var(--text-soft);
}

/* ---- Grids --------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--sp-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid--split {
  grid-template-columns: 1fr;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: start;
}

@media (min-width: 900px) {
  .grid--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .grid--split-wide {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.stack-lg > * + * {
  margin-top: var(--sp-6);
}

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgb(255 255 255 / 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: rgb(255 255 255 / 0.94);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

/* ==========================================================================
   Brand lockup

   Three parts held as one mark: the brain icon, the wordmark, and a rule of
   three values beneath it. The tagline is a flex row set to space-between,
   so it stretches to whatever width the wordmark occupies and the two lines
   stay optically locked at every size instead of drifting apart.
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.6rem, 0.45rem + 0.55vw, 1rem);
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand__mark {
  width: clamp(42px, 2.2rem + 1.1vw, 58px);
  height: clamp(42px, 2.2rem + 1.1vw, 58px);
  object-fit: contain;
  flex-shrink: 0;
}

/* Column children stretch by default, which is what gives the tagline the
   wordmark's width to distribute itself across. */
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.42em;
}

.brand__name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 0.55rem + 1.62vw, 2.08rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--heading);
  white-space: nowrap;
}

.brand__tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45em;
  font-size: clamp(0.5rem, 0.16rem + 0.44vw, 0.565rem);
  font-weight: 640;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--blue-700);
}

.brand__sep {
  flex-shrink: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--blue-400);
}

/* The mark is the only part that survives the narrowest screens intact; the
   type steps down so the lockup never crowds the menu button. */
@media (max-width: 480px) {
  .brand {
    gap: 0.55rem;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
  }

  .brand__name {
    font-size: 1.12rem;
  }

  /* 8px is the floor here: this is a site about access, so the tagline
     never shrinks below what is comfortably readable. */
  .brand__tag {
    font-size: 0.5rem;
    letter-spacing: 0.055em;
    gap: 0.3em;
  }
}

/* Primary navigation */

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

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list li + li {
  margin-top: 0;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 520;
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}

.nav__link:hover {
  color: var(--text);
  background: rgb(var(--ink-rgb) / 0.05);
}

.nav__link[aria-current="page"] {
  color: var(--text);
  font-weight: 620;
  background: rgb(var(--brand-rgb) / 0.12);
}

.nav__cta {
  margin-left: var(--sp-2);
}

/* Mobile menu toggle */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: background-color var(--dur-fast) var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--dur) var(--ease);
}

.nav-toggle__bars::before {
  top: -6px;
}
.nav-toggle__bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--gutter) var(--sp-6);
    background: var(--n-850);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
      visibility var(--dur);
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
  }

  .nav__link {
    display: block;
    padding: 0.8rem 0.9rem;
    font-size: 1.05rem;
    border-radius: var(--r-sm);
  }

  .nav__cta {
    margin-left: 0;
    justify-content: center;
  }
}

/* ==========================================================================
   Site footer
   ========================================================================== */

.site-footer {
  position: relative;
  padding-top: clamp(2.75rem, 2rem + 3.5vw, 4.5rem);
  /* Extra room at the bottom so the fixed back-to-top button never lands on
     the last line of footer text. */
  padding-bottom: calc(var(--sp-6) + 3rem);
  background: var(--n-950);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-soft);
  text-decoration: underline;
}

.site-footer__grid {
  display: grid;
  gap: var(--sp-7);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: var(--sp-8);
  }
}

.site-footer .brand__name {
  color: var(--heading);
}

.site-footer__blurb {
  margin-top: var(--sp-4);
  max-width: 38ch;
  color: var(--text-mute);
  line-height: var(--lh-loose);
}

.site-footer__title {
  margin-bottom: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 640;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-700);
}

.site-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer__list li + li {
  margin-top: var(--sp-3);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-mute);
}
