/* gallery.css — Cycles · NFC Lisbon 2026 · Teia */

:root {
  --bg: #0a0a0a;
  --surface: #111;
  --border: #1e1e1e;
  --text: #f0f0f0;
  --text-muted: #666;
  --accent: #c8ff00;
  --accent2: #ff134a;
  --nav-height: 54px;
}

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

body {
  font-family: 'Inter', 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Nav ───────────────────────────────────────── */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: var(--nav-height);
}

.nav-brand {
  font-family: 'Anybody', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  text-decoration: none;
}
.nav-brand:hover { color: var(--text); text-decoration: none; }

.nav-links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.2s;
}
.nav-links a.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Header ────────────────────────────────────── */

header {
  padding: 56px 40px 36px;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

header h1 {
  font-family: 'Anybody', sans-serif;
  font-weight: 900;
  font-size: clamp(72px, 13vw, 160px);
  line-height: 0.88;
  letter-spacing: -2px;
  color: var(--accent);
  text-transform: uppercase;
}

.header-sub {
  font-family: 'Anybody', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 14px;
}

.teia-logo {
  height: 52px;
  opacity: 0.85;
  flex-shrink: 0;
  margin-bottom: 8px;
}

/* ── Info panel ─────────────────────────────────── */

.content-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px 40px;
}

.info-panel {
  display: flex;
  gap: 60px;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.details {
  flex: 0 0 240px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-muted);
}

.details p { margin-bottom: 16px; }

.details strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 2px;
}

.links { margin-top: 4px; }
.links strong { margin-bottom: 6px; }
.links a {
  display: inline-block;
  margin-right: 12px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.links a:hover { text-decoration: underline; }

.essay-section {
  flex: 1;
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

.essay-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(240, 240, 240, 0.65);
  max-width: 580px;
}
.essay-text p { margin-bottom: 14px; }
.essay-text em { color: var(--accent); font-style: normal; font-weight: 600; }
.essay-text a { color: var(--accent); }

.stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
  min-width: 80px;
}

.stat {}
.stat-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-value {
  display: block;
  font-family: 'Anybody', sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

/* ── Gallery controls ───────────────────────────── */

.gallery-controls {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

#info-bar {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sort-control select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}
.sort-control select:focus { border-color: var(--accent); }

/* ── Gallery grid ───────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 1 / 1;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.05);
  opacity: 0.7;
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 10px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.gallery-item:hover .overlay { opacity: 1; }

.overlay-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.overlay-artist {
  display: block;
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 5px;
  z-index: 2;
  pointer-events: none;
  line-height: 1.6;
}

/* Fallback for tokens whose preview image fails to load */
.gallery-item.no-image {
  background: repeating-linear-gradient(
    45deg,
    #111,
    #111 10px,
    #161616 10px,
    #161616 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item.no-image .overlay { opacity: 1; background: none; }

.play-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 6px;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

.platform-HEN    { background: #1d4ed8; color: #fff; }
.platform-OBJKT  { background: #0e7490; color: #fff; }
.platform-VERSUM { background: #15803d; color: #fff; }
.platform-FXHASH { background: #7e22ce; color: #fff; }
.platform-8BIDOU { background: #b91c1c; color: #fff; }
.platform-TYPED  { background: #1e3a5f; color: #fff; }

/* ── Load more ──────────────────────────────────── */

.load-more-wrapper {
  text-align: center;
  padding: 48px 0 64px;
  max-width: 1240px;
  margin: 0 auto;
}

#load-more {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 48px;
  font-family: 'Anybody', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 0;
}
#load-more:hover {
  background: var(--accent);
  color: #000;
}

/* ── Lightbox ───────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 60px 80px;
  overflow-y: auto;
}
.lightbox.active { display: flex; }

.lightbox-inner {
  width: min(90vw, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#lightbox-media {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#lightbox-media img,
#lightbox-media video {
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  display: block;
}

#lightbox-media a { display: block; line-height: 0; }

#lightbox-caption {
  width: 100%;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: left;
}
.lb-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.lb-artist {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.lb-bio {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.45);
  max-height: 80px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  margin-bottom: 10px;
}
.lb-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
}
.lb-link:hover { text-decoration: underline; }

.close-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  font-size: 32px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  z-index: 1001;
}
.close-btn:hover { color: var(--accent); }

.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  background: none;
  border: none;
  padding: 16px;
  transition: color 0.2s;
  user-select: none;
  z-index: 1001;
}
.nav-arrow:hover { color: var(--accent); }
.nav-prev { left: 8px; }
.nav-next { right: 8px; }

/* ── Footer ─────────────────────────────────────── */

footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* Always show overlay on touch devices (no hover available) */
@media (hover: none) {
  .overlay { opacity: 1; }
}

@media (max-width: 768px) {
  nav { padding: 0 20px; }

  header { padding: 40px 20px 24px; flex-direction: column; align-items: flex-start; gap: 24px; }
  .teia-logo { height: 36px; }

  .content-wrapper { padding: 0 20px 32px; }

  .gallery-controls {
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .info-panel { flex-direction: column; gap: 28px; }
  .essay-section { flex-direction: column; gap: 24px; }
  .stats { flex-direction: row; gap: 32px; }

  .gallery { grid-template-columns: repeat(2, 1fr); padding: 0 20px; gap: 2px; }

  /* Lightbox */
  .lightbox { padding: 52px 12px 24px; }
  .lightbox-inner { width: 100%; gap: 12px; }

  #lightbox-media img,
  #lightbox-media video { max-height: 48vh; }

  .lb-bio {
    max-height: none;
    overflow-y: visible;
  }

  .nav-arrow { font-size: 22px; padding: 12px 8px; }
  .nav-prev { left: 0; }
  .nav-next { right: 0; }

  .close-btn { font-size: 28px; top: 12px; right: 14px; padding: 8px; }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: repeat(2, 1fr); padding: 0 8px; gap: 2px; }
  header h1 { font-size: 64px; }
}
