/* ==========================================================================
   Maxer Photonics — Layout: header, footer, section shells, grid utilities
   ========================================================================== */

.section {
  position: relative;
  padding-block: var(--space-section);
  background: var(--ink-0);
}

.section--alt { background: var(--ink-1); }

.section--paper {
  background: var(--paper-0);
  color: var(--text-on-paper);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  max-width: 44rem;
}

.section-head--split {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  max-width: none;
  gap: var(--space-lg);
}

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

/* Grid items get an implicit min-width:auto floor equal to their content's
   min-content size, which can force a 1fr column wider than its track (and
   the page wider than the viewport) when content contains a long unbreakable
   run (e.g. an email address). Neutralizing that floor site-wide is the
   standard fix — harmless wherever a track is already content's width or
   wider, which is every existing desktop layout. */
.grid > * { min-width: 0; }

.grid-12 { grid-template-columns: repeat(12, 1fr); }

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

/* ---------------------------------- Header ---------------------------- */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 76px;
  background: rgba(7, 8, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.brand img { height: 37.4px; width: auto; } /* 22px + 70% */

.nav-primary {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-primary a {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-on-dark-dim);
  position: relative;
  padding-block: 0.4rem;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav-primary a:hover,
.nav-primary a:focus-visible { color: var(--text-on-dark); }

.nav-primary a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--spectrum-gradient);
  transition: right var(--dur-base) var(--ease-out);
}

.nav-primary a:hover::after,
.nav-primary a:focus-visible::after { right: 0; }

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--text-on-dark);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

/* ---------------------------------- Mobile nav overlay ------------------ */

.nav-overlay {
  position: fixed;
  inset: 0;
  /* Above the GDPR consent banner (z-index 2000, css/pages.css) — an
     intentionally-opened full-screen menu shouldn't be covered by a
     passive, dismissible banner underneath it. */
  z-index: 2050;
  background: var(--ink-0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--container-pad);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s var(--dur-base);
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s;
}

.nav-overlay a {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  font-weight: 800;
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--line-0);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), color var(--dur-micro) var(--ease-standard);
}

.nav-overlay.is-open a {
  opacity: 1;
  transform: translateY(0);
}
.nav-overlay.is-open a:nth-child(1) { transition-delay: 80ms; }
.nav-overlay.is-open a:nth-child(2) { transition-delay: 140ms; }
.nav-overlay.is-open a:nth-child(3) { transition-delay: 200ms; }
.nav-overlay.is-open a:nth-child(4) { transition-delay: 260ms; }
.nav-overlay.is-open a:nth-child(5) { transition-delay: 320ms; }

.nav-overlay a:hover { color: var(--accent-cyan); }

@media (prefers-reduced-motion: reduce) {
  .nav-overlay a { transition: opacity var(--dur-fast) linear; transform: none; }
}

/* ---------------------------------- Footer ------------------------------ */

.site-footer {
  background: var(--ink-0);
  border-top: 1px solid var(--line-0);
  padding-block: var(--space-2xl) var(--space-lg);
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.footer-brand { max-width: 34ch; }

.footer-brand p {
  margin-top: var(--space-sm);
  max-width: 30ch;
  font-size: var(--fs-small);
  color: var(--text-on-dark-dim);
}

/* Six evenly distributed columns, wide horizontal gaps, no per-column
   borders/cards — a dense, wide grid rather than the narrower 4-column
   layout this replaces. */
.footer-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: var(--space-xl);
  row-gap: var(--space-lg);
}

/* Compact, consistent vertical rhythm between links (gap, not padding). */
.footer-col { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-dark-faint);
  font-weight: 500;
  margin-bottom: calc(var(--space-sm) - 0.55rem);
}

.footer-col a, .footer-col li {
  display: block;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-on-dark-dim);
}

.footer-col a:hover { color: var(--text-on-dark); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line-0);
  font-size: var(--fs-small);
  color: var(--text-on-dark-faint);
  flex-wrap: wrap;
  gap: var(--space-sm);
}
