/* ===========================================================================
   03 — Header: brand, nav, language switch, theme switch, mobile menu
   Driven by js/nav.js (sticky border, burger) and js/i18n.js (UR / EN).
   =========================================================================== */

.hdr{
  position:sticky;top:0;z-index:100;
  background:var(--bg); /* fallback where color-mix is unsupported */
  background:color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter:blur(14px) saturate(1.4);
  -webkit-backdrop-filter:blur(14px) saturate(1.4);
  border-bottom:1px solid transparent;
  transition:border-color .25s ease, background .25s ease;
}
.hdr.stuck{border-bottom-color:var(--rule);background:var(--bg)}
.hdr.stuck{background:color-mix(in srgb, var(--bg) 94%, transparent)}
.hdr-in{display:flex;align-items:center;gap:20px;height:68px}

.brand{display:inline-flex;align-items:center;gap:10px;flex:none}
/* The app's own launcher icon (assets/icon/icon.png), resized into
   website/img/. Square in the file, rounded here, so the same file also
   serves as the social preview and the Apple touch icon. */
.brand-mark{width:32px;height:32px;flex:none;border-radius:9px;overflow:hidden;box-shadow:var(--sh-1)}
.brand-mark img{width:100%;height:100%;display:block}
.brand-txt{font-family:var(--ff-display);font-weight:800;font-size:19px;letter-spacing:-.03em}

.nav{display:flex;gap:4px;margin-inline-start:auto}
.nav a{
  position:relative;padding:8px 13px;border-radius:9px;
  font-size:14.5px;font-weight:500;color:var(--ink-2);
  transition:color .18s ease,background .18s ease;
}
.nav a:hover{color:var(--ink);background:var(--surface-2)}
.nav a[aria-current="page"]{color:var(--brand-text);background:var(--surface-2)}

.hdr-act{display:flex;align-items:center;gap:10px;margin-inline-start:auto}
.nav + .hdr-act{margin-inline-start:0}

.lang{display:flex;background:var(--surface-2);border-radius:999px;padding:3px;gap:2px}
.lang button{
  padding:5px 11px;border-radius:999px;font-size:12.5px;font-weight:600;
  color:var(--ink-3);transition:background .18s ease,color .18s ease;line-height:1.4;
}
.lang button.on{background:var(--surface);color:var(--brand-text);box-shadow:var(--sh-1)}

.theme{
  width:36px;height:36px;border-radius:999px;display:grid;place-items:center;
  color:var(--ink-2);background:var(--surface-2);transition:color .18s ease;
}
.theme:hover{color:var(--ink)}
.theme svg{width:17px;height:17px}
.i-moon{display:none}
:root[data-theme="dark"] .i-sun{display:none}
:root[data-theme="dark"] .i-moon{display:block}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .i-sun{display:none}
  :root:not([data-theme="light"]) .i-moon{display:block}
}

.burger{display:none;width:38px;height:38px;border-radius:10px;padding:10px 9px;flex-direction:column;justify-content:space-between}
.burger span{display:block;height:2px;background:var(--ink);border-radius:2px;transition:transform .25s ease,opacity .2s ease}
.burger[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.burger[aria-expanded="true"] span:nth-child(2){opacity:0}
.burger[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

.mnav{display:none;flex-direction:column;padding:6px var(--gut) 16px;border-top:1px solid var(--rule);background:var(--bg)}
.mnav a{padding:13px 4px;font-weight:550;border-bottom:1px solid var(--rule)}
.mnav a[aria-current="page"]{color:var(--brand-text)}
.mnav a:last-child{border-bottom:0}

/* ── narrow: the inline nav becomes the burger menu ────────────────────── */
/* Six links plus the actions need ~1000px; below that they fold into the menu. */
@media (max-width:1060px){
  .nav{display:none}
  .burger{display:flex}
  .hdr-act .btn-sm{display:none}
  .mnav{display:flex}
  .mnav[hidden]{display:none}
}
@media (max-width:620px){
  .hdr-in{height:62px;gap:12px}
  .lang button{padding:5px 9px;font-size:12px}
}
@media (max-width:380px){
  .brand-txt{font-size:17px}
}

/* Sign in sits beside the install button on wide screens; on a phone it lives in the
   menu instead, so the header keeps one clear action. */
@media (max-width:620px){ .hdr-signin{ display:none; } }
