.dropdown-menu { display: none; }
.dropdown:hover .dropdown-menu { display: block; }
.nav-hamburger { display: none; }
.nav-desktop { display: flex; }
.mobile-panel { display: none; }
@media (max-width: 960px) {
  .nav-desktop { display: none !important; }
  .nav-hamburger { display: flex !important; }
  .mobile-panel.open { display: flex !important; }
}
.back-to-top {
  display: none; position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--color-accent-700);
  background: var(--color-surface); color: var(--color-accent-300); font-size: 19px;
  align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-md);
}
.back-to-top.visible { display: flex; }
/* Scroll reveal is opt-IN: the hidden state applies only once JS has flagged the
   document. Without JS the content renders fully visible instead of being
   permanently stuck at opacity 0. */
.js-reveal [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
}
.js-reveal [data-reveal].revealed { opacity: 1; transform: none; }

/* ── Accessibility: invisible-by-default only ──
   No type-scale or color overrides live here. The earlier version of this file
   enumerated inline font-size values and rewrote them with !important, which
   flattened the type hierarchy site-wide. Type sizes belong in the markup. */

/* Visible only on KEYBOARD focus.
   Previously this used :focus and only moved itself off-screen with top:-60px.
   Two bugs came out of that: a mouse click satisfies :focus, so clicking near the
   top-left revealed it; and once revealed it sat over the logo at z-index 100,
   holding focus and staying put. Now it is clipped to nothing when hidden (no
   painted box, no hit area) and only :focus-visible brings it back. */
.skip-link {
  position: absolute; left: 12px; top: 12px; z-index: 100;
  width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  background: var(--color-surface); color: var(--color-accent-200);
  border: 1px solid var(--color-accent-600); border-radius: 8px;
  font-size: 15px; text-decoration: none;
}
.skip-link:focus-visible {
  width: auto; height: auto; padding: 10px 16px;
  overflow: visible; clip-path: none;
  outline: 2px solid var(--color-accent); outline-offset: 2px;
}

/* Keyboard parity with the existing :hover dropdowns */
.dropdown:focus-within .dropdown-menu { display: block; }

/* Nocturne mandates this ring; it replaces the default blue outline */
a:focus-visible, button:focus-visible, [href]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { scroll-behavior: auto !important; }
}

/* Touch targets. WCAG 2.2 SC 2.5.8 (24px, AA) was already met; this lifts the
   controls to the 44px SC 2.5.5 (AAA) floor. Inline text links are left in the
   text flow — padding them to 44px would break the paragraphs they sit in. */
