/* Prevent initial mobile menu flash and the resulting layout shift before JS initializes. */
@media (min-width:1251px) { .menu-button { display:none; } }
@media (max-width:1250px) { #scif-nav:not(.scif-nav-open) { display:none; } }
/* Header navigation readability. Use collapsed navigation while the
   full set of links cannot fit comfortably alongside the wordmark. */
@media (min-width:1251px) {
  .brandline { gap:1.5%; padding-left:3%; padding-right:2%; }
  .brand { gap:clamp(10px,1.25vw,19px); }
  .nav { gap:clamp(8px,.8vw,17px); padding-left:2%; }
  .nav a { font-size:clamp(15px,.95vw,17px); }
  .nav .nav-cta { font-size:clamp(13px,.78vw,15px); padding-inline:1.1em; }
  .nav-toggle { width:20px; }
}
@media (min-width:1051px) and (max-width:1250px) {
  .brandline { min-height:74px; padding:12px 4.5%; flex-wrap:wrap; gap:12px; }
  .nav { flex-basis:100%; border:0; border-top:1px solid var(--line);
         padding:12px 0; align-items:stretch; flex-direction:column; gap:0; }
  .nav a { font-size:16px; min-height:44px; white-space:normal; }
  .nav-top > a { flex:1; }
  .nav-toggle { width:44px; }
  .nav-sub { position:static; box-shadow:none; border:0;
             border-left:2px solid var(--line); padding:0 12px; margin:0 0 8px 12px; }
  .nav .nav-cta { align-self:start; margin-top:8px; font-size:14px; min-height:44px; }
}
/* Compact desktop navigation before the responsive menu breakpoint. */
@media (min-width:1251px) and (max-width:1599px) {
  .brandline { gap:1%; padding-left:2%; padding-right:1.5%; }
  .nav { min-width:0; gap:clamp(5px,.65vw,10px); padding-left:1.5%; }
  .nav .nav-group { min-width:0; }
  .nav a { font-size:clamp(12px,.86vw,14px); }
  .nav .nav-cta { font-size:clamp(11px,.82vw,13px); padding-inline:.8em; }
}
@media (min-width:1700px) {
  .nav a { font-size:17px; }
  .nav .nav-cta { font-size:15px; }
}

/* Arrow-free dropdowns: hover/focus on desktop, visible nested links on mobile.
   Main labels remain regular links. */
.nav .nav-toggle { display:none!important; }
@media (min-width:1251px) {
  .nav .nav-sub { display:none; }
  .nav .nav-group:hover > .nav-sub,
  .nav .nav-group:focus-within > .nav-sub { display:block; }
}
@media (max-width:1250px) {
  .nav .nav-sub { display:block; }
}
/* Clear keyboard focus and active-page state without underlining links. */
.nav a:focus-visible, .menu-button:focus-visible { outline:2px solid #275b83; outline-offset:3px; }
.nav .nav-sub a[aria-current="page"] { background:#e8f0f5; box-shadow:inset 3px 0 0 #365b75; }
.nav .nav-top a[aria-current="page"] { box-shadow:inset 0 -2px 0 #365b75; }
@media (max-width:1250px) {
  .nav { max-height:calc(100dvh - 100px); overflow-y:auto; overscroll-behavior:contain; }
}
/* Consistent whole-item hover: no text underlines. Keep the CTA distinct. */
.nav .nav-group,
.nav .nav-contact {
  border-radius:4px;
  transition:background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.nav .nav-group:hover,
.nav .nav-group:focus-within {
  background:rgba(255,255,255,.80);
  box-shadow:0 3px 12px rgba(20,49,70,.10);
  transform:translateY(-2px);
}
.nav .nav-group .nav-top > a {
  text-decoration:none;
}
.nav a:hover,
.nav a:focus-visible {
  text-decoration:none;
}
.nav .nav-sub a {
  border-radius:3px;
  transition:background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.nav .nav-sub a:hover,
.nav .nav-sub a:focus-visible {
  background:#edf3f7;
  transform:translateX(3px);
  box-shadow:inset 3px 0 0 #365b75;
  text-decoration:none;
}
.nav .nav-cta:hover,
.nav .nav-cta:focus-visible {
  text-decoration:none;
  transform:none;
}
@media (max-width:1250px) {
  .nav .nav-group:hover,
  .nav .nav-group:focus-within {
    transform:none;
  }
}
@media (prefers-reduced-motion:reduce) {
  .nav .nav-group,.nav .nav-contact,.nav .nav-sub a {
    transition:none;
  }
  .nav .nav-group:hover,.nav .nav-group:focus-within,
  .nav .nav-sub a:hover,.nav .nav-sub a:focus-visible {
    transform:none;
  }
}
