/* Header chrome: navigation pills, the Radar status link, the SEO cross-link
   and the theme switch. Loaded after styles.css so it settles the cascade for
   these components instead of competing with the three older header layers. */

/* ---------------------------------------------------------------- layout */
.header-right{display:flex;align-items:center;gap:9px;flex:0 0 auto}
.header-controls{display:flex;align-items:center;gap:9px;flex:0 0 auto}

/* ------------------------------------------------------- Radar live pill */
/* Radar is the only continuously-updating destination in the bar, so it is
   styled as a status indicator rather than a fourth identical tab. */
.tab-radar{
  position:relative;display:inline-flex;align-items:center;gap:6px;
  margin-left:2px;padding:6px 10px;border:0;border-radius:8px;
  background:transparent;color:#c0334a;font-size:13px;font-weight:650;
  transition:background .16s,color .16s;
}
.tab-radar:hover{background:rgba(255,92,114,.09);color:#a92a3f}
.tab-radar.is-active{background:rgba(255,92,114,.13);color:#a92a3f}
.tab-radar-dot{
  width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:#e0364f;
  box-shadow:0 0 0 0 rgba(224,54,79,.55);animation:scxRadarPulse 2.1s ease-out infinite;
}
/* The pulsing dot already says "live"; the badge only added bulk. */
.tab-radar-live{display:none}
@keyframes scxRadarPulse{
  0%{box-shadow:0 0 0 0 rgba(224,54,79,.5)}
  70%{box-shadow:0 0 0 7px rgba(224,54,79,0)}
  100%{box-shadow:0 0 0 0 rgba(224,54,79,0)}
}
@media(prefers-reduced-motion:reduce){.tab-radar-dot{animation:none}}

html[data-theme="dark"] .tab-radar{background:transparent;color:#ff8fa2}
html[data-theme="dark"] .tab-radar:hover{background:rgba(255,110,132,.12);color:#ffb3c0}
html[data-theme="dark"] .tab-radar.is-active{background:rgba(255,110,132,.16);color:#ffb3c0}
html[data-theme="dark"] .tab-radar-dot{background:#ff6e84}
html[data-theme="dark"] .tab-radar-live{background:rgba(255,110,132,.18)}

/* ------------------------------------------------------------- SEO CTA */
/* Back to the terminal-prompt treatment: outlined and monospace so it reads as
   a sister tool rather than the page's primary action. */
.header .seo-cta,
.seo-cta{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 11px;border:1px solid transparent;border-radius:8px;
  background:var(--brand-soft);color:var(--brand-strong);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700;
  white-space:nowrap;transition:background .16s,border-color .16s,color .16s;
}
.header .seo-cta:hover,
.seo-cta:hover{background:var(--brand);border-color:var(--brand);color:#fff}
.seo-cta:hover :is(.seo-cta-prompt,.seo-cta-arrow){color:#fff}
.seo-cta-prompt{color:var(--brand);font-weight:800;letter-spacing:-.5px}
.seo-cta:hover .seo-cta-prompt{color:var(--brand-strong)}
.seo-cta-text{font-family:inherit}
.seo-cta-arrow{font-size:10px;color:var(--brand);transition:transform .16s,color .16s}
.seo-cta:hover .seo-cta-arrow{color:var(--brand-strong);transform:translate(2px,-2px)}
.seo-cta:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* --------------------------------------------------------- theme switch */
.theme-toggle{
  position:relative;display:grid;place-items:center;
  width:34px;height:34px;flex:0 0 34px;padding:0;
  border:1px solid var(--border);border-radius:10px;
  background:var(--soft);color:var(--text-dim);cursor:pointer;
  transition:border-color .16s,background .16s,color .16s;
}
.theme-toggle:before{content:none}
.theme-toggle:hover{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-strong)}
.theme-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.theme-toggle-glyph{display:grid;place-items:center;width:18px;height:18px}
.theme-toggle svg{width:18px;height:18px;overflow:visible}

/* The orb is the shared body of both icons. A masked circle slides across it to
   carve the crescent, and the rays retract at the same time — one continuous
   movement rather than two icons cross-fading. */
.theme-toggle-orb{fill:currentColor;transition:r .3s cubic-bezier(.4,0,.2,1)}
.theme-toggle-cut{transition:cx .3s cubic-bezier(.4,0,.2,1),cy .3s cubic-bezier(.4,0,.2,1)}
.theme-toggle-rays line{
  stroke:currentColor;stroke-width:1.7;stroke-linecap:round;
  transform-origin:10px 10px;
  transition:opacity .22s ease,transform .3s cubic-bezier(.4,0,.2,1);
}

/* Light theme showing: offer the moon. */
.theme-toggle-orb{r:6}
.theme-toggle-cut{cx:15;cy:5}
.theme-toggle-rays line{opacity:0;transform:scale(.4)}

/* Dark theme showing: offer the sun. */
html[data-theme="dark"] .theme-toggle-orb{r:4.4}
html[data-theme="dark"] .theme-toggle-cut{cx:24;cy:-4}
html[data-theme="dark"] .theme-toggle-rays line{opacity:1;transform:scale(1)}

@media(prefers-reduced-motion:reduce){
  .theme-toggle-orb,.theme-toggle-cut,.theme-toggle-rays line{transition:none}
}

/* ------------------------------------------------------------ responsive */
@media(max-width:1150px){
  .seo-cta-text{display:none}
  .header .seo-cta,.seo-cta{padding:8px 10px}
}
@media(max-width:900px){
  .tab-radar-live{display:none}
}
@media(max-width:760px){
  /* Older layers hid the CTA entirely on small screens; keep it, just compact. */
  .header .seo-cta,.seo-cta{display:inline-flex}
  .header-right{gap:7px}
  .theme-toggle{width:30px;height:30px;flex:0 0 30px}
}

/* ------------------------------------------------- flattened primary nav */
/* Eight destinations at the top level need to read as one control strip, not
   as text floating in a gap. A single tinted rail groups them. */
.tabs{
  display:flex;align-items:center;gap:2px;flex-wrap:wrap;
  padding:3px;border-radius:11px;background:var(--soft);
}
.tabs>.tab,.nav-group>summary{
  padding:7px 10px;border-radius:8px;font-size:13px;font-weight:600;
  color:var(--text-dim);white-space:nowrap;
}
.tabs>.tab:hover,.nav-group>summary:hover{background:var(--panel);color:var(--text)}
.tabs>.tab.is-active{background:var(--brand);color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.nav-group--more>summary::after{content:'⌄';font-size:11px;margin-left:5px;opacity:.65}
.nav-group[data-active=true]>summary{background:var(--brand-soft);color:var(--brand-strong)}

html[data-theme="dark"] .tabs{background:rgba(255,255,255,.04)}
html[data-theme="dark"] .tabs>.tab:hover,
html[data-theme="dark"] .nav-group>summary:hover{background:rgba(255,255,255,.07)}

/* The Radar link keeps its accent but sits inside the same rail. */
.tabs>.tab-radar{margin-left:2px}

@media(max-width:1320px){
  .tabs>.tab,.nav-group>summary{padding:7px 8px;font-size:12.5px}
}
