/* =============================================================
   AXIOM — Bio Page
   Glassmorphic bio built on the AXIOM design system.
   Reuses tokens, easing and the shared tilt/reveal primitives.
   ============================================================= */

/* ---------- Local tokens ---------- */
.bio-body {
  /* Warm-neutral glass surface tuned to the reference */
  --glass-bg: rgba(28, 28, 32, 0.34);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-inner: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 2px 6px rgba(0, 0, 0, .28), 0 30px 70px -34px rgba(0, 0, 0, .78);
  --glass-radius: 22px;
  --chip-bg: rgba(0, 0, 0, 0.16);

  min-height: 100svh;
  background: var(--ink-900);
  overflow: hidden;
}

/* Kill the blue/grey square tap highlight Android draws on tap.
   Applied to every element so links, buttons and the intro gate all stay clean. */
.bio-body,
.bio-body * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* =============================================================
   BACKGROUND — fixed, blurred wallpaper + dark overlay
   ============================================================= */
.bio-bg {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    url("../assets/png.png");
  background-size: cover;
  background-position: center;
  filter: blur(4px) saturate(115%);
  transform: scale(1.12);           /* hide the blurred edge bleed */
  will-change: transform;
}
/* Animated background (video). Fills the blurred/scaled .bio-bg container,
   so it inherits the same blur + saturate as the static image. */
.bio-bg__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
.bio-bg__overlay {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent, rgba(0,0,0,.42) 100%),
    linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.36));
  pointer-events: none;
}

/* =============================================================
   INTRO GATE — "click to continue" (unlocks audio autoplay)
   ============================================================= */
.intro {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;   /* explicit for older Android WebView */
  width: 100%; height: 100%;
  z-index: 10000;
  display: flex;                          /* flex centering is safer than grid on old Android */
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  /* Opaque fallback first, then the blurred glass on top where supported.
     This guarantees a visible background even without backdrop-filter. */
  background: rgba(10, 10, 11, .92);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  /* Self-contained easing — does not depend on --ease from styles.css */
  transition: opacity .6s ease, visibility .6s ease;
}
/* Where backdrop-filter is supported, we can trust the blur and lighten the tint. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .intro { background: rgba(10, 10, 11, .5); }
}
.intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro__hint {
  display: block;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: .95rem;
  font-weight: 300;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(247, 247, 245, .82);
  animation: introPulse 2.2s ease infinite;
}
@keyframes introPulse {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

/* =============================================================
   LAYOUT — centered stack
   ============================================================= */
.bio {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vh, 4rem) clamp(1rem, 5vw, 2rem);
}
.bio__stack {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: clamp(.7rem, 1.6vh, 1rem);
  /* The whole stack tilts as ONE rigid glass plate. The perspective is baked
     into the JS transform (perspective(...) rotateX/Y) and applied here to the
     wrapper — so all three cards share a single origin and projection, with no
     per-card drift. */
  transform-origin: center center;
  transform-style: preserve-3d;
  transition: transform .3s var(--ease);
  will-change: transform;
}

/* =============================================================
   GLASS CARD — shared shell
   ============================================================= */
