/* ============================================================
 * Smash Studios UI layer: one button system + one pill switcher, used on every page.
 * Button: letters roll up on hover (text-roll, 21st.dev style) while the arrow chip slides
 * out and back in. Static SS gradient, no scaling, no glow pulses.
 * Pill: one highlight that glides between options (React Bits PillNav / 21st.dev tubelight),
 * used by the nav (follows the section in view) and the YouTube / Twitch tabs.
 * ============================================================ */
:root {
  --ss-ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ss-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 14px 13px 24px; border-radius: 999px;
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em; line-height: 1.2;
  position: relative; isolation: isolate; overflow: hidden;
  transition: background-position 0.6s var(--ss-ease), border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:not(:has(.btn-ic)) { padding-right: 24px; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent-2, #5fc6ff); outline-offset: 3px; }

/* variants (all the same shape and motion) */
.btn-accent, .btn-accent.is-animated {
  background: linear-gradient(100deg, #1e40af 0%, #2FA8E2 45%, #5fc6ff 70%, #2FA8E2 100%);
  background-size: 220% 100%; background-position: 0% 50%;
  color: #fff; animation: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 30px -12px rgba(47,168,226,0.55);
}
.btn-accent:hover { background-position: 100% 50%; filter: none; transform: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 14px 34px -12px rgba(47,168,226,0.7); }
.btn-accent:active { transform: scale(0.98); }
.btn-ghost {
  background: rgba(255,255,255,0.02); color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.32); }
.btn-flat { background: #fff; color: #05070c; }
.btn-flat:hover { background: var(--accent-2, #5fc6ff); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: var(--accent, #2FA8E2); transform: none; }

/* rolling label: every letter has a twin underneath; on hover the pair slides up, staggered */
.btn-roll { display: inline-flex; white-space: pre; }
.btn-roll .ch { display: inline-block; position: relative; overflow: hidden; vertical-align: top; }
.btn-roll .ch > span { display: block; transition: transform 0.5s var(--ss-ease); transition-delay: calc(var(--i) * 14ms); }
.btn-roll .ch > span + span { position: absolute; left: 0; top: 0; transform: translateY(105%); }
.btn:hover .btn-roll .ch > span:first-child { transform: translateY(-105%); }
.btn:hover .btn-roll .ch > span + span { transform: translateY(0); }

/* arrow chip: the icon leaves to the upper right and its twin arrives from the lower left */
.btn-ic {
  position: relative; display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 999px; overflow: hidden;
  background: rgba(5,7,12,0.28); font-size: 11px;
  transition: background 0.3s ease;
}
.btn-ghost .btn-ic { background: rgba(255,255,255,0.08); }
.btn-flat .btn-ic, .btn-primary .btn-ic { background: rgba(5,7,12,0.1); }
.btn-ic > i { grid-area: 1 / 1; transition: transform 0.5s var(--ss-ease); }
.btn-ic > i + i { transform: translate(-160%, 160%); }
.btn:hover .btn-ic > i:first-child { transform: translate(160%, -160%); }
.btn:hover .btn-ic > i + i { transform: translate(0, 0); }
.btn:hover .btn-ic { background: rgba(5,7,12,0.42); }
.btn-ghost:hover .btn-ic { background: rgba(47,168,226,0.22); }
.btn-flat:hover .btn-ic { background: rgba(5,7,12,0.16); }
.btn.w-full.justify-center { padding-left: 24px; padding-right: 24px; }

/* ---------- Pill switcher (nav + tabs) ---------- */
.ss-pill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0;
  border-radius: 999px; pointer-events: none; z-index: 0; opacity: 0;
  background: rgba(47,168,226,0.12);
  box-shadow: inset 0 0 0 1px rgba(47,168,226,0.3);
  transition: transform 0.45s var(--ss-ease-out), width 0.45s var(--ss-ease-out), opacity 0.25s ease;
}
/* tubelight: a short SS-blue light on top of the active option */
.ss-pill::before {
  content: ''; position: absolute; top: -1px; left: 50%; width: 22px; height: 2px; transform: translateX(-50%);
  border-radius: 2px; background: var(--accent-2, #5fc6ff);
  box-shadow: 0 0 10px 1px rgba(95,198,255,0.75), 0 0 22px 4px rgba(47,168,226,0.35);
}
.ss-pill.is-on { opacity: 1; }
.ss-pill.is-hover::before { opacity: 0.35; }
[data-ss-pill] { position: relative; }
[data-ss-pill] > :not(.ss-pill) { position: relative; z-index: 1; }

/* nav: the pill replaces the per-link hover background */
.nav-desktop[data-ss-pill] .nav-link { background: transparent !important; transition: color 0.25s ease; }
.nav-desktop[data-ss-pill] .nav-link.is-current, .nav-desktop[data-ss-pill] .nav-link:hover { color: #fff; }

/* feeds tabs: the pill is the selected state */
.feeds-tabs[data-ss-pill] .feed-tab { background: transparent !important; color: rgba(255,255,255,0.6); }
.feeds-tabs[data-ss-pill] .feed-tab:hover { color: #fff; }
.feeds-tabs[data-ss-pill] .feed-tab.active { color: #fff; }
.feeds-tabs[data-ss-pill] { overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  .btn-roll .ch > span, .btn-ic > i, .ss-pill { transition: none !important; }
  .btn:hover .btn-roll .ch > span:first-child, .btn:hover .btn-ic > i:first-child { transform: none; }
  .btn:hover .btn-roll .ch > span + span, .btn:hover .btn-ic > i + i { transform: translateY(105%); }
}

/* ---------- Crew focus (driven by ss-ui.js; --mute is 0 under the cursor, rising with distance) ---------- */
.crew-member .crew-avatar > img {
  filter: grayscale(calc(0.2 + 0.75 * var(--mute, 0))) brightness(calc(1 - 0.42 * var(--mute, 0)));
  transition: transform 1s cubic-bezier(0.4,0,0.2,1), filter 0.45s ease;
}

/* ---------- SuperNova × SS exclusive frame (home + shop). Same treatment as the MomoCon frame,
   in the shirt's own print colours: yellow, green, red, blue ---------- */
.sn-frame {
  --sn-y: #efaa09; --sn-g: #2ebc02; --sn-r: #f32d00; --sn-b: #0e7dee;
  position: relative; padding: 2px; border-radius: 36px;
  background: linear-gradient(135deg, var(--sn-y) 0%, var(--sn-g) 34%, var(--sn-r) 67%, var(--sn-b) 100%);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}
.sn-frame-inner {
  position: relative; height: 100%; padding: 14px; border-radius: 34px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(239,170,9,0.07), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(14,125,238,0.08), transparent 55%),
    var(--bg, #0a0a0a);
}
.sn-frame-inner > * { height: 100%; }
.sn-frame-label {
  position: absolute; top: -10px; left: 24px; z-index: 3;
  padding: 3px 14px; border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: #07080c;
  background: linear-gradient(90deg, var(--sn-y) 0%, var(--sn-g) 34%, var(--sn-r) 67%, var(--sn-b) 100%);
}
