/* Material 3 inspired theme */
:root {
  --m3-primary: #6300ff;
  --m3-on-primary: #FFFFFF;
  --m3-surface: #0F0F12;
  --m3-surface-variant: #1A1A20;
  --m3-on-surface: #E6E1E5;
  --m3-outline: #3D3A40;
  --m3-secondary: #7D5260;
  --m3-tonal: #EADDFF;

  /* Perk card rail width (desktop) */
  --perk-rail: 36px;

  /* Cyberpunk accents (used across site) */
  --cyber-cyan: #00E5FF;     /* neon cyan */
  --cyber-violet: #9B4DFF;   /* vivid violet */
  --cyber-magenta: #FF3D81;  /* hot magenta */

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.2);
  --shadow-2: 0 6px 16px rgba(0,0,0,.38), 0 2px 8px rgba(0,0,0,.2);

  --container: 1160px;
}

/* Preloader */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: radial-gradient(1200px 800px at 10% 10%, #121218, #09090d);
  transition: opacity .35s ease;
}
#preloader.done { opacity: 0; pointer-events: none; }
#preloader[hidden] { display: none !important; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: rgba(255,255,255,.9);
  animation: spin 0.9s linear infinite;
  filter: drop-shadow(0 0 18px rgba(255,255,255,.25));
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,1px,1px); white-space: nowrap; border: 0; }

/* Desktop-only: grayscale Perks video and overlay */
@media (min-width: 769px) {
  #perks .media--color { filter: grayscale(80%); }
  #perks video,
  #perks .perks-video--desktop { filter: grayscale(60%) saturate(90%) contrast(185%); }
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Roboto Flex', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--m3-on-surface);
  background: radial-gradient(1200px 800px at 10% 10%, #121218, #09090d);
}

img { max-width: 100%; display: block; }

.container { width: min(100% - 32px, var(--container)); margin: 0 auto; }
.center { text-align: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* Topbar */
.topbar {
  position: fixed; inset: 16px 16px auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 999px;
  background: color-mix(in oklab, var(--m3-surface) 70%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--m3-outline);
}
.topbar .brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--m3-on-surface); font-weight: 700; letter-spacing: .2px; }
.topbar .brand img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255,255,255,.06)); }
.topbar .actions { display: flex; gap: 8px; }

/* Mobile: slightly larger brand text and no wrap */
@media (max-width: 768px) {
  .topbar .brand { white-space: nowrap; }
  .topbar .brand span { font-size: clamp(15px, 4.2vw, 18px); }
}

/* Mobile menu toggle */
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--m3-outline); background: color-mix(in oklab, var(--m3-surface) 70%, transparent); color: var(--m3-on-surface); align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.menu-toggle span:nth-child(2) { width: 14px; }
.menu-toggle.active span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

/* Mobile: show 3 dots instead of 3 dashes in the menu toggle */
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; gap: 6px; }
  .menu-toggle span { width: 6px; height: 6px; border-radius: 50%; }
  .menu-toggle span:nth-child(2) { width: 6px; }
  /* Keep dots appearance when menu is active */
  .menu-toggle.active span:nth-child(1),
  .menu-toggle.active span:nth-child(3) { transform: none; }
  .menu-toggle.active span:nth-child(2) { opacity: 1; }
}

/* Buttons */
.btn { --pad: 12px 18px; display: inline-flex; align-items: center; gap: 8px; padding: var(--pad); border-radius: 999px; text-decoration: none; font-weight: 600; letter-spacing: .3px; transition: .25s ease; border: 1px solid transparent; }
.btn.contained { background: var(--m3-primary); color: var(--m3-on-primary); box-shadow: var(--shadow-2); }
.btn.contained:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(103,80,164,.35); }
.btn.tonal { background: color-mix(in oklab, var(--m3-tonal) 15%, transparent); color: var(--m3-on-surface); border-color: color-mix(in oklab, var(--m3-tonal) 20%, transparent); }
.btn.text { color: var(--m3-on-surface); opacity: .92; }
.btn.text:hover { opacity: 1; }

/* Hero */
.hero { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 0 24px; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(110%) contrast(105%); }
.hero__overlay { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 40%, rgba(12,10,20,.35), rgba(6,5,10,.9)); backdrop-filter: blur(5px); }
.hero__tint { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,10,20,.55), rgba(12,10,20,.25) 30%, rgba(103,80,164,.18) 70%, rgba(12,10,20,.65)); mix-blend-mode: normal; }
.hero-anim { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 0; height: 100vh; }
.hero-anim__placeholder { width: clamp(160px, 25vw, 320px); height: clamp(160px, 25vw, 320px); border-radius: 50%; overflow: hidden; border: 1px solid color-mix(in oklab, var(--m3-outline) 60%, transparent); background-color: color-mix(in oklab, var(--m3-surface-variant) 55%, transparent); background-image: url("./images/BTM_Logo_2.png"); background-repeat: no-repeat; background-position: center; background-size: 80% auto; box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 36px rgba(103,80,164,.28), 0 16px 40px rgba(0,0,0,.35); flex: 0 0 auto; align-self: center; }
.hero-anim__lottie { height: 100vh; width: auto; display: grid; place-items: center; transform: scale(1.9); transform-origin: center; will-change: transform; }
.hero-anim__lottie > *, .hero-anim__lottie svg { width: auto !important; max-width: 100% !important; height: 100% !important; display: block; background: transparent !important; }
.hero__content { position: relative; z-index: 1; text-align: center; display: grid; gap: 16px; }
.hero h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.1; letter-spacing: -.5px; margin: 0 0 12px; font-weight: 800; }
.hero p { font-size: clamp(14px, 2vw, 18px); opacity: .9; margin: 0 0 20px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; }

/* Desktop: nudge hero logo placeholder further left */
@media (min-width: 768px) {
  /* Layout: placeholder left, Lottie right (no overlap) */
  .hero-anim {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: clamp(24px, 4vw, 48px);
    width: min(1200px, 92vw);
    margin-inline: auto;
  }
  .hero-anim__placeholder {
    margin: 0; /* override any previous margin shift */
    justify-self: start;
    position: relative; z-index: 2;
  }
  .hero-anim__lottie {
    position: relative; z-index: 1; pointer-events: none; justify-self: end;
    height: auto; /* avoid 100vh overlap */
    width: min(60vw, 860px);
    max-height: 86vh;
    transform: none; /* rely on natural size; prevent huge scale overlap */
  }
}

