/* =========================================================================
   Studio portfolio: styles
   Colors are set here; the accent color comes from config.php.
   ========================================================================= */

:root {
  --bg: #08080b;
  --surface: #111116;
  --surface-2: #18181f;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f4f6;
  --muted: #a0a0ab;
  --dim: #6c6c78;
  --accent: #7c5cff;
  --accent-ink: #ffffff;
  --live: #22c55e;
  --radius: 16px;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.03em; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

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

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 30px -10px var(--accent); }
.btn--accent:hover { filter: brightness(1.12); }
.btn--ghost { background: rgba(255, 255, 255, 0.06); border-color: var(--line-2); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn--small { padding: 9px 15px; font-size: 14px; }
.btn--big { padding: 16px 26px; font-size: 16px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Live dot ---------- */

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
  flex: none;
}
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.dot--inline { width: 10px; height: 10px; margin-right: 12px; vertical-align: middle; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 14px 0 auto;
  z-index: 50;
  pointer-events: none;
}
.nav__inner {
  pointer-events: auto;
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 8px 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.is-scrolled .nav__inner {
  background: rgba(14, 14, 18, 0.72);
  border-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 16px;
  overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.brand__mark.has-img { background: var(--surface-2); border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; transition: color 0.2s, background 0.2s; }
.nav__links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero__mosaic {
  position: absolute;
  inset: -10% -20%;
  z-index: -2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  transform: rotate(-7deg);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero__mosaic.is-ready { opacity: 0.7; }
.mosaic-row { display: flex; gap: 14px; width: max-content; animation: drift 90s linear infinite; }
.mosaic-row:nth-child(even) { animation-direction: reverse; animation-duration: 110s; }
.mosaic-row:nth-child(3n) { margin-left: -130px; }
.mosaic-row:nth-child(3n + 1) { margin-left: -60px; }
.mosaic-row img {
  width: 300px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  background: var(--surface-2);
}
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(8, 8, 11, 0.92) 0%, rgba(8, 8, 11, 0.72) 55%, rgba(8, 8, 11, 0.55) 100%),
    linear-gradient(to bottom, rgba(8, 8, 11, 0.6) 0%, transparent 25%, transparent 60%, var(--bg) 100%);
}
.hero__content { text-align: center; padding: 140px 0 90px; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.live-pill b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.hero__title {
  margin: 26px 0 14px;
  font-size: clamp(56px, 13vw, 150px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
.hero__dot { color: var(--accent); }
.hero__tagline { color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); }
.hero__actions { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* fade the text in once the data has arrived */
.hero__content > * { transition: opacity 0.6s ease, transform 0.6s ease; }
.is-loading .hero__content > * { opacity: 0; transform: translateY(8px); }

/* ---------- Stats ---------- */

.stats {
  position: relative;
  margin-top: -40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stats.no-members { grid-template-columns: repeat(3, 1fr); }
.stat { padding: 28px 24px; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat__label { color: var(--muted); font-size: 14px; }

/* ---------- Section heads ---------- */

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
h2 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 700; line-height: 1.05; text-wrap: balance; }

/* ---------- Featured marquee ---------- */

.featured { padding: 110px 0 20px; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__track { display: flex; gap: 18px; width: max-content; padding: 6px 0 16px; animation: drift var(--marquee-time, 60s) linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }

.fcard {
  position: relative;
  width: 360px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.fcard:hover { transform: translateY(-4px); border-color: var(--line-2); }
.fcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.fcard:hover img { transform: scale(1.06); }
.fcard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.3) 45%, transparent 70%);
}
.fcard__body { position: absolute; inset: auto 0 0; z-index: 1; padding: 16px 18px; }
.fcard__name { font-weight: 600; font-size: 16px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard__meta { margin-top: 4px; display: flex; gap: 14px; color: rgba(255, 255, 255, 0.75); font-size: 13px; }
.fcard__meta span { display: inline-flex; align-items: center; gap: 6px; }
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- Games grid ---------- */

.games { padding: 90px 0 30px; }

.sorter {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.sorter button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.sorter button:hover { color: var(--text); }
.sorter button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  animation: rise 0.5s ease both;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--surface-2); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.grid.no-anim .card { animation: none; }

.card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__rank {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 30px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card__rank.is-top { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.card__live {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card__live .dot { width: 7px; height: 7px; }
.card__live.is-zero { color: var(--muted); }
.card__live.is-zero .dot { background: var(--dim); }
.card__live.is-zero .dot::after { display: none; }

.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__name {
  font-family: var(--font);
  letter-spacing: 0;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta { margin-top: auto; display: flex; gap: 16px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.card__meta .ico { width: 15px; height: 15px; color: var(--dim); }

.card--skeleton {
  min-height: 250px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

.notice {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  color: var(--muted);
  text-align: center;
}
.updated { margin-top: 18px; color: var(--dim); font-size: 13px; text-align: right; }

/* ---------- Contact ---------- */

.contact { padding: 110px 0 90px; }
.contact__panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(48px, 8vw, 96px) 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}
.contact__panel::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 120%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 100%, var(--accent) 0%, transparent 60%);
  opacity: 0.35;
}
.contact__panel h2 { font-size: clamp(34px, 5.4vw, 64px); max-width: 16ch; margin-inline: auto; }
.contact__sub { margin: 16px auto 0; color: var(--muted); font-size: 18px; max-width: 46ch; }
.contact__buttons { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a:hover { color: var(--text); }

/* ---------- Toast (e.g. "Copied Discord username") ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__inner .btn { margin-left: auto; }
  .stats, .stats.no-members { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stats.no-members .stat:nth-child(3) { grid-column: 1 / -1; }
  .fcard { width: 280px; }
  .mosaic-row img { width: 220px; }
}

@media (max-width: 520px) {
  .stat { padding: 22px 12px; }
  .section-head { align-items: start; }
  .grid { grid-template-columns: 1fr; }
  .updated { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* the small live dot keeps pinging; big moving parts stop */
  .mosaic-row, .marquee__track, .card--skeleton { animation: none; }
  .marquee { overflow-x: auto; }
}
