:root {
  --stage: #1A1220;
  --mid: #2A1F35;
  --ink: #0D0A12;
  --cream: #FFF6E8;
  --red: #E63946;
  --cyan: #00C2FF;
  --lemon: #FFE66D;
  --lime: #7CFC9A;
  --spark: #B388FF;
  --flock: #FF6AD5;
  --radius: 16px;
  --font: "Fredoka", "Nunito", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--stage);
  color: var(--cream);
  min-height: 100dvh;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sticky nav ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(26, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 246, 232, 0.08);
  padding: 10px 12px calc(10px + var(--safe-bottom));
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--cream);
  white-space: nowrap;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--cyan);
}
.nav-links {
  display: flex;
  flex: 1;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,246,232,0.72);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  background: var(--lemon);
  border-color: var(--lemon);
  text-decoration: none;
}
.lang-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  border: 1px solid rgba(255,246,232,0.2);
  border-radius: 999px;
  overflow: hidden;
}
.lang-toggle button {
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: rgba(255,246,232,0.55);
  cursor: pointer;
}
.lang-toggle button.on {
  background: var(--cyan);
  color: var(--ink);
}

/* ── Hero banner ── */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}
.hero-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid rgba(230, 57, 70, 0.45);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,194,255,0.15);
  aspect-ratio: 16 / 9;
  background: var(--mid);
}
.hero-banner img,
.hero-banner canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,18,32,0.15) 30%, rgba(26,18,32,0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
}
.hero-overlay h1 {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 800;
  color: var(--cream);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.hero-overlay p {
  margin: 0;
  font-size: 13px;
  color: rgba(255,246,232,0.8);
  max-width: 42ch;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--mid);
  border: 1px solid rgba(255,246,232,0.12);
  color: var(--cream);
}
.chip.cyan { border-color: var(--cyan); color: var(--cyan); }
.chip.lemon { border-color: var(--lemon); color: var(--lemon); }
.chip.lime { border-color: var(--lime); color: var(--lime); }
.chip.red { border-color: var(--red); color: var(--red); }

/* ── Sections ── */
main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 48px; }
section { scroll-margin-top: 72px; margin-top: 28px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,246,232,0.1);
}
.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head h2 .mark {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--red);
  box-shadow: 0 0 8px var(--cyan);
}
.section-head .count {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,246,232,0.45);
}
.section-lead {
  margin: -4px 0 14px;
  font-size: 13px;
  color: rgba(255,246,232,0.55);
}

/* ── Grids ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.grid.live {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.grid.vfx {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grid.stage {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
  .grid.vfx { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid.vfx { grid-template-columns: repeat(3, 1fr); }
}

/* ── Asset cards ── */
.card {
  background: var(--mid);
  border: 1px solid rgba(255,246,232,0.1);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: rgba(0,194,255,0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.card-media {
  position: relative;
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(42,31,53,0.4), transparent 70%),
    var(--stage);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.card-media.banner {
  aspect-ratio: 16 / 9;
  padding: 0;
}
.card-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.card-media.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}
.card-media canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}
.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid rgba(255,246,232,0.06);
  background: rgba(26,18,32,0.55);
}
.card-body .name {
  font-weight: 800;
  font-size: 13px;
  color: var(--cream);
}
.card-body .role {
  font-size: 11px;
  color: rgba(255,246,232,0.55);
}
.card-body .file {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--cyan);
  opacity: 0.85;
  word-break: break-all;
}
.tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(26,18,32,0.85);
  border: 1px solid rgba(255,246,232,0.15);
  color: var(--lemon);
}
.tag.legacy { color: var(--flock); border-color: var(--flock); }
.tag.new { color: var(--lime); border-color: var(--lime); }
.tag.prop { color: var(--cyan); border-color: var(--cyan); }
.tag.boss { color: var(--red); border-color: var(--red); }

/* ── VFX card controls ── */
.vfx-card .card-media {
  aspect-ratio: 16 / 10;
  padding: 0;
  background: var(--stage);
}
.vfx-card .card-media canvas {
  border-radius: 0;
}
.vfx-controls {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.vfx-controls button {
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,246,232,0.2);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.vfx-controls button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.vfx-controls button.on {
  background: var(--lemon);
  color: var(--ink);
  border-color: var(--lemon);
}
.vfx-controls button.play {
  background: var(--cyan);
  color: var(--ink);
  border-color: var(--cyan);
}

/* ── Archive ── */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.archive-grid .card-media { padding: 6px; }
.archive-note {
  font-size: 12px;
  color: rgba(255,246,232,0.5);
  margin-bottom: 10px;
}

/* ── Footer ── */
footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px calc(32px + var(--safe-bottom));
  border-top: 1px solid rgba(255,246,232,0.1);
  font-size: 12px;
  color: rgba(255,246,232,0.5);
  text-align: center;
}
footer strong { color: var(--cream); }
footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

/* Wide banner card spanning grid */
.card.span-2 { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .card.span-2 { grid-column: span 2; }
}