/* Hero logo placeholder: 3D tilt + border shimmer (match tribe style) */
.hero-anim__placeholder { position: relative; transform-style: preserve-3d; will-change: transform, box-shadow; }
.hero-anim__placeholder::before { 
  content: ""; position: absolute; inset: -2px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 60% at 50% 50%, rgba(112,128,144,.28), rgba(0,0,0,0));
  filter: blur(20px); opacity: .20; transition: opacity .25s ease;
}
.hero-anim__placeholder::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.14) 50%, rgba(255,255,255,0) 70%);
  transform: translate(-120%, -120%) rotate(0.0001deg);
  opacity: 0;
}
.hero-anim__placeholder:hover,
.hero-anim__placeholder.is-hover { 
  box-shadow: 0 0 0 2px rgba(255,255,255,.24), 0 22px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(203,184,255,.14) inset; 
  animation: tribe-glow 1.8s ease-in-out infinite; 
}
.hero-anim__placeholder:hover::before,
.hero-anim__placeholder.is-hover::before { opacity: .38; }
.hero-anim__placeholder:hover::after,
.hero-anim__placeholder.is-hover::after { animation: tribe-sweep 1.2s ease-out forwards; }

@media (prefers-reduced-motion: reduce) {
  .hero-anim__placeholder { animation: none !important; }
  .hero-anim__placeholder::after { animation: none !important; }
}

/* Hero translucent content card (mobile) */
.content-card { border-radius: var(--radius-2xl); }

/* Hero Ticker */
.hero-ticker { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; gap: 6px; padding: 10px 0; pointer-events: none; }
.ticker { overflow: hidden; mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent); }
.ticker__track { display: inline-flex; align-items: center; gap: 32px; white-space: nowrap; will-change: transform; filter: drop-shadow(0 1px 6px rgba(0,0,0,.35)); opacity: .95; }
.ticker__track span { font-weight: 800; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.5); }

/* Seamless marquee animations: move half-width across duplicated content */
@keyframes ticker-ltr { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
@keyframes ticker-rtl { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Differential inertia: distinct speeds + slight desync */
.ticker--ltr .ticker__track { animation: ticker-ltr 36s linear infinite; animation-delay: -2s; }
.ticker--rtl .ticker__track { animation: ticker-rtl 48s linear infinite; animation-delay: -5s; }

@media (max-width: 600px) {
  .hero-ticker { gap: 4px; padding: 8px 0; }
  .ticker__track { gap: 20px; }
  .ticker--ltr .ticker__track { animation-duration: 28s; }
  .ticker--rtl .ticker__track { animation-duration: 36s; }
}
@media (max-width: 600px) {
  /* Match Join card exactly */
  .content-card { background: color-mix(in oklab, var(--m3-surface-variant) 70%, transparent); border: 1px solid var(--m3-outline); box-shadow: var(--shadow-2); padding: 18px; backdrop-filter: none; }
  .hero { min-height: 100svh; padding: 0 16px; place-items: stretch center; }
  .hero-anim { gap: 16px; height: 100svh; align-self: stretch; }
  .hero-anim__placeholder { width: clamp(110px, 30vw, 160px); height: clamp(110px, 30vw, 160px); border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 24px rgba(103,80,164,.28), 0 12px 28px rgba(0,0,0,.3); flex: 0 0 auto; align-self: center; background-image: url("./images/BTM_Logo_2.png"); background-repeat: no-repeat; background-position: center; background-size: 78% auto; }
  /* Option A: full-width Lottie on phones, slight upward nudge to remove bands */
  .hero-anim__lottie { height: 100%; width: 100%; max-width: 100%; transform: scale(1.3) translateX(-2svh); transform-origin: center; overflow: hidden; box-sizing: border-box; }
  .hero-anim__lottie > *, .hero-anim__lottie svg { width: 100% !important; height: 100% !important; max-width: 100% !important; }
}

/* Parallax decorative */
.parallax { pointer-events: none; position: absolute; inset: 0; z-index: 0; }
.parallax__layer { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .5; mix-blend-mode: plus-lighter; }
.layer--1 { width: 38vmax; height: 38vmax; background: #A0A6FF; top: -10vmax; left: -6vmax; }
.layer--2 { width: 26vmax; height: 26vmax; background: #FF9EDB; bottom: -6vmax; right: -2vmax; }
.layer--3 { width: 20vmax; height: 20vmax; background: #7AE1FF; bottom: 6vmax; left: 10vmax; }

/* Sections */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section__title { font-size: clamp(28px, 4.5vw, 44px); letter-spacing: -.5px; margin: 0 0 24px; }
.container { width: min(1100px, 92%); margin-inline: auto; }
.lead { font-size: clamp(16px, 2.5vw, 20px); opacity: .88; }

/* Desktop: tighten About vertical spacing so Tribes fits within one viewport */
@media (min-width: 769px) {
  /* Prevent the sticky header from covering the About title on anchor jumps */
  html, body { scroll-padding-top: 112px; }
  #about { scroll-margin-top: 112px; }
  #about .section__title { scroll-margin-top: 112px; padding-top: 6px; }
  #about.section {
    /* Option A: tighter top padding on desktop */
    padding-top: clamp(32px, 3vw, 56px);
    padding-bottom: clamp(0px, 1vw, 8px);
  }
  /* Make About title smaller and reduce gap below it */
  #about .section__title {
    font-size: clamp(22px, 3vw, 36px);
    margin-bottom: 12px;
    text-align: center;
  }
  /* Also trim the top padding of Tribes to reduce the gap below About's video */
  #tribes.section {
    padding-top: 0;
  }
  #tribes .section__title { margin-bottom: 12px; }
}

/* Mobile Nav Overlay */
.mobile-nav[hidden] { display: none !important; }
.mobile-nav { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-columns: 1fr; background: rgba(12,10,20,.38); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
.mobile-nav__panel { margin-left: auto; width: min(92vw, 360px); height: 100%; padding: 22px; display: grid; align-content: start; gap: 10px; background: color-mix(in oklab, var(--m3-surface-variant) 78%, transparent); border-left: 1px solid var(--m3-outline); box-shadow: -10px 0 24px rgba(0,0,0,.4); transform: translateX(8%); transition: transform .28s ease; }
.mobile-nav:not([hidden]) { opacity: 1; pointer-events: auto; }
body.nav-open .mobile-nav__panel { transform: translateX(0); }
.mobile-link { display: block; padding: 12px 10px; color: var(--m3-on-surface); text-decoration: none; border-radius: 12px; border: 1px solid transparent; }
.mobile-link:hover { background: color-mix(in oklab, var(--m3-tonal) 10%, transparent); border-color: color-mix(in oklab, var(--m3-tonal) 15%, transparent); }

/* Prevent body scroll when nav open */
body.nav-open { overflow: hidden; }

/* Cards */
.grid { display: grid; gap: 20px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: color-mix(in oklab, var(--m3-surface-variant) 80%, transparent); border: 1px solid var(--m3-outline); padding: 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow-1); transition: transform .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card .material-symbols-rounded { font-size: 28px; opacity: .9; }
.card h3 { margin: 8px 0 6px; }
.card p { margin: 0; opacity: .9; }

/* Parallax media sections */
.section--parallax { position: relative; overflow: hidden; }
.parallax-media { position: absolute; inset: 0; z-index: 0; }
.media-layer { position: absolute; inset: 0; background-size: cover; background-position: center; }
/* Ensure videos inside parallax fill the container */
.parallax-media > video.media-layer { width: 100%; height: 100%; object-fit: cover; }
/* Use this to fit entire video without cropping */
.media--fit { object-fit: contain !important; background: #000; }
.media--bg { 
  filter: blur(18px) saturate(110%); opacity: .35; 
}
/* Shared flare background for all parallax sections */
/* .section--parallax .media--bg {
  background-image:
    radial-gradient(60% 60% at 12% 18%, rgba(103,80,164,.28), transparent 60%),
    radial-gradient(48% 48% at 88% 16%, rgba(3,218,198,.22), transparent 60%),
    radial-gradient(46% 46% at 50% 86%, rgba(255,64,129,.18), transparent 60%);
} */
.media--color { background: radial-gradient(60% 60% at 75% 40%, rgba(103,80,164,.25), transparent 80%); mix-blend-mode: plus-lighter; }
.section--parallax .container { position: relative; z-index: 2; display: grid; place-items: center; }

/* Subtle pattern overlays */
/* Dot grid pattern (global variables) */
:root {
  --pattern-color: rgba(255,255,255,0.22);
  --pattern-size: 22px;
  --pattern-bg: radial-gradient(var(--pattern-color) 1.2px, transparent 1.6px);
}

/* About: apply pattern on section background (fixed to viewport) */
#about {
  /* darker overlay for readability over static content */
  background-image:
    linear-gradient(180deg, rgba(12,10,20,0.55), rgba(12,10,20,0.65)),
    var(--pattern-bg);
  background-size:
    auto,
    var(--pattern-size) var(--pattern-size);
  background-position:
    top center,
    top center;
  background-attachment: scroll;
}

/* Tribes: apply pattern on section background (fixed to viewport) */
#tribes {
  /* slightly lighter overlay to keep video visible */
  background-image:
    linear-gradient(180deg, rgba(12,10,20,0.42), rgba(12,10,20,0.52)),
    var(--pattern-bg);
  background-size:
    auto,
    var(--pattern-size) var(--pattern-size);
  background-position:
    top center,
    top center;
  background-attachment: scroll;
}

/* Perks: apply pattern as section background (fixed to viewport) */
#perks {
  /* moderate overlay, matches grayscale treatment */
  background-image:
    linear-gradient(180deg, rgba(12,10,20,0.48), rgba(12,10,20,0.58)),
    var(--pattern-bg);
  background-size:
    auto,
    var(--pattern-size) var(--pattern-size);
  background-position:
    top center,
    top center;
  background-attachment: scroll;
}

/* Join: apply pattern on the section background (outside the card) */
#join {
  /* slightly stronger overlay to reduce dot contrast behind form */
  background-image:
    linear-gradient(180deg, rgba(12,10,20,0.58), rgba(12,10,20,0.68)),
    var(--pattern-bg);
  background-size:
    auto,
    var(--pattern-size) var(--pattern-size);
  background-position:
    top center,
    top center;
  background-attachment: scroll;
}

