/* Helicon Defense — correction layer (2026-08-16 immediate correction package)
 * Loaded after styles.css and site-v5.css. Additive only: no existing brand
 * token, colour, or type scale is redefined.
 *
 * HD-009 header density 1280–1440px, HD-002 error state, HD-013 radio group.
 */

/* ---------------------------------------------- HD-009 masthead density */
/* The duplicate Contact control is removed in markup. The remaining tuning
   keeps every control visible and non-overlapping from 1280px upward.       */
/* nowrap applies only where the full desktop nav is shown. Below 1081px the
   nav collapses into the toggle drawer and the masthead MUST stay wrappable,
   otherwise the language chip, CTA and Menu button run off a 320-375px screen. */
@media (min-width: 1081px) {
  .mast-inner {
    gap: clamp(12px, 1.4vw, 28px);
    flex-wrap: nowrap;
  }
  .mast-nav > ul {
    gap: clamp(10px, 1.05vw, 22px);
    flex-wrap: nowrap;
  }
}
@media (max-width: 1080px) {
  .mast-inner { flex-wrap: wrap; row-gap: 8px; }
  .mast-right { flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; row-gap: 8px; }
}
@media (max-width: 420px) {
  /* 320px: brand, language chip, CTA and Menu all fit without clipping */
  .mast-inner { padding-left: 10px; padding-right: 10px; column-gap: 8px; }
  .mast-right { gap: 6px; }
  .mast-cta { padding: 9px 8px; font-size: 10.5px; letter-spacing: 0.05em; }
  .mast .lang-chip { padding: 6px 8px; }
  .mast-toggle { padding: 10px 10px; }
}
.mast-nav > ul > li > a,
.mast-res-btn {
  white-space: nowrap;
}
.mast-right {
  gap: 12px;
  flex: 0 0 auto;
}
/* 1280-1365px was the reported crowding band. Measured intrinsic width at
   1280px was 1351px (brand 203 + nav 860 + controls 172 + gaps + 80px pad),
   so density is reduced by ~90px across padding, gaps and label size while
   keeping every label above the 12px floor and keeping Resources + language. */
@media (min-width: 1081px) and (max-width: 1439px) {
  .mast-inner {
    padding-left: 20px;
    padding-right: 20px;
    gap: 12px;
  }
  .mast-nav > ul { gap: 8px; }
  .mast-nav > ul > li > a,
  .mast-res-btn {
    font-size: 0.78125rem;     /* 12.5px — above the 12px floor */
    letter-spacing: 0.01em;
    padding: 4px 6px;
  }
  .mast-word {
    font-size: 0.9375rem;
  }
  .mast-right { gap: 8px; }
  .mast-cta { padding: 9px 10px; }
}
@media (min-width: 1440px) {
  .mast-nav > ul > li > a,
  .mast-res-btn {
    font-size: 0.875rem;
  }
}
/* Nothing in the header may create horizontal overflow at any width. */
html, body { overflow-x: hidden; }
.mast, .mast-inner { max-width: 100%; }

/* ------------------------------------------------- HD-013 audience group */
.represent-group[role="radiogroup"] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.represent-option:focus-within {
  outline: 3px solid #E36414;
  outline-offset: 2px;
  border-radius: 4px;
}
.audience-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 2rem;
}
.audience-fieldset > legend {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* --------------------------------------------------- HD-002 error state */
.form-error {
  border-left: 4px solid #A12C7B;
  background: rgba(161, 44, 123, 0.06);
  padding: 14px 16px;
  margin: 0 0 18px;
  border-radius: 3px;
}
.form-error:focus-visible,
.form-error:focus {
  outline: 3px solid #E36414;
  outline-offset: 2px;
}
.form-error__title {
  font-weight: 700;
  margin: 0 0 6px;
}
.form-error p { margin: 0 0 6px; line-height: 1.55; }
.form-error__detail {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  opacity: 0.7;
}
button[aria-busy="true"] { opacity: 0.75; cursor: progress; }

/* ------------------------------------------ preview-only backend notice */
.backend-notice {
  border: 1px dashed rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  margin: 0 0 20px;
  font-size: 0.85rem;
  line-height: 1.55;
  border-radius: 3px;
}

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

/* ------------------------------------- QA-A11Y: WCAG AA contrast repairs
 * Measured with the runtime suite (build/qa_runtime.js) against the composited
 * background actually behind each string. Only the failing roles are touched;
 * brand hues are preserved, darkened or lightened to the nearest AA-passing
 * value rather than replaced.
 *   #C25510 inline links / outline-button labels on light surfaces  4.05-4.37:1
 *   #C25510 footer ecosystem name + description on navy             4.10:1
 *   audience option labels on the tinted contact panel              4.44:1
 */
.prose a:not(.btn), .measure a:not(.btn), main p a:not(.btn), main li a:not(.btn),
.field-note a, .form-legal a, .btn-outline {
  color: #8A3206;
}
.btn-outline { border-color: #8A3206; }
.btn-outline:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.footer-ecosystem__name, .footer-ecosystem__desc { color: var(--gold); }
.represent-option, .represent-option span, .field-help, .field-note { color: #26241E; }
/* Dark surfaces keep the light accent: the darkened value above is only for
   light backgrounds. Re-asserted after it so no navy section inherits it. */
.hero a:not(.btn):not(.lang-chip), .page-hero a:not(.btn):not(.lang-chip),
.section--navy a:not(.btn), .section--navy2 a:not(.btn),
.site-footer a:not(.btn) { color: var(--gold); }
.hero .btn-outline, .page-hero .btn-outline,
.section--navy .btn-outline, .section--navy2 .btn-outline {
  color: #FF8A3D;
  border-color: #FF8A3D;
}
/* Breadcrumb colours were bound to a `.crumbs .container ol` selector that the
   rebuilt Ukrainian shell does not emit, so /ua/ breadcrumbs rendered dark text
   on the navy bar (1.0:1). Colour is now bound to the breadcrumb itself. */
.crumbs, .crumbs ol, .crumbs li { color: #C9D6E4; }
/* the Ukrainian shell renders the breadcrumb inside <main>, so this must also
   out-specify the light-surface link repair above */
.crumbs ol li a, main .crumbs ol li a { color: #E5EDF5; }
.crumbs ol li[aria-current="page"], main .crumbs ol li[aria-current="page"] { color: #FFFFFF; }
