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

body {
  background: #0d0d0d;
  color: #cccccc;
  font-family: 'Consolas', 'Cascadia Mono', monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Full-page ambient background glow — LED grid lighting the room */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* Primary cursor-linked blob */
    radial-gradient(
      ellipse 70% 80% at var(--bg-x, 65%) var(--bg-y, 50%),
      hsla(var(--bg-hue1, 260), 90%, 28%, 0.6) 0%,
      hsla(var(--bg-hue1, 260), 85%, 16%, 0.25) 40%,
      transparent 75%
    ),
    /* Secondary mirrored blob */
    radial-gradient(
      ellipse 60% 70% at var(--bg-x2, 35%) var(--bg-y2, 50%),
      hsla(var(--bg-hue2, 290), 85%, 24%, 0.5) 0%,
      hsla(var(--bg-hue2, 290), 80%, 14%, 0.2) 40%,
      transparent 70%
    ),
    /* Bounce light A — top-left corner orbit */
    radial-gradient(
      ellipse 50% 55% at var(--bounce-ax, 15%) var(--bounce-ay, 20%),
      hsla(var(--bg-hue1, 260), 75%, 22%, 0.45) 0%,
      hsla(var(--bg-hue1, 260), 65%, 12%, 0.15) 50%,
      transparent 80%
    ),
    /* Bounce light B — bottom-right corner orbit */
    radial-gradient(
      ellipse 50% 55% at var(--bounce-bx, 85%) var(--bounce-by, 80%),
      hsla(var(--bg-hue2, 290), 75%, 20%, 0.4) 0%,
      hsla(var(--bg-hue2, 290), 65%, 12%, 0.15) 50%,
      transparent 80%
    ),
    /* Bounce light C — left edge wander */
    radial-gradient(
      ellipse 45% 60% at var(--bounce-cx, 10%) var(--bounce-cy, 60%),
      hsla(var(--bg-hue3, 250), 70%, 18%, 0.4) 0%,
      hsla(var(--bg-hue3, 250), 60%, 10%, 0.12) 50%,
      transparent 75%
    ),
    /* Bounce light D — right edge wander */
    radial-gradient(
      ellipse 45% 60% at var(--bounce-dx, 90%) var(--bounce-dy, 30%),
      hsla(var(--bg-hue1, 260), 70%, 18%, 0.35) 0%,
      hsla(var(--bg-hue1, 260), 60%, 10%, 0.1) 50%,
      transparent 75%
    ),
    /* Corner anchor — top-left */
    radial-gradient(
      ellipse 55% 55% at var(--corner-tlx, 5%) var(--corner-tly, 8%),
      hsla(var(--bg-hue2, 290), 65%, 16%, 0.35) 0%,
      transparent 70%
    ),
    /* Corner anchor — top-right */
    radial-gradient(
      ellipse 55% 55% at var(--corner-trx, 95%) var(--corner-try, 8%),
      hsla(var(--bg-hue3, 250), 65%, 16%, 0.3) 0%,
      transparent 70%
    ),
    /* Corner anchor — bottom-left */
    radial-gradient(
      ellipse 55% 55% at var(--corner-blx, 5%) var(--corner-bly, 92%),
      hsla(var(--bg-hue1, 260), 65%, 14%, 0.3) 0%,
      transparent 70%
    ),
    /* Corner anchor — bottom-right */
    radial-gradient(
      ellipse 55% 55% at var(--corner-brx, 95%) var(--corner-bry, 92%),
      hsla(var(--bg-hue2, 290), 65%, 14%, 0.28) 0%,
      transparent 70%
    ),
    /* Ambient wash — fills the entire room */
    radial-gradient(
      ellipse 120% 120% at 55% 50%,
      hsla(var(--bg-hue3, 250), 70%, 14%, 0.55) 0%,
      hsla(var(--bg-hue3, 250), 60%, 8%, 0.35) 40%,
      hsla(var(--bg-hue3, 250), 50%, 5%, 0.2) 70%,
      hsla(var(--bg-hue3, 250), 40%, 3%, 0.1) 100%
    );
}

