/* gallery.css — Computational Jewelry · #ComputationalJewelry · Teia */

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

:root {
  --bg:           #e3cafc;   /* soft lavender */
  --bg-deeper:    #d4b6f5;   /* deeper lavender */
  --bg-mid:       #eeddff;   /* light lavender surface */
  --text:         #0c0919;
  --text-muted:   rgba(12, 9, 25, 0.52);
  --purple:       #6d28d9;
  --purple-light: #a78bfa;
  --green:        #15803d;   /* terminal green */
  --green-bright: #4ade80;
  --border:       rgba(109, 40, 217, 0.18);
  --bg-dark:      #0d0018;   /* gallery zone */
  --text-dark:    #f0e4ff;
  --text-dark-muted: rgba(240, 228, 255, 0.5);
  --font-display: 'Cormorant Garant', Georgia, serif;
  --font-sans:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Top bar ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 48px;
  background: var(--bg-deeper);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-brand {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar-link {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.top-bar-link:hover { color: var(--text); }

.top-bar-deadline {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--purple);
  color: #fff;
  padding: 3px 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Hero ── */
.hero {
  padding: 72px 56px 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 760px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 24px;
}

.hero-chinese {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.2;
  color: var(--purple);
  margin-bottom: 6px;
}

.hero-collab {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-tag-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  border: 2px solid var(--purple);
  padding: 6px 16px;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.65;
}

/* ── Statement ── */
.statement-section {
  background: var(--bg-deeper);
  padding: 80px 56px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.statement-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 56px;
  align-items: start;
}

.statement-headline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  color: var(--text);
}

.statement-body p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 18px;
}
.statement-body p:last-child { margin-bottom: 0; }

.statement-body strong {
  font-weight: 600;
  color: var(--purple);
}

.statement-pics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 64px;
}

.statement-pics img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 1px solid var(--border);
}

/* ── Themes ── */
.themes-section {
  padding: 96px 56px;
  background: var(--bg);
}

.themes-inner {
  max-width: 860px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.themes-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 56px;
  color: var(--text);
}

.themes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.theme-item {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.theme-num {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 300;
  color: var(--purple-light);
  line-height: 1;
  width: 56px;
  flex-shrink: 0;
  text-align: right;
}

.theme-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  line-height: 1.2;
}

/* ── Why Submit ── */
.why-section {
  background: var(--bg-mid);
  padding: 96px 56px;
  border-top: 1px solid var(--border);
}

.why-inner {
  max-width: 860px;
  margin: 0 auto;
}

.why-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 600;
  margin-bottom: 48px;
  color: var(--text);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.why-card {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 32px;
}

.why-card-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 12px;
}

.why-card-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Gallery zone (dark) ── */
.gallery-zone {
  background: var(--bg-dark);
  color: var(--text-dark);
  padding-top: 0;
}

.gallery-zone-header {
  padding: 56px 32px 32px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.15);
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.gallery-zone-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-dark);
}

.gallery-zone-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green-bright);
  letter-spacing: 0.03em;
}

/* ── Gallery controls ── */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  gap: 16px;
}

#info-bar {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dark-muted);
  letter-spacing: 0.04em;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-control label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dark-muted);
}

.sort-control select {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--text-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  outline: none;
  cursor: pointer;
}
.sort-control select option { background: #1a0035; }

/* ── Gallery grid ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
  padding: 2px 2px 0;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: #1a0035;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,0,24,0.85) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  gap: 3px;
}
.gallery-item:hover .overlay { opacity: 1; }

.overlay-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-artist {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green-bright);
  letter-spacing: 0.04em;
}

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(13,0,24,0.7);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  pointer-events: none;
}

/* ── Load more ── */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  padding: 40px 32px;
}

#load-more {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--text-dark);
  padding: 12px 40px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
#load-more:hover { border-color: var(--purple-light); background: rgba(167,139,250,0.08); }

/* ── Empty state ── */
.empty-state {
  padding: 80px 32px;
  text-align: center;
}
.empty-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.empty-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dark-muted);
}
.empty-sub a { color: var(--purple-light); }

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 0, 24, 0.96);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-media img,
#lightbox-media video {
  max-width: min(80vw, 900px);
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

#lightbox-caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.lb-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 500;
  color: #fff;
  display: block;
}
.lb-artist {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green-bright);
  display: block;
}
.lb-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dark-muted);
  display: block;
}
.lb-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple-light);
  margin-top: 6px;
  display: block;
  transition: color 0.15s;
}
.lb-link:hover { color: #fff; }

.close-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 1001;
}
.close-btn:hover { opacity: 1; }

.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(109, 40, 217, 0.25);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 48px;
  height: 64px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
  z-index: 1001;
}
.nav-arrow:hover { opacity: 1; background: rgba(109,40,217,0.5); }
.nav-prev { left: 12px; }
.nav-next { right: 12px; }

/* ── Footer ── */
footer {
  padding: 32px;
  border-top: 1px solid rgba(167, 139, 250, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dark-muted);
  flex-wrap: wrap;
}
footer a { color: var(--text-dark-muted); transition: color 0.15s; }
footer a:hover { color: var(--text-dark); }
.footer-sep { opacity: 0.3; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero { padding: 48px 24px 40px; }

  .statement-section { padding: 56px 24px 0; }
  .themes-section,
  .why-section { padding: 64px 24px; }

  .statement-inner {
    grid-template-columns: 1fr;
  }

  .statement-pics {
    flex-direction: row;
    position: static;
    gap: 8px;
    margin: 32px -24px 0;
  }

  .statement-pics img {
    flex: 1;
    height: 220px;
    object-position: center top;
    border-left: none;
    border-right: none;
  }

  .gallery-zone-header { padding: 40px 20px 24px; flex-direction: column; gap: 8px; }
  .gallery-controls { padding: 16px 20px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .top-bar { padding: 0 20px; }

  .theme-num { font-size: 2.4rem; width: 40px; }
}

@media (max-width: 480px) {
  .top-bar-link { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