/* Ensure content sits above overlays */
.section--parallax .container { position: relative; z-index: 2; }

/* Mobile: reproduce pattern overlays above background videos */
@media (max-width: 768px) {
  /* About */
  #about { position: relative; }
  #about::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    z-index: 0; /* sit beneath content */
    background-image:
      linear-gradient(180deg, rgba(12,10,20,0.55), rgba(12,10,20,0.65)),
      var(--pattern-bg);
    background-size:
      auto,
      var(--pattern-size) var(--pattern-size);
    background-position:
      top center,
      top center;
  }
  /* Ensure About content sits above the overlay */
  #about .container { position: relative; z-index: 2; }

  /* Tribes */
  #tribes { position: relative; }
  #tribes::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    z-index: 1;
    background-image:
      linear-gradient(180deg, rgba(12,10,20,0.42), rgba(12,10,20,0.52)),
      var(--pattern-bg);
    background-size:
      auto,
      var(--pattern-size) var(--pattern-size);
    background-position:
      top center,
      top center;
  }

  /* Perks */
  #perks { position: relative; }
  #perks::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    z-index: 1;
    background-image:
      linear-gradient(180deg, rgba(12,10,20,0.48), rgba(12,10,20,0.58)),
      var(--pattern-bg);
    background-size:
      auto,
      var(--pattern-size) var(--pattern-size);
    background-position:
      top center,
      top center;
  }

  /* Join */
  #join { position: relative; }
  #join::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    z-index: 1;
    background-image:
      linear-gradient(180deg, rgba(12,10,20,0.58), rgba(12,10,20,0.68)),
      var(--pattern-bg);
    background-size:
      auto,
      var(--pattern-size) var(--pattern-size);
    background-position:
      top center,
      top center;
  }
}
/* Perks: enhance title readability and grayscale the overlay */
#perks .section__title,
#perks .lead {
  text-shadow: 0 2px 12px rgba(0,0,0,.45), 0 6px 24px rgba(0,0,0,.35);
}
#perks .media--color { filter: grayscale(80%); }
/* Constrain Join background to the form card */
#join .join.card { position: relative; overflow: hidden; }
#join .join.card .parallax-media { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; clip-path: inset(0 round var(--radius-lg)); z-index: 0; }
#join .join.card .parallax-media .media-layer { width: 100%; height: 100%; object-fit: cover; object-position: center center; pointer-events: none; }
#join .join.card > *:not(.parallax-media) { position: relative; z-index: 1; }
/* Dark tint over Join form video */
#join .join.card .parallax-media .media--color {
  background:
    linear-gradient(180deg, rgba(12,10,20,.58), rgba(12,10,20,.70)),
    radial-gradient(60% 60% at 50% 40%, rgba(12,10,20,.35), transparent 60%);
  mix-blend-mode: normal;
}

/* Perks: responsive background videos */
#perks .perks-video--desktop { display: block; }
#perks .perks-video--mobile { display: none; }

@media (max-width: 768px) {
  /* Hide desktop-only stacked perks placeholder on mobile */
  .perks-stack { display: none !important; }

  /* Swap to mobile video on phones */
  #perks .perks-video--desktop { display: none; }
  #perks .perks-video--mobile { display: block; }

  /* Cyberpunk hue overlay for mobile: cyan + magenta + violet blend */
  #perks .media--color {
    background:
      radial-gradient(60% 60% at 18% 30%, rgba(0, 255, 234, 0.22), transparent 60%),
      radial-gradient(48% 48% at 82% 24%, rgba(255, 0, 141, 0.24), transparent 60%),
      radial-gradient(46% 46% at 50% 78%, rgba(155, 77, 255, 0.20), transparent 60%);
    mix-blend-mode: plus-lighter;
  }
  /* Slightly reduce blur/tint so text remains legible over video */
  #perks .media--bg { opacity: .30; }

  /* Mobile: keep Perks video and overlay in color */
  #perks video,
  #perks .perks-video--mobile { filter: none !important; }
  #perks .media--color { filter: none !important; }
}