.card {
  position: relative;
  border-radius: var(--glass-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
  overflow: hidden;
  transition: transform .3s var(--ease), border-color .5s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}
/* Single hairline border + top highlight in one masked ring.
   Drawn as one layer so the rounded corners never split. */
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background:
    linear-gradient(180deg, var(--glass-inner), transparent 42%),
    var(--glass-border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
/* glass reflection sheen (sweeps on hover) */
.card__sheen {
  position: absolute; top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.10), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
/* Sweep is armed by JS on mouseenter (adds .is-sheen), so it plays exactly
   once per entry — not on every mousemove (which the 3D tilt would otherwise
   retrigger by re-running :hover hit-testing). Opacity lives inside the
   keyframes so the sheen fully fades on its own at the end of the sweep. */
.card.is-sheen .card__sheen {
  animation: sheen 1.1s var(--ease-out);
}
@keyframes sheen {
  0%   { left: -60%; opacity: 0; }
  12%  { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}
.card:hover { --glass-border: rgba(255,255,255,.2); }

/* =============================================================
   PROFILE CARD
   ============================================================= */
.card--profile {
  padding: 1.5rem 1.4rem 1.3rem;
  text-align: center;
}
.profile__views,
.profile__badge {
  position: absolute; top: .95rem;
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--paper-dim);
  z-index: 3;
}
.profile__views {
  left: 1.1rem;
  font-size: .72rem; letter-spacing: .01em;
  padding: .2rem .45rem;
  border-radius: 100px;
  background: var(--chip-bg);
  color: rgba(247,247,245,.72);
}
.profile__badge {
  right: 1.1rem;
  color: rgba(247,247,245,.85);
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.4));
  transition: transform .4s var(--ease), color .4s var(--ease);
}
.profile__badge:hover { transform: rotate(-6deg) scale(1.08); color: #fff; }

.profile__avatar {
  position: relative;
  width: 86px; height: 86px;
  margin: .3rem auto .85rem;
  border-radius: 50%;
  padding: 1.25px;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.05));
  box-shadow: 0 10px 26px -12px rgba(0,0,0,.7);
}
.profile__avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile__avatar {
  /* Tune the decoration fit here:
     --deco-w  = horizontal spread of the wings relative to the avatar
     --deco-y  = vertical offset (negative = higher above the ring) */
  --deco-w: 128%;
  --deco-y: -9%;
}
.profile__deco {
  position: absolute;
  /* Anchored to the avatar box via inset, not translate — this keeps the
     horizontal fit locked to the ring at any browser zoom level. */
  left: 50%;
  top: var(--deco-y);
  width: var(--deco-w);
  height: auto;              /* preserve the PNG's native aspect ratio */
  transform: translateX(-50%);
  border-radius: 0 !important;
  object-fit: contain;
  pointer-events: none;
  z-index: 4;
}

.profile__name {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--paper);
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.profile__status {
  margin-top: .2rem;
  font-size: .82rem;
  font-weight: 300;
  color: rgba(247,247,245,.68);
}

/* ---------- Social icons ---------- */
.socials {
  display: flex;
  justify-content: center;
  gap: .55rem;
  margin-top: 1.1rem;
}
.social {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: rgba(247,247,245,.82);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  transition: transform .35s var(--ease), background .35s var(--ease), color .35s var(--ease);
}
.social:hover {
  transform: translateY(-3px) scale(1.06);
  background: rgba(255,255,255,.18);
  color: #fff;
}
.social:active { transform: translateY(-1px) scale(1.02); }

/* =============================================================
   MUSIC PLAYER CARD
   ============================================================= */
