:root {
  color-scheme: dark;
  --bg: #050915;
  --panel: rgba(14, 23, 45, 0.72);
  --panel-strong: #101a31;
  --line: rgba(130, 164, 227, 0.18);
  --text: #f5f8ff;
  --muted: #8c9bb7;
  --blue: #0878ff;
  --cyan: #31d7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(8, 15, 31, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 15, 31, 0.3) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 40rem;
  height: 40rem;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.18;
  pointer-events: none;
}

.ambient-one { top: -18rem; right: -9rem; background: #006dff; }
.ambient-two { top: 42rem; left: -22rem; background: #00d9ff; opacity: 0.09; }

.site-header {
  width: min(1440px, calc(100% - 48px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand strong { color: var(--cyan); font-weight: 750; }

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.developer {
  padding: 9px 13px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.developer strong {
  color: var(--text);
  font-weight: 700;
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 9, 21, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.status b { font-weight: 650; }

.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(88, 101, 242, 0.45);
  border-radius: 999px;
  color: #c8ceff;
  background: rgba(88, 101, 242, 0.11);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.discord-link:hover,
.discord-link:focus-visible {
  border-color: #7b85ff;
  background: rgba(88, 101, 242, 0.22);
  color: #fff;
  outline: none;
}

.discord-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

main { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }

.intro {
  position: relative;
  min-height: 530px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 0 64px;
}

.intro::before {
  content: "△  ○  ×  □";
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: transparent;
  -webkit-text-stroke: 1px rgba(75, 139, 255, 0.085);
  font-size: clamp(7rem, 18vw, 15rem);
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.eyebrow, .section-kicker {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

h1 {
  position: relative;
  margin: 0;
  font-size: clamp(3.4rem, 8vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1.5px #2ebeff;
  text-shadow: 0 0 35px rgba(0, 120, 255, 0.16);
}

.lead {
  position: relative;
  max-width: 570px;
  margin: 28px auto 32px;
  color: var(--muted);
  font-size: 1rem;
}

.search-wrap {
  position: relative;
  width: min(650px, 100%);
  display: flex;
  align-items: center;
  border: 1px solid rgba(60, 133, 255, 0.45);
  border-radius: 14px;
  background: rgba(9, 17, 34, 0.92);
  box-shadow: 0 0 0 4px rgba(7, 120, 255, 0.05), var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(49, 215, 255, 0.09), var(--shadow);
}

.search-wrap svg {
  width: 22px;
  margin-left: 19px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  padding: 18px 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.search-wrap input::placeholder { color: #66758f; }

kbd {
  margin-right: 16px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #111a2c;
  font: 0.72rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gallery-section { padding: 30px 0 100px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-kicker { margin-bottom: 5px; font-size: 0.65rem; }

h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.04em; }

#resultCount { margin: 0; color: var(--muted); font-size: 0.84rem; }

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

.avatar-card {
  position: relative;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(18, 31, 58, 0.92), rgba(8, 14, 29, 0.9));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.avatar-card:hover, .avatar-card:focus-visible {
  z-index: 1;
  transform: translateY(-4px);
  border-color: rgba(49, 215, 255, 0.75);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.34), 0 0 20px rgba(0, 120, 255, 0.11);
  outline: none;
}

.image-shell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #070c17;
}

.image-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: inherit;
  pointer-events: none;
}

.avatar-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 240ms ease, opacity 200ms ease;
}

.avatar-card:hover img { transform: scale(1.035); }

.avatar-code {
  display: block;
  margin: 10px 3px 3px;
  overflow: hidden;
  color: #b8c6de;
  font: 0.72rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  padding: 72px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}

.empty span { display: block; color: var(--cyan); font-size: 2.4rem; }
.empty h3 { margin: 8px 0 4px; color: var(--text); font-size: 1.1rem; }
.empty p { margin: 0; }

.load-trigger { height: 2px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 12px 16px;
  border: 1px solid rgba(49, 215, 255, 0.45);
  border-radius: 10px;
  background: #101b31;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 700px) {
  .site-header, main { width: min(100% - 28px, 1280px); }
  .site-header {
    height: auto;
    min-height: 70px;
    padding: 13px 0;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand { gap: 9px; font-size: 0.88rem; }
  .header-nav { width: 100%; gap: 5px; justify-content: flex-end; }
  .developer { padding: 7px 8px; font-size: 0.72rem; }
  .status { padding: 8px 10px; }
  .discord-link { padding: 8px 10px; }
  .discord-link span { display: none; }
  .intro { min-height: 470px; padding-top: 48px; }
  .intro::before { font-size: 6.2rem; }
  h1 { font-size: clamp(3.2rem, 16vw, 5.2rem); }
  .lead { font-size: 0.95rem; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .avatar-card { padding: 7px; }
  .avatar-code { font-size: 0.66rem; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
