/* ============================================================
   Header platform dropdowns — Twitch ▾ / Kick ▾ → Live Viewers | Followers
------------------------------------------------------------
   Deliberately a FILE, not another block appended to site.css, because
   index.html doesn't load site.css — it carries its own inline copy of the
   nav. Three separate bugs on this site have come from a nav rule living in
   one of those two places and not the other (.chips, .faq-help, the
   .pdp-left mobile collapse). A dropdown that has to behave identically on
   all sixteen pages gets exactly one source of truth.

   NOT the icon-tile / title / subtitle row that every SaaS nav ships. This
   one is built out of things this site already owns:
     - a platform-coloured eyebrow, the same .klabel device the page sections
       use, so the panel announces which platform you're inside
     - a platform-coloured top edge and a wash that sweeps in from the left on
       hover, echoing the platform-native chrome the PDPs already wear
     - Space Grotesk for the option names — the display face, used here for
       the first time in the nav, which is most of why it reads differently
     - a red LIVE tag on the viewers row in the logo dot's own #ff4747
   Squarer corners and a hairline between rows rather than two floating
   cards: this should read as stream chrome, not as a soft app popover.

   Colour split: the platform tint says WHICH platform a row belongs to, cyan
   says WHERE YOU ARE. Using one colour for both loses the distinction.
   ============================================================ */

.nav-dd { position: relative; }
.nav-dd[data-plat="twitch"] { --pl: #9146ff; }
.nav-dd[data-plat="kick"]   { --pl: #53fc18; }

/* <button>, not <a>: the parent is a chooser now, not a destination. The two
   real links live inside and ship in the static HTML, so internal linking is
   unchanged — in fact both follower pages gained a sitewide link. */
.nav-dd-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 14.5px; line-height: 1;
  color: var(--muted-2); background: none; border: 0; padding: 0;
  cursor: pointer; -webkit-appearance: none;
  transition: color .18s ease;
}
.nav-dd-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 4px; }
.nav-dd-car { width: 11px; height: 11px; flex: none; opacity: .7; transition: transform .2s cubic-bezier(.23,1,.32,1); }

/* The parent lights up cyan when you're on EITHER of its two pages, so the
   header still answers "where am I" once the destination is one level down. */
.nav-dd.on > .nav-dd-btn { color: var(--green); font-weight: 600; }

/* ---- the panel's contents (shared by both breakpoints) ---- */
.nav-dd-eye {
  display: block; font-family: 'Space Grotesk', var(--head);
  font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase;
  color: var(--pl);
}
.nav-dd-item { position: relative; display: flex; align-items: center; gap: 12px; isolation: isolate; }
/* A hairline between the two, not a gap — one object with two rows reads as a
   choice; two spaced cards read as two unrelated things. */
.nav-dd-item + .nav-dd-item { box-shadow: inset 0 1px 0 rgba(255,255,255,.055); }
/* The wash sweeps from the platform-coloured edge inward, so hover looks like
   the row is being lit from the side the accent lives on. */
.nav-dd-item::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pl) 22%, transparent), transparent 84%);
  transition: opacity .2s ease;
}
.nav-dd-item:hover::before, .nav-dd-item:focus-visible::before { opacity: 1; }

.nav-dd-hd { display: flex; align-items: center; gap: 8px; }
/* The visible label is "Live Viewers", but the link used to read "Twitch" and
   the anchor text still has to say which platform it points at. Hidden the
   clip() way, NOT display:none — display:none would drop it from the
   accessibility tree too, and "Live Viewers" announced with no platform is
   exactly as ambiguous for a screen reader as it is for a crawler. */
