
/* ═══════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════ */
:root {
  --yellow: #f8d03a;
  --red:    #e83b3b;
  --blue:   #4965ff;
  --green:  #2a9d2a;
  --font-pixel:  'Tiny5', 'Courier New', monospace;
  --font-accent: 'Courier New', monospace;
  --font-body:   'Courier New', monospace;
  --t: 0.2s;
}

/* DARK (default) */
:root, [data-theme="dark"] {
  --bg:       #111111;
  --bg-alt:   #181818;
  --bg-card:  #1c1c1c;
  --fg:       #f0f0f0;
  --fg-muted: #888888;
  --border:   #2e2e2e;
  --border-hi:#555555;
  --accent-text: var(--yellow);
}

/* LIGHT */
[data-theme="light"] {
  --bg:       #f8f8f0;
  --bg-alt:   #ffffff;
  --bg-card:  #ffffff;
  --fg:       #111111;
  --fg-muted: #666666;
  --border:   #111111;
  --border-hi:#111111;
  --accent-text: var(--fg);
}

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 75px;
}

/* Offset for fixed nav on all anchor targets */
#who, #work, #noc, #chronicle, #feria, #mural, #proposal {
  scroll-margin-top: 70px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background var(--t), color var(--t);
}

a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
html, body { overflow-x: hidden; max-width: 100%; } /* prevent horizontal scroll bleed on mobile */

/* ═══════════════════════════════════════
   NAV
═══════════════════════════════════════ */
nav {
  position: fixed;
  top: calc(100vh - 60px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  height: 60px;
  border-top: 3px solid var(--yellow);
  border-bottom: 3px solid transparent;
  gap: 1rem;
  transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              border-top-color 0.35s ease,
              border-bottom-color 0.35s ease;
}

body.past-hero nav {
  top: 0;
  border-top-color: transparent;
  border-bottom-color: var(--yellow);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--yellow);
  flex-shrink: 0;
  position: absolute;
  left: 1.5rem;
}

.nav-logo img {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}

.nav-logo-text {
  display: none;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
}

nav ul a {
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 0.75rem;
  transition: color var(--t);
  white-space: nowrap;
}

nav ul a:hover { color: var(--yellow); }

/* ── Floating controls (theme + lang) ── */
.float-controls {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.float-btn {
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  border: 1.5px solid rgba(248, 208, 58, 0.4);
  background: rgba(17, 17, 17, 0.82);
  color: var(--yellow);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  font-family: var(--font-accent);
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--t), background var(--t);
  white-space: nowrap;
}

.float-btn:hover {
  border-color: var(--yellow);
  background: rgba(248, 208, 58, 0.1);
}

/* Nav always has dark background — keep text light in light mode */
[data-theme="light"] nav ul a { color: #f0f0f0; }
[data-theme="light"] nav ul a:hover { color: var(--yellow); }

[data-theme="light"] .float-btn {
  background: rgba(248, 248, 240, 0.88);
  color: #111;
  border-color: rgba(17, 17, 17, 0.3);
}

[data-theme="light"] .float-btn:hover {
  border-color: #111;
  background: rgba(17, 17, 17, 0.08);
}

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
#hero {
  min-height: 100vh;
  background: #0a0a0a;
  color: #f0f0f0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem 1.5rem;
  text-align: center;
  gap: 0;
}

.hero-bynounish {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  color: var(--fg-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.hero-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}

.hero-logo-float {
  animation: heroFloat 3.5s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-logo-img {
  width: clamp(180px, 40vw, 360px);
  height: auto;
  image-rendering: pixelated;
  display: block;
}

.hero-logo-reflection {
  animation: heroReflect 3.5s ease-in-out infinite;
}

@keyframes heroReflect {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(12px); }
}

.hero-logo-reflection .hero-logo-img {
  transform: scaleY(-1);
  opacity: 0.3;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 65%);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 65%);
  margin-top: 2px;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  line-height: 0.95;
  margin-bottom: 1.75rem;
  color: #fff;
}

.hero-title span:first-child { color: var(--yellow); }

.hero-sub {
  font-family: var(--font-accent);
  font-size: 0.88rem;
  color: var(--fg-muted);
  max-width: 500px;
  margin: 0.5rem auto 1.75rem;
  line-height: 1.7;
  text-align: center;
}