/* Two-column layout */
.site-layout {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Left panel — preview area */
.preview-panel {
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 48px 40px;
}

.preview-image {
  max-width: 708px;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.6s ease 0.15s;
}

.preview-image.hidden {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.preview-image img {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 63vh;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.preview-image img.active {
  opacity: 1;
}

.preview-title {
  position: absolute;
  bottom: clamp(32px, 7.1vh, 64px);
  left: 0;
  right: 0;
  color: #fff;
  font-size: clamp(11px, 1.25vw, 18px);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-date {
  position: absolute;
  bottom: clamp(14px, 3.1vh, 28px);
  left: 0;
  right: 0;
  color: #fff;
  font-size: clamp(9px, 0.97vw, 14px);
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-dimensions {
  position: absolute;
  bottom: clamp(22px, 4.9vh, 44px);
  left: 0;
  right: 0;
  color: #fff;
  font-size: clamp(8px, 0.83vw, 12px);
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-title.visible,
.preview-date.visible,
.preview-dimensions.visible {
  opacity: 1;
}

/* Artist name — visible h1 for SEO, subtle for design */
.artist-name {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 50;
  padding: 16px 40px 16px 60px;
  color: #000;
  font-size: clamp(9px, 0.97vw, 14px);
  font-family: 'Consolas', 'Cascadia Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Noscript fallback for crawlers */
.noscript-fallback {
  padding: 40px;
  color: #fff;
  font-family: 'Consolas', 'Cascadia Mono', monospace;
  font-size: 14px;
  line-height: 1.8;
}

.noscript-fallback img {
  max-width: 400px;
  display: block;
  margin: 16px 0;
  border-radius: 4px;
}

/* Show link — fixed top-left with large hover zone */
.show-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  padding: 16px 40px 6px 40px;
  color: #fff;
  font-size: clamp(9px, 0.97vw, 14px);
  font-family: 'Consolas', 'Cascadia Mono', monospace;
  text-decoration: none;
  transition: color 0.2s ease;
}

.show-link:hover {
  color: #ddd;
}

/* Email link — fixed top-left, below show link */
.email-link {
  position: fixed;
  top: 38px;
  left: 0;
  z-index: 50;
  padding: 4px 40px 6px 40px;
  color: #fff;
  font-size: clamp(9px, 0.97vw, 14px);
  font-family: 'Consolas', 'Cascadia Mono', monospace;
  text-decoration: none;
  transition: color 0.2s ease;
}

.email-link:hover {
  color: #ddd;
}

/* Right panel — 3D scene with grid */
.scene {
  width: 55%;
  perspective: 900px;
  perspective-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.board-grid {
  overflow: visible;
}

/* LED hit area */
.led-hit {
  cursor: pointer;
}

/* LED circles */
.led {
  pointer-events: none;
}

/* LED hot-core overlay */
.led-core {
  mix-blend-mode: screen;
  pointer-events: none;
}

/* LED glow circles */
.led-glow {
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ── Detail view (click overlay) ── */
.detail-view {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.15);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.detail-view.active {
  opacity: 1;
  pointer-events: all;
}

.detail-content {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  align-items: stretch;
}

/* Detail left — 45% to match preview panel */
.detail-left {
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 48px 20px;
}

.detail-video {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
}

.detail-video::before {
  content: "";
  position: absolute;
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: #888;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-video iframe {
  border: none;
  border-radius: 4px;
  position: relative;
  pointer-events: none;
}

.detail-meta {
  display: contents;
}

.detail-title {
  position: absolute;
  bottom: clamp(32px, 7.1vh, 64px);
  left: 0;
  right: 0;
  color: #fff;
  font-size: clamp(11px, 1.25vw, 18px);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-align: center;
}

.detail-date {
  position: absolute;
  bottom: clamp(14px, 3.1vh, 28px);
  left: 0;
  right: 0;
  color: #fff;
  font-size: clamp(9px, 0.97vw, 14px);
  text-align: center;
}

.detail-dimensions {
  position: absolute;
  bottom: clamp(22px, 4.9vh, 44px);
  left: 0;
  right: 0;
  color: #fff;
  font-size: clamp(8px, 0.83vw, 12px);
  line-height: 1.5;
  text-align: center;
}

/* Detail right — description panel */
.detail-right {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 60px 48px 20px;
  overflow-y: auto;
}

.detail-description {
  color: #fff;
  font-size: clamp(9px, 0.94vw, 13.5px);
  line-height: 1.8;
  max-width: 640px;
  text-align: left;
}

.detail-description p {
  margin: 0 0 1em 0;
}

.detail-description p:last-child {
  margin-bottom: 0;
}

.detail-description .emdash {
  letter-spacing: -0.05em;
  display: inline-block;
  transform: scaleX(1.6);
  margin: 0 0.35em;
}

/* ── Mobile (JS-applied .is-mobile class on body) ── */
body.is-mobile {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

.is-mobile .site-layout {
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  overflow-y: auto;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.is-mobile .preview-panel {
  display: none;
}

.is-mobile .scene {
  display: none;
}

.aurora-canvas {
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2;
  filter: blur(16px);
}

.aurora-top {
  top: -20px;
}

.aurora-bottom {
  bottom: -20px;
}

/* ── Mobile vertical scroll ── */
.is-mobile .mobile-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 15vh 0;
  padding: 15svh 0;
}

.is-mobile .carousel-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.is-mobile .detail-video {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.is-mobile .carousel-img-wrap {
  position: relative;
}

.is-mobile .carousel-img-wrap img {
  max-width: 92vw;
  max-height: 70vh;
  max-height: 70svh;
  border-radius: 4px;
  display: block;
}

.is-mobile .carousel-label {
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.is-mobile .carousel-title {
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.is-mobile .carousel-dimensions {
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
}

.is-mobile .carousel-date {
  color: #fff;
  font-size: 12px;
}

/* ── Detail view — mobile tap cycle ── */
.is-mobile .detail-content {
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.is-mobile .detail-left {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 32px 20px;
  flex-direction: column;
}

.is-mobile .detail-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
  flex-shrink: 0;
}

.is-mobile .detail-title,
.is-mobile .detail-date,
.is-mobile .detail-dimensions {
  position: static;
  color: #fff;
}

.is-mobile .detail-title {
  font-size: 16px;
}

.is-mobile .detail-date {
  font-size: 14px;
}

.is-mobile .detail-dimensions {
  font-size: 12px;
}

.is-mobile .detail-description {
  color: #fff;
  font-size: 14px;
  line-height: 1.9;
  margin: auto 0;
}

/* Landscape mobile — label left of video */
.is-mobile.is-landscape .detail-left {
  flex-direction: row;
  align-items: center;
  padding: 16px 20px;
  gap: 24px;
}
.is-mobile.is-landscape .detail-meta {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  order: -1;
  width: 28%;
  flex-shrink: 0;
}
.is-mobile.is-landscape .detail-video {
  flex: 1;
  min-width: 0;
}
.is-mobile.is-landscape .detail-title,
.is-mobile.is-landscape .detail-date,
.is-mobile.is-landscape .detail-dimensions {
  position: static;
  text-align: left;
}
.is-mobile.is-landscape .detail-title {
  font-size: 18px;
}
.is-mobile.is-landscape .detail-date {
  font-size: 15px;
}
.is-mobile.is-landscape .detail-dimensions {
  font-size: 13px;
}

.is-mobile .detail-right {
  width: 100%;
  padding: 0 20px 32px;
  display: none;
}

.is-mobile .detail-view.show-desc .detail-left {
  display: none;
}

.is-mobile .detail-view.show-desc .detail-right {
  display: flex;
  flex: 1;
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 48px 20px;
}

.is-mobile.is-landscape .detail-view.show-desc .detail-right {
  padding: 52px 28px 28px;
}

/* Lock background scroll when detail overlay is open */
body.is-mobile.detail-open .site-layout {
  overflow: hidden !important;
}

body.is-mobile.detail-open .mobile-carousel {
  pointer-events: none;
}

.is-mobile .artist-name {
  bottom: 0;
  top: auto;
  left: auto;
  right: 0;
  padding: 16px;
  font-size: 13px;
}

.is-mobile .show-link {
  padding: 14px 30px 2px 16px;
  font-size: 13px;
}

.is-mobile .email-link {
  position: fixed;
  top: 32px;
  left: 0;
  bottom: auto;
  right: auto;
  padding: 2px 30px 6px 16px;
  font-size: 13px;
}

/* ── Landscape mobile — horizontal scroll ── */
body.is-mobile.is-landscape {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

.is-mobile.is-landscape .site-layout {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.is-mobile.is-landscape .mobile-carousel {
  flex-direction: row;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  padding: 16px 15vw;
  height: 100vh;
  height: 100svh;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.is-mobile.is-landscape .mobile-carousel::-webkit-scrollbar {
  display: none;
}

.is-mobile.is-landscape .carousel-item {
  flex-shrink: 0;
  width: auto;
  padding: 0 24px;
  height: 100%;
  justify-content: center;
}

.is-mobile.is-landscape .carousel-img-wrap img {
  max-width: 85vw;
  max-height: 82vh;
  max-height: 82svh;
}

.is-mobile.is-landscape .carousel-label {
  margin-top: 4px;
}

/* Aurora in landscape — left & right edges instead of top & bottom */
.is-mobile.is-landscape .aurora-canvas.aurora-top {
  top: 0;
  left: -20px;
}

.is-mobile.is-landscape .aurora-canvas.aurora-bottom {
  top: 0;
  bottom: auto;
  left: auto;
  right: -20px;
}
