:root {
  /* DARK THEME DEFAULTS */
  --bg: #050505;
  --fg: #f5f5f5;
  --muted: #888888;
  --accent: #f5ff3b;              /* yellow – good on black */
  --accent-soft: rgba(245,255,59,0.12);
  --panel-bg: rgba(5,5,5,0.98);
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

/* FRAME */

.frame {
  min-height: 100vh;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* TOP BAR */

header[role="banner"] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hide-cursor {
  cursor: none !important;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  user-select: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(245,255,59,0.8);
  animation: ping 2.4s infinite ease-in-out;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  color: var(--fg);
  letter-spacing: 0.26em;
  font-size: 11px;
}

.brand-url {
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 9px;
  text-transform: lowercase;
}

.top-right {
  color: var(--muted);
  text-align: right;
}

/* CENTER TITLE */

main[role="main"] {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

h1.title {
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  text-align: center;
  position: relative;
  pointer-events: auto;
  cursor: default;
}

h1.title small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--muted);
  margin-top: 10px;
}

.subtitle {
  margin-top: 32px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  text-align: center;
  cursor: pointer;
}

/* GLITCH TEXT */

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.glitch::before {
  color: #ff3264;
}

.glitch::after {
  color: #3bf2ff;
}

.glitch.is-glitching::before {
  animation: glitch-before 0.4s steps(6, end);
}

.glitch.is-glitching::after {
  animation: glitch-after 0.4s steps(6, end);
}

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

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

/* BOTTOM INDEX / NAV */

footer[role="contentinfo"] {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint {
  opacity: 0.55;
}

nav[aria-label="Primary"] {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.index-label {
  font-size: 9px;
  opacity: 0.5;
}

.index-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.index-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  transition: 0.2s ease;
}

.index-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* PANELS */

.panel {
  position: fixed;
  inset: 0;
  background: var(--panel-bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.panel-inner {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-title {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.panel-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0 4px 12px;
  opacity: 0.7;
  transition: 0.2s ease;
}

.panel-close:hover {
  color: var(--accent);
  opacity: 1;
}

.panel-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#panel-works .panel-body,
#panel-artists .panel-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-column {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* ARTISTS LIST */

.artists-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 13px;
}

.artist-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 8px;
  cursor: pointer;
  transition: 0.15s ease;
}

.artist-item:hover {
  border-color: var(--accent);
}

.artist-name {
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.artist-note {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  max-width: 260px;
}

/* ARTIST PROFILE (WORKS PANEL) */

.artist-profile {
  display: none;          /* becomes flex when an artist is selected */
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.artist-profile-thumb {
  width: 256px;
  height: 256px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.artist-profile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-profile-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.artist-profile-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.artist-profile-location {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.artist-profile-bio {
  font-size: 11px;
  color: var(--muted);
  max-width: 420px;
}

/* WORKS LIST */

.works-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.work-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed rgba(255,255,255,0.12);
  padding-bottom: 6px;
  cursor: pointer;
  transition: 0.15s ease;
}

.work-item:hover {
  border-color: var(--accent);
}

.work-title {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
}

.work-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  max-width: 260px;
}

.works-filter-note {
  margin-top: 16px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.works-filter-note span {
  white-space: nowrap;
  cursor: pointer;
}

/* VIEWING PANEL */

.viewing-block {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.viewing-block a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.35);
  padding-bottom: 1px;
}

/* WORK MODAL / CAROUSEL */

.modal-spacer {
  flex: 1;
}

.work-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.86);
  display: flex;
  flex-direction: column;      
  overflow-y: auto;            
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 20;
}


.work-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.work-modal-inner {
  width: 100%;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #f5f5f5;
}

.work-modal-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b0b0b0;
}

.work-modal-close {
  border: none;
  background: transparent;
  color: #b0b0b0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding-left: 12px;
  transition: 0.2s ease;
}

.work-modal-close:hover {
  color: #ffffff;
}

.work-modal-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
}


.work-nav {
  border: none;
  background: transparent;
  color: #b0b0b0;
  font-size: 18px;
  cursor: pointer;
  padding: 8px 6px;
  transition: 0.2s ease;
}

.work-nav:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.work-image-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.work-image-wrap img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 4px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: none;
}

.work-caption-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.work-caption-meta {
  font-size: 11px;
  color: #b0b0b0;
}

.work-caption-desc {
  margin-top: 6px;
  font-size: 11px;
  color: #9f9f9f;
  line-height: 1.6;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* IMAGE INDICATOR (1/2) */

.work-image-indicator {
  position: absolute;
  bottom: 10px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.65);
  color: #f5f5f5;
  opacity: 0.9;
  display: none; /* only when >= 2 images */
}

/* MAGNIFIER LENS */

.magnifier-lens {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 12px rgba(0,0,0,0.7);
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 25;

  /* new: fade + slight zoom in */
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

/* when active */
.magnifier-lens.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* SCREEN GLITCH OVERLAY */

.screen-glitch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.18) 0px,
      rgba(255,255,255,0.18) 1px,
      transparent 1px,
      transparent 3px
    );
  z-index: 30;
}

.screen-glitch.is-on {
  animation: screen-glitch 0.35s steps(6, end);
}

@keyframes screen-glitch {
  0% { opacity: 0.9; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
  100% { opacity: 0; transform: translateY(0); }
}

/* SECRET TOAST */

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 8px 16px;
  background: rgba(0,0,0,0.82);
  color: #f5f5f5;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}

/* force left alignment for artwork descriptions */
#work-modal-desc,
.work-modal-desc,
.work-modal-body p {
  text-align: left !important;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* SMALL ANIMS */

@keyframes ping {
  0% { transform: scale(1); opacity: 0.7; }
  40% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 0.7; }
}

/* RESPONSIVE */

@media (max-width: 640px) {
  .frame {
    padding: 18px 14px;
  }
  .panel-inner {
    padding: 18px 14px;
  }
  .artist-item,
  .work-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .artist-note,
  .work-meta {
    text-align: left;
  }
  h1.title {
    letter-spacing: 0.26em;
  }
  .work-modal-inner {
    padding: 14px;
  }
  .work-modal-body {
    grid-template-columns: minmax(0,1fr);
  }
  .work-nav {
    display: none;  /* on mobile we hide arrows, use swipe */
  }

  .artist-profile {
    flex-direction: column;
    align-items: flex-start;
  }

  .artist-profile-thumb {
    width: 100%;
    max-width: 260px;
    height: auto;
  }

  .artist-profile-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .artist-profile-text {
    width: 100%;
  }

  .artist-profile-bio {
    max-width: 100%;
    line-height: 1.6;
  }

  .work-caption-desc {
    max-width: 100%;
  }

  .work-modal-body {
    align-items: flex-start;
  }

  /* mobile tweaks added */
  .panel-body {
    align-items: center;
  }

  /* DEFAULT = center works list vertically */
  #panel-works .panel-body {
    align-items: center;
  }

  /* When artist profile is visible → align works to top */
  #panel-works .artist-profile:not([style*="display: none"]) ~ .panel-body,
  #panel-works .artist-profile[style*="display: block"] ~ .panel-body,
  #panel-works .artist-profile[style*="flex"] ~ .panel-body {
    align-items: flex-start;
  }

}