.hero-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-btn {
  background: none;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-family: var(--font-accent);
  font-size: 0.82rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.6rem 1.1rem;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}

.hero-btn:hover { background: var(--yellow); color: #000 !important; text-decoration: none; }

/* ═══════════════════════════════════════
   DIVIDER
═══════════════════════════════════════ */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

.divider span {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--fg-muted);
  font-weight: bold;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   SECTION WRAPPER
═══════════════════════════════════════ */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem;
  overflow-x: hidden;
}

.section-label {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: bold;
  margin-bottom: 0.75rem;
}

h2 {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  font-weight: normal;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--fg);
}

h3 {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  font-weight: normal;
  margin-bottom: 0.4rem;
}

/* ═══════════════════════════════════════
   CARD SYSTEM — shared
═══════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  overflow: hidden;
}

.card-label {
  background: var(--bg-card);
  color: var(--yellow);
  font-family: var(--font-accent);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.65rem 1rem;
  border-bottom: 2px solid var(--border);
}

.card-body { padding: 1.25rem; }

/* ═══════════════════════════════════════
   STATS
═══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 3px solid var(--border);
  margin-top: 2rem;
}

.stat-cell {
  background: var(--bg-card);
  padding: 1.75rem 1rem;
  text-align: center;
}

.stat-num {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  color: var(--accent-text);
  line-height: 1;
  display: block;
}

.stat-lbl {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
  display: block;
  line-height: 1.8;
}


/* ═══════════════════════════════════════
   WHO — HEADER BAR
═══════════════════════════════════════ */
#who-header {
  background: var(--yellow);
  border-top: 6px solid #111;
  border-bottom: 6px solid #111;
  padding: 2.5rem 0;
}

.who-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.who-header-inner > img {
  width: 100px;
  height: 100px;
  image-rendering: pixelated;
  flex-shrink: 0;
  border: 3px solid #111;
}

.who-header-text .section-label { color: rgba(0,0,0,0.4); }

.who-header-text h2 {
  color: #111;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.2rem;
}

.who-header-text p {
  font-size: 0.9rem;
  color: #444;
  font-family: var(--font-body);
}

/* ═══════════════════════════════════════
   WHO — BODY GRID
═══════════════════════════════════════ */
.who-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.who-intro {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.who-residency-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.who-residency-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 0.25rem;
}

.who-residency-divider::before,
.who-residency-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

.who-residency-divider span {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--fg-muted);
  font-weight: bold;
  white-space: nowrap;
}

.who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ── Resident tabbed card ── */
.resident-card {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.resident-card-header {
  padding: 0.55rem 1.1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.resident-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.resident-tab-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s, border-color 0.15s;
}
.resident-tab-btn:hover { color: var(--fg); }
.resident-tab-btn.active { color: var(--accent-text); border-bottom-color: var(--yellow); }
.resident-tab-panel { display: none; padding: 1.25rem; }
.resident-tab-panel.active { display: block; }

/* ── Accordion ── */
.acc-trigger {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.15s;
}
.acc-trigger:hover { color: var(--fg); }
.acc-trigger.open { color: var(--accent-text); }
.acc-arrow {
  font-size: 0.55rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
  opacity: 0.6;
  transition: transform 0.28s ease, opacity 0.15s;
}
.acc-trigger.open .acc-arrow { transform: rotate(90deg); opacity: 1; }
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.acc-body.open { grid-template-rows: 1fr; }
.acc-body-inner { overflow: hidden; }
.acc-subtitle {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.5;
}
/* Resident accordion item overrides */
.res-acc-item {
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
}
.res-acc-item:last-child { border-bottom: none !important; }
.res-acc-item .card-label { border-bottom: none; }
.res-acc-item .acc-body.open { border-top: 1px solid var(--border); }
.acc-pinned { cursor: default !important; }
.acc-pinned:hover { color: var(--yellow) !important; }

/* ── Bio card ── */
.who-bio {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--bg-card);
  border: 3px solid var(--border);
  overflow: hidden;
}

.who-portrait {
  background: var(--bg-alt);
  border-right: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  overflow: hidden;
}

.portrait-widget {
  width: 100%;
  transition: transform 0.1s ease-out;
  transform-origin: center 90%;
  will-change: transform;
  cursor: grab;
  user-select: none;
}
.portrait-widget:active {
  cursor: grabbing;
}

