/* V28 — navigation reliability + night typography visibility */
/* Persistent top navigation */
body>header{
  position:sticky!important;top:0!important;z-index:10000!important;
  isolation:isolate;
  -webkit-backdrop-filter:blur(20px) saturate(1.18)!important;
  backdrop-filter:blur(20px) saturate(1.18)!important;
}
/* Keep all page/project headings readable in Night mode. */
html[data-theme="night"] body:not(.print-v17):not(.story-page) main :is(h1,h2,h3,h4,.title,.section-head h2,.project h3,.feature-cover h2){
  color:#f1f5f7!important;
  opacity:1!important;
  text-shadow:0 1px 18px rgba(0,0,0,.18)!important;
}
html[data-theme="night"] body:not(.print-v17):not(.story-page) main :is(p,.intro p){color:#d8e2e7!important}
html[data-theme="night"] body:not(.print-v17):not(.story-page) main :is(.label,.kicker,.meta){color:#adc1cc!important;opacity:1!important}
html[data-theme="night"] .stat b{color:#f1f5f7!important}
html[data-theme="night"] .stat span{color:#b8c8d0!important}

/* Header contrast in both atmospheres */
html[data-theme="day"] body>header{background:rgba(237,242,243,.78)!important;border-bottom-color:rgba(54,77,91,.15)!important}
html[data-theme="night"] body>header{background:rgba(7,11,15,.78)!important;border-bottom-color:rgba(213,231,239,.14)!important}

@media(max-width:800px){
  body>header{height:72px!important;padding:14px 5vw!important;align-items:center!important}
  body>header .logo{position:relative!important;z-index:10004!important}
  body>header .menu-toggle{
    display:flex!important;position:absolute!important;right:5vw!important;top:14px!important;
    z-index:10005!important;width:44px!important;height:44px!important;
  }
  body>header .theme-toggle{
    position:absolute!important;right:calc(5vw + 52px)!important;top:17px!important;
    z-index:10005!important;width:38px!important;height:38px!important;margin:0!important;
  }
  body>header .nav{
    display:flex!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important;
    position:fixed!important;z-index:10002!important;inset:0!important;width:100vw!important;height:100dvh!important;
    padding:105px 7vw 42px!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;
    gap:0!important;overflow-y:auto!important;transform:translateY(-10px)!important;
    transition:opacity .24s ease,transform .3s ease,visibility .24s!important;
    -webkit-backdrop-filter:blur(28px) saturate(1.2)!important;backdrop-filter:blur(28px) saturate(1.2)!important;
  }
  html[data-theme="day"] body>header .nav{background:rgba(237,242,243,.97)!important;color:#17232c!important}
  html[data-theme="night"] body>header .nav{background:rgba(8,12,16,.97)!important;color:#f1f5f7!important}
  body.menu-open>header .nav{
    visibility:visible!important;opacity:1!important;pointer-events:auto!important;transform:translateY(0)!important;
  }
  body>header .nav a{
    display:flex!important;align-items:center!important;width:100%!important;min-height:58px!important;
    padding:15px 0!important;font-size:clamp(27px,8.2vw,40px)!important;font-weight:700!important;
    letter-spacing:-.025em!important;line-height:1!important;text-decoration:none!important;
  }
  html[data-theme="day"] body>header .nav a{color:#17232c!important;border-bottom:1px solid rgba(54,77,91,.18)!important}
  html[data-theme="night"] body>header .nav a{color:#f1f5f7!important;border-bottom:1px solid rgba(218,233,240,.16)!important}
  html[data-theme="day"] body>header .menu-toggle span{background:#17232c!important}
  html[data-theme="night"] body>header .menu-toggle span{background:#f1f5f7!important}
  body.menu-open{overflow:hidden!important}
}