#mobile-menu-toggle { min-width: 44px; min-height: 44px; }
.input, select.input { min-height: 44px; }
textarea.input { min-height: 110px; }
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* The nowrap + flex-shrink:0 pin exists for ONE case: the submit button sits in a
   flex row beside the .form-note text, loses the space contest, and wraps its own
   label. Applying it to every .btn is what made long link labels ("Explore
   penetration testing →", 254px) unable to fit a phone-width column — so it is
   scoped to submit buttons only. */
.btn[type="submit"] {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Pre-existing bug fix, not an a11y change ──
   Nocturne's .seg-opt is authored for <label><input type="radio">, so it never
   resets background/border/font. These tabs are bare <button>, which inherits UA
   button chrome (grey buttonface + system font). Font size stays inline (13px). */
button.seg-opt {
  background: transparent;
  border: 0;
  font-family: inherit;
  color: var(--color-text);
}
button.seg-opt + button.seg-opt { border-left: 1px solid var(--color-divider); }
/* The system hover keys off :not(:has(input:checked)) — always true for a button,
   so it would wash out the selected tab. */
button.seg-opt[aria-selected="true"]:hover { background: transparent; }
button.seg-opt[aria-selected="true"] {
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

/* ── Responsive: stack multi-column inline grids on phones ──
   Written as stack-by-default with ONE exception, not as a list of the templates
   to stack. The previous version enumerated 15 specific values, so any grid whose
   template was not on the list stayed multi-column at every width and clipped its
   contents (that is how "1fr 0.8fr" — the closing CTA panel on three pages — was
   missed). Inverting it means a grid template added later stacks automatically.

   The one exception is "auto 1fr": 139 icon-plus-text rows, where the first track
   is the icon and stacking would put the label under its own bullet. */
@media (max-width: 760px) {
  [style*="grid-template-columns"]:not([style*="grid-template-columns:auto 1fr"]) {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-rows:1fr 1fr"] { grid-template-rows: none !important; }
  nav[style*="position:sticky"] { position: static !important; }
  /* A stacked panel no longer has room for 48px of inset on a phone. */
  [style*="padding:48px"] { padding: 26px !important; }
}

/* Field labels: Nocturne's .field > label is 12px, the smallest functional text
   on a form. Lifted for readability — this is scoped to labels only, not a
   global type override. */
.field > label { font-size: 14px; }

/* ── CTA prominence ──
   Nocturne outlines primary actions and forbids accent floods, but names the
   accent as "a line and a glow". This lifts the primary CTA off a busy hero
   without filling it: a faint outer glow plus a hairline inner edge. */
.btn-primary {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 22%, transparent),
              0 2px 18px color-mix(in srgb, var(--color-accent) 14%, transparent);
}
.btn-primary:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 34%, transparent),
              0 2px 22px color-mix(in srgb, var(--color-accent) 22%, transparent);
}
/* Ghost CTAs read as text; an arrow that steps forward on hover makes the
   affordance legible without adding a second button weight to the page. */
.btn-ghost { transition: background .18s ease, color .18s ease; }
.btn-ghost:hover { color: var(--color-accent-200); }

/* ── Horizontal overflow ──
   The decorative radial glows are absolutely positioned with negative offsets
   (e.g. right:-150px on a 500px circle) so they bleed off the edge by design.
   With nothing clipping them they extend the document's scroll width, which on a
   phone reads as content cut off on the right. Clip at the landmark boxes.
   overflow-x:clip, NOT hidden: hidden would create a scroll container and break
   the sticky header. */
main, footer { overflow-x: clip; }

@media (max-width: 760px) {
  /* the five client logos sit in a grid with a hard 520px floor; the stacking
     rule above cannot take effect while that floor holds the width open */
  [style*="grid-template-columns:repeat(5, 1fr)"][style*="min-width:520px"] { min-width: 0 !important; }
  /* any inline fixed width wider than a phone, capped without touching layout */
  [style*="min-width:520px"], [style*="min-width:540px"] { min-width: 0 !important; }
}

@media (max-width: 760px) {
  /* Long CTA labels must be allowed to wrap rather than overflow their column.
     min-height stays 44px for the touch target; height goes auto so a two-line
     label grows the button instead of spilling out of a tile with overflow:hidden. */
  main .btn, footer .btn {
    white-space: normal;
    flex-shrink: 1;
    max-width: 100%;
    height: auto;
    padding-top: 11px;
    padding-bottom: 11px;
    text-align: center;
    text-wrap: balance;
  }
  /* the submit button keeps its pin, but may now shrink if it must */
  .btn[type="submit"] { flex-shrink: 1; }
}

@media (max-width: 760px) {
  /* ── Headings ──
     Every heading carries an inline px size (h1 up to 56px) with no mobile
     override, so its longest single token can be wider than the whole content
     box — "Cybersecurity," measures 375px against 296px available at 360px — and
     with overflow-wrap:normal there is no legal break point, so it was being
     clipped by main{overflow-x:clip}.

     Scaled with clamp+vw rather than a flat value per tag, so the sizes track the
     viewport and keep some of the h1/h2/h3 hierarchy instead of collapsing to one
     size. !important is required: the sizes are inline. break-word is the safety
     net so any future long token breaks rather than clipping. */
  main h1, main h2, main h3, main h4, main blockquote p {
    overflow-wrap: break-word;
    text-wrap: pretty;
  }
  main h1 { font-size: clamp(26px, 8.5vw, 34px) !important; line-height: 1.14 !important; }
  main h2 { font-size: clamp(22px, 6.5vw, 28px) !important; line-height: 1.18 !important; }
  main h3 { font-size: clamp(18px, 5vw, 22px) !important; line-height: 1.25 !important; }
  main blockquote p { font-size: clamp(19px, 5.4vw, 24px) !important; line-height: 1.34 !important; }
}
