/* ═══════════════════════════════════════════════════════════════
   Top bar — glass, larger marks, the five sections as the hero
   element rather than an afterthought.
   ═══════════════════════════════════════════════════════════════ */

/* White bar against the dark body. The marks were disappearing into a
   dark glass ground; on white they read instantly and the BCG lockup
   can use its proper black artwork. */
header.top {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: var(--headerH);
  display: flex; align-items: center; gap: clamp(14px, 2vw, 36px);
  padding: 0 var(--gutter);
  background: var(--glass-bar);
  box-shadow: var(--bar-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--bar-line);

  /* The bar is a light island in a dark shell — re-point tokens so
     every child reads correctly without per-rule overrides. */
  --ink: var(--bar-ink); --stone: var(--bar-stone); --grey-2: var(--bar-grey);
  --line: var(--bar-hair); --line-firm: var(--bar-hair-2);
  --glass-hi: var(--bar-hi);
  color: var(--ink);
}

/* Chrome diet, 23 Sep. The bar was sized around the BCG lockup at
   full height, which cost ~90px of a 100vh stage that can never
   scroll. Every pixel taken back here goes straight to the cards,
   which are the reason anyone is looking at the screen. The marks
   shrink with it so the bar stays optically balanced. */
:root { --headerH: clamp(54px, 4.4vh, 66px); }

/* ── Marks ───────────────────────────────────────────────────── */

.lockup {
  display: flex; align-items: center; gap: clamp(12px, 1.2vw, 20px);
  background: none; border: 0; padding: 0; flex: none;
}
.lockup__bcg    { height: clamp(38px, 3.9vh, 50px); width: auto; display: block; }
.lockup__client { height: clamp(25px, 2.5vh, 33px); width: auto; display: block; }
.lockup__bcg--light { display: none; }   /* bar is always white now */
.lockup__x { font-size: var(--t-300); color: var(--grey-2); line-height: 1; font-weight: 300; }

.fac-badge { display: none; }   /* "Live session" removed */

/* ── Sections ────────────────────────────────────────────────── */

nav.tabs {
  display: flex; align-items: center; gap: 4px;
  flex: 1 1 auto; min-width: 0; justify-content: flex-end;
  overflow-x: auto; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }

nav.tabs button {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  background: none; border: 1px solid transparent; border-radius: 100px;
  padding: 8px clamp(12px, 1.1vw, 18px);
  font-size: var(--t-200); font-weight: 600;
  letter-spacing: -.005em;
  color: var(--stone); white-space: nowrap;
  transition: color var(--d-micro) var(--ease),
              background var(--d-micro) var(--ease),
              border-color var(--d-micro) var(--ease);
}
nav.tabs button .n {
  font-family: var(--font-display);
  font-size: var(--t-050); font-weight: 800;
  letter-spacing: var(--tr-wide); color: var(--grey-2);
  font-variant-numeric: tabular-nums;
  transition: color var(--d-micro) var(--ease);
}
nav.tabs button:hover { color: var(--ink); background: var(--glass-hi); border-color: transparent; }
nav.tabs button[aria-current="true"] {
  color: var(--bar-on-dark); background: var(--ink); border-color: var(--ink);
}
nav.tabs button[aria-current="true"] .n { color: var(--bar-on-dark); opacity: .55; }

@media (max-width: 1240px) { nav.tabs button .n { display: none; } }
@media (max-width: 900px)  { .lockup__x { display: none; } }


/* ── Section tint. The glass takes a wash of whichever section is
   active, transitioning between them. ──────────────────────────── */
header.top {
  background-image: linear-gradient(90deg,
    color-mix(in srgb, var(--sect, transparent) 16%, transparent) 0%,
    transparent 46%);
  transition: background-image .6s var(--ease);
}
body:has(nav.tabs button[data-view="agenda"][aria-current="true"])    header.top { --sect: var(--step-deploy); }
body:has(nav.tabs button[data-view="immersion"][aria-current="true"]) header.top { --sect: var(--step-invent); }
body:has(nav.tabs button[data-view="themes"][aria-current="true"])    header.top { --sect: var(--step-reshape); }
body:has(nav.tabs button[data-view="debrief"][aria-current="true"])   header.top { --sect: var(--step-deploy); }
body:has(nav.tabs button[data-view="nextsteps"][aria-current="true"]) header.top { --sect: var(--step-invent); }

/* Active pill picks up the section colour too. */
nav.tabs button[aria-current="true"]::before { background: var(--sect, var(--bar-ink)); }
nav.tabs button[aria-current="true"] { color: var(--bar-on-dark); border-color: transparent; outline: 0; }


/* ── No outline on the active section. Asked for repeatedly; the
   border was being re-applied by the base rule AND :focus-visible. ── */
nav.tabs button,
nav.tabs button:hover,
nav.tabs button[aria-current="true"] {
  border: 0;
  outline: 0;
  box-shadow: none;
}
nav.tabs button:focus-visible { outline: 2px solid var(--bar-ink); outline-offset: 2px; }


