/* ---- Fonts ---- */
@font-face {
  font-family: "Space Grotesk";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-700.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/space-grotesk-500.woff2") format("woff2");
}

/* ---- Tokens ---- */
:root {
  /* Yin-yang duo palette: blue (ECH0) vs red (SERV0) */
  --glow-blue: #2b6cff;
  --glow-red: #ff2e43;
  --blue-rgb: 43, 108, 255;
  --red-rgb: 255, 46, 67;
  --cyan: #9bdcff;            /* blue-side text accent */
  --warm: #ffb0a0;            /* red-side text accent (mirror of cyan) */
  --blue-deep: #0a1326;       /* left base */
  --red-deep: #220a10;        /* right base */
  /* Horizontal blue->dark->red blend under the radial depth vignette */
  --bg:
    radial-gradient(120% 80% at 50% 32%, rgba(20, 28, 46, 0.55) 0%, rgba(5, 7, 11, 0.85) 72%),
    linear-gradient(90deg, var(--blue-deep) 0%, #06080d 50%, var(--red-deep) 100%);
  --muted: #b9c6da;
  --chrome: linear-gradient(180deg, #ffffff 0%, #aebfd6 38%, #43566f 52%, #d6e2f0 68%, #6f8199 100%);
  --font-head: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-head);
  color: #fff;
  background: #05070b;          /* solid fallback under the gradient */
  background: var(--bg);
  background-attachment: fixed;
  min-height: 100svh;
}

/* ---- Layout ---- */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6vmin;
}

/* ---- Title (chrome) ---- */
.title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 0.95;
  font-size: clamp(2.75rem, 13vw, 11rem);
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* subtle depth without hurting legibility */
  filter: drop-shadow(0 2px 10px rgba(108, 182, 255, 0.18));
}

/* ---- Members ---- */
.members {
  margin: clamp(0.8rem, 2.4vw, 1.6rem) 0 0;
  font-weight: 500;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.45em;
  /* the trailing letter-spacing pushes text right; nudge back to optical center */
  text-indent: 0.45em;
  font-size: clamp(0.7rem, 2.2vw, 1.05rem);
}
.members .m-serv0 { color: var(--warm); }
.members .m-ech0 { color: var(--cyan); }

/* ---- Tagline ---- */
.tagline {
  margin: clamp(0.6rem, 1.8vw, 1.1rem) 0 0;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-size: clamp(0.85rem, 2.6vw, 1.25rem);
}

/* ---- Distant globe (yin-yang planet: blue hemisphere / red hemisphere) ---- */
/* Sits in FRONT of the energy field (z 0) and moves most under parallax, so it
   reads as the closest layer. The comets/motes drift behind it. */
.glow {
  position: fixed;
  z-index: 1;            /* planet renders in FRONT of the energy field (z 0) */
  top: 48%;
  left: 50%;
  /* circular so it reads as a globe, not a wide haze */
  width: min(86vw, 640px);
  height: min(86vw, 640px);
  transform: translate(calc(-50% + var(--mx, 0px)), calc(-50% + var(--my, 0px)));
  pointer-events: none;
  background:
    /* atmosphere rim */
    radial-gradient(circle at 50% 50%, rgba(180, 205, 255, 0) 52%, rgba(180, 205, 255, 0.16) 58%, rgba(180, 205, 255, 0) 65%),
    /* volume shadow on the lower-right to give the sphere depth */
    radial-gradient(circle at 64% 68%, rgba(2, 4, 12, 0.42) 0%, rgba(2, 4, 12, 0) 52%),
    /* specular sheen upper-left */
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 26%),
    /* blue hemisphere (left) */
    radial-gradient(circle at 33% 50%, rgba(var(--blue-rgb), 0.55) 0%, rgba(var(--blue-rgb), 0.18) 34%, rgba(var(--blue-rgb), 0) 60%),
    /* red hemisphere (right) */
    radial-gradient(circle at 67% 50%, rgba(var(--red-rgb), 0.50) 0%, rgba(var(--red-rgb), 0.16) 34%, rgba(var(--red-rgb), 0) 60%),
    /* opaque planet body (bottom layer): makes the disc solid so the energy
       field is truly occluded behind it instead of shining through */
    radial-gradient(circle at 50% 50%, rgba(7, 10, 18, 0.94) 0%, rgba(7, 10, 18, 0.94) 46%, rgba(7, 10, 18, 0) 62%);
  /* clip the gradient box to a soft circle so the limb is clean (no square edges) */
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 56%, transparent 68%);
          mask: radial-gradient(circle at 50% 50%, #000 56%, transparent 68%);
  filter: blur(8px);
  animation: glow-pulse 9s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.85; transform: translate(calc(-50% + var(--mx,0px)), calc(-50% + var(--my,0px))) scale(1); }
  50%      { opacity: 1;    transform: translate(calc(-50% + var(--mx,0px)), calc(-50% + var(--my,0px))) scale(1.08); }
}

