/* ═══════════════════════════════════════════════════════════
   p1xelDrifter Museum — Cyberpunk / Pixel-Art Theme
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Background layers */
  --bg-primary: #0a0a0f;
  --bg-secondary: #0d0d14;
  --bg-card: #111118;
  --bg-card-hover: #181825;

  /* Neon accents */
  --neon-cyan: #00ffff;
  --neon-magenta: #ff00ff;
  --neon-green: #00ff41;
  --neon-yellow: #ffff00;
  --neon-orange: #ff6600;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #b0b0c0;

  /* Borders & glows */
  --border-color: #2a2a3a;
  --border-glow-cyan: 0 0 8px rgba(0, 255, 255, 0.4), 0 0 20px rgba(0, 255, 255, 0.1);
  --border-glow-magenta: 0 0 8px rgba(255, 0, 255, 0.4), 0 0 20px rgba(255, 0, 255, 0.1);
  --text-glow-cyan: 0 0 10px rgba(0, 255, 255, 0.6);

  /* Typography */
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --font-size-xs: 0.75rem;      /* 12px — was 0.7rem */
  --font-size-sm: 0.85rem;      /* 13.6px — was 0.8rem */
  --font-size-base: 0.95rem;
  --font-size-lg: 1.15rem;
  --font-size-xl: 1.4rem;
  --font-size-2xl: 1.8rem;
  --font-size-3xl: 2.6rem;
  --font-size-hero: 3.5rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Layout */
  --nav-height: 80px;
  --max-width: 100%;
  --grid-gap: 1rem;

  /* Animation */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Scanline */
  --scanline-opacity: 0.04;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── CRT Scanline Overlay ── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,var(--scanline-opacity)) 0px,
    rgba(0,0,0,var(--scanline-opacity)) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-magenta);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}
a:hover {
  color: var(--neon-magenta);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
}

/* ── Focus-visible styles (keyboard nav) ── */
a:focus-visible,
.artwork-card:focus-visible,
.nav-links a:focus-visible,
.hero-cta:focus-visible,
.hero-link:focus-visible,
.nav-social:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}
a:focus:not(:focus-visible) {
  outline: none;
}

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 0 32px;
  z-index: 1000;
}

.nav-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  gap: 10px;
}

.nav-logo-icon {
  display: block;
  flex-shrink: 0;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 2px;
}

/* Font-based logo (replaces image) */
.nav-logo-main {
  font-size: 22px;
  font-weight: 700;
  color: var(--neon-magenta);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
  letter-spacing: 0.01em;
  font-family: var(--font-mono);
  white-space: nowrap;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

.nav-logo-sub {
  font-size: 22px;
  font-weight: 700;
  color: var(--neon-magenta);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
  letter-spacing: 0.01em;
  font-family: var(--font-mono);
  white-space: nowrap;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

/* Logo hover — same cyan highlight as nav links */
.nav-logo:hover .nav-logo-main,
.nav-logo:hover .nav-logo-sub {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

/* Centered nav links — flex: 1 pushes the social icon to the right */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon-cyan);
  transition: width var(--transition-base);
  box-shadow: 0 0 6px var(--neon-cyan);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* ARTICLES link — visually distinct from category links */
.nav-links .nav-articles {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  margin-left: var(--space-sm);
  padding-left: var(--space-lg);
  border-left: 1px solid var(--border-color);
}

.nav-links .nav-articles:hover,
.nav-links .nav-articles.active {
  color: var(--neon-yellow);
}

.nav-links .nav-articles::after {
  background: var(--neon-yellow);
}

/* Mobile hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  margin-left: auto;
  transition: border-color var(--transition-fast);
}
.nav-toggle:hover {
  border-color: var(--neon-cyan);
}

/* X / Twitter social link — top right */
.nav-social {
  color: var(--text-secondary);
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-social:hover {
  color: var(--neon-cyan);
  text-shadow: var(--text-glow-cyan);
}

.nav-social svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Main Content ── */
.content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  position: relative;
  z-index: 1;
}

/* ── Hero Section (Landing) ── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
}

/* Small eyebrow text above the title */
.hero-eyebrow {
  font-size: calc(var(--font-size-base) * 2);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.hero-title {
  font-size: var(--font-size-hero);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-lg);
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.25em;
  line-height: 1.1;
}

/* Brand name — magenta with glow */
.hero-title-brand {
  color: var(--neon-magenta);
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.5), 0 0 30px rgba(255, 0, 255, 0.2);
}

/* Venue — cyan with glow */
.hero-title-venue {
  color: var(--neon-cyan);
  text-shadow: var(--text-glow-cyan), 0 0 40px rgba(0, 255, 255, 0.3);
}

/* Glitch effect on hero title */
.hero-title.glitch {
  animation: glitch-title 0.3s ease 0.5s 1 forwards;
}

@keyframes glitch-title {
  0%   { transform: translate(0); }
  20%  { transform: translate(-3px, 2px); }
  40%  { transform: translate(3px, -1px); }
  60%  { transform: translate(-2px, -2px); }
  80%  { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-lg);
  line-height: 1.8;
}

.hero-tagline {
  margin-bottom: 0;
}

/* Submission invitation below CTA */
.hero-submission {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-lg);
  letter-spacing: 0.03em;
}

.hero-link {
  color: var(--neon-cyan);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

.hero-link:hover {
  color: var(--neon-magenta);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
}

.hero-link-arrow {
  display: inline-block;
  transition: transform var(--transition-fast);
}

.hero-link:hover .hero-link-arrow {
  transform: translateX(4px);
}

/* ── Category Cards (Hero) ── */
.category-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  max-width: 1080px;
  width: 100%;
  margin: var(--space-xl) auto 0;
  padding: 0 var(--space-md);
}

