/* ── header variant: rounded, floating, tone-aware ─────────────────────────────
   Loaded after style.css. The bar floats inside the page margins as a pill,
   stays pinned at the top, and takes a tone from whatever section is
   scrolling under it — each section names its tone in data-header-tone, and
   js/header-pill.js copies the one under the bar onto the header. Desktop
   shows every link; below 860px the links fold into the same menu as before,
   dropped as a rounded panel under the bar. */

.site-header,
.site-header.scrolled {
  top: 12px;
  left: 50%;
  right: auto;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 9px 10px 9px 22px;
  gap: 24px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--pill-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Tones. glass lets the hero's metal show through; blue picks up the deck
   cards' accent; ink separates the bar from the bright demo footage; panel is
   the card grey the dojo row and contact panel are built from. */
.site-header                          { --pill-bg: rgba(3, 3, 4, 0.28);     --pill-border: rgba(201, 242, 255, 0.14); }
.site-header[data-tone="blue"]        { --pill-bg: rgba(0, 60, 70, 0.55);   --pill-border: var(--blue-dim); }
.site-header[data-tone="ink"]         { --pill-bg: rgba(3, 3, 4, 0.92);     --pill-border: var(--border-strong); }
.site-header[data-tone="panel"]       { --pill-bg: rgba(10, 11, 12, 0.88); --pill-border: var(--border-strong); }

/* The lockup sits dead centre of the bar, 30% up on the old 20px. */
.site-header .logo-lockup { height: 26px; }

/* ── merch ──
   Every other link is a place on this page; merch is another page, so it is
   set apart as a chip in the site's second signal colour, with the arrow the
   contact links use for "this goes somewhere". */
.nav-merch { position: relative; }
.merch-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--red-dim);
  border-radius: 999px;
  background: rgba(255, 40, 81, 0.12);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.merch-link span { color: var(--red); font-size: 0.85em; }
.merch-link:hover,
.merch-link:focus-visible,
.merch-link[aria-current="page"] { color: #fff; border-color: var(--red); background: rgba(255, 40, 81, 0.22); }
.merch-link:focus-visible { outline: 1px solid var(--red); outline-offset: 2px; }

/* The support callout, pinned under the merch chip for as long as the header
   is on screen. Built like the HUD's panels: panel ground, a strong border,
   the corner tick, a mono kicker in red and the line itself in blue, with a
   block cursor. It points up at the chip, and × puts it away for the visit. */
.merch-cta {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  display: flex;
  align-items: flex-start;
  width: max-content;
  max-width: min(300px, calc(100vw - 48px));
  background: var(--panel);
  border: 1px solid var(--red-dim);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 40, 81, 0.12);
  animation: merch-cta-in 0.5s ease-out 0.8s both;
}
.merch-cta::before {
  /* the pointer, a rotated square tucked under the border */
  content: "";
  position: absolute;
  top: -6px;
  right: 26px;
  width: 10px;
  height: 10px;
  background: var(--panel);
  border-top: 1px solid var(--red-dim);
  border-left: 1px solid var(--red-dim);
  transform: rotate(45deg);
}
.merch-cta::after {
  /* the corner tick the deck cards and contact panel carry */
  content: "";
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border-bottom: 2px solid var(--blue);
  border-left: 2px solid var(--blue);
}
.merch-cta[hidden] { display: none; }
.merch-cta-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 6px 13px 14px;
  text-decoration: none;
}
.merch-cta-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}
.merch-cta-text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--blue);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}
.merch-cta-link:hover .merch-cta-text,
.merch-cta-link:focus-visible .merch-cta-text { color: #fff; }
.merch-cta-cursor {
  display: inline-block;
  width: 7px;
  height: 12px;
  margin-left: 3px;
  vertical-align: -1px;
  background: var(--blue);
  animation: merch-cursor 1.1s steps(1) infinite;
}
.merch-cta-close {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 4px 4px 0 0;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.merch-cta-close:hover, .merch-cta-close:focus-visible { color: var(--text); }
@keyframes merch-cursor { 50% { opacity: 0; } }
@keyframes merch-cta-in {
  0% { opacity: 0; transform: translateY(-6px); }
  60% { opacity: 1; }
  70% { opacity: 0.4; }
  80%, 100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .merch-cta { animation: none; }
  .merch-cta-cursor { animation: none; }
}
/* an open menu owns the space under the bar */
.site-nav.is-open ~ .nav-merch .merch-cta { display: none; }

/* desktop: the lockup centred, sections either side, merch at the end */
@media (min-width: 861px) {
  .site-header .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .nav-toggle { display: none; }
  .site-nav,
  .site-nav.is-open {
    position: static;
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 2px;
    padding: 0;
    background: none;
    border: 0;
  }
  /* the second half of the sections starts on the far side of the lockup */
  .site-nav a:nth-child(4) { margin-left: auto; }
  .site-nav a,
  .site-nav a + a {
    padding: 7px 12px;
    font-size: 13px;
    border: 0;
    border-radius: 999px;
    transition: color 0.2s ease, background-color 0.2s ease;
  }
  .site-nav a:hover,
  .site-nav a:focus-visible { color: var(--text); background: rgba(201, 242, 255, 0.08); }
  .site-nav a[aria-current="page"],
  .site-nav a.is-here { color: var(--blue); }
  .nav-merch { margin-left: 8px; }
}
/* narrow desktops: a little less air per link keeps both halves clear of the lockup */
@media (min-width: 861px) and (max-width: 1000px) {
  .site-nav a, .site-nav a + a { padding: 7px 9px; }
}

/* mobile: merch | lockup | menu, the menu dropping as a panel under the bar */
@media (max-width: 860px) {
  .site-header,
  .site-header.scrolled {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;   /* at 24px the side columns could not hold the merch chip and the lockup drifted */
    padding: 7px 8px;
  }
  .nav-merch { grid-column: 1; grid-row: 1; justify-self: start; }
  .site-header .logo { grid-column: 2; grid-row: 1; }
  .nav-toggle { grid-column: 3; grid-row: 1; justify-self: end; border-radius: 999px; width: 38px; height: 30px; }
  .merch-link { padding: 6px 12px; font-size: 12px; }
  .merch-cta { right: auto; left: 0; }
  .merch-cta::before { right: auto; left: 26px; }
  .site-nav {
    top: calc(100% + 8px);
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: var(--bg);   /* solid: at 0.96 the hero lockup still read through */
  }
  .site-nav a { border-radius: 12px; }
  .site-nav a + a { border-top: 0; }
  .site-nav a:hover, .site-nav a:focus-visible { background: rgba(201, 242, 255, 0.06); }
}
