/* ============================================================
   BASE — shared reset, typography loading, and structural
   skeleton for header/footer. Each vertical reskins these
   classes with its own palette; markup and behavior stay
   consistent so the site reads as one hand across four worlds.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4, p, figure { margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline-offset: 3px;
}

/* ---------- Shared header skeleton ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.8rem clamp(1.25rem, 4vw, 2.5rem);
}

.site-header__brands {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  min-width: 0;
}

.site-header__subbrand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-left: clamp(1rem, 3vw, 2rem);
  border-left: 1px solid rgba(128, 128, 128, 0.35);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-header__submark {
  height: 34px;
  width: auto;
  display: block;
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.site-header[data-scrolled="true"] .site-header__submark {
  transform: scale(0.72);
}

@media (max-width: 1080px) {
  .site-header__subbrand { display: none; }
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.nav-item--dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.4em;
  background: none;
  border: none;
  padding: 0.25rem 0;
}

.nav-dropdown-trigger .chevron {
  transition: transform 0.25s ease;
  width: 0.6em;
  height: 0.6em;
}

.nav-item--dropdown[data-open="true"] .chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.9rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 320px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.nav-item--dropdown[data-open="true"] .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1.1rem;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }

  .nav-menu > li > a,
  .nav-dropdown-trigger {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .nav-menu {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(86vw, 380px);
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 5.5rem 1.75rem 2rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow-y: auto;
  }

  .nav-menu[data-open="true"] { transform: translateX(0); }

  .nav-item--dropdown { width: 100%; }

  .nav-dropdown-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
  }

  .nav-item--dropdown[data-open="true"] .nav-dropdown-collapse {
    grid-template-rows: 1fr;
  }

  .nav-dropdown,
  .nav-item--dropdown[data-open="true"] .nav-dropdown {
    position: static;
    left: auto;
    transform: none;
    min-width: 0;
    width: 100%;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    min-height: 0;
    overflow: hidden;
  }
}

/* ---------- Shared footer skeleton ---------- */

.site-footer {
  width: 100%;
}

.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.site-footer__bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* Footer links sit in stacked lists — give each a 24px+ hit area (WCAG 2.5.8). */
.site-footer__inner li a {
  display: inline-block;
  padding-block: 0.25rem;
}

/* ---------- Shared form + button sizing ---------- */

.btn { min-height: 44px; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* Grid tracks default to min-content; a long <option> would otherwise
   push the whole contact column past a phone's edge. */
.contact-wrap > * { min-width: 0; }

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ---------- Shared skip link ---------- */

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Shared lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 5rem);
  background: rgba(10, 8, 6, 0.9);
}

.lightbox[hidden] { display: none; }

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- Reduced motion ----------
   Keep every state change (reveals still fade in, the header mark still
   shrinks) but drop travel, rotation and looping pulses. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  [data-reveal] {
    transform: none !important;
    transition: opacity 0.3s ease !important;
  }

  .site-header__submark,
  .nav-menu,
  .nav-dropdown,
  .nav-dropdown-collapse,
  .nav-dropdown-trigger .chevron {
    transition: none;
  }

  /* Page stylesheets load after base.css, so these need the extra weight. */
  .compass-needle { animation: none !important; }

  .radar-sweep { animation: none !important; opacity: 0.15; }

  .radar-blip { animation: none !important; opacity: 0.9 !important; }
}