/* Dark neon accent */
.neon { 
  color: var(--neon, #CBB8FF);
  text-shadow:
    0 0 14px color-mix(in oklab, var(--neon, #CBB8FF) 55%, transparent),
    0 0 30px color-mix(in oklab, var(--neon, #CBB8FF) 35%, transparent);
}

/* About */
.about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.about-media, .about-copy { height: 100%; }
.about-media { display: grid; }
.about-media .media-frame { border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--m3-outline); box-shadow: 0 0 0 1px rgba(103,80,164,.12) inset, 0 40px 80px rgba(103,80,164,.15); height: 100%; }
.about-video { width: 100%; height: 100%; display: block; object-fit: cover; }
.about-copy p { margin: 0 0 10px; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Tribes */
.tribes-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.tribe.card { 
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; height: 100%;
  border-radius: 22px;
  padding: 26px;
  border: 1px solid rgba(112,128,144,.38); /* SlateGray border */
  background: linear-gradient(180deg, rgba(14,12,20,.95), rgba(14,12,20,.90));
  box-shadow:
    0 8px 24px rgba(0,0,0,.45),
    0 0 0 1px rgba(112,128,144,.12) inset;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, background .35s ease;
}
.tribe.card::before { 
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 50%, rgba(112,128,144,.28), rgba(0,0,0,0));
  filter: blur(20px); opacity: .20; z-index: 0; transition: opacity .25s ease;
  transform: rotate(0deg);
}
.tribe.card > *:not(.card-glare):not(.cyber-lines):not(.corner-elements):not(.scan-line):not(.card-particles) { position: relative; z-index: 1; }
.tribe.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.14) 50%, rgba(255,255,255,0) 70%);
  transform: translate(-120%, -120%) rotate(0.0001deg);
  opacity: 0;
}
.tribe.card .tracker { position: absolute; inset: 0; border-radius: inherit; z-index: 3; display: grid; grid-template-columns: repeat(5,1fr); grid-template-rows: repeat(5,1fr); pointer-events: auto; }
.tribe.card .tracker span { display: block; width: 100%; height: 100%; background: transparent; }
.tribe.card:hover { 
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 22px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(203,184,255,.14) inset;
  animation: tribe-glow 1.8s ease-in-out infinite;
}
.tribe.card:hover::before { opacity: .38; }
.tribe.card:hover::after { animation: tribe-sweep 1.2s ease-out forwards; }
.tribe .lead { text-align: center; margin-top: 8px; }
.circle-video { 
  width: 220px; height: 220px; border-radius: 50%; overflow: hidden; margin: 0 auto 16px;
  border: 1px solid transparent;
  background:
    radial-gradient(80% 80% at 50% 20%, rgba(255,255,255,.04), rgba(255,255,255,0)) padding-box,
    conic-gradient(from 180deg at 50% 50%, rgba(155,77,255,.9), rgba(0,229,255,.9), rgba(255,61,129,.9), rgba(155,77,255,.9)) border-box;
  box-shadow:
    0 10px 30px rgba(155,77,255,.25),
    0 0 24px rgba(103,80,164,.25) inset;
}
.circle-video::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 40%, rgba(155,77,255,.5), rgba(0,0,0,0));
  filter: blur(18px); opacity: .35;
}
.circle-video video { width: 100%; height: 100%; object-fit: cover; filter: saturate(118%) contrast(104%); }
.tribe h3 { margin: 8px 0 6px; }

/* Uiverse-like overlays inside tribe cards */
.tribe.card .card-glare,
.tribe.card .cyber-lines,
.tribe.card .corner-elements,
.tribe.card .scan-line { position: absolute; inset: 0; pointer-events: none; }

/* Card glare overlay */
.tribe.card .card-glare {
  z-index: 1;
  background: linear-gradient(
    125deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.05) 45%,
    rgba(255,255,255,.10) 50%,
    rgba(255,255,255,.05) 55%,
    rgba(255,255,255,0) 100%
  );
  opacity: 0;
  transition: opacity .3s ease;
}
.tribe.card:hover .card-glare { opacity: 1; }

/* Cyber horizontal scan lines */
.tribe.card .cyber-lines { z-index: 1; }
.tribe.card .cyber-lines span { position: absolute; height: 1px; left: 0; right: 0; 
  background: linear-gradient(90deg, transparent, rgba(124, 77, 255, 0.24), transparent);
  transform: scaleX(0); opacity: 0;
}
.tribe.card .cyber-lines span:nth-child(1) { top: 22%; transform-origin: left; }
.tribe.card .cyber-lines span:nth-child(2) { top: 44%; transform-origin: right; }
.tribe.card .cyber-lines span:nth-child(3) { top: 66%; transform-origin: left; }
.tribe.card .cyber-lines span:nth-child(4) { top: 82%; transform-origin: right; }
.tribe.card:hover .cyber-lines span:nth-child(1) { animation: lineGrow 3s linear infinite; }
.tribe.card:hover .cyber-lines span:nth-child(2) { animation: lineGrow 3s linear infinite .8s; }
.tribe.card:hover .cyber-lines span:nth-child(3) { animation: lineGrow 3s linear infinite 1.6s; }
.tribe.card:hover .cyber-lines span:nth-child(4) { animation: lineGrow 3s linear infinite 2.2s; }

