/* ============================================================== tokens */
:root {
  color-scheme: dark;

  --bg:         #0a0b0f;
  --surface:    rgba(255,255,255,.04);
  --surface-hi: rgba(255,255,255,.07);
  --border:     rgba(255,255,255,.08);
  --border-hi:  rgba(255,255,255,.16);

  --text:  #e9ebf2;
  --muted: #8b90a3;
  --faint: #5c6172;

  --accent: #7c8ce0;
  --green:  #43b581;
  --amber:  #faa61a;
  --red:    #f04747;
  --grey:   #747f8d;

  --ease: cubic-bezier(.16,1,.3,1);
  --ease-soft: cubic-bezier(.4,0,.2,1);

  --maxw: 940px;
  --pad: clamp(1.15rem, 5vw, 2.5rem);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* =============================================================== reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* Any class here that sets `display` would otherwise beat the UA's
   `[hidden] { display: none }` and render hidden elements anyway. */
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #0a0b0f; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ============================================================= ambient */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb-a {
  width: 46rem; height: 46rem; top: -18rem; left: 50%; margin-left: -23rem;
  background: radial-gradient(circle, rgba(94,106,210,.42), transparent 68%);
  animation: drift-a 24s ease-in-out infinite;
}
.orb-b {
  width: 34rem; height: 34rem; bottom: -14rem; right: -8rem;
  background: radial-gradient(circle, rgba(124,140,224,.24), transparent 70%);
  animation: drift-b 30s ease-in-out infinite;
}
@keyframes drift-a { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-3rem,2.5rem) scale(1.08)} }
@keyframes drift-b { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(2.5rem,-2rem) scale(1.06)} }

.grain {
  position: absolute; inset: 0; opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 1; }

/* ============================================================== reveal */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s var(--ease) var(--d,0s), transform .9s var(--ease) var(--d,0s);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ============================================================== topbar */
.topbar {
  position: fixed;
  top: calc(var(--safe-t) + .85rem);
  left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.counter, .audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 38px;
  padding: 0 .8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18,20,28,.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--muted);
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
  transition: color .4s var(--ease-soft), border-color .4s var(--ease-soft);
}
.counter svg, .audio-btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.audio-btn { width: 38px; padding: 0; position: relative; }
.audio-btn:hover, .counter:hover { color: var(--text); border-color: var(--border-hi); }
.audio-btn[aria-pressed="true"] { color: var(--accent); border-color: rgba(124,140,224,.4); }

/* `hidden` does nothing on SVG (wrong namespace) — drive these from CSS. */
.audio-btn .ico-pause { display: none; }
.audio-btn[aria-pressed="true"] .ico-play { display: none; }
.audio-btn[aria-pressed="true"]:hover .ico-pause { display: block; }
.audio-btn[aria-pressed="true"]:hover .eq { display: none; }

/* little equalizer shown while playing */
.eq { display: none; gap: 2px; align-items: flex-end; height: 13px; }
.audio-btn[aria-pressed="true"] .eq { display: flex; }
.eq i { width: 2.5px; background: currentColor; border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(1){ height:5px; animation-delay:0s }
.eq i:nth-child(2){ height:11px; animation-delay:.18s }
.eq i:nth-child(3){ height:7px; animation-delay:.36s }
@keyframes eq { 0%,100%{ transform: scaleY(.4) } 50%{ transform: scaleY(1) } }

/* ================================================================ hero */
/* Tall enough to feel like a landing, short enough not to leave dead space
   below the hero content and the next section. */
.hero {
  min-height: min(88svh, 720px);
  display: grid; place-items: center;
  padding: 5.5rem var(--pad) 2rem;
  position: relative; text-align: center;
}
.hero-inner { max-width: 40rem; width: 100%; }

.avatar-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 1.6rem; }
.avatar {
  width: 120px; height: 120px; border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: var(--surface-hi);
  object-fit: cover; position: relative; z-index: 2;
}
.avatar-glow {
  position: absolute; inset: -28%; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,140,224,.5), transparent 62%);
  filter: blur(22px); z-index: 0;
  animation: breathe 5.5s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{opacity:.55;transform:scale(1)} 50%{opacity:.9;transform:scale(1.09)} }

.status-ring {
  position: absolute; right: 5px; bottom: 5px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 3.5px solid var(--bg);
  background: var(--grey); z-index: 3;
  transition: background .4s var(--ease-soft);
}
[data-status="online"] { background: var(--green) !important; }
[data-status="idle"]   { background: var(--amber) !important; }
[data-status="dnd"]    { background: var(--red)   !important; }
[data-status="offline"]{ background: var(--grey)  !important; }

.name { font-size: clamp(2.3rem, 8vw, 3.6rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.05; }
.handle { margin-top: .5rem; color: var(--muted); font-size: .92rem; }
.bio {
  margin-top: 1.4rem; color: var(--muted);
  font-size: 1.02rem; line-height: 1.75; text-wrap: pretty;
  white-space: pre-wrap;
}

/* Discord badges sit inline with the handle. Empty when the account has none. */
.badges { display: inline-flex; gap: .3rem; align-items: center; vertical-align: middle; }
.badges:not(:empty) { margin-left: .4rem; }
.badges svg { width: 15px; height: 15px; fill: var(--accent); opacity: .85; }

/* Custom status / current game / Spotify — hidden when there's nothing on. */
.activity-line {
  margin-top: .7rem;
  display: inline-block;
  padding: .4rem .95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-line.playing { color: var(--accent); border-color: rgba(124,140,224,.3); }

/* ============================================================ sections */
.section { max-width: var(--maxw); margin: 0 auto; padding: 4.5rem var(--pad); }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.8rem, 5.5vw, 2.6rem); font-weight: 600; letter-spacing: -.035em; }
.section-sub { color: var(--muted); margin-top: .4rem; }
.subhead { font-size: 1.02rem; font-weight: 500; color: var(--muted); margin: 3rem 0 1.2rem; }