.portrait-widget img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.who-bio-right {
  display: flex;
  flex-direction: column;
}

.bio-text {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.bio-text strong { color: var(--fg); }
.bio-text a { font-weight: bold; }

.bio-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--border);
}

.bio-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.bio-stat-n {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--accent-text);
  line-height: 1;
}

.bio-stat-l {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.8;
}

/* ── WHO generic card ── */
.who-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Props card ── */
.who-props { grid-column: 1 / -1; }

.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.trait {
  border: 3px solid var(--border);
  background: var(--bg-alt);
  text-align: center;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s, border-color 0.2s, opacity 0.2s;
}

.trait:hover {
  transform: scale(1.1);
  box-shadow: 4px 4px 0 var(--border);
  filter: none !important;
  opacity: 1 !important;
}

.trait--canceled { filter: grayscale(100%); opacity: 0.6; border-color: var(--border-hi); }
.trait--defeated { border-color: var(--red); }
.trait--executed { border-color: var(--green); }

.trait-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #222;
  overflow: hidden;
}

[data-theme="light"] .trait-img { background: #e0e0e0; }

.trait-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.trait-info {
  padding: 0.35rem 0.4rem;
  font-size: 0.6rem;
  border-top: 2px solid var(--border);
  background: var(--bg-card);
}

.trait--defeated .trait-info { border-top-color: var(--red); }
.trait--executed .trait-info { border-top-color: var(--green); }

.trait-name { font-weight: bold; color: var(--fg); display: block; line-height: 1.3; }
.trait-prop { color: var(--fg-muted); display: block; }
.trait-status { display: block; }
.trait--defeated .trait-status { color: var(--red); }
.trait--canceled .trait-status { color: var(--fg-muted); }
.trait--executed .trait-status { color: var(--green); font-weight: bold; }

/* ── Noundry big num ── */
.noundry-num {
  font-family: var(--font-pixel);
  font-size: 4rem;
  color: var(--accent-text);
  line-height: 1;
}

/* ── WHO cards: consistent two-column split (visual left, text right) ── */
.card-split {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.card-split-img {
  width: 160px;
  height: 160px;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.card-split-img img,
.card-split-img svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ═══════════════════════════════════════
   WORK / PORTFOLIO
═══════════════════════════════════════ */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.artwork-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.artwork-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--border);
}

.artwork-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.artwork-img img,
.artwork-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.ph-icon {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: var(--border-hi);
}

.artwork-caption {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  border-top: 2px solid var(--border);
  color: var(--fg-muted);
}

/* ═══════════════════════════════════════
   NOC VIEWER
═══════════════════════════════════════ */
/* ── NOC viewer ─────────────────────────────────────────── */
.noc-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 0.5rem;
}
.noc-section-header h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--yellow);
  margin: 0;
  letter-spacing: 0.04em;
}
.noc-section-header .noc-count-badge {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--bg);
  background: var(--yellow);
  padding: 1px 6px 2px;
  line-height: 1.4;
}
.noc-section-desc {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0 0 1.25rem;
}

.noc-viewer {
  display: flex;
  gap: 2rem;
  align-items: start;
  max-height: 650px;
}

.noc-thumb-col {
  flex-shrink: 0;
}

.noc-scroll-shell {
  position: relative;
}

.noc-thumb-scroll {
  max-height: 620px;
  overflow-y: scroll;
  overflow-x: clip;
  scrollbar-width: none;
}
.noc-thumb-scroll::-webkit-scrollbar { display: none; }

.noc-scroll-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--yellow);
  font-size: 0.55rem;
  line-height: 1;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.noc-scroll-arrow.visible { opacity: 1; pointer-events: auto; }
.noc-scroll-arrow-up  { top: 2px; }
.noc-scroll-arrow-down { bottom: 2px; }

.noc-thumb-hint {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--fg-muted);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.noc-thumb-grid {
  display: grid;
  grid-template-columns: repeat(8, 64px);
  gap: 3px;
  padding: 6px 4px;
}

.noc-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: block;
  position: relative;
  transition: transform 0.12s;
  outline: none;
}

.noc-thumb:hover {
  transform: scale(1.18);
  z-index: 2;
  outline: 1px solid var(--yellow);
  outline-offset: 1px;
}

