/* ============================================================
   FatFigures — core stylesheet
   z-order:  0 media · 1 grain/glow · 2 content · 5 chrome · 9999 gate
   ============================================================ */

:root {
  --void:       #07070B;
  --ink:        #F5F3EE;
  --muted:      #9A94AC;
  --glass-edge: rgba(255, 255, 255, 0.11);

  /* Per-profile card look, overridden from JS (profiles.json).
     See applyCardStyle() in site.js for the field names. */
  --accent-rgb:           16, 16, 22;    /* "accent"        card tint      */
  --card-opacity:         0.5;           /* "opacity"       tint strength  */
  --card-border-rgb:      255, 255, 255; /* "border"        border colour  */
  --card-border-opacity:  0.12;          /* "borderOpacity" border alpha   */
  --card-border-width:    1px;           /* "borderWidth"   thickness      */

  /* Muted tones for the generated aura — a haze, not a colour wheel. */
  --tone-a: #2B303C;
  --tone-b: #3A4152;
  --tone-c: #1D222D;
  --tone-d: #474E60;

  /* one easing curve for everything that moves */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body { position: relative; }
::selection { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* Content wrapper. Held back until the visitor enters, then eased in. */
.world {
  position: relative;
  z-index: 2;
  transform: scale(1.04);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
body.entered .world {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  transition: transform 1s var(--ease), opacity 0.75s ease;
}
/* no gate on this page (or JS failed) — show immediately */
body.no-gate .world { transform: none; opacity: 1; pointer-events: auto; }

/* ---------- Grain, above media and below content ---------- */
.grain {
  position: fixed;
  inset: -100px;
  z-index: 1;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.045;
  mix-blend-mode: overlay;
  animation: grain-shift 0.7s steps(1) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, 3%); }
  40%  { transform: translate(4%, -5%); }
  60%  { transform: translate(-3%, -3%); }
  80%  { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Soft light trailing the pointer (desktop only) ---------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 68%);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* ============================================================
   Enter gate

   No panel, no ring: the real scene sits behind it (blurred by the
   poster's own filter) and this is just a dim wash plus the prompt.
   ============================================================ */
.enter-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 7, 0.55);
  cursor: pointer;
  transition: opacity 0.9s var(--ease);
}
.enter-gate:focus-visible { outline: none; }
.enter-gate.hide { opacity: 0; pointer-events: none; }

.enter-label {
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.65);
  opacity: 0;
  animation:
    label-in 0.9s var(--ease) 0.15s forwards,
    label-breathe 3.4s ease-in-out 1.1s infinite;
  transition: transform 0.5s var(--ease);
}
.enter-gate:hover .enter-label,
.enter-gate:focus-visible .enter-label { transform: scale(1.04); }
.enter-gate.hide .enter-label {
  transform: scale(1.12);
  animation: none;
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.6s ease;
}
@keyframes label-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes label-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.62; }
}

/* ============================================================
   Backgrounds
   ============================================================ */
.bg-media {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--void);
}
.bg-media .bg-poster,
.bg-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The poster carries the gate's blur. Doing it here rather than with a
   backdrop-filter on the gate keeps it a single static image blur
   instead of a per-frame pass over playing video. */
.bg-media .bg-poster {
  transform: scale(1.14);
  filter: blur(24px);
  transition: transform 1.6s var(--ease), filter 1.2s var(--ease);
}
body.entered .bg-media .bg-poster,
body.no-gate .bg-media .bg-poster {
  transform: scale(1.04);
  filter: blur(6px);
}
/* Deliberately NO css filter on the video. A filter on a playing
   full-screen video costs a GPU pass on every frame, and stacked under
   the card's backdrop-filter it was enough to stall repaints on mobile.
   The scrim below does the darkening instead — paid once. */
.bg-media video { opacity: 0; transition: opacity 1.2s ease; }
.bg-media video.visible { opacity: 1; }
/* Content sits dead centre, so the scrim darkens the middle too — a pure
   edge vignette leaves the card fighting the busiest part of the frame. */