/* ═══════════════════════════════════════════════════════════════
   Sections: equal width, one pastel tone each, animated gradient
   on whichever is active.
   ═══════════════════════════════════════════════════════════════ */

/* Back to the right-hand group beside the marks, NOT stretched across
   the bar. Equal pill widths via a fixed column track, so no pill
   bulges wider than its neighbours. */
nav.tabs {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 6px; justify-self: end; margin-left: auto;
  flex: 0 0 auto; width: auto; overflow: visible;
}
nav.tabs button {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  padding: 9px 12px; border-radius: 100px;
  font-size: var(--t-200); font-weight: 600;
  white-space: nowrap;
}

nav.tabs button:nth-child(1) { --sc: var(--sec-1); }
nav.tabs button:nth-child(2) { --sc: var(--sec-2); }
nav.tabs button:nth-child(3) { --sc: var(--sec-3); }
nav.tabs button:nth-child(4) { --sc: var(--sec-4); }
nav.tabs button:nth-child(5) { --sc: var(--sec-5); }

nav.tabs button .n { color: var(--sc); opacity: .85; }
nav.tabs button:hover { background: color-mix(in srgb, var(--sc) 16%, transparent); }

/* Active: a slow pastel gradient drifting inside the pill. */
nav.tabs button[aria-current="true"] {
  color: var(--sec-ink);
  background-image: linear-gradient(100deg,
    color-mix(in srgb, var(--sc) 78%, var(--bar-on-dark)) 0%,
    color-mix(in srgb, var(--sc) 42%, var(--bar-on-dark)) 38%,
    color-mix(in srgb, var(--sc) 82%, var(--bar-on-dark)) 70%,
    color-mix(in srgb, var(--sc) 48%, var(--bar-on-dark)) 100%);
  background-size: 280% 100%;
  animation: pillDrift 9s ease-in-out infinite alternate;
}
nav.tabs button[aria-current="true"] .n { color: var(--sec-ink); opacity: .55; }
nav.tabs button[aria-current="true"]::before { display: none; }
@keyframes pillDrift {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  nav.tabs button[aria-current="true"] { animation: none; }
}

/* Bar wash follows the active section's pastel. */
body:has(nav.tabs button[data-view="agenda"][aria-current="true"])    header.top { --sect: var(--sec-1); }
body:has(nav.tabs button[data-view="immersion"][aria-current="true"]) header.top { --sect: var(--sec-2); }
body:has(nav.tabs button[data-view="themes"][aria-current="true"])    header.top { --sect: var(--sec-3); }
body:has(nav.tabs button[data-view="debrief"][aria-current="true"])   header.top { --sect: var(--sec-4); }
body:has(nav.tabs button[data-view="nextsteps"][aria-current="true"]) header.top { --sect: var(--sec-5); }


/* Simple, smooth. The pill previously animated position AND ran a
   drifting gradient at the same time, which read as a jitter when
   moving between 04 and 05. Colour only now. */
nav.tabs button {
  transition: background-color .32s var(--ease), color .32s var(--ease);
}
nav.tabs button[aria-current="true"] { animation: none; background-size: 100% 100%; }

/* ═══════════════════════════════════════════════════════════════
   ACTIVE PILL — a pastel that breathes, not a gradient that slides
   The drifting linear gradient had visible banding edges travelling
   across the pill, which caught the eye every few seconds during a
   presentation. Replaced with a flat pastel base and two soft radial
   blooms that move slowly and out of phase, so the surface feels
   alive without anything ever reading as an edge in motion.
   ═══════════════════════════════════════════════════════════════ */

nav.tabs button[aria-current="true"] {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--sec-ink);
  /* Flat, calm base — the animation is light on top of it. */
  background-image: none;
  background-color: color-mix(in srgb, var(--sc) 62%, var(--bar-on-dark));
  animation: none;
}

/* Two blooms, different sizes, different speeds, opposite directions.
   Because they are radial and heavily feathered there is no hard edge
   to track, so the motion registers as a shimmer rather than a swipe. */
nav.tabs button[aria-current="true"]::after {
  content: ""; position: absolute; inset: -40%;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 120% at 28% 42%,
      color-mix(in srgb, var(--bar-on-dark) 62%, transparent) 0%,
      transparent 64%),
    radial-gradient(38% 110% at 74% 62%,
      color-mix(in srgb, var(--sc) 88%, var(--bar-on-dark)) 0%,
      transparent 60%);
  animation: pillBloom 6s ease-in-out infinite alternate;
}
/* Faster and less linear than before: the blooms swell and drift on
   slightly different curves, which reads as liquid rather than as a
   panel sliding. */
@keyframes pillBloom {
  0%   { transform: translate3d(-8%, -4%, 0) scale(1);    opacity: .85; }
  35%  { transform: translate3d(3%,  5%, 0)  scale(1.14); opacity: 1;   }
  70%  { transform: translate3d(9%, -2%, 0)  scale(1.06); opacity: .92; }
  100% { transform: translate3d(-4%, 3%, 0)  scale(1.18); opacity: 1;   }
}

@media (prefers-reduced-motion: reduce) {
  nav.tabs button[aria-current="true"]::after { animation: none; }
}