.noc-thumb.active {
  transform: scale(1.18);
  z-index: 3;
  outline: 2px solid var(--yellow);
  outline-offset: 1px;
}

.noc-thumb.noc-clicked {
  animation: nocPop 0.18s ease forwards;
}

.noc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  image-rendering: pixelated;
}

.noc-preview-panel {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* fixed 500×540 frame — nothing shifts */
.noc-preview-frame {
  width: 500px;
  height: 540px;
  position: relative;
  outline: none;
  background: transparent;
  overflow: hidden;
}

/* idle: RGB logo centered, fades out when GIF loads */
.noc-preview-idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s;
  pointer-events: none;
}

.noc-preview-idle.hidden {
  opacity: 0;
}

.noc-preview-gif-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.25s;
  display: block;
}

.noc-preview-gif-img.visible {
  opacity: 1;
}

.noc-preview-label {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--yellow);
  margin: 0;
  background: var(--bg);
  padding: 2px 6px;
  border-left: 3px solid var(--yellow);
  letter-spacing: 0.06em;
  min-height: 1.4em;
}

@keyframes nocPop {
  0%   { transform: scale(1.3); }
  40%  { transform: scale(1.05); }
  100% { transform: scale(1.18); }
}

@media (max-width: 1100px) {
  .noc-viewer { gap: 1rem; }
  .noc-thumb-grid { grid-template-columns: repeat(2, 56px); }
  .noc-thumb { width: 56px; height: 56px; }
  .noc-thumb-scroll { max-height: 590px; }
  .noc-preview-panel { position: static; flex: 1; min-width: 0; }
  .noc-preview-frame { width: 100%; height: 420px; }
}

@media (max-width: 480px) {
  .noc-viewer { flex-direction: column; max-height: none; gap: 0.35rem; }
  /* Thumbnails first (above the GIF), preview panel second */
  .noc-thumb-col { order: 1; width: 100%; }
  .noc-preview-panel { order: 2; width: 100%; gap: 0.2rem; }
  .noc-preview-frame { width: 100%; height: min(90vw, 320px); }
  .noc-scroll-shell { width: 100%; }
  /* 2-row horizontal grid: fills row 1 then row 2, then adds columns */
  .noc-thumb-scroll { max-height: none; overflow-x: auto; overflow-y: hidden; cursor: grab; }
  .noc-thumb-scroll:active { cursor: grabbing; }
  .noc-thumb-grid {
    grid-template-rows: repeat(2, 44px);
    grid-auto-flow: column;
    grid-auto-columns: 44px;
    grid-template-columns: unset;
    gap: 3px;
  }
  .noc-thumb { width: 44px; height: 44px; }
  .noc-scroll-arrow { display: none; }
}

/* ═══════════════════════════════════════
   CONTRIBUTIONS
═══════════════════════════════════════ */
.contrib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.contrib-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.contrib-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--border);
}

.contrib-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--border);
  overflow: hidden;
}

.contrib-img img { width: 100%; height: 100%; object-fit: cover; }

.contrib-body { padding: 0.75rem; }

.contrib-name {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--fg);
  display: block;
  margin-bottom: 0.25rem;
}

.contrib-desc { font-size: 0.78rem; color: var(--fg-muted); }

/* ═══════════════════════════════════════
   FERIA
═══════════════════════════════════════ */
#feria {
  padding: 2rem 2rem;
}

#feria .inner { max-width: 1100px; margin: 0 auto; }

.feria-tabs {
  display: flex;
  border: 3px solid var(--border-hi);
  width: fit-content;
  margin: 1.5rem 0 1rem;
}

.feria-tab {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-accent);
  font-size: 0.78rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  border-right: 2px solid var(--border-hi);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.feria-tab:last-child { border-right: none; }