.bg-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at center,
      rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.76) 55%, rgba(0,0,0,0.94) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 28%, transparent 72%, rgba(0,0,0,0.45));
}

/* Generated aura (profiles with no video) */
#aura { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#aura span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float-blob 18s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -4s);
}
@keyframes float-blob {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-42%, -58%) scale(1.25); }
}

/* ============================================================
   Audio player
   ============================================================ */
.audio-control {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(10, 10, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  opacity: 0;
  animation: label-in 0.8s var(--ease) 0.4s forwards;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.audio-control:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(14, 14, 20, 0.66); }

.audio-control button {
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease);
}
.audio-control button:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.08); }
.audio-control button:active { transform: scale(0.94); }
.audio-control button svg { width: 15px; height: 15px; fill: currentColor; }
.audio-control button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* live equaliser, driven by the WebAudio analyser */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 18px;
  padding: 0 8px;
}
.eq i {
  display: block;
  width: 2.5px;
  height: 10%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
  transition: height 0.08s linear;
}

/* volume slides open on hover */
.audio-control .vol-wrap {
  display: flex;
  align-items: center;
  width: 0;
  overflow: hidden;
  transition: width 0.45s var(--ease), margin 0.45s var(--ease);
}
.audio-control:hover .vol-wrap,
.audio-control:focus-within .vol-wrap { width: 82px; margin-right: 8px; }
.audio-control input[type="range"] { width: 82px; accent-color: #fff; cursor: pointer; }

/* ============================================================
   Layout shells
   ============================================================ */
.stage, .directory {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* ============================================================
   Profile card
   ============================================================ */
.card {
  position: relative;
  width: 100%;
  max-width: 580px;
  padding: 44px 44px 46px;
  border-radius: 28px;
  text-align: center;
  background: rgba(var(--accent-rgb), var(--card-opacity));
  border: var(--card-border-width) solid rgba(var(--card-border-rgb), var(--card-border-opacity));
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.3s var(--ease), box-shadow 0.5s var(--ease);
}
/* specular sheen following the pointer (--mx/--my set from JS) */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.09), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* children rise in sequence once the card lands */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: label-in 0.75s var(--ease) forwards;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}

.avatar-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto 18px;
  border-radius: 50%;
}
/* Monochrome halo that breathes with the music (--beat from JS).
   No conic gradient, no colour cycling. */
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.20), transparent 68%);
  opacity: calc(0.35 + var(--beat, 0) * 0.65);
  transform: scale(calc(0.94 + var(--beat, 0) * 0.12));
  pointer-events: none;
}

.avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #14141A;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s var(--ease), border-color 0.4s ease;
}
.avatar-wrap:hover .avatar { transform: scale(1.05); border-color: rgba(255, 255, 255, 0.4); }
.avatar.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: #1E222C;
  letter-spacing: -1px;
}

/* ---- name + sparkles ---- */
.name-wrap { position: relative; display: inline-block; }
.name {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: scale(var(--s, 1));
  animation: twinkle 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes twinkle {
  0%, 100%   { opacity: 0;    transform: scale(calc(var(--s, 1) * 0.4)); }
  45%        { opacity: 0.85; transform: scale(var(--s, 1)); }
  70%        { opacity: 0.2;  transform: scale(calc(var(--s, 1) * 0.7)); }
}

.bio {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}
.username {
  margin: 8px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  word-break: break-word;
}
.location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
}
.location svg { width: 13px; height: 13px; fill: currentColor; flex: none; }

/* ---- Discord presence card ---- */
.discord-slot {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s var(--ease);
}
.discord-slot.in { opacity: 1; transform: none; }