/* Corner brackets */
.tribe.card .corner-elements { z-index: 2; }
.tribe.card .corner-elements span { position: absolute; width: 16px; height: 16px; border: 2px solid rgba(124,77,255,.35); transition: all .3s ease; }
.tribe.card .corner-elements span:nth-child(1) { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.tribe.card .corner-elements span:nth-child(2) { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.tribe.card .corner-elements span:nth-child(3) { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.tribe.card .corner-elements span:nth-child(4) { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.tribe.card:hover .corner-elements span { border-color: rgba(124,77,255,.8); box-shadow: 0 0 10px rgba(124,77,255,.45); }

/* Vertical scan line */
.tribe.card .scan-line { z-index: 1; background: linear-gradient(to bottom, transparent, rgba(124,77,255,.10), transparent); transform: translateY(-100%); }
.tribe.card:hover .scan-line { animation: scanMove 2s linear infinite; }

/* Keyframes for overlays */
@keyframes lineGrow {
  0% { transform: scaleX(0); opacity: 0; }
  50% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0); opacity: 0; }
}
@keyframes scanMove {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* Perks - Uiverse Exact Animation with Flip */
.perks-container { position: relative; display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 24px; }


.perk-glass {
  position: relative;
  width: 300px;
  height: 345px;
  background: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 25px 25px rgba(0, 0, 0, 0.25);
  transition: 0.5s;
  border-radius: 10px;
  margin: 0 -90px;
  backdrop-filter: blur(10px);
  transform: rotate(calc(var(--r) * 1deg)) translateX(calc(var(--r) * 1.5px)) translateY(calc(var(--r) * var(--r) * 0.2px));
  perspective: 1000px;
  transform-origin: 50% 80%;
}

@media (min-width: 769px) {
  /* Show video, hide cards entirely on desktop */
  #perks .container { display: flex; flex-direction: column; }
  /* Flush bottom spacing for a seamless transition to next section */
  #perks.section { padding-bottom: 0; }


  .perks-stack {
    position: relative;
    /* 50% smaller than previous container max, with a safe lower bound */
    width: clamp(320px, 50vw, calc(var(--container) / 2));
    /* left align within the container */
    margin: 24px 0 0;
    aspect-ratio: 1 / 1; /* keep square */
    border-radius: var(--radius-xl);
    overflow: visible; /* children handle their own overflow */
  }
  .perk-card {
    position: absolute;
    inset: 0;
    margin: 0 auto;
    width: min(100%, 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    /* Drop shadow for depth on opaque cards */
    box-shadow: 0 10px 20px rgba(0,0,0,0.18), 0 6px 12px rgba(0,0,0,0.12);
    transform-origin: 50% 70%;
    will-change: transform, filter, opacity;
    background: rgba(0,0,0,.35);
    backdrop-filter: saturate(120%) blur(1px);
  }
  .perk-card::after {
    content: attr(data-title);
    position: absolute;
    left: 16px;
    bottom: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .02em;
    text-shadow: 0 2px 6px rgba(0,0,0,.5);
    pointer-events: none;
  }
  .perk-card__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(30%) contrast(105%) saturate(95%);
    transform: translateZ(0);
  }
  /* Hide old perks glass cards on desktop when using stacked cards */
  .perks-container { display: none !important; }
}

/* Prefer dynamic viewport units when supported to avoid scrollbar-induced shifts */
@supports (width: 100dvw) {
  @media (min-width: 769px) {
    /* Keep constrained container on capable browsers as well */

  }
}

/* Prevent any accidental horizontal overflow on the perks section */
#perks { overflow-x: clip; }

.perk-glass::before {
  content: attr(data-text);
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  z-index: 10;
}

/* Desktop: rotate title text 90deg (reads bottom -> top) and show a vertical rail */
@media (min-width: 769px) {
  /* Vertical rail */
  .perk-glass::after {
    content: "";
    position: absolute;
    left: 0; top: 0;
    height: 100%; width: var(--perk-rail);
    /* Nearly solid purple rail + shimmer overlay */
    background:
      linear-gradient(
        180deg,
        rgba(155,77,255,0.62) 0%,          /* purple */
        rgba(155,77,255,0.58) 100%         /* almost solid */
      ),
      linear-gradient(
        180deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.25) 50%,
        rgba(255,255,255,0) 100%
      );
    background-size: 100% 100%, 100% 200%;
    background-position: 0 0, 0 -100%;
    animation: railShimmer 3.2s linear infinite;
    border-right: 1px solid rgba(155,77,255,0.45);
    box-shadow:
      0 0 18px rgba(155,77,255,0.25),
      0 0 10px rgba(155,77,255,0.24) inset,
      0 0 0 1px rgba(203,184,255,0.10) inset;
    border-top: none; border-bottom: none;
    z-index: 5;
  }
  /* Distinct pillar hues per card (cycles every 4) */
  .perk-glass:nth-child(4n+1)::after {
    background-image:
      linear-gradient(180deg, rgba(204,17,240,0.62) 0%, rgba(204,17,240,0.58) 100%),
      linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  }
  .perk-glass:nth-child(4n+2)::after {
    background-image:
      linear-gradient(180deg, rgba(99,0,255,0.62) 0%, rgba(99,0,255,0.58) 100%),
      linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  }
  .perk-glass:nth-child(4n+3)::after {
    background-image:
      linear-gradient(180deg, rgba(255,0,141,0.62) 0%, rgba(255,0,141,0.58) 100%),
      linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  }
  .perk-glass:nth-child(4n+4)::after {
    background-image:
      linear-gradient(180deg, rgba(209,78,234,0.62) 0%, rgba(209,78,234,0.58) 100%),
      linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  }
  /* Rotated text */
  .perk-glass::before {
    background: transparent;
    width: auto; height: auto;
    top: 50%; left: calc(var(--perk-rail) / 2); /* center of rail */
    bottom: auto; right: auto;
    /* Bottom-to-top reading direction, perfectly centered */
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center center;
    display: block;
    padding: 0;
    z-index: 10;
    letter-spacing: .3px;
    white-space: nowrap; /* prevent wrap inside the rail */
    text-align: center;
    color: #FFFFFF; /* white text */
    text-shadow:
      0 0 8px rgba(255,61,129,0.45),
      0 0 16px rgba(155,77,255,0.35);
  }
  /* Shrink flip faces to exclude rail width */
  .perk-front, .perk-back {
    left: var(--perk-rail);
    width: calc(100% - var(--perk-rail));
  }
}

.perk-front, .perk-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: transform 0.6s;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: inherit;
}

/* Re-apply desktop sizing after base rule so it takes precedence */
@media (min-width: 769px) {
  .perk-front, .perk-back { left: var(--perk-rail); width: calc(100% - var(--perk-rail)); }
}


/* Front face base (image handled in ::before for isolated filtering) */
.perk-front {
  z-index: 2;
  transition: filter 0.4s ease;
}
/* Render the image layer with grayscale and zoom */
.perk-front::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(100%);
  animation: bgZoom var(--perk-zoom, 5s) ease-in-out infinite alternate;
  animation-delay: var(--perk-zoom-delay, 0s);
  will-change: background-size;
  border-radius: inherit;
}

/* Vignette/hue overlay lives on ::after so it stays colored while image is grayscale */
.perk-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.70) 100%);
  border-radius: inherit;
  pointer-events: none;
}

/* Ensure any inline images remain grayscale */
.perk-glass img,
.perk-front img,
.perk-back img { filter: grayscale(100%) !important; }

/* Back face: ensure grayscale if background imagery used via ::before, and support hue overlay in ::after */
.perk-back::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(100%);
  border-radius: inherit;
  z-index: 0;
}
.perk-back::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.76) 100%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* Assign background images to each card */
/* Assign background images to front via ::before (so we can grayscale just the image) */
.perk-glass[data-text="Creative Gear"] .perk-front::before { background-image: url('./CreativeResources.jpg'); }
.perk-glass[data-text="Tech Tools"] .perk-front::before { background-image: url('./TechTools.jpg'); }
.perk-glass[data-text="Professional Support"] .perk-front::before { background-image: url('./Professional Support.jpg'); }

.perk-glass[data-text="Learning & Development"] .perk-front::before { background-image: url('./Learning.jpg'); }
.perk-glass[data-text="Caffeine Power"] .perk-front::before { background-image: url('./Caffeine Power.jpg'); }
.perk-glass[data-text="Community & Culture"] .perk-front::before { background-image: url('./Community.jpg'); }