.feria-tab.active { background: var(--yellow); color: #111; }

.feria-panel { display: none; }
.feria-panel.active { display: block; }

.feria-ig-btn {
  display: inline-block;
  background: var(--yellow);
  color: #111;
  border: 2px solid var(--yellow);
  font-family: var(--font-accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.55rem 1.1rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1.25rem;
}

.feria-ig-btn:hover { background: #dab82e; text-decoration: none; }

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.sticker-card {
  background: #fff;
  border: 3px solid #111;
  overflow: hidden;
  text-align: center;
  transition: transform var(--t), box-shadow var(--t);
}

.sticker-card:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 #111; }

.sticker-img {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sticker-img img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.sticker-ph { font-family: var(--font-pixel); font-size: 1rem; color: #ccc; }

.sticker-artist {
  padding: 0.4rem 0.5rem;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  letter-spacing: 1px;
  border-top: 2px solid #111;
  color: #111;
}

.artist-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.artist-tag {
  font-family: var(--font-accent);
  font-size: 0.7rem;
  letter-spacing: 1px;
  padding: 0.3rem 0.65rem;
  background: var(--bg-card);
  border: 2px solid var(--border-hi);
  color: var(--fg);
}

/* ═══════════════════════════════════════
   MURAL
═══════════════════════════════════════ */
.mural-intro {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 2rem;
  margin-top: 1.5rem;
  align-items: start;
}

.mural-meta-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 3px solid var(--border);
}

.mural-stat {
  background: var(--bg-card);
  padding: 1rem;
  text-align: center;
}

.mural-stat-n {
  display: block;
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--yellow);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.mural-stat-l {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-muted);
}

.mural-collab {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--yellow);
  background: var(--bg-alt);
}

/* ═══════════════════════════════════════
   LANGUAGE TOGGLE
═══════════════════════════════════════ */
.t-es { display: none; }
[data-lang="es"] .t-en { display: none; }
[data-lang="es"] .t-es { display: revert; }

/* ═══════════════════════════════════════
   CHRONICLE / HORIZONTAL TIMELINE
═══════════════════════════════════════ */

/* Intro text */
.ch-intro {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* Horizontal timeline UI */
.ch-timeline-ui {
  margin-top: 2rem;
}

.ch-rail-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow) transparent;
}
.ch-rail-scroll::-webkit-scrollbar { height: 4px; }
.ch-rail-scroll::-webkit-scrollbar-thumb { background: var(--yellow); border-radius: 2px; }

.ch-rail {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding: 0.5rem 0 1.25rem;
  min-width: max-content;
  gap: 0;
}

/* Horizontal yellow connecting line */
.ch-rail::before {
  content: '';
  position: absolute;
  left: 7px;
  right: 7px;
  top: 13px;
  height: 4px;
  background: var(--yellow);
}

/* Each dot + label */
.ch-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  min-width: 80px;
  padding: 0 0.35rem;
  position: relative;
  z-index: 1;
  transition: opacity 0.15s;
}
.ch-dot-wrap:hover { opacity: 0.85; }

.ch-dot {
  width: 14px;
  height: 14px;
  background: var(--bg);
  border: 3px solid var(--yellow);
  outline: 2px solid var(--yellow);
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}
.ch-dot-wrap:hover .ch-dot {
  background: color-mix(in srgb, var(--yellow) 60%, transparent);
  transform: scale(1.18);
}

.ch-dot-date {
  font-family: var(--font-accent);
  font-size: 0.56rem;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
  transition: opacity 0.2s, height 0.2s;
}

/* ── Card stack area ── */
.ch-card-area {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Prev/next slots: only show card-head (mini, no border, faded) */
.ch-slot--empty { display: none; }

.ch-slot--prev,
.ch-slot--next {
  opacity: 0.38;
  transform: scale(0.94);
  transform-origin: bottom center;
  filter: blur(0.4px);
  cursor: pointer;
  transition: opacity 0.2s;
  pointer-events: auto;
}
.ch-slot--next { transform-origin: top center; }
.ch-slot--prev:hover,
.ch-slot--next:hover { opacity: 0.65; }

/* Hide body in prev/next mini cards */
.ch-slot--prev .ch-card-body,
.ch-slot--next .ch-card-body { display: none; }

/* Current slot: full card */
.ch-slot--current {
  transition: none;
}

.ch-open-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  overflow: hidden;
}
.ch-slot--current .ch-open-card {
  border-color: var(--yellow);
  animation: ch-slide-in 0.2s ease;
}
.ch-slot--prev .ch-open-card,
.ch-slot--next .ch-open-card {
  border-color: transparent;
  background: transparent;
}

/* Date shown at top of selected card */
.ch-open-date {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--yellow);
  letter-spacing: 1px;
  padding: 0.5rem 1rem 0;
}