.category-card {
  display: block;
  border: 1px solid var(--border-color);
  overflow: hidden;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  aspect-ratio: 1 / 1;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  transition: filter var(--transition-base), transform 0.4s ease;
}

.category-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--border-glow-cyan);
  transform: scale(1.04);
  z-index: 2;
}

.category-card:hover img {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.08);
}

/* ── Section Headers ── */
.section-header {
  padding: var(--space-xl) 48px var(--space-lg);  /* was 32px / --space-md */
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: var(--font-size-2xl);
  color: var(--neon-cyan);
  text-shadow: var(--text-glow-cyan);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: var(--font-size-sm);         /* was 0.8rem → now 0.85rem */
  color: var(--text-secondary);            /* was --text-muted → WCAG AA fix */
  letter-spacing: 0.05em;
}

/* ── Gallery Grid ── */
.gallery {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px var(--space-2xl);   /* was 32px → 48px for breathing room */
}

.gallery-group {
  margin-bottom: var(--space-xl);
}

.gallery-group-title {
  font-size: var(--font-size-lg);
  color: var(--neon-magenta);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid rgba(255, 0, 255, 0.2);
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

/* Item count badge next to collection heading */
.gallery-group-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);   /* was 4 → 5 per row */
  gap: var(--grid-gap);
}

/* ── Artwork Card ── */
.artwork-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base), opacity 0.4s ease;
  position: relative;
  text-decoration: none;
  display: block;
}

.artwork-card:hover {
  transform: scale(1.03);
  border-color: var(--neon-cyan);
  box-shadow: var(--border-glow-cyan);
  z-index: 2;
}

/* Image wrapper with hover overlay */
.artwork-card-imgwrap {
  position: relative;
  overflow: hidden;
}

.artwork-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  background: var(--bg-secondary);
  transition: transform 0.4s ease, filter 0.3s ease;
}

.artwork-card:hover .artwork-card-image {
  transform: scale(1.08);
  filter: brightness(0.7);
}

.artwork-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(10,10,15,0) 40%, rgba(10,10,15,0.7) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.artwork-card:hover .artwork-card-overlay {
  opacity: 1;
}

.artwork-card-overlay span {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--text-glow-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.artwork-card-info {
  padding: 12px 16px 14px;   /* was 8px 16px — more breathing room */
}

.artwork-card-title {
  font-size: var(--font-size-sm);   /* was 0.8rem → now 0.85rem (~14px) */
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;          /* reserve 2 lines so all cards align */
}

.artwork-card-artist {
  font-size: var(--font-size-xs);   /* was 0.7rem → now 0.75rem (12px) */
  color: var(--text-secondary);
}

/* ── Card Meta: Blockchain + Mint Date ── */
.artwork-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.bc-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Ethereum — blue/cyan */
.bc-badge.bc-ethereum {
  background: rgba(0, 170, 255, 0.15);
  color: #4da6ff;
  border: 1px solid rgba(0, 170, 255, 0.35);
}
.bc-badge.bc-ethereum:hover {
  background: rgba(0, 170, 255, 0.25);
}

/* Tezos — green/teal */
.bc-badge.bc-tezos {
  background: rgba(0, 255, 65, 0.12);
  color: var(--neon-green);
  border: 1px solid rgba(0, 255, 65, 0.3);
}
.bc-badge.bc-tezos:hover {
  background: rgba(0, 255, 65, 0.2);
}

.meta-dot {
  color: var(--text-muted);
  font-size: 0.7rem;
  user-select: none;
}

.mint-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Card entrance animation */
.artwork-card {
  opacity: 0;
  transform: translateY(12px);
}
.artwork-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Coming Soon ── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  text-align: center;
  padding: var(--space-xl);
}

.coming-soon-title {
  font-size: var(--font-size-3xl);
  color: var(--neon-magenta);
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  margin-bottom: var(--space-md);
}

.coming-soon-text {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

/* ── NotFound / Error ── */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  text-align: center;
  padding: var(--space-xl);
}

.not-found-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  color: var(--neon-magenta);
}

.not-found-title {
  font-size: var(--font-size-2xl);
  color: var(--neon-magenta);
  margin-bottom: var(--space-sm);
}

.not-found-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* ── Loading / Image States ── */
img {
  background: var(--bg-secondary);
}

/* Native loading="lazy" handles network deferral.
   No opacity:0 gate — it caused a race condition where
   dynamically-rendered images never received the .loaded class. */

/* ── Responsive ── */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);   /* was 3 → 4 */
  }
  .category-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 720px;
  }
  :root {
    --font-size-hero: 2.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);   /* was 2 → 3 */
  }
  .navbar {
    padding: 0 var(--space-md);
  }
  .nav-links {
    gap: var(--space-md);
  }
  .nav-links a {
    font-size: var(--font-size-xs);
  }
  .nav-social svg {
    width: 16px;
    height: 16px;
  }
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  .section-title {
    font-size: var(--font-size-xl);
  }
  .category-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
  }
  :root {
    --font-size-hero: 2rem;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
    z-index: 999;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    font-size: var(--font-size-sm);
    padding: var(--space-sm) 0;
    width: 100%;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery {
    padding: 0 16px var(--space-2xl);
  }
  .section-header {
    padding: var(--space-lg) 16px var(--space-md);
  }
  .hero {
    padding: var(--space-lg) var(--space-md);
  }
  .hero-eyebrow {
    font-size: var(--font-size-sm);
    letter-spacing: 0.2em;
  }
  .category-cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
  :root {
    --font-size-hero: 1.5rem;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .artwork-card {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    opacity: 1;
    transform: none;
  }
  .artwork-card:hover {
    transform: none;
  }
  .hero-title.glitch {
    animation: none;
  }
}
