:root {
  --bg: #0b0b14;
  --bg-card: #141428;
  --bg-card-hover: #1a1a34;
  --bg-input: #1a1a30;
  --border: #2a2a4a;
  --border-focus: #00d4ff;
  --text: #e0e0f0;
  --text-muted: #8888aa;
  --text-heading: #ffffff;
  --accent-cyan: #00d4ff;
  --accent-pink: #ff2d95;
  --glow-cyan: rgba(0, 212, 255, 0.12);
  --glow-pink: rgba(255, 45, 149, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 200ms ease;
  --max-width: 1200px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-pink);
}

img {
  display: block;
  max-width: 100%;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header / Nav ===== */

header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 20, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
}

nav .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-heading);
  letter-spacing: 0.05em;
}

nav .logo span {
  color: var(--accent-cyan);
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

nav a:hover,
nav a.active {
  color: var(--accent-cyan);
}

nav .spacer {
  flex: 1;
}

/* ===== Hero ===== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px 80px;
  overflow: hidden;
  min-height: 420px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 11, 20, 0.75) 0%, rgba(11, 11, 20, 0.25) 40%, rgba(11, 11, 20, 0.85) 100%),
    url('/images/hero.png') center / cover no-repeat;
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.3);
}

.hero p {
  position: relative;
  z-index: 1;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
}

.hero .glow-line {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 2px;
  background: var(--accent-cyan);
  margin: 24px auto;
  box-shadow: 0 0 20px var(--accent-cyan);
}

/* ===== Callout ===== */

.callout {
  padding: 48px 20px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.callout p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.callout strong {
  color: var(--text);
}

/* ===== Filters ===== */

.filters {
  display: flex;
  gap: 12px;
  padding: 0 20px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.filters input::placeholder {
  color: var(--text-muted);
}

.filters input:focus,
.filters select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--glow-cyan);
}

.filters input {
  flex: 1;
  min-width: 200px;
}

.filters select {
  cursor: pointer;
  min-width: 140px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%238888aa'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.filters select option {
  background: var(--bg-card);
  color: var(--text);
}

/* ===== Token Grid ===== */

.gallery {
  padding: 0 20px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ===== Token Card ===== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 8px 32px var(--glow-cyan);
  background: var(--bg-card-hover);
}

.card-image {
  aspect-ratio: 1;
  background: var(--bg-input);
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-image .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-muted);
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
  margin: 0;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-type {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.tag-status-claimed {
  background: rgba(255, 45, 149, 0.12);
  color: var(--accent-pink);
  border: 1px solid rgba(255, 45, 149, 0.2);
}

.tag-status-unclaimed {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.card-actions {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #0b0b14;
  border-color: var(--accent-cyan);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-cyan);
  box-shadow: 0 0 20px var(--glow-cyan);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--accent-cyan);
  color: #0b0b14;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-link {
  background: transparent;
  color: var(--accent-cyan);
  padding: 9px 0;
  font-size: 0.82rem;
}

.btn-link:hover {
  color: var(--accent-pink);
}

/* ===== Empty / Error State ===== */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--accent-pink);
}

.error-state p {
  font-size: 1.1rem;
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-more {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Modal ===== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  position: relative;
  animation: modalIn 200ms ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal h2 {
  font-size: 1.25rem;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.modal p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal .form-group {
  margin-bottom: 16px;
}

.modal label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.modal input[type="email"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal input[type="email"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--glow-cyan);
}

.modal input[type="email"]::placeholder {
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-actions .btn {
  flex: 1;
}

.modal-success {
  text-align: center;
  padding: 20px 0;
}

.modal-success .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.modal-success h3 {
  color: var(--text-heading);
  margin-bottom: 8px;
}

.modal-success .url-display {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  word-break: break-all;
  margin: 12px 0;
  font-family: "SF Mono", "Fira Code", monospace;
}

.url-copy-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.url-copy-group input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--accent-cyan);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: "SF Mono", "Fira Code", monospace;
  outline: none;
  cursor: default;
}

.url-copy-group input:focus {
  border-color: var(--border-focus);
}

.url-copy-group .btn {
  flex-shrink: 0;
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  color: var(--text);
  font-size: 0.88rem;
  z-index: 300;
  animation: toastIn 300ms ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 360px;
}

.toast.success {
  border-color: var(--accent-cyan);
}

.toast.error {
  border-color: var(--accent-pink);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Footer ===== */

footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ===== Responsive ===== */

/* ===== Detail Modal ===== */

.modal-detail {
  max-width: 720px;
  padding: 0;
  overflow: hidden;
}

.modal-detail-body {
  display: flex;
}

.modal-detail-image {
  flex: 1;
  min-width: 280px;
  aspect-ratio: 1;
  background: var(--bg-input);
}

.modal-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-detail-info {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-detail-info h2 {
  font-size: 1.25rem;
  color: var(--text-heading);
  margin-bottom: 10px;
}

@media (max-width: 600px) {
  .modal-detail-body {
    flex-direction: column;
  }
  .modal-detail-image {
    min-width: unset;
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .hero {
    padding: 80px 20px 60px;
    min-height: 340px;
  }
}

@media (max-width: 600px) {
  nav {
    gap: 20px;
    height: 48px;
  }

  .hero {
    padding: 60px 16px 48px;
    min-height: 280px;
  }

  .hero h1 {
    margin-bottom: 12px;
  }

  .callout {
    padding: 32px 16px;
  }

  .filters {
    flex-direction: column;
    padding: 0 16px 24px;
  }

  .filters input,
  .filters select {
    width: 100%;
    min-width: unset;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery {
    padding: 0 16px 60px;
  }

  .modal {
    padding: 24px;
  }

  .modal-actions {
    flex-direction: column;
  }
}