/* Mini date in prev/next */
.ch-mini-date {
  font-family: var(--font-accent);
  font-size: 0.6rem;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
  padding: 0.3rem 0.75rem 0;
  display: block;
}

/* Tag row in selected card */
.ch-open-tag-row {
  padding: 0.25rem 1rem 0;
}

/* Active dot state */
.ch-dot-wrap.is-active .ch-dot {
  background: var(--yellow);
  transform: scale(1.35);
}
.ch-dot-wrap.is-active .ch-dot-date {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}
/* Triangle indicator below active dot */
.ch-dot-wrap.is-active::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--yellow);
  margin: 2px auto 0;
}

@keyframes ch-slide-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Keep the old .chronicle hidden (JS sets display:none, this is fallback) */
.chronicle {
  position: relative;
  margin-top: 2.5rem;
  padding-left: 3rem;
}

.ch-entry {
  position: relative;
  margin-bottom: 2.5rem;
}

/* Yellow square bullet (only visible in fallback vertical view) */
.ch-entry::before {
  content: '';
  position: absolute;
  left: -2.25rem;
  top: 0.45rem;
  width: 14px;
  height: 14px;
  background: var(--yellow);
  border: 3px solid var(--bg);
  outline: 2px solid var(--yellow);
}

.ch-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.ch-date {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: 1px;
  font-weight: bold;
}

.ch-tag {
  font-family: var(--font-accent);
  font-size: 0.62rem;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ch-tag--milestone { background: var(--yellow); color: #111; }
.ch-tag--event     { background: var(--blue);   color: #fff; }
.ch-tag--artwork   { background: var(--green);  color: #fff; }

.ch-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  overflow: hidden;
  transition: border-color var(--t);
}

.ch-card-head {
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ch-card-head h3 { margin: 0; flex: 1; font-family: var(--font-accent); font-size: 0.9rem; font-weight: bold; }

.ch-card-head::after {
  content: '⌐◨-◨';
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--fg-muted);
  opacity: 0.35;
  flex-shrink: 0;
  line-height: 1.2;
}

.ch-card-body { padding: 0.75rem 1rem; }

.ch-desc {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* Photo grid inside chronicle */
.ch-photos {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.ch-photo {
  width: 120px;
  height: 90px;
  border: 2px solid var(--border);
  background: var(--bg-alt);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--t);
  cursor: zoom-in;
}

.ch-photo:hover { opacity: 0.85; }


.ch-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ch-photo-ph { font-size: 1.2rem; color: var(--border-hi); }

/* ═══════════════════════════════════════
   PROPOSAL
═══════════════════════════════════════ */
#proposal {
  background: #0a0a0a;
  color: #f0f0f0;
  text-align: center;
  padding: 5rem 2rem;
}

#proposal h2 {
  color: var(--yellow);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}

#proposal > p {
  max-width: 560px;
  margin: 0 auto 2rem;
  color: #999;
  font-size: 0.95rem;
}

.prop-pills {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.prop-pill {
  border: 2px solid var(--yellow);
  color: var(--yellow);
  padding: 0.45rem 1rem;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.btn {
  display: inline-block;
  background: var(--yellow);
  color: #111;
  font-family: var(--font-accent);
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding: 0.8rem 2rem;
  text-decoration: none;
  border: 3px solid var(--yellow);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.btn:hover { background: transparent; color: var(--yellow); }


/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
  background: #0a0a0a;
  color: #666;
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  border-top: 3px solid #1e1e1e;
}

footer span { color: var(--yellow); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 700px) {
  nav ul a { font-size: 0.72rem; padding: 0.5rem; }
  .who-grid { grid-template-columns: 1fr; }
  .who-bio  { grid-column: 1; grid-template-columns: 1fr; }
  .who-portrait {
    border-right: none;
    border-bottom: 3px solid var(--border);
    min-height: 0;
    max-height: 200px;
  }
  .portrait-widget {
    max-width: 160px;
  }
  .traits-grid { grid-template-columns: repeat(3, 1fr); }
  .who-header-inner { flex-direction: column; gap: 1rem; }
  .chronicle { padding-left: 2rem; }
  .bio-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 0.5rem; justify-items: center; }
  .who-residency-body { grid-template-columns: 1fr; gap: 1rem; }
  .mural-intro { grid-template-columns: 1fr; }
  .mural-meta-box { grid-template-columns: repeat(3, 1fr); }
  .hero-bynounish { font-size: 0.75rem; letter-spacing: 2px; }
  .hero-ctas { flex-direction: column; align-items: center; }
  /* Card split: stack vertically on mobile */
  .card-split {
    grid-template-columns: 1fr;
  }
  .card-split-img {
    width: 120px;
    height: 120px;
    margin: 0 auto;
  }
  .who-body { padding: 1.5rem 1rem; }
  .section { padding: 1.25rem 1rem; }
  #feria { padding: 1.25rem 1rem; }
  .artist-list { justify-content: center; }
}

@media (max-width: 480px) {
  nav { padding: 0 0.5rem; gap: 0; justify-content: center; }
  .nav-logo { display: none; }
  nav ul { flex-wrap: nowrap; gap: 0; justify-content: center; width: 100%; }
  nav ul a { font-size: 0.68rem; padding: 0.35rem 0.6rem; }
  nav ul li:has(a[href="#feria"]),
  nav ul li:has(a[href="#mural"]) { display: none; }
  .who-grid { grid-template-columns: 1fr; }
  .hero-logo-img { width: clamp(140px, 70vw, 240px); }
  .card-split-img { width: 100px; height: 100px; }
  .noundry-num { font-size: 2.5rem; }
  .ch-photos { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .ch-photo { width: 88px; height: 66px; flex-shrink: 0; }
}

/* ═══════════════════════════════════════
   DYNAMIC GALLERIES
═══════════════════════════════════════ */
.dyn-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  margin-top: 1rem;
}

.dyn-gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  cursor: default;
}

.dyn-gallery-item img,
.dyn-gallery-item video {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}

.dyn-gallery-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.78);
  color: var(--yellow);
  font-family: var(--font-accent);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 6px;
  opacity: 0;
  transition: opacity 0.18s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dyn-gallery-item:hover .dyn-gallery-label {
  opacity: 1;
}