.perk-back {
  transform: rotateY(180deg);
  background: rgba(12, 10, 20, 0.22); /* darker glass for readability */
  flex-direction: column;
  padding: 20px;
  justify-content: flex-start; /* Aligns content to the top */
  align-items: flex-start; /* Aligns content to the left */
}

.perk-glass:hover .perk-front {
  transform: rotateY(-180deg);
}

.perk-glass:hover .perk-back {
  transform: rotateY(0deg);
}

.perk-glass:hover {
  z-index: 10;
}

/* .perk-front .material-symbols-rounded was here */

.perk-back p {
  color: #FFFFFF; /* ensure not dimmed by overlay */
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  text-align: left;
  padding: 0 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  z-index: 2; /* above ::after vignette */
}

.perk-back p span {
  display: block;
  position: relative;
  padding-left: 15px; /* Space for the pointer */
  margin-bottom: 4px; /* Space between lines */
}

.perk-back p span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 2px;
  background: #B388FF;
}

/* ===== Override: Remove images from all perk cards ===== */
/* Disable background images applied via pseudo-elements */
.perk-glass .perk-front::before,
.perk-glass .perk-back::before {
  background-image: none !important;
  content: none !important; /* remove pseudo so no hit to layout/filters */
  filter: none !important;
}

/* Perks Carousel Styles Removed */

/* Magnetic buttons (primary) */