/* very restrained title shimmer */
.title { background-size: 100% 200%; background-position: 0 0; animation: chrome-shimmer 12s ease-in-out infinite; }
@keyframes chrome-shimmer {
  0%, 100% { background-position: 0 0; }
  50%      { background-position: 0 40%; }
}

/* ---- Background energy field (motes + comets) ---- */
.field {
  position: fixed;
  inset: 0;
  z-index: 0;            /* motes/comets sit behind the globe (z 1) and content (z 2) */
  pointer-events: none;
  overflow: hidden;
}

/* Soft drifting dust motes. Drift uses the individual `translate`/`opacity`
   properties so the JS pointer parallax can own `transform` without conflict. */
.mote {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--s, 1) * 3px);
  height: calc(var(--s, 1) * 3px);
  border-radius: 50%;
  /* --rgb is the element's tint; JS flips it to the OPPOSITE of its side. */
  --rgb: var(--blue-rgb);
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(var(--rgb), 0.55) 45%,
    rgba(var(--rgb), 0) 70%);
  opacity: 0.5;
  /* Most-distant layer, so it moves least under parallax. */
  transform: translate3d(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 6px), 0);
  animation: mote-drift var(--dur, 26s) ease-in-out var(--delay, 0s) infinite;
  will-change: translate, opacity;
}

@keyframes mote-drift {
  0%, 100% { translate: 0 0; opacity: 0.22; }
  25%      { opacity: 0.85; }
  50%      { translate: var(--drift, 10px) calc(var(--drift, 10px) * -1.4); opacity: 0.5; }
  75%      { opacity: 0.8; }
}

/* Drifting comets: a tapered streak (transparent tail -> bright head at the
   leading edge) plus a bright head orb, flying head-first along their own
   direction. `rotate` orients the streak to --angle; the `translate` keyframes
   move it the same way (translate is screen-space, applied before rotate), so
   the tail naturally streams out behind the head. */
.comet {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w, 40vmin);
  height: var(--h, 3vmin);
  border-radius: 50%;
  /* --rgb is the element's tint; JS flips it to the OPPOSITE of its side. */
  --rgb: var(--blue-rgb);
  /* tail fades in from the left; head is bright at the right (leading) edge */
  background: linear-gradient(90deg,
    rgba(var(--rgb), 0) 0%,
    rgba(var(--rgb), 0.10) 42%,
    rgba(var(--rgb), 0.34) 76%,
    rgba(var(--rgb), 0.6) 100%);
  rotate: var(--angle, 0deg);
  filter: blur(5px);
  opacity: 0.14;        /* base for reduced-motion; animation drives the rest */
  transform: translate3d(calc(var(--px, 0) * 13px), calc(var(--py, 0) * 13px), 0);
  animation: comet-fly var(--dur, 22s) linear var(--delay, 0s) infinite;
  will-change: translate, opacity;
}

/* Bright head orb at the leading (right) edge of the streak. */
.comet::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--h, 3vmin) * -0.4);
  width: calc(var(--h, 3vmin) * 2.4);
  height: calc(var(--h, 3vmin) * 2.4);
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(var(--rgb), 0.7) 38%,
    rgba(var(--rgb), 0) 72%);
}

/* The flight + fade happen in the first ~26% of the cycle; the rest is an
   invisible pause held off-screen, so each comet appears only occasionally. */
@keyframes comet-fly {
  0%   { translate: 0 0; opacity: 0; }
  3%   { opacity: var(--peak, 0.6); }
  22%  { opacity: var(--peak, 0.6); }
  26%, 100% {
    translate: calc(var(--dist, 60vmin) * var(--cos, 1))
               calc(var(--dist, 60vmin) * var(--sin, 0));
    opacity: 0;
  }
}

/* ---- Scroll cue ---- */
.scroll-cue {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
  color: #f2f6ff;
  border: 1px solid rgba(242, 246, 255, 0.35);
  background: radial-gradient(circle, rgba(8, 12, 22, 0.55) 0%, rgba(8, 12, 22, 0) 72%);
  box-shadow: 0 0 18px rgba(242, 246, 255, 0.18);
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.4s ease;
  animation: scroll-bob 2.4s ease-in-out infinite;
}
.scroll-cue:focus-visible {
  outline: 2px solid rgba(242, 246, 255, 0.8);
  outline-offset: 3px;
}
.scroll-cue svg {
  display: block;
  filter: drop-shadow(0 0 6px rgba(242, 246, 255, 0.55));
}
/* Fade the cue out once the user scrolls down away from the hero. */
.scroll-cue.is-hidden { opacity: 0; pointer-events: none; }

