/* =========================================================
   header.css — the top bar: logo, main navigation with its
   dropdowns (js/components/nav.js), Day/Night switch and the
   account area. Compact and quiet: one accent colour for the
   current page, neutral greys everywhere else.
   Desktop nav from 1200px; below that the Menu drawer (menu.css).
   ========================================================= */
:root{
  --hdr-h:56px;
  --nv-fs:13.5px;
  --nv-r:8px;
  --nv-shadow:0 1px 2px rgba(16,16,40,.06),0 12px 32px -12px rgba(16,16,40,.22);
  --nv-ease:cubic-bezier(.2,.7,.2,1);
}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:30;background:var(--hdr-bg)}

/* Bar: sticky, a hairline underneath, a soft shadow once the page scrolls (motion.js adds .scrolled) */
header{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;color:var(--hdr-ink);
  background:var(--hdr-bg);border-bottom:1px solid var(--hdr-line);
  transition:box-shadow .25s ease,background-color .25s ease}
header.scrolled{box-shadow:0 1px 0 var(--hdr-line),0 8px 24px -18px rgba(16,16,40,.4);
  background:color-mix(in srgb,var(--hdr-bg) 90%,transparent);-webkit-backdrop-filter:saturate(1.6) blur(12px);backdrop-filter:saturate(1.6) blur(12px)}
@supports not (backdrop-filter:blur(1px)){header.scrolled{background:var(--hdr-bg)}}
.hbar{position:relative;display:flex;align-items:center;gap:20px;min-height:var(--hdr-h);padding-block:0}
header .hbar{max-width:1320px}

/* Logo */
.brand{display:flex;align-items:center;gap:9px;text-decoration:none;color:var(--hdr-ink);flex-shrink:0;border-radius:var(--nv-r)}
.brand b{font:700 17px/1 var(--f-display);letter-spacing:-.01em}
.seal{width:26px;height:26px;border-radius:50%;background:var(--p-red);display:grid;place-items:center;color:var(--on-p);font:600 10px/1 var(--f-mono);letter-spacing:.02em}
.brand:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* ---------- Main navigation ---------- */
#nav{min-width:0;flex:1;display:flex;justify-content:center}
.nv{list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:2px}
.nv>li{position:relative}
.nv-a{position:relative;display:inline-flex;align-items:center;gap:3px;white-space:nowrap;text-decoration:none;
  color:var(--hdr-muted);font:500 var(--nv-fs)/1 var(--f-body);letter-spacing:.005em;
  height:34px;padding:0 10px;border-radius:var(--nv-r);border:0;background:none;cursor:pointer;
  transition:color .18s ease,background-color .18s ease}
.nv-a:hover,.nv-dd.open>.nv-a{color:var(--hdr-ink);background:var(--hdr-hover)}
.nv-a:focus-visible,.nv-item:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
/* current page: darker text and a short accent line under it (on the bar's bottom edge) */
.nv-a::after{content:"";position:absolute;left:50%;bottom:calc((34px - var(--hdr-h)) / 2);width:18px;height:2px;border-radius:2px;background:var(--accent);
  transform:translateX(-50%) scaleX(0);transition:transform .25s var(--nv-ease)}
.nv-a[aria-current="page"],.nv-dd.cur>.nv-a{color:var(--hdr-ink)}
.nv-a[aria-current="page"]::after,.nv-dd.cur>.nv-a::after{transform:translateX(-50%) scaleX(1)}
.nv-chev{width:13px;height:13px;margin-right:-2px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;opacity:.7;transition:transform .2s var(--nv-ease)}
.nv-dd.open .nv-chev{transform:rotate(180deg)}
.navcount{display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 5px;margin-left:3px;border-radius:999px;
  background:var(--accent-soft);color:var(--accent);font:600 10.5px/1 var(--f-mono)}
.navcount[hidden]{display:none}

/* Dropdown panel */
.nv-menu{position:absolute;top:calc(100% + 13px);left:-6px;z-index:40;width:292px;padding:6px;display:grid;gap:1px;
  background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:12px;box-shadow:var(--nv-shadow);
  opacity:0;visibility:hidden;transform:translateY(-4px);transform-origin:top left;
  transition:opacity .16s ease,transform .18s var(--nv-ease),visibility 0s .18s}