.card--player {
  padding: 1.15rem 1.35rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "vol title controls"
    "bar bar bar";
  align-items: center;
  gap: .55rem 1rem;
}
.player__volume {
  grid-area: vol;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0; background: none; cursor: pointer;
  color: rgba(247,247,245,.85);
  border-radius: 10px;
  transition: color .3s var(--ease), background .3s var(--ease);
}
.player__volume:hover { color: #fff; background: rgba(255,255,255,.08); }
/* volume / mute icon swap */
.player__volume .ico-mute { display: none; }
.player__volume[data-muted] .ico-vol  { display: none; }
.player__volume[data-muted] .ico-mute { display: block; color: rgba(247,247,245,.55); }

.player__title {
  grid-area: title;
  text-align: center;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--paper);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player__controls {
  grid-area: controls;
  display: flex; align-items: center; gap: .35rem;
}
.player__ctrl {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0; cursor: pointer;
  border-radius: 50%;
  color: rgba(247,247,245,.9);
  background: transparent;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.player__ctrl:hover { color: #fff; transform: scale(1.08); }
.player__ctrl:active { transform: scale(.96); }
.player__ctrl--play {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.16);
}
.player__ctrl--play:hover { background: rgba(255,255,255,.22); }
/* play/pause icon swap */
.player__ctrl--play .ico-pause { display: block; }
.player__ctrl--play .ico-play  { display: none; }
.card--player[data-paused] .ico-pause { display: none; }
.card--player[data-paused] .ico-play  { display: block; }

/* ---------- Timeline ---------- */
.player__bar {
  grid-area: bar;
  display: flex; align-items: center; gap: .8rem;
  margin-top: .1rem;
}
.player__time {
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  color: rgba(247,247,245,.62);
  min-width: 34px;
}
.player__time--dur { text-align: right; }
.player__track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 100px;
  background: rgba(255,255,255,.14);
  cursor: pointer;
}
.player__fill {
  position: absolute; inset: 0 auto 0 0;
  width: 16%;
  border-radius: 100px;
  background: rgba(247,247,245,.9);
}
.player__knob {
  position: absolute; top: 50%; left: 16%;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
  transform: translate(-50%, -50%);
}

/* =============================================================
   DISCORD CARD
   ============================================================= */
.card--discord {
  padding: .85rem 1rem .85rem .85rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.discord__id { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.discord__avatar {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: visible;
}
.discord__avatar img {
  width: 100%; height: 100%;
  border-radius: 12px;
  object-fit: cover;
}
.discord__presence {
  position: absolute; right: -3px; bottom: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #747f8d;               /* offline / unknown (grey) by default */
  border: 3px solid rgba(24,24,28,.9);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
/* Live status colours driven by data-status (set by the Lanyard client). */
.discord__presence[data-status="online"] { background: #3ba55d; box-shadow: 0 0 8px rgba(59,165,93,.6); }
.discord__presence[data-status="idle"]   { background: #faa61a; box-shadow: 0 0 8px rgba(250,166,26,.6); }
.discord__presence[data-status="dnd"]     { background: #ed4245; box-shadow: 0 0 8px rgba(237,66,69,.6); }
.discord__presence[data-status="offline"] { background: #747f8d; box-shadow: none; }
.discord__meta { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.discord__name {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .86rem; font-weight: 500; color: var(--paper);
}
.discord__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.discord__tag {
  font-size: .72rem; color: rgba(247,247,245,.5);
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.discord__btn {
  display: inline-flex; align-items: center; gap: .4rem;
  flex-shrink: 0;
  padding: .55rem .9rem;
  font-size: .78rem; font-weight: 500;
  color: var(--paper);
  border-radius: 100px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.discord__btn svg { transition: transform .4s var(--ease); }
.discord__btn:hover { background: rgba(255,255,255,.2); transform: translateY(-2px); }
.discord__btn:hover svg { transform: translateX(3px); }
.discord__btn:active { transform: translateY(0); }

/* =============================================================
   LOAD ANIMATION — subtle scale + fade on the stack
   (works with the shared .reveal primitive via data-reveal)
   ============================================================= */
.bio .reveal { transform: translateY(20px) scale(.98); }
.bio .reveal.is-in { transform: none; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 460px) {
  .bio__stack { max-width: 100%; }
  .profile__name { font-size: 1.4rem; }
  .player__title { font-size: .76rem; letter-spacing: .04em; }
  .discord__btn { padding: .5rem .75rem; font-size: .74rem; }
}

/* =============================================================
   TOUCH DEVICES — no sticky :hover
   On touch, :hover stays "stuck" after a tap until you tap elsewhere.
   1) Cancel every hover highlight so nothing lingers.
   2) Reproduce the highlight through the JS-driven .is-tap class, which
      bio.js removes automatically 1s after the tap.
   ============================================================= */
@media (hover: none) {
  /* 1 — neutralise stuck :hover back to the resting state */
  .card:hover { transform: none; --glass-border: rgba(255,255,255,.14); }
  .card.is-sheen .card__sheen { opacity: 0; animation: none; }
  .profile__badge:hover { transform: none; color: rgba(247,247,245,.85); }
  .social:hover {
    transform: none;
    background: rgba(255,255,255,.08);
    color: rgba(247,247,245,.82);
  }
  .player__volume:hover { color: rgba(247,247,245,.85); background: none; }
  .player__ctrl:hover { transform: none; color: rgba(247,247,245,.9); }
  .player__ctrl--play:hover { background: rgba(255,255,255,.14); }
  .discord__btn:hover { transform: none; background: rgba(255,255,255,.1); }
  .discord__btn:hover svg { transform: none; }

  /* 2 — momentary tap highlight (auto-cleared after 100ms by bio.js) */
  .profile__badge.is-tap { transform: rotate(-6deg) scale(1.08); color: #fff; }
  .social.is-tap {
    transform: translateY(-3px) scale(1.06);
    background: rgba(255,255,255,.18);
    color: #fff;
  }
  .player__volume.is-tap { color: #fff; background: rgba(255,255,255,.08); }
  .player__ctrl.is-tap { color: #fff; transform: scale(1.08); }
  .player__ctrl--play.is-tap { background: rgba(255,255,255,.22); }
  .discord__btn.is-tap { background: rgba(255,255,255,.2); transform: translateY(-2px); }
  .discord__btn.is-tap svg { transform: translateX(3px); }
}