@media (max-width: 600px) {
  .dyn-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .dyn-gallery-item img,
  .dyn-gallery-item video {
    height: 120px;
  }
}

/* ── Gallery context note ─────────────────────────────────── */
.gallery-context-note {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.gallery-context-note p {
  font-size: 0.83rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin: 0;
}

/* ── Masonry gallery ──────────────────────────────────────── */
.masonry-wrap {
  max-height: 600px;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
  margin-top: 1rem;
  overscroll-behavior: contain;
}
.masonry-wrap::-webkit-scrollbar { display: none; }

.masonry-gallery {
  columns: 5;
  column-gap: 4px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

.masonry-item img,
.masonry-item video {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
  transition: opacity 0.15s;
}

.masonry-item:hover img,
.masonry-item:hover video {
  opacity: 0.85;
}

.masonry-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  color: var(--yellow);
  font-family: var(--font-accent);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 6px;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masonry-item:hover .masonry-label { opacity: 1; }

@media (max-width: 900px) { .masonry-gallery { columns: 4; } }
@media (max-width: 600px) {
  .masonry-gallery { columns: 4; }
  .masonry-wrap { max-height: 460px; margin-left: 2rem; margin-right: 2rem; }
}
@media (max-width: 400px) {
  .masonry-gallery { columns: 3; }
  .masonry-wrap { margin-left: 1.75rem; margin-right: 1.75rem; }
}

/* ── Lightbox ─────────────────────────────────────────────── */
#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#lb-overlay.active { display: flex; }

#lb-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lb-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
#lb-close:hover { opacity: 1; }

#lb-media img,
#lb-media video {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
  image-rendering: auto;
}

#lb-prev, #lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.1rem;
  padding: 0.9rem 0.65rem;
  cursor: pointer;
  z-index: 10001;
  opacity: 0.7;
  transition: opacity 0.12s, color 0.12s;
  line-height: 1;
}
#lb-prev:hover, #lb-next:hover { opacity: 1; color: var(--yellow); }
#lb-prev { left: 0; }
#lb-next { right: 0; }

/* ── Gallery view toggle ── */
.gv-toggle {
  display: flex;
  gap: 3px;
  margin: 0.6rem 0 0;
}
.gv-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.gv-btn:hover { color: var(--fg); border-color: var(--border-hi); }
.gv-btn--active { color: var(--yellow); border-color: var(--yellow); }