.nav-dd-plat {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.nav-dd-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.nav-dd-tx b {
  font-family: 'Space Grotesk', var(--head);
  font-size: 15px; font-weight: 700; letter-spacing: -.012em; line-height: 1.15;
  color: var(--text); transition: color .18s ease;
}
.nav-dd-tx i { font-style: normal; font-size: 11.5px; line-height: 1.3; color: var(--muted); }

/* Static, unlike the logo's dot. Two pulses in one header is a tic, and this
   one is a label for a product rather than a liveness indicator. */
.nav-dd-live {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-family: 'Space Grotesk', var(--head);
  font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #ff7b7b; background: rgba(255,71,71,.13); border: 1px solid rgba(255,71,71,.26);
  padding: 2px 5px; border-radius: 4px; line-height: 1.5;
}
.nav-dd-live::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #ff4747; }

.nav-dd-go {
  flex: none; width: 15px; height: 15px; color: var(--muted); opacity: .45;
  transition: transform .2s cubic-bezier(.23,1,.32,1), color .2s ease, opacity .2s ease;
}
.nav-dd-item:hover .nav-dd-go { transform: translateX(3px); color: var(--pl); opacity: 1; }
.nav-dd-item.active .nav-dd-tx b { color: var(--green); }
.nav-dd-item.active .nav-dd-go { color: var(--green); opacity: 1; }
.nav-dd-item.active::before {
  opacity: 1;
  background: linear-gradient(90deg, rgba(74,214,255,.15), transparent 84%);
}

/* ---------------- desktop: hover / focus dropdown ---------------- */
@media (min-width: 961px) {
  .nav-dd-menu {
    position: absolute; top: calc(100% + 16px); left: 50%; z-index: 5;
    /* `translate` is its own property, so the centring never has to be
       re-stated inside the animated `transform` (the classic bug where
       translateX(-50%) gets dropped mid-scale and the panel jumps right). */
    translate: -50% 0;
    width: 296px;
    background: #131316; border: 1px solid rgba(255,255,255,.08);
    /* 14px, not the 18–24px the cards use — closer to app chrome than to a
       soft popover, and it clips the top edge and the row washes. */
    border-radius: 14px; overflow: hidden;
    box-shadow: 0 26px 64px -14px rgba(0,0,0,.78);
    /* scales out of the trigger sitting directly above it, not out of nowhere */
    transform-origin: top center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-6px) scale(.96);
    /* exit is quicker than entry — the system responding should outpace the
       user deciding. visibility flips only after the fade has finished. */
    transition: opacity .13s cubic-bezier(.23,1,.32,1),
                transform .13s cubic-bezier(.23,1,.32,1),
                visibility 0s linear .13s;
  }
  .nav-dd.open > .nav-dd-menu {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    transition: opacity .19s cubic-bezier(.23,1,.32,1),
                transform .19s cubic-bezier(.23,1,.32,1),
                visibility 0s;
  }
  /* Bridges the 16px gap so the pointer can travel from the trigger to the
     panel without crossing dead space and closing the menu. */
  .nav-dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; }

  .nav-dd-in { position: relative; }
  /* the platform's colour as the panel's top edge, fading out across it */
  .nav-dd-in::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 1;
    background: linear-gradient(90deg, var(--pl), transparent 74%);
  }
  .nav-dd-eye { padding: 14px 16px 10px; }
  .nav-dd-item { padding: 11px 16px 13px; }

  /* Opening brightens the trigger — except when it's the page you're already
     on, where "where am I" outranks "what am I hovering". Without this the
     active parent drops from cyan to white the moment you point at it. */
  .nav-dd.open > .nav-dd-btn { color: var(--text); }
  .nav-dd.on.open > .nav-dd-btn { color: var(--green); }
  .nav-dd.open .nav-dd-car { transform: rotate(180deg); }

  .nav-dd-item:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
}

/* ---------------- mobile: accordion inside the burger drawer ---------------- */
@media (max-width: 960px) {
  .nav-dd { display: block; }
  /* Matches .nav-links a in site.css exactly — the row has to sit in the
     stack as if it were one of the links, because visually it is. */
  .nav-dd-btn {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    min-height: 48px; padding: 12px 15px; border-radius: 13px;
    font-size: 16px; font-weight: 600; color: var(--text);
    transition: background .18s ease, color .18s ease;
  }
  .nav-dd-btn:active { background: rgba(255,255,255,.06); }
  .nav-dd.on > .nav-dd-btn { color: var(--green); background: rgba(74,214,255,.09); }
  .nav-dd-car { width: 13px; height: 13px; opacity: .55; }
  .nav-dd.open .nav-dd-car { transform: rotate(180deg); }

  /* 0fr -> 1fr animates to the content's own height with no JS measuring and
     no magic max-height that clips when the copy changes. */
  .nav-dd-menu {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows .24s cubic-bezier(.23,1,.32,1);
  }
  .nav-dd.open > .nav-dd-menu { grid-template-rows: 1fr; }
  .nav-dd-in { min-height: 0; overflow: hidden; }

  /* The trigger row directly above already says "Twitch" — repeating it as an
     eyebrow inside the drawer is noise the desktop panel doesn't have. */
  .nav-dd-eye { display: none; }

  /* Indented and edged in the platform colour, so the two rows read as
     belonging to the trigger they dropped out of rather than as two more
     top-level destinations. */
  .nav-links a.nav-dd-item {
    min-height: 50px; padding: 10px 14px 11px 17px; border-radius: 11px;
    border-left: 2px solid color-mix(in srgb, var(--pl) 55%, transparent);
    margin: 2px 0 0 13px;
  }
  .nav-links a.nav-dd-item:active { background: rgba(255,255,255,.06); }
  .nav-dd-item + .nav-dd-item { box-shadow: none; }
  .nav-links a.nav-dd-item.active { border-left-color: var(--green); }
  .nav-dd-item.active::before { border-radius: 11px; }
  .nav-dd-item::before { border-radius: 11px; }
  .nav-dd-tx b { font-size: 14.5px; }
  .nav-dd-tx i { font-size: 11px; }
  .nav-dd-go { width: 14px; opacity: .35; }
}

/* Fewer and gentler, not none: the fades and colour changes still explain what
   happened; only the movement goes. The accordion keeps its height transition
   because without it the drawer jumps, and that is the jarring change the
   preference exists to avoid. */
@media (prefers-reduced-motion: reduce) {
  .nav-dd-menu { transition-duration: .12s !important; }
  .nav-dd-menu, .nav-dd.open > .nav-dd-menu { transform: none !important; }
  .nav-dd-car, .nav-dd-go { transition: color .18s ease, opacity .18s ease; }
  .nav-dd-item:hover .nav-dd-go { transform: none; }
}