.discord-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: min(280px, 100%);
  max-width: 100%;
  padding: 11px 15px 11px 11px;
  border-radius: 16px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease);
}
.discord-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}
.discord-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.dc-avatar { position: relative; flex: none; width: 46px; height: 46px; }
.dc-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #1E222C;
}
/* status pip: a dark ring with the coloured shape punched inside it */
.dc-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #16161C;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dc-dot i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #80848E;
}
/* Discord's own shapes: solid dot, crescent, barred, ring. Masks keep the
   cut-outs genuinely transparent so the pip reads on any background. */
.dc-dot i[data-status="online"] { background: #23A55A; }
.dc-dot i[data-status="idle"] {
  background: #F0B232;
  -webkit-mask: radial-gradient(circle at 72% 26%, transparent 46%, #000 47%);
  mask: radial-gradient(circle at 72% 26%, transparent 46%, #000 47%);
}
.dc-dot i[data-status="dnd"] {
  background: #F23F43;
  -webkit-mask: linear-gradient(#000 0 33%, transparent 33% 67%, #000 67% 100%);
  mask: linear-gradient(#000 0 33%, transparent 33% 67%, #000 67% 100%);
}
.dc-dot i[data-status="offline"] {
  background: #80848E;
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 43%);
  mask: radial-gradient(circle, transparent 42%, #000 43%);
}

.dc-info { min-width: 0; }
.dc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* guild tag pill — server badge + short tag, e.g. [icon] 640 */
.dc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}
.dc-tag img { width: 14px; height: 14px; display: block; }

.dc-badges { display: inline-flex; align-items: center; gap: 3px; }
.dc-badges img { width: 15px; height: 15px; display: block; }
.dc-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.dc-handle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}
.dc-activity {
  margin-top: 2px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- links: bare glyphs, no boxes ---- */
.links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: rgba(255, 255, 255, 0.92);
  /* resting glow, so the row reads as lit rather than flat */
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.30));
  transition: transform 0.35s var(--ease), color 0.3s ease, filter 0.35s var(--ease);
}
.links a:hover {
  transform: translateY(-6px) scale(1.12);
  color: #fff;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.75))
    drop-shadow(0 0 22px rgba(255, 255, 255, 0.35));
}
.links a:active { transform: translateY(-2px) scale(1.04); }
.links a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 8px; }
.links svg { width: 27px; height: 27px; fill: currentColor; }
/* label pops up on hover */
.links a::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 6px);
  padding: 4px 9px;
  border-radius: 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(8, 8, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.links a:hover::after { opacity: 1; transform: translate(-50%, 0); }

/* ---- view counter, bottom-left ---- */
.card-views {
  position: absolute;
  left: 26px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease), color 0.3s ease;
}
.card-views.in { opacity: 1; transform: none; }
.card-views:hover { color: rgba(255, 255, 255, 0.8); }
.card-views svg { width: 15px; height: 15px; fill: currentColor; }

.card-empty {
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
}
.card-empty code { color: var(--ink); }

/* ============================================================
   Directory
   ============================================================ */
.dir-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* site-wide view count, under the grid */
.dir-views {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease), color 0.3s ease;
}
.dir-views.in { opacity: 1; transform: none; }
.dir-views:hover { color: rgba(255, 255, 255, 0.78); }
.dir-views svg { width: 15px; height: 15px; fill: currentColor; }

.grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 34px;
  perspective: 1000px;
}

.profile-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 224px;
  padding: 26px 20px 22px;
  border-radius: 20px;
  background: rgba(12, 12, 17, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  text-decoration: none;
  color: var(--ink);
  transform-style: preserve-3d;
  will-change: transform;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.5s var(--ease);
  opacity: 0;
  animation: tile-in 0.85s var(--ease) forwards;
  animation-delay: calc(var(--i) * 110ms + 200ms);
}
@keyframes tile-in {
  from { opacity: 0; transform: translateY(28px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
.profile-tile:hover {
  background: rgba(18, 18, 26, 0.68);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}
.profile-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
/* pointer-tracked sheen */
.profile-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.11), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.profile-tile:hover::before { opacity: 1; }

.tile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
  transform: translateZ(30px);
  transition: transform 0.5s var(--ease);
}
.profile-tile:hover .tile-avatar { transform: translateZ(45px) scale(1.04); }
.tile-avatar.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.9);
  background: #1E222C;
}
.tile-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  transform: translateZ(22px);
}
.tile-slug {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.32);
  transform: translateZ(16px);
  transition: color 0.3s ease;
}
.profile-tile:hover .tile-slug { color: rgba(255, 255, 255, 0.62); }