/* Responsive Design */
@media (max-width: 768px) {
  .topbar {
    border-radius: 24px;
  }

  .tribe-container {
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow-x: auto; /* Allow horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
  }

  .tribe-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
  }

  /* Tighten padding on perks container to align list further left */
  #perks .container { padding-left: 12px; padding-right: 12px; }

  /* Mobile: keep cards hidden and also hide desktop video */
  .perks-container { display: none !important; }
  .perks-desktop-video-wrap { display: none !important; }
  .perks-desktop-png-wrap { display: none !important; }

  /* Mobile perks layout */
  .perks-mobile { 
    display: flex !important; /* ensure visible on mobile */
    gap: 12px;
    padding: 0; /* remove side padding so list hugs the container edge */
    align-items: stretch; /* equalize heights */
    width: 100%;
    margin-top: 8px;
    position: relative;
    z-index: 2;
  }
  .perks-mobile .perk-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 40%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .perks-mobile .perk-list li {
    font-size: 13.5px; /* scaled down */
    line-height: 1.25;
    color: #E9E4FF;
    opacity: .75;
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(203,184,255,0.14);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: opacity .2s ease, background .2s ease, border-color .2s ease;
    text-align: left;
    position: relative;
    overflow: hidden; /* for shimmer sweep */
  }
  .perks-mobile .perk-list li:hover,
  .perks-mobile .perk-list li:focus { opacity: 1; }
  .perks-mobile .perk-list li.active {
    opacity: 1;
    background: rgba(203,184,255,0.10);
    border-color: rgba(203,184,255,0.35);
  }

  .perks-mobile .perk-preview {
    width: 60%;
    min-height: 220px;
    position: relative;
    display: block; /* allow child absolute panel to fill */
  }
  .perks-mobile .perk-panel {
    position: absolute;
    inset: 0;
    display: none;
    padding: 14px;
    border-radius: 16px;
    /* Stronger glass for readability over video */
    background: linear-gradient(180deg, rgba(14,12,20,0.62), rgba(14,12,20,0.46));
    border: 1px solid rgba(203,184,255,0.18);
    backdrop-filter: blur(10px) saturate(120%);
    box-shadow: 0 18px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(203,184,255,0.08) inset;
    color: #FFFFFF; /* ensure text not dimmed */
    overflow: hidden;
  }
  .perks-mobile .perk-panel.active { display: block; }
  .perks-mobile .perk-panel h3 {
    margin: 0 0 8px 0;
    font-size: 15px; /* slightly smaller to match scaled list */
    color: #FFFFFF;
  }
  .perks-mobile .perk-panel ul {
    margin: 0;
    padding-left: 0; /* custom bullets */
  }

  /* Subtle vignette inside panel for legibility */
  .perks-mobile .perk-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(90% 80% at 50% 40%, rgba(255,255,255,0.02), rgba(0,0,0,0.35));
    mix-blend-mode: normal;
    z-index: 0;
  }

  /* Slight text glow for contrast on mobile panel */
  .perks-mobile .perk-panel h3,
  .perks-mobile .perk-panel li { text-shadow: 0 1px 2px rgba(0,0,0,0.6); }

  /* Keep text content above decorative overlays on mobile */
  .perks-mobile .perk-panel h3,
  .perks-mobile .perk-panel ul,
  .perks-mobile .perk-panel li { position: relative; z-index: 5; color: #FFFFFF; }
  .perks-mobile .perk-panel li {
    margin: 6px 0; 
    font-size: 14px; 
    list-style: none;
    position: relative;
    padding-left: 18px; /* space for dash bullet */
  }
  .perks-mobile .perk-panel li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.9em;
    width: 12px; height: 2px; border-radius: 2px;
    /* Match desktop dash color (uses var(--m3-primary) / #6750A4) */
    background: var(--m3-primary);
    box-shadow: 0 0 8px rgba(103, 80, 164, 0.5);
  }

  /* Tribe overlay styles adapted for perk panels */
  .perk-panel > *:not(.card-glare):not(.cyber-lines):not(.corner-elements):not(.scan-line):not(.card-particles):not(.tracker) {
    position: relative; z-index: 1;
  }
  .perk-panel .card-glare,
  .perk-panel .cyber-lines,
  .perk-panel .corner-elements,
  .perk-panel .scan-line { position: absolute; inset: 0; pointer-events: none; }

  .perk-panel .card-glare {
    z-index: 1;
    background: linear-gradient(
      125deg,
      rgba(255,255,255,0.0) 0%,
      rgba(255,255,255,0.08) 28%,
      rgba(255,255,255,0.18) 34%,
      rgba(255,255,255,0.08) 40%,
      rgba(255,255,255,0.0) 48%
    );
    filter: blur(20px); opacity: .20; z-index: 0; transition: opacity .25s ease;
    transform: rotate(0deg);
  }
  .perk-panel .tracker { position: absolute; inset: 0; border-radius: inherit; z-index: 3; display: grid; grid-template-columns: repeat(5,1fr); grid-template-rows: repeat(5,1fr); pointer-events: auto; }
  .perk-panel .tracker span { display: block; width: 100%; height: 100%; background: transparent; }
  .perk-panel:hover { 
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 22px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(203,184,255,.14) inset;
  }
  .perk-panel .cyber-lines { z-index: 1; }
  .perk-panel .cyber-lines span { position: absolute; height: 1px; left: 0; right: 0; 
    background: linear-gradient(90deg, transparent, rgba(124, 77, 255, 0.24), transparent);
    transform: scaleX(0); opacity: 0;
  }
  .perk-panel .cyber-lines span:nth-child(1) { top: 22%; transform-origin: left; }
  .perk-panel .cyber-lines span:nth-child(2) { top: 44%; transform-origin: right; }
  .perk-panel .cyber-lines span:nth-child(3) { top: 66%; transform-origin: left; }
  .perk-panel .cyber-lines span:nth-child(4) { top: 82%; transform-origin: right; }
  .perk-panel:hover .cyber-lines span:nth-child(1) { animation: lineGrow 3s linear infinite; }
  .perk-panel:hover .cyber-lines span:nth-child(2) { animation: lineGrow 3s linear infinite .8s; }
  .perk-panel:hover .cyber-lines span:nth-child(3) { animation: lineGrow 3s linear infinite 1.6s; }
  .perk-panel:hover .cyber-lines span:nth-child(4) { animation: lineGrow 3s linear infinite 2.2s; }

  .perk-panel .corner-elements { z-index: 2; }
  .perk-panel .corner-elements span { position: absolute; width: 16px; height: 16px; border: 2px solid rgba(124,77,255,.35); transition: all .3s ease; border-radius: 4px; }
  .perk-panel .corner-elements span:nth-child(1) { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
  .perk-panel .corner-elements span:nth-child(2) { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
  .perk-panel .corner-elements span:nth-child(3) { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
  .perk-panel .corner-elements span:nth-child(4) { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
  .perk-panel:hover .corner-elements span { border-color: rgba(124,77,255,.8); box-shadow: 0 0 10px rgba(124,77,255,.45); }

  /* Disable glass shimmer and corners on detail card in mobile */
  .perks-mobile .perk-panel .card-glare,
  .perks-mobile .perk-panel .corner-elements { display: none !important; }
  .perks-mobile .perk-panel:hover { transform: none; box-shadow: none; }

  /* Shimmer sweep moved to left title hover */
  .perks-mobile .perk-list li::after {
    content: ""; position: absolute; inset: -30%; pointer-events: none; opacity: 0;
    background: linear-gradient(110deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 80%);
    transform: translateX(-120%) rotateZ(0.0001deg);
  }
  .perks-mobile .perk-list li:hover::after,
  .perks-mobile .perk-list li:focus::after,
  .perks-mobile .perk-list li.active::after { animation: tribe-sheen 1.1s ease-out forwards; }

  .perk-panel .scan-line { z-index: 1; background: linear-gradient(to bottom, transparent, rgba(124,77,255,.10), transparent); transform: translateY(-100%); }
  .perk-panel:hover .scan-line { animation: scanMove 2s linear infinite; }

  /* Disable shimmer overlay on detail card; shimmer lives on left items */
  .perks-mobile .perk-panel::after { display: none !important; }
}

/* Hide mobile perks layout on desktop/tablet only */
@media (min-width: 769px) {
  .perks-mobile { display: none; }
}

.perks-mobile .perk-panel::after { will-change: transform, opacity; }
@keyframes shimmerSweep {
  0% { transform: translate(-120%, -120%) rotate(0.0001deg); }
  100% { transform: translate(120%, 120%) rotate(0.0001deg); }
}

.btn.contained { position: relative; overflow: hidden; }
.btn.contained::after { content: ""; position: absolute; inset: -40%; background: radial-gradient(200px 200px at var(--mx,50%) var(--my,50%), rgba(255,255,255,.2), transparent 60%); transform: translateZ(0); pointer-events: none; transition: opacity .2s ease; opacity: .0; }
.btn.contained:hover::after { opacity: 1; }

/* Scroll cue */
.scroll-cue { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(203,184,255,.6); border-radius: 16px; opacity: .8; display: none; }
.scroll-cue::after { content: ""; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; background: #CBB8FF; border-radius: 2px; transform: translateX(-50%); animation: cue 1.4s ease-in-out infinite; }
@keyframes cue { 0% { transform: translate(-50%,0); opacity: 1;} 70% { transform: translate(-50%,10px); opacity: .2;} 100% { transform: translate(-50%,0); opacity: 1;} }

/* Marquee */
.marquee { position: relative; border-top: 1px solid var(--m3-outline); border-bottom: 1px solid var(--m3-outline); background: rgba(20,18,28,.6); overflow: hidden; }
.marquee__track { display: inline-flex; gap: 36px; padding: 10px 0; min-width: 200%; animation: marquee 18s linear infinite; white-space: nowrap; }
.marquee__track span { color: #CBB8FF; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Hero ticker mounted at bottom of header uses the same marquee look */
.hero-ticker { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; gap: 6px; pointer-events: none; }
.hero-ticker .marquee { pointer-events: auto; }
.marquee--hero .marquee__track { min-width: 200%; width: auto; }

/* Differential inertia for hero: LTR row and RTL row */
@keyframes marquee-ltr { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
@keyframes marquee-rtl { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.marquee--hero .marquee__track.is-ltr { animation: marquee-ltr 36s linear infinite; animation-delay: -2s; }
.marquee--hero .marquee__track.is-rtl { animation: marquee-rtl 48s linear infinite; animation-delay: -5s; }

/* Hover: bold text for hero marquee */
.marquee--hero .marquee__track span { transition: font-weight .15s linear; }

/* First hero marquee (LTR) color */
.marquee--hero .marquee__track.is-ltr span { color: #6300ff; }

/* Add hyphen separator between items so loop ends don't merge */
.marquee--hero .marquee__track span::after { content: " -"; margin-left: 12px; opacity: .85; }
.marquee--hero:hover .marquee__track span { font-weight: 900; }

/* Second hero marquee (RTL) color */
.marquee--hero .marquee__track.is-rtl span { color: #ff008d; }

@media (max-width: 600px) {
  .marquee--hero .marquee__track.is-ltr { animation-duration: 28s; }
  .marquee--hero .marquee__track.is-rtl { animation-duration: 36s; }
}

/* Footer marquee (the marquee directly after footer) */
.footer + .marquee .marquee__track span { color: #FFFFFF; }

/* Join */
.join.card { background: color-mix(in oklab, var(--m3-surface-variant) 70%, transparent); margin-inline: auto; max-width: 720px; width: 100%; box-sizing: border-box; justify-self: center; align-self: center; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 14px; opacity: .9; }
.form-row input, .form-row textarea { background: #121219; color: var(--m3-on-surface); border: 1px solid var(--m3-outline); border-radius: 14px; padding: 12px 14px; outline: none; box-shadow: 0 2px 0 rgba(0,0,0,.2) inset; }
.form-row input:focus, .form-row textarea:focus { border-color: color-mix(in oklab, var(--m3-primary) 60%, transparent); box-shadow: 0 0 0 3px rgba(103,80,164,.25); }

/* Contact */
.contact { padding: 28px; border-radius: var(--radius-xl); background: color-mix(in oklab, var(--m3-surface-variant) 60%, transparent); border: 1px solid var(--m3-outline); text-align: center; }

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero { min-height: 72vh; padding-top: 18px; }
  .topbar .actions { display: none; }
  .menu-toggle { display: inline-flex; }
  .scroll-cue { display: block; }
}

/* Desktop layout: force 3 cards in one row */
@media (min-width: 1024px) {
  .tribes-grid { grid-template-columns: repeat(3, 1fr); }
}


/* Tribe card 3D scan animation */
.tribe .circle-video { position: relative; perspective: 800px; transform-style: preserve-3d; }
.tribe .circle-video video { transform: translateZ(0); }
.tribe .circle-video::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 80%);
  filter: blur(6px);
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-120%) rotateZ(0.0001deg);
}
.tribe.card { transform-style: preserve-3d; }
.tribe.card.fx-card { will-change: transform; }
@keyframes tribe-tilt {
  0%, 100% { transform: rotateX(0deg) rotateY(0deg); }
  50% { transform: rotateX(6deg) rotateY(-6deg); }
}
@keyframes tribe-sheen {
  0% { opacity: 0; transform: translateX(-120%) rotateZ(0.0001deg); }
  20% { opacity: 1; }
  60% { opacity: .85; }
  100% { opacity: 0; transform: translateX(120%) rotateZ(0.0001deg); }
}
.perks-mobile .perk-panel::after { will-change: transform, opacity; }
@keyframes railShimmer {
  0%   { background-position: 0 0, 0 -100%; }
  100% { background-position: 0 0, 0 100%; }
}
@keyframes bgZoom {
  0%   { background-size: 100% 100%; }
  100% { background-size: 110% 110%; }
}
.tribe.card:hover .circle-video::before,
.tribe.card:focus-within .circle-video::before { animation: tribe-sheen 1.2s ease-out forwards; }
/* Older tilt animation was removed earlier; keep hover animations enabled */

/* Uiverse-like animations */
@keyframes tribe-glow {
  0%, 100% { box-shadow: 0 22px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(203,184,255,.14) inset; }
  50% { box-shadow: 0 28px 70px rgba(0,0,0,.6), 0 0 0 1px rgba(203,184,255,.22) inset; }
}
@keyframes tribe-sweep {
  0% { opacity: 0; transform: translate(-120%, -120%) rotate(0.0001deg); }
  20% { opacity: .6; }
  100% { opacity: 0; transform: translate(120%, 120%) rotate(0.0001deg); }
}

/* Particles inside the card (Uiverse-like) */
.card-particles { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; overflow: hidden; }
.card-particles span {
  position: absolute;
  display: block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #708090; /* SlateGray */
  filter: drop-shadow(0 0 6px rgba(112,128,144,.6));
  opacity: .7;
  transform: translate3d(0,0,0) scale(1);
  animation: particleFloat 6s linear infinite;
}

/* Different sizes, positions, timings */
.card-particles span:nth-child(1) { top: 10%; left: 18%; width: 8px; height: 8px; animation-duration: 7.2s; animation-delay: -.5s; }
.card-particles span:nth-child(2) { top: 22%; right: 14%; width: 9px; height: 9px; animation-duration: 6.6s; animation-delay: -1.2s; }
.card-particles span:nth-child(3) { top: 48%; left: 8%; width: 6px; height: 6px; animation-duration: 5.8s; animation-delay: -.8s; }
.card-particles span:nth-child(4) { top: 62%; right: 10%; width: 10px; height: 10px; animation-duration: 7.6s; animation-delay: -2.0s; }
.card-particles span:nth-child(5) { bottom: 18%; left: 30%; width: 7px; height: 7px; animation-duration: 6.2s; animation-delay: -1.6s; }
.card-particles span:nth-child(6) { bottom: 12%; right: 24%; width: 9px; height: 9px; animation-duration: 7.0s; animation-delay: -.3s; }

@keyframes particleFloat {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: .0; }
  10%  { opacity: .7; }
  50%  { transform: translate3d(10px, -14px, 0) scale(1.08); opacity: .85; }
  100% { transform: translate3d(0, -28px, 0) scale(1); opacity: .0; }
}

@media (prefers-reduced-motion: reduce) {
  .card-particles span { animation: none; opacity: .4; }
}

/* Neon-styled title and subtitle (Uiverse-like) */
.tribe.card .card-title {
  position: relative;
  z-index: 5; /* above tracker (3) and overlays (1-2) */
  pointer-events: none;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #d7c6ff 0%, #9b4dff 35%, #00e5ff 65%, #ff3d81 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 8px rgba(155,77,255,.28), 0 0 18px rgba(0,229,255,.20);
  opacity: 0 !important; transform: translateY(6px) !important;
  transition: opacity .28s ease, transform .28s ease, text-shadow .3s ease, filter .3s ease;
}
.tribe.card .card-title strong { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,.25), 0 0 22px rgba(155,77,255,.35); }
.tribe.card .card-subtitle {
  position: relative;
  z-index: 5;
  pointer-events: none;
  color: rgba(220, 210, 255, .82);
  text-shadow: 0 0 6px rgba(155,77,255,.22), 0 0 14px rgba(0,229,255,.18);
  opacity: 0 !important; transform: translateY(8px) !important;
  transition: opacity .28s ease, transform .28s ease, text-shadow .3s ease, filter .3s ease;
}
.tribe.card:hover .card-title,
.tribe.card.is-hover .card-title { opacity: 1 !important; transform: translateY(0) !important; text-shadow: 0 0 10px rgba(155,77,255,.45), 0 0 26px rgba(0,229,255,.35), 0 0 40px rgba(255,61,129,.25); filter: brightness(1.06); transition-delay: .02s; }
.tribe.card:hover .card-subtitle,
.tribe.card.is-hover .card-subtitle { opacity: 1 !important; transform: translateY(0) !important; text-shadow: 0 0 10px rgba(155,77,255,.35), 0 0 22px rgba(0,229,255,.28); filter: brightness(1.04); transition-delay: .06s; }

/* Auto scan every few seconds on larger screens */
@media (min-width: 768px) {
  .tribe.card .circle-video::before { animation: tribe-sheen 2.2s ease-out 1.2s forwards; }
}

@media (max-width: 420px) {
  .hero { min-height: 60vh; }
  .hero h1 { font-size: clamp(34px, 9vw, 48px); line-height: 1.02; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero__overlay { backdrop-filter: none; }
  .marquee__track { animation: none; }
  .tribe.card:hover { animation: none; }
  .tribe .circle-video::before { animation: none !important; }
}

/* Footer */
.footer { padding: 32px 0 60px; border-top: 1px solid var(--m3-outline); background: linear-gradient(180deg, transparent, rgba(255,255,255,.02)); }
.footer small { opacity: .7; }

/* FX - split text, reveal, cards */
.fx-split span { display: inline-block; will-change: transform, opacity; }
.fx-reveal { opacity: 0; transform: translateY(16px); }
.fx-card { opacity: 0; transform: translateY(24px) scale(.98); }

@media (max-width: 640px) {
  .topbar { inset: 12px 12px auto; }
  .btn { --pad: 10px 14px; }
}
