/* NERVEN 3.3.13 — Header optical size + positive Manrope tracking.
   Loaded after site.css under a new stylesheet URL, so previous theme CSS caches
   cannot silently keep the 3.3.12 heading rules. Intentionally restricted to
   the header logo and typography. */

/* The transparent-trimmed NERVEN logo is a very wide wordmark (6.37:1).
   The old 104–132px container rendered the logo only ~16–21px tall. */
@media (min-width:1101px) {
  html body .nrv-header-inner > .nrv-logo {
    width:156px !important;
    flex:0 0 156px !important;
    max-width:none !important;
    min-width:0 !important;
    height:auto !important;
    align-self:center !important;
    overflow:visible !important;
  }
  html body .nrv-header-inner > .nrv-logo img {
    display:block !important;
    width:100% !important;
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
  }
}
@media (min-width:1600px) {
  html body .nrv-header-inner > .nrv-logo {
    width:170px !important;
    flex-basis:170px !important;
  }
}
/* Make room for the slightly wider logo at intermediate desktop widths. */
@media (min-width:1101px) and (max-width:1399px) {
  html body .nrv-header-inner > .nrv-logo {
    width:144px !important;
    flex-basis:144px !important;
  }
  html body .nrv-header-inner > .nrv-nav {gap:13px;}
  html body .nrv-header-inner {gap:12px;}
}
@media (max-width:1100px) {
  html body.nrv-en .nrv-header-inner > .nrv-logo,
  html body.nrv-ar .nrv-header-inner > .nrv-logo {
    width:150px !important;
    flex:0 0 150px !important;
    max-width:39vw !important;
  }
  html body.nrv-en .nrv-header-inner > .nrv-logo img,
  html body.nrv-ar .nrv-header-inner > .nrv-logo img {
    display:block !important;
    width:100% !important;
    height:auto !important;
    max-width:100% !important;
    max-height:38px !important;
    object-fit:contain !important;
  }
}
@media (max-width:430px) {
  html body.nrv-en .nrv-header-inner > .nrv-logo,
  html body.nrv-ar .nrv-header-inner > .nrv-logo {
    width:138px !important;
    flex:0 0 138px !important;
    max-width:39vw !important;
  }
  html body.nrv-en .nrv-header-inner > .nrv-logo img,
  html body.nrv-ar .nrv-header-inner > .nrv-logo img {
    max-height:36px !important;
  }
}
@media (max-width:350px) {
  html body.nrv-en .nrv-header-inner > .nrv-logo,
  html body.nrv-ar .nrv-header-inner > .nrv-logo {
    width:128px !important;
    flex-basis:128px !important;
  }
}

/* Manrope heading letter tracking. 
   This is letter-spacing, NOT word-spacing. Override old -0.07em values. */
