/* ==========================================================================
   LAYOUT
   Containers, header/nav, footer, page-level grids.
   ========================================================================== */

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

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

.section {
  position: relative;
  padding-block: var(--section-pad);
  z-index: 2;
}

.section-tight { padding-block: clamp(48px, 6vw, 80px); }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head.center { max-width: 620px; margin-inline: auto; text-align: center; align-items: center; }

.section-head p { color: var(--color-text-dim); font-size: var(--fs-lead); }

/* ---- header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}

/* the frosted-glass fill lives on a ::before layer, not on .site-header
   itself — a `filter`/`backdrop-filter` on .site-header would make it a
   containing block for its fixed-position descendants (the mobile nav
   panel), breaking that panel's full-viewport positioning on mobile */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out), backdrop-filter var(--dur-fast) var(--ease-out);
}

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

.site-header.is-scrolled::before {
  background-color: rgba(11, 11, 12, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-brand .mark { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

.nav-links a:not(.btn) {
  position: relative;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-text-dim);
  padding-block: 4px;
}

.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--color-accent);
  transition: width var(--dur-fast) var(--ease-out);
}

.nav-links a:not(.btn):hover { color: var(--color-text); }
.nav-links a:not(.btn):hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--color-text); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.nav-toggle .bars {
  position: relative;
  width: 16px; height: 11px;
}

.nav-toggle .bars span {
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--color-text);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out), top var(--dur-fast) var(--ease-out);
}

.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 5px; }
.nav-toggle .bars span:nth-child(3) { top: 10px; }

.nav-toggle[aria-expanded="true"] .bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* ---- footer ---- */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--color-border-soft);
  padding-block: clamp(56px, 8vw, 90px) 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(36px, 6vw, 56px);
}

.footer-brand p {
  color: var(--color-text-dim);
  font-size: var(--fs-small);
  max-width: 280px;
  margin-top: 14px;
}

.footer-col-title {
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dimmer);
  margin-bottom: 18px;
}

.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a { font-size: var(--fs-small); color: var(--color-text-dim); transition: color var(--dur-fast); }
.footer-links a:hover { color: var(--color-accent); }

/* Currently unused: the footer social icons were pulled (see git history)
   after the LinkedIn placeholder handle turned out to resolve to a real,
   unrelated UK company. Kept ready for whenever real profile URLs exist —
   just add a .footer-social div back into footer-brand in each page. */
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text-dim);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.footer-social a:hover { color: var(--color-accent); background: rgba(34, 224, 255, 0.1); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-soft);
  font-size: var(--fs-micro);
  color: var(--color-text-dimmer);
}

.footer-bottom a { color: var(--color-text-dimmer); transition: color var(--dur-fast); }
.footer-bottom a:hover { color: var(--color-accent); }

/* wraps the Privacy Policy / Sitemap / Terms links so footer-bottom's
   space-between still only has two things to split: the copyright on
   the left, this group of links on the right */
.footer-legal-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }

  .nav-links.mobile-open {
    display: flex;
    position: fixed;
    inset: 84px 0 0 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 24px var(--gutter) 40px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border-soft);
    overflow-y: auto;
  }

  .nav-links.mobile-open a:not(.btn) {
    width: 100%;
    padding-block: 16px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border-soft);
  }

  .nav-links.mobile-open .btn { margin-top: 20px; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
