/* ═══════════════════════════════════════════════════════════════════════════
   THE AFTERDARK-DIRECTION NAV ON THE SIM FIX PAGE  (dx-sim-fix-afterdark-nav)
   Loaded AFTER seek-next-sfx.css and scoped to .adnav__* so nothing here can
   touch any other rule. Source: the nav block of seek-next-adr.css — the pill,
   brand lockup, links, circular theme control and Join pill, same values.

   WHAT IS KEPT FROM SIM FIX ON PURPOSE: the wrapper is still <header class="nav"
   data-nav>, so the page's own opening (the -85px hold, the 2300ms entrance
   delay, boot-isolation hiding, the reduced-motion kill and page.js's
   animationend clean-up) runs exactly as before. The theme button carries
   data-theme-toggle, which is all page.js and the inline dissolve controller
   bind to — there is no second theme system here, only presentation.
   ═══════════════════════════════════════════════════════════════════════════ */

/* the wrapper: Sim Fix's own centring and top, freed from left:50%'s half-width
   shrink-to-fit so the wider pill can never be squeezed; clear of the notch /
   Dynamic Island and the side safe areas */
.nav {
  width: max-content;
  max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  top: max(clamp(14px, 2.08vw, 30px), calc(env(safe-area-inset-top, 0px) + 8px));
}

/* ---- the pill (seek-next-adr.css .nav__pill) ---- */
.adnav__pill {
  --adn-glass: rgba(19, 17, 26, .62);
  --adn-line: rgba(255, 255, 255, .08);
  --adn-ink: #F4F1F6;
  --adn-ink2: rgba(244, 241, 246, .70);
  --adn-btn-bg: #F4F1F6;
  --adn-btn-ink: #0B0A0F;
  --adn-e: cubic-bezier(.2, .7, .2, 1);
  position: relative;
  display: flex; align-items: center; gap: 22px;
  height: 54px; padding: 6px 6px 6px 18px; border-radius: 999px;
  background: var(--adn-glass); color: var(--adn-ink);
  border: 1px solid var(--adn-line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .5);
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html[data-theme="light"] .adnav__pill {
  --adn-glass: rgba(250, 250, 248, .72);
  --adn-line: rgba(21, 20, 25, .09);
  --adn-ink: #151419;
  --adn-ink2: rgba(21, 20, 25, .68);
  --adn-btn-bg: #151419;
  --adn-btn-ink: #F6F6F4;
}
.adnav__brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: .16em; line-height: 1; }
.adnav__mark { width: 30px; height: auto; display: block; }
.adnav__mark--light { display: none; }
html[data-theme="light"] .adnav__mark--dark { display: none; }
html[data-theme="light"] .adnav__mark--light { display: block; }
.adnav__links { display: flex; gap: 24px; font-size: 14px; }
.adnav__links a { color: var(--adn-ink2); text-decoration: none; transition: color .2s; }
.adnav__links a:hover { color: var(--adn-ink); }

/* ---- the circular theme control (seek-next-adr.css .nav__theme) ----
   Only where it can work: `js` is stamped by the page's pre-paint resolver, as
   Sim Fix's own tile was gated. Glyph shows the destination: sun in dark, moon
   in light, cross-rotating in one grid cell so the control never reflows. */
.adnav__theme { display: none; }
html.js .adnav__theme {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 1px solid var(--adn-line); background: transparent; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.adnav__theme svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity .3s, transform .4s var(--adn-e); }
.adnav__theme .ico-moon { opacity: 0; transform: rotate(-40deg) scale(.7); }
html[data-theme="light"] .adnav__theme .ico-sun { opacity: 0; transform: rotate(40deg) scale(.7); }
html[data-theme="light"] .adnav__theme .ico-moon { opacity: 1; transform: none; }
/* inside the page's snapshot dissolve the glyphs land with the new frame, as
   Sim Fix's tile did (html.theme-vt) */
html.theme-vt .adnav__theme svg { transition: none; }

/* ---- Join (seek-next-adr.css .nav__cta) ---- */
.adnav__cta {
  height: 42px; padding: 0 18px; border-radius: 999px; flex: none;
  background: var(--adn-btn-bg); color: var(--adn-btn-ink);
  display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; text-decoration: none;
  margin-left: -12px; -webkit-tap-highlight-color: transparent;
}

/* ---- mobile menu: a button and a plain list, no animation ---- */
.adnav__menu-btn { display: none; }
.adnav__panel[hidden] { display: none; }

/* focus: the page's own teal ring language */
.adnav__pill a:focus-visible, .adnav__pill button:focus-visible { outline: 2px solid #1FD3AE; outline-offset: 3px; }

/* 1024-class: gaps give way before anything else shrinks */
@media (max-width: 1100px) {
  .adnav__pill { gap: 18px; }
  .adnav__links { gap: 18px; }
}
@media (max-width: 860px) {
  .adnav__links { display: none; }
  .adnav__pill { gap: 10px; padding-left: 16px; }
  .adnav__cta { margin-left: 0; }
  html.js .adnav__menu-btn {
    display: grid; place-items: center; flex: none;
    width: 42px; height: 42px; padding: 0; border-radius: 50%;
    border: 1px solid var(--adn-line); background: transparent; color: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .adnav__menu-btn svg { width: 18px; height: 18px; }
  .adnav__menu-btn[aria-expanded="true"] { background: var(--adn-line); }
  .adnav__panel {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    display: flex; flex-direction: column; padding: 8px; border-radius: 24px;
    background: var(--adn-glass); border: 1px solid var(--adn-line);
    -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .55);
  }
  .adnav__panel a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 16px; color: var(--adn-ink); text-decoration: none; font-size: 16px; }
  .adnav__panel a:active { background: var(--adn-line); }
  /* without script the links stay reachable: the page simply scrolls to them */
  html:not(.js) .adnav__panel { display: none; }
}
/* phones: slightly tighter, and kept well under 90% of the viewport width so
   WebKit never treats the pill as a full-width fixed header for its bar tint */
@media (max-width: 480px) {
  .adnav__pill { height: 50px; padding: 5px 5px 5px 14px; gap: 8px; }
  .adnav__brand { font-size: 13px; letter-spacing: .14em; gap: 8px; }
  .adnav__mark { width: 27px; }
  html.js .adnav__theme, html.js .adnav__menu-btn { width: 40px; height: 40px; }
  .adnav__cta { height: 40px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .adnav__theme svg { transition: none; }
}
