/* Accessibility and resilient navigation baseline — 2026-09-02
   Target: WCAG 2.2 AA while retaining WCAG 2.1 AA compatibility. */

:root {
  --a11y-focus: #8fffee;
  --a11y-text: #f7f6f2;
  --a11y-muted: #d5d2ca;
  --a11y-surface: #070a0a;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
  -webkit-text-size-adjust: 100%;
}

body { overflow-wrap: anywhere; }

/* Keyboard navigation */
.skip-link {
  position: fixed !important;
  top: .75rem !important;
  left: .75rem !important;
  z-index: 10000 !important;
  min-height: 44px;
  padding: .75rem 1rem !important;
  display: inline-flex;
  align-items: center;
  background: #fff !important;
  color: #050606 !important;
  border: 2px solid #050606;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--a11y-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #07100f !important;
}

/* Reliable, visible title navigation. Never remove destinations merely to fit width. */
.site-header {
  align-items: center;
  flex-wrap: wrap;
  height: auto;
}
.site-header nav {
  display: flex !important;
  flex: 1 1 620px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .35rem .55rem !important;
  min-width: 0;
}
.site-header nav > a,
.site-header .nav-resources > summary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: .65rem .72rem !important;
  color: var(--a11y-text) !important;
  line-height: 1.2;
  text-decoration-thickness: .1em;
  text-underline-offset: .2em;
  white-space: nowrap;
}
.site-header nav > a:hover,
.site-header .nav-resources > summary:hover,
.site-header nav > a[aria-current="page"] {
  color: #fff !important;
  background: rgba(105, 200, 193, .12);
}
.nav-cta {
  border: 1px solid rgba(143,255,238,.65) !important;
  background: rgba(105,200,193,.12) !important;
}
.nav-resources { position: relative; }
.nav-resources > summary { cursor: pointer; }
.nav-menu {
  z-index: 1000;
  max-width: min(90vw, 24rem);
}
.nav-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--a11y-text) !important;
}

/* General interactive targets */
.button,
.actions a,
.insight-link,
.zw-links a,
button {
  min-height: 44px;
}
.button,
.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Improve readable contrast where older layers use low-opacity copy. */
.story-hero .lede,
.section-heading > p,
.profile p:not(.eyebrow),
.method-list p,
.contact p,
footer {
  color: var(--a11y-muted);
}

/* Reflow: keep functionality at narrow viewport / high zoom. */
@media (max-width: 1120px) {
  .site-header {
    gap: .5rem 1rem;
    padding-block: .55rem;
  }
  .site-header .brand { flex: 1 1 240px; }
  .site-header nav {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .site-header nav > a:not(.nav-cta) { display: inline-flex !important; }
  .site-header {
    position: sticky;
    top: 0;
    max-height: none;
  }
  .site-header nav {
    overflow: visible;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: .5rem 4vw;
  }
  .site-header .brand {
    flex-basis: 100%;
  }
  .site-header nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: .35rem !important;
  }
  .site-header nav > a,
  .site-header .nav-resources > summary {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
  .nav-resources { width: 100%; }
  .nav-menu {
    position: fixed;
    top: auto;
    left: 4vw;
    right: 4vw;
    width: auto;
    max-height: 70vh;
    overflow-y: auto;
  }
  .story-hero,
  .section-shell,
  .soc-center,
  .zw-doctrine {
    overflow-x: clip;
  }
}

/* Users asking for less motion should get a genuinely quiet interface. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Forced-colors / Windows High Contrast resilience. */
@media (forced-colors: active) {
  .site-header,
  .nav-menu,
  .button,
  .nav-cta {
    border: 1px solid ButtonText;
  }
  :where(a, button, summary):focus-visible {
    outline: 3px solid Highlight !important;
  }
}