.empty-state {
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  padding: 40px 0;
}

/* ============================================================
   Interaction states set from JS
   ============================================================ */

/* Tilt is armed only after the entrance keyframes finish, so the
   inline transform never fights the animation. */
.profile-tile.settled {
  animation: none;
  opacity: 1;
  transition:
    transform 0.28s var(--ease),
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.5s var(--ease);
}

/* Page-leave crossfade, so tile -> profile isn't a hard cut. */
body.leaving .world,
body.leaving .bg-media,
body.leaving #aura,
body.leaving .audio-control {
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 620px) {
  /* Phones do the same compositing work on a fraction of the GPU:
     lighter backdrop blur, and a static grain instead of an animated
     blended layer. */
  .card {
    padding: 34px 22px 40px;
    border-radius: 22px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .profile-tile { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .grain { animation: none; mix-blend-mode: normal; opacity: 0.03; }

  .avatar-wrap { width: 96px; height: 96px; }
  .links { gap: 16px; }
  .links svg { width: 24px; height: 24px; }
  .card-views { left: 18px; bottom: 14px; font-size: 12px; }

  .grid { gap: 20px; }
  .profile-tile { width: calc(50% - 10px); min-width: 150px; padding: 20px 14px 18px; }
  .tile-avatar { width: 92px; height: 92px; }
  .tile-name { font-size: 18px; }
  .audio-control { top: 14px; right: 14px; }
  .audio-control .vol-wrap { display: none; }
  .dir-inner { gap: 22px; }
}

/* Touch devices: no cursor glow */
@media (hover: none) {
  .cursor-glow { display: none; }
}

/* ============================================================
   Reduced motion — keep it readable, drop the movement
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .world { transform: none !important; opacity: 1 !important; }
  .grain, .cursor-glow, .spark { display: none; }
  .enter-label, .reveal, .profile-tile, .audio-control, .card-views, .dir-views,
  .discord-slot {
    opacity: 1 !important;
    transform: none !important;
  }
  body.leaving .world,
  body.leaving .bg-media,
  body.leaving #aura,
  body.leaving .audio-control { opacity: 1; transform: none; }
}

/* ============================================================
   Icon sets

   Two shapes of icon share the link row: Simple Icons are filled paths,
   Lucide are stroked outlines. The base `.links svg` rule fills, so
   stroked icons opt out here — a class beats the bare element selector,
   which a presentation attribute on the SVG would not.
   ============================================================ */
svg.ico-stroke,
.links svg.ico-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.ico-fill,
.links svg.ico-fill { fill: currentColor; stroke: none; }

/* ============================================================
   Account chip

   Top-left on every page: sign in, or jump to your own editor. The
   opposite corner from .audio-control, which owns the top right.
   Deliberately quiet — it should read as site chrome, not a call to
   action competing with the card.
   ============================================================ */
.account {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 5;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease);
}
.account.in { opacity: 1; transform: none; }

.account a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 8px;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(12, 12, 18, 0.55);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.account a:hover {
  color: #fff;
  background: rgba(20, 20, 28, 0.8);
  border-color: rgba(255, 255, 255, 0.24);
}
/* No avatar, no need for the extra left padding the avatar was making
   room for. */
.account a:not(:has(.account-avatar)) { padding-left: 13px; }

.account-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: #1E222C;
}

@media (max-width: 560px) {
  .account { top: 13px; left: 13px; }
  .account a { font-size: 11px; padding: 6px 11px 6px 7px; }
}