@keyframes scroll-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* ---- Sections ---- */
.section {
  position: relative;
  z-index: 2;
  max-width: min(960px, 90vw);
  margin: 0 auto;
  padding: clamp(4rem, 10vmin, 8rem) clamp(1rem, 5vw, 2.5rem);
}

.section-title {
  margin: 0 0 clamp(1.25rem, 3.5vmin, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: clamp(1.4rem, 5vw, 2.5rem);
  text-transform: uppercase;
  /* mini yin-yang: blue on the left, red on the right */
  background: linear-gradient(90deg, var(--cyan) 0%, #ffffff 50%, var(--warm) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-text {
  max-width: 70ch;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.8;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 500;
}

/* ---- Members grid ---- */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.25rem, 4vmin, 2.5rem);
  margin-top: clamp(1.25rem, 3.5vmin, 2rem);
}

.member {
  /* --accent / --accent-rgb default to blue; per-character modifiers override */
  --accent: var(--cyan);
  --accent-rgb: var(--blue-rgb);
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 12px;
  padding: clamp(1.5rem, 4vmin, 2.5rem);
  text-align: center;
  box-shadow: 0 0 44px rgba(var(--accent-rgb), 0.07) inset;
}

.member--serv0 { --accent: var(--warm); --accent-rgb: var(--red-rgb); }
.member--ech0 { --accent: var(--cyan); --accent-rgb: var(--blue-rgb); }

.portrait {
  display: block;
  margin: 0 auto clamp(1rem, 2.5vmin, 1.5rem);
  width: clamp(110px, 28vmin, 220px);
  height: auto;
}

.member-name {
  margin: 0 0 0.5rem;
  font-size: clamp(0.75rem, 1.8vw, 0.95rem);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
}

.member-role {
  margin: 0 0 1rem;
  font-size: clamp(0.78rem, 1.7vw, 0.9rem);
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.02em;
}

.member-bio {
  margin: 0;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  color: var(--muted);
  line-height: 1.75;
  text-align: left;
}

/* ---- Scrollbar (blue->red, restrained) ---- */
/* Firefox: no gradient support, so fall back to a solid blue thumb. */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--glow-blue) rgba(8, 12, 22, 0.5);
}
/* WebKit/Blink: real blue (top) -> red (bottom) gradient thumb. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(8, 12, 22, 0.5); }
::-webkit-scrollbar-thumb {
  border-radius: 999px;
  /* 2px transparent border + padding-box clip insets the thumb so it reads thin */
  border: 2px solid transparent;
  background-clip: padding-box;
  background-image: linear-gradient(180deg, var(--glow-blue) 0%, var(--glow-red) 100%);
}
::-webkit-scrollbar-thumb:hover {
  border-width: 1px;          /* slightly fatter on hover */
  box-shadow: 0 0 8px rgba(var(--blue-rgb), 0.35);
}
::-webkit-scrollbar-corner { background: transparent; }

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .glow, .title, .scroll-cue,
  .field, .mote, .comet { animation: none !important; }
  .scroll-cue { transition: none; }
}

/* ---- Listen / player ---- */
.player {
  max-width: 640px;
  margin: 0 auto;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--blue-rgb), 0.22);
  border-radius: 12px;
  padding: clamp(1.25rem, 4vmin, 2rem);
  box-shadow: 0 0 44px rgba(var(--blue-rgb), 0.07) inset;
}

/* Plyr theme tuned to the dark page */
.player .plyr {
  --plyr-color-main: var(--glow-blue);
  --plyr-audio-controls-background: transparent;
  --plyr-audio-control-color: var(--muted);
  --plyr-audio-control-color-hover: #fff;
  border-radius: 8px;
}

.tracklist {
  list-style: none;
  margin: clamp(1rem, 3vmin, 1.5rem) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.track {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.track:hover,
.track:focus-visible {
  background: rgba(var(--blue-rgb), 0.10);
  color: #fff;
}

.track:focus-visible {
  outline: 2px solid var(--glow-blue);
  outline-offset: 2px;
}

.track-num {
  flex: 0 0 1.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.track.is-playing {
  color: #fff;
  background: rgba(var(--blue-rgb), 0.16);
}

.track.is-playing .track-num {
  color: var(--cyan);
  opacity: 1;
}