html body.nrv-en h1,
html body.nrv-en h2 {
  letter-spacing:.032em !important;
  font-kerning:normal;
  font-feature-settings:"kern" 1;
  text-rendering:optimizeLegibility;
}
/* Extra room for large display typography and full-width headings. */
html body.nrv-en :is(
  .nrv-reposition-hero-copy h1,
  .nrv-hero-copy h1,
  .nrv-page-hero h1,
  .nrv-system-hero h1,
  .nrv-product-hero h1,
  .nrv-article-hero h1,
  .nrv-professional-hero h2,
  .nrv-system-need-head h2,
  .nrv-section-head h2,
  .nrv-philosophy-copy h2,
  .nrv-philosophy-grid > div > h2,
  .nrv-final-cta h2,
  .nrv-footer-cta h2,
  .nrv-engineering-manifesto h2,
  .nrv-core-manifesto h2
) {
  letter-spacing:.036em !important;
}
/* Heading-style labels on technical pages, archives, and cards. */
html body.nrv-en :is(
  .nrv-stack-row h3,
  .nrv-system-showcase h3,
  .nrv-product-grid h3,
  .nrv-feature-grid h3,
  .nrv-motor-variant-grid h3,
  .nrv-professional-resource-grid h3,
  .nrv-application-card-copy h3
) {
  letter-spacing:.018em !important;
}
/* Arabic PNU/Arabic font shaping must never gain inter-character spacing. */
html body.nrv-ar h1,
html body.nrv-ar h2,
html body.nrv-ar h3 {
  letter-spacing:0 !important;
}
@media (max-width:760px) {
  /* Retain readability while allowing long mobile headlines to wrap naturally. */
  html body.nrv-en h1,
  html body.nrv-en h2 {letter-spacing:.026em !important;}
  html body.nrv-en :is(
    .nrv-reposition-hero-copy h1,
    .nrv-hero-copy h1,
    .nrv-page-hero h1,
    .nrv-system-hero h1,
    .nrv-product-hero h1,
    .nrv-article-hero h1,
    .nrv-professional-hero h2,
    .nrv-section-head h2,
    .nrv-philosophy-copy h2,
    .nrv-system-need-head h2
  ) {letter-spacing:.030em !important;}
  html body.nrv-ar h1,
  html body.nrv-ar h2,
  html body.nrv-ar h3 {letter-spacing:0 !important;}
}

/* The larger mark needs a compact header before the six-link nav runs out
   of room on narrow desktop/tablet landscape widths (1101–1219px). */
@media (min-width:1101px) and (max-width:1219px) {
  html body .nrv-header-inner {
    display:flex !important;
    flex-flow:row nowrap !important;
    align-items:center !important;
    justify-content:space-between !important;
    height:68px !important;
  }
  html body.nrv-en .nrv-header-inner {direction:ltr !important;}
  html body.nrv-ar .nrv-header-inner {direction:rtl !important;}
  html body .nrv-header-inner > .nrv-nav {display:none !important;}
  html body .nrv-header-inner > .nrv-logo {
    flex:0 0 144px !important;
    width:144px !important;
    height:auto !important;
    align-self:center !important;
    margin:0 !important;
  }
  html body .nrv-header-inner > .nrv-header-actions {
    display:flex !important;
    flex:0 0 auto !important;
    align-items:center !important;
    gap:10px !important;
    margin:0 !important;
    height:auto !important;
  }
  html body .nrv-header-actions > .nrv-header-catalogue,
  html body .nrv-header-actions > .nrv-header-cta {display:none !important;}
  html body .nrv-header-actions > .nrv-lang {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    height:40px !important;
    min-width:44px !important;
  }
  html body .nrv-header-actions > .nrv-menu-toggle {
    display:flex !important;
    width:44px !important;
    height:40px !important;
    padding:8px 9px !important;
    flex-flow:column nowrap !important;
    justify-content:center !important;
  }
  html body .nrv-header-actions > .nrv-menu-toggle span {
    width:100%;
    margin:4px 0;
  }
  html body .nrv-mobile-menu.is-open {
    display:flex !important;
    position:fixed;
    inset-block-start:68px;
    inset-inline:0;
    flex-direction:column;
    gap:8px;
    max-height:calc(100dvh - 68px);
    overflow-y:auto;
    padding:22px 24px 38px;
    background:#09090b;
    border-block-end:1px solid #222;
  }
  html body .nrv-mobile-menu > a,
  html body .nrv-mobile-menu summary {
    padding:12px 0;
    border-block-end:1px solid #1f1f24;
    cursor:pointer;
  }
  html body .nrv-mobile-menu details > div {
    display:flex;
    flex-direction:column;
    padding:10px 0 14px;
  }
  html body .nrv-mobile-menu details a {padding:7px 12px;color:#a9a9b0;}
  html body.nrv-ar .nrv-mobile-menu {direction:rtl;text-align:right;}
  html body.nrv-en .nrv-mobile-menu {direction:ltr;text-align:left;}
}