/* ============================================================= socials */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: .8rem;
}
.social-card {
  display: flex; align-items: center; gap: .85rem;
  min-height: 62px;
  padding: .95rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text); text-decoration: none;
  position: relative; overflow: hidden;
  transition: transform .5s var(--ease), border-color .5s var(--ease), background .5s var(--ease);
}
.social-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(16rem 9rem at var(--mx,50%) var(--my,50%), rgba(124,140,224,.16), transparent 60%);
  opacity: 0; transition: opacity .45s var(--ease-soft);
}
.social-card:hover::before { opacity: 1; }
.social-icon { width: 20px; height: 20px; flex: none; fill: currentColor; color: var(--muted); transition: color .45s var(--ease-soft); position: relative; z-index: 1; }
.social-card:hover .social-icon { color: var(--accent); }
.social-text { position: relative; z-index: 1; min-width: 0; }
.social-name { font-size: .95rem; font-weight: 500; display: block; }
.social-handle { font-size: .79rem; color: var(--faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========================================================== collection */
.value-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  padding: clamp(1.6rem, 5vw, 2.6rem);
  text-align: center; position: relative; overflow: hidden;
}
.value-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(30rem 16rem at 50% -20%, rgba(124,140,224,.22), transparent 65%);
  pointer-events: none;
}
.value-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .13em; color: var(--faint); }
.value-figure {
  margin-top: .6rem;
  font-size: clamp(2.4rem, 11vw, 4.2rem);
  font-weight: 600; letter-spacing: -.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.value-figure .currency { font-size: .5em; vertical-align: .38em; color: var(--muted); margin-right: .06em; }

.stat-row {
  display: flex; justify-content: center; gap: clamp(1.5rem, 8vw, 3.5rem);
  margin-top: 1.6rem; position: relative;
}
.stat { display: flex; flex-direction: column; gap: .1rem; }
.stat-n { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-l { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.value-meta { margin-top: 1.3rem; font-size: .8rem; color: var(--faint); position: relative; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: .85rem;
}
.card-item {
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .5s var(--ease), border-color .5s var(--ease), background .5s var(--ease);
}
.card-item:hover { transform: translateY(-3px); border-color: var(--border-hi); background: var(--surface-hi); }
.card-thumb {
  aspect-ratio: 4 / 3;
  background: rgba(0,0,0,.28);
  display: grid; place-items: center;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: contain; padding: .6rem; }
.card-body { padding: .9rem 1rem 1.05rem; display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.card-cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); opacity: .8; }
.card-name { font-size: .93rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.35; }
.card-set { font-size: .77rem; color: var(--faint); }
.card-foot { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: .7rem; }
.card-value { font-size: 1.08rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card-qty { font-size: .72rem; padding: .16rem .48rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.card-delta { font-size: .74rem; font-variant-numeric: tabular-nums; }
.card-delta.up { color: var(--green); }
.card-delta.down { color: var(--red); }

/* =============================================================== misc */
.flag {
  display: inline-block; margin-left: .5rem; padding: .1rem .45rem;
  font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid rgba(240,71,71,.4); color: var(--red); border-radius: 999px;
  vertical-align: middle;
}
.footer {
  text-align: center;
  padding: 3.5rem var(--pad) calc(3rem + var(--safe-b));
  color: var(--faint); font-size: .8rem;
  border-top: 1px solid var(--border);
  max-width: var(--maxw); margin: 0 auto;
}

/* ============================================================= mobile */
@media (max-width: 640px) {
  .hero { padding: 4.5rem var(--pad) 2rem; min-height: auto; }
  .avatar-wrap, .avatar { width: 104px; height: 104px; }
  .section { padding: 4.5rem var(--pad); }
  .bio { font-size: .97rem; }

  .social-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .social-card { padding: .8rem .85rem; gap: .6rem; min-height: 58px; }
  .social-name { font-size: .87rem; }
  .social-handle { font-size: .72rem; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .card-body { padding: .7rem .75rem .85rem; }
  .card-name { font-size: .85rem; }
  .subhead { margin: 2.2rem 0 1rem; }
}
/* Socials go full width for comfortable tapping; cards keep two columns
   (they have art, so they stay scannable) until the screen is very narrow. */
@media (max-width: 420px) {
  .social-grid { grid-template-columns: 1fr; }
}
@media (max-width: 330px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* Hover effects are noise on touch devices — they stick after a tap. */
@media (hover: none) {
  .social-card:hover, .card-item:hover { transform: none; }
  .social-card::before { display: none; }
}

/* Big blurs are expensive on phones; drop them where they cost the most. */
@media (max-width: 640px) {
  .orb { filter: blur(70px); }

}

/* ===================================================== reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
