/* =============================================================================
 * LAYOUT — containers, sections, header, footer
 * ===========================================================================*/

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

.section {
  background: var(--bg);
  color: var(--text);
  padding-block: var(--section-y);
  position: relative;
  isolation: isolate;
  /* Contain reveal transforms + decorative glows so they never widen the page.
     `clip` (unlike hidden) doesn't force a scroll container or affect overflow-y. */
  overflow-x: clip;
}
.section--tight { padding-block: clamp(2.5rem, 2rem + 3vw, 4rem); }
.section--flush-top { padding-top: 0; }

.section__head { max-width: 720px; margin-bottom: var(--space-xl); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head h2 { margin-top: var(--space-sm); }
.section__head p { margin-top: var(--space-md); }

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

/* Generic responsive grids */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============================ HEADER ====================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), backdrop-filter var(--dur) var(--ease-out);
  border-bottom: 1px solid transparent;
  background: transparent;
}
.site-header[data-scrolled='true'] {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  flex-shrink: 0;
}
.brand__name { font-size: 1.02rem; white-space: nowrap; }
.brand__name b { font-weight: 600; }

/* Real Verity logo images (wordmark / mark). Proportion preserved: fixed height,
   width auto, never stretched. Explicit width/height attrs prevent layout shift. */
.brand__logo { display: block; height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.brand--header .brand__logo { height: 26px; }
.brand--footer .brand__logo { height: 30px; }
@media (max-width: 640px) { .brand--header .brand__logo { height: 30px; } }
/* Light knockout for the single-tone logo on dark surfaces (footer, drawer,
   portal entry) — interim until a reversed-colour asset is provided. */
.brand--invert .brand__logo,
.brand__logo.brand--invert { filter: brightness(0) invert(1); opacity: 0.92; }

.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.nav-primary a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
}
.nav-primary a:hover { color: var(--text-strong); }
.nav-primary a[aria-current='page'] { color: var(--text-strong); }
.nav-primary a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.28rem;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--mint), var(--periwinkle));
}

.header-search {
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.header-search:hover { color: var(--text-strong); border-color: var(--border-strong); }
.header-search svg { width: 18px; height: 18px; }
.header-cta { margin-left: 0.25rem; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  color: var(--text-strong);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 960px) {
  /* Higher specificity so these beat .btn's display from components.css */
  .site-header .nav-primary,
  .site-header .header-search,
  .site-header .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  background: var(--bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
}
.drawer[data-open='true'] { visibility: visible; opacity: 1; }
.drawer__top {
  display: flex; align-items: center;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--border);
}
.drawer__close { margin-left: auto; width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 1px solid var(--border); }
.drawer__body {
  padding: var(--space-xl) var(--gutter) calc(var(--space-2xl) + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.drawer__body a.drawer-link {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--text-strong);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__body a.drawer-link span { color: var(--muted); font-family: var(--font-mono); font-size: 0.7rem; }
.drawer__cta { margin-top: var(--space-lg); }

/* ============================ FOOTER ====================================== */
.site-footer {
  background: var(--black);          /* solid, deep black footer */
  color: var(--off-white);
  padding-block: var(--space-3xl) var(--space-xl);
  position: relative;
}
.site-footer[data-theme] { --text-muted: var(--muted-txt); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-xl);
}
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--muted-txt); margin-top: var(--space-md); font-size: 0.95rem; }
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--muted-txt);
  margin-bottom: var(--space-md);
}
.footer-col a { display: block; padding: 0.28rem 0; color: #d4cfe0; font-size: 0.94rem; }
.footer-col a:hover { color: var(--off-white); }
.footer-social { display: flex; gap: 0.6rem; margin-top: var(--space-lg); }
.footer-social a {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(205,184,255,0.16); color: #d4cfe0;
}
.footer-social a:hover { color: var(--off-white); border-color: color-mix(in srgb, var(--violet) 55%, transparent); }
.footer-social svg { width: 18px; height: 18px; }

.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(205,184,255,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  align-items: center;
  justify-content: space-between;
  color: var(--muted-txt);
  font-size: 0.85rem;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.footer-disclaimer {
  margin-top: var(--space-lg);
  color: var(--muted-txt);
  font-size: 0.8rem;
  max-width: 760px;
  line-height: 1.6;
}
.footer-newsletter { margin-top: var(--space-md); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl) var(--space-lg); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; row-gap: var(--space-2xl); }
  .footer-col a { padding: 0.4rem 0; }   /* comfier footer tap targets */
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .footer-bottom nav { gap: var(--space-sm) var(--space-md); }
}