/* ── TV channel view ── */
.tv-view { margin-top: 0.75rem; }

.tv-screen {
  position: relative;
  background: #000;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(72vh, 680px);
  overflow: hidden;
}

.tv-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-media img,
.tv-media video {
  max-width: calc(100% - 5rem);
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

@media (max-width: 600px) {
  .tv-screen { height: 360px; }
}

.tv-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0,0,0,0.35);
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  padding: 0 0.6rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  z-index: 2;
}
.tv-nav:hover { background: rgba(0,0,0,0.65); color: var(--yellow); }
.tv-nav--prev { left: 0; }
.tv-nav--next { right: 0; }

.tv-counter {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-align: center;
  padding: 0.35rem 0;
  letter-spacing: 1px;
}


/* ═══════════════════════════════════════
   GALLERY HUB — selector cards
═══════════════════════════════════════ */
.gallery-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.ghub-card {
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ghub-card:hover {
  border-color: var(--yellow);
  transform: translateY(-2px);
}

.ghub-preview-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  border-radius: 3px;
  overflow: hidden;
}
.ghub-preview-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.ghub-name {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  color: var(--yellow);
  line-height: 1.3;
}
.ghub-meta {
  font-size: 0.72rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
.ghub-open-hint {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  color: var(--fg-muted);
  margin-top: auto;
  opacity: 0.7;
}
.ghub-card:hover .ghub-open-hint {
  color: var(--yellow);
  opacity: 1;
}

/* ═══════════════════════════════════════
   GALLERY HUB — ACTIVE STATE + BADGE
═══════════════════════════════════════ */
.ghub-card.active {
  border-color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 8%, var(--bg-alt));
}
.ghub-card.active .ghub-open-hint {
  color: var(--yellow);
  opacity: 1;
}

.ghub-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.ghub-count-badge {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  color: var(--bg);
  background: var(--yellow);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   INLINE GALLERY PANELS
═══════════════════════════════════════ */
.inline-gallery {
  margin-top: 1.5rem;
  border-top: 2px solid var(--yellow);
  padding-top: 1.5rem;
  overflow-x: hidden;
}

/* ── Gallery ✕ close button — inline with title, mobile only ── */
.gallery-close-x {
  display: none;
  background: none;
  border: none;
  color: var(--yellow);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  padding: 0 0.1rem;
  flex-shrink: 0;
}
.gallery-close-x:hover { opacity: 0.7; }
@media (max-width: 600px) {
  .gallery-close-x { display: block; }
  .inline-gallery { min-height: 0; }
}

/* NOC viewer inside inline panel: nowrap on desktop so preview stays right */
.inline-gallery .noc-viewer {
  max-height: none;
  flex-wrap: nowrap;
}
.inline-gallery .noc-preview-panel {
  position: sticky;
  top: 0;
  flex: 1;       /* grow to fill remaining width after thumb col */
  min-width: 0;
}
.inline-gallery .noc-preview-frame {
  width: 100%;   /* now resolves correctly against the panel's explicit flex width */
  height: 620px;
}
  height: 620px; /* match noc-thumb-scroll max-height */
}
/* Gallery description text: full width, no constraint */
.gallery-desc {
  max-width: none;
}

/* ── Consistent action button for chronicle / card links ── */
.link-btn {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  text-decoration: none;
  letter-spacing: 1px;
  transition: background var(--t), color var(--t);
}
.link-btn:hover { background: var(--yellow); color: #000 !important; text-decoration: none; }

@media (max-width: 700px) {
  .inline-gallery {
    max-height: none; /* mobile: let it flow naturally */
    overflow-y: visible;
    overflow-x: hidden;
  }
  .inline-gallery .noc-viewer { flex-wrap: wrap; gap: 0.35rem; }
}
@media (max-width: 600px) {
  .gallery-hub {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  .ghub-card { padding: 0.4rem; gap: 0.3rem; }
  .ghub-preview-row { gap: 2px; grid-template-columns: repeat(2, 1fr); }
  .ghub-preview-row img:nth-child(n+3) { display: none; }
  .ghub-name { font-size: 0.58rem; }
  .ghub-meta { display: none; }
  .ghub-open-hint { font-size: 0.52rem; }
}

/* ── Footer links (moved from hero) ── */
.footer-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}