.nv-menu::before{content:"";position:absolute;inset:-14px 0 auto;height:14px}   /* bridge so the pointer can travel from the button */
.nv-dd.open .nv-menu{opacity:1;visibility:visible;transform:none;transition:opacity .16s ease,transform .18s var(--nv-ease)}
.nv-item{display:grid;grid-template-columns:30px minmax(0,1fr);gap:11px;align-items:center;padding:8px 10px 8px 8px;border-radius:8px;text-decoration:none;color:var(--ink);transition:background-color .15s ease}
.nv-item:hover,.nv-item:focus-visible{background:var(--sunk)}
.nv-item.nv-sep{margin-top:5px;position:relative}
.nv-item.nv-sep::before{content:"";position:absolute;left:8px;right:8px;top:-3.5px;height:1px;background:var(--line)}
.nv-ic{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:var(--sunk);color:var(--muted);transition:color .15s ease,background-color .15s ease}
.nv-item:hover .nv-ic,.nv-item:focus-visible .nv-ic{background:var(--surface);color:var(--accent);box-shadow:inset 0 0 0 1px var(--line)}
.nv-item[aria-current="page"] .nv-ic{background:var(--accent-soft);color:var(--accent)}
.nv-item[aria-current="page"] .nv-t b{color:var(--accent)}
.nv-ic svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nv-t{display:grid;gap:2px;min-width:0}
.nv-t b{font:500 13.5px/1.3 var(--f-body);color:var(--ink)}
.nv-t small{font-size:12px;line-height:1.35;color:var(--muted)}

@media (max-width:1199.98px){#nav{display:none}}
@media (min-width:1200px){.menu-btn{display:none!important}}
@media (min-width:1200px) and (max-width:1359.98px){.nv-a{padding:0 8px}.hbar{gap:14px}}
@media (prefers-reduced-motion:reduce){.nv-menu,.nv-chev,.nv-a,.nv-a::after,header{transition:none}}

/* ---------- Right side: Day / Night switch (js/theme.js) and account ---------- */
.hact{margin-left:auto;flex-shrink:0;display:flex;align-items:center;gap:6px}
.theme-sw{flex-shrink:0;display:flex}
/* one icon button: it shows the mode you can switch to (the pressed one is hidden) */
.theme-sw button{display:grid;place-items:center;width:34px;height:34px;border:0;background:transparent;color:var(--hdr-muted);padding:0;border-radius:var(--nv-r);cursor:pointer;transition:background-color .18s,color .18s}
.theme-sw button[aria-pressed=true]{display:none}
.theme-sw span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.theme-sw svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-sw button[data-mode=dark] svg{fill:none;stroke-width:1.8;width:16px;height:16px}
.theme-sw button:hover{color:var(--hdr-ink);background:var(--hdr-hover)}
.theme-sw button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.hsep{width:1px;height:20px;background:var(--hdr-line);flex-shrink:0}

/* a smooth fade when switching (not on first load) */
html.theme-anim,html.theme-anim *{transition:background-color .35s,color .35s,border-color .35s!important}

/* Phones */
@media (max-width:760px){
  :root{--hdr-h:52px}
  .hbar{gap:10px}
  .brand b{font-size:16px}
  .seal{width:24px;height:24px;font-size:9.5px}
}

/* Featured section in the bar (SAT Practice): accent text, a soft tinted chip and a small dot */
.nv-a.nv-feat{color:var(--accent);font-weight:600;padding:0 12px 0 10px;
  background:color-mix(in srgb,var(--accent) 8%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 24%,transparent)}
.nv-a.nv-feat::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;margin-right:6px;flex-shrink:0;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent);transition:box-shadow .25s ease}
.nv-a.nv-feat:hover,.nv-a.nv-feat[aria-current="page"]{color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,transparent)}
.nv-a.nv-feat:hover::before{box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 24%,transparent)}
@media (prefers-reduced-motion:reduce){.nv-a.nv-feat::before{transition:none}}

/* SAT Practice shortcut in the bar on phones and tablets (the full menu is in the drawer there) */
.sat-quick{display:none;align-items:center;gap:6px;height:32px;padding:0 11px 0 9px;border-radius:999px;text-decoration:none;white-space:nowrap;
  font:600 12.5px/1 var(--f-body);color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 24%,transparent);transition:background-color .18s}
.sat-quick i{width:6px;height:6px;border-radius:50%;background:currentColor}
.sat-quick:hover{background:color-mix(in srgb,var(--accent) 15%,transparent)}
.sat-quick:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sat-quick .sq-s{display:none}
@media (max-width:1199.98px){.sat-quick{display:inline-flex}.sat-quick[hidden]{display:none}}
@media (max-width:440px){.sat-quick .sq-l{display:none}.sat-quick .sq-s{display:inline}}
[data-nav="a"] .sat-quick{color:var(--nav-gold,#FFB020);background:rgba(255,176,32,.12);box-shadow:inset 0 0 0 1px rgba(255,176,32,.32)}
