:root {
  --bg: #080a09;
  --wall: #0b0d0c;
  --surface: #0f1211;
  --surface-2: #141817;
  --border: #1e2321;
  --border-hover: #2f3a35;
  --text: #f3f5f4;
  --text-dim: #8b918d;
  --text-faint: #5a615d;
  --accent: #34e08b;
  --accent-dim: #1c3a2b;

  /* placard (museum label) */
  --placard-bg: #f0efe8;
  --placard-ink: #17181a;
  --placard-ink-dim: #5c5d58;

  /* per-project categorical colors, fixed assignment (dataviz palette, dark-surface validated) */
  --p-atlas: #3987e5;
  --p-hunch: #199e70;
  --p-track: #c98500;
  --p-velvet: #9085e9;
  --p-dropzone: #e66767;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 253, 240, 0.03), transparent 60%),
    linear-gradient(180deg, var(--wall) 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.gh-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 5px 13px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.gh-chip:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface);
}

.gh-avatar {
  border-radius: 50%;
  display: block;
}

.gh-mark {
  color: var(--text-faint);
}

/* Gallery entry */
.gallery {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 84px 28px 80px;
}

.gallery-entry {
  text-align: center;
  margin-bottom: 90px;
}

.collection-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.title {
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #ffffff 30%, #7f8582 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title .dot {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

/* Pieces — one wall section each */
.piece {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: 54px 0 64px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.piece.lit {
  opacity: 1;
  transform: none;
}

.piece + .piece {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.piece-flip .frame-wrap {
  order: 2;
}

.piece-flip .placard {
  order: 1;
  justify-self: end;
  text-align: right;
}

.piece-flip .placard-links {
  justify-content: flex-end;
}

.piece-flip .placard-spark {
  direction: rtl;
}

/* The framed work */
.frame-wrap {
  position: relative;
  display: block;
  text-decoration: none;
  perspective: 900px;
  padding-top: 44px; /* room for the spotlight to breathe */
}

.spotlight {
  position: absolute;
  inset: 0 -12% auto -12%;
  height: 130%;
  pointer-events: none;
  background: radial-gradient(58% 68% at 50% 0%, rgba(255, 250, 230, 0.075), transparent 68%);
  opacity: 0.6;
  transition: opacity 0.35s ease;
}

.frame-wrap:hover .spotlight {
  opacity: 1;
}

.frame {
  position: relative;
  display: block;
  border: 12px solid #181a18;
  outline: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  background: #050605;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 48px -18px rgba(0, 0, 0, 0.85),
    0 8px 18px -8px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.frame-wrap:hover .frame {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 32px 60px -18px rgba(0, 0, 0, 0.9),
    0 10px 22px -8px rgba(0, 0, 0, 0.75);
}

.mat {
  position: relative;
  display: block;
  padding: 10px;
  background: #0c0e0d;
}

/* live app hung in the frame — a moving painting, click passes to the frame link */
.live-wrap {
  position: absolute;
  inset: 10px;
  overflow: hidden;
  background: #05070a;
  pointer-events: none;
}

.live {
  width: 200%;
  height: 200%;
  border: 0;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
}

/* optional real screenshot override: art/<key>.png wins if present */
.shot {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: cover;
  object-position: top center;
}

/* The canvas */
.art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(240px, 34vw, 360px);
  overflow: hidden;
  background: #05070a;
}

/* Atlas — live news on a digital earth */
.art-atlas {
  background: radial-gradient(130% 100% at 50% 115%, #0d1f2e 0%, #060a10 62%);
}

.atlas-stars {
  position: absolute;
  top: 14%;
  left: 18%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    60px 22px 0 rgba(255, 255, 255, 0.35),
    140px -6px 0 rgba(255, 255, 255, 0.5),
    220px 30px 0 rgba(255, 255, 255, 0.3),
    300px 4px 0 rgba(255, 255, 255, 0.45),
    380px 40px 0 rgba(255, 255, 255, 0.3),
    470px 12px 0 rgba(255, 255, 255, 0.4),
    30px 90px 0 rgba(255, 255, 255, 0.25),
    250px 80px 0 rgba(255, 255, 255, 0.2);
}

.atlas-glow {
  position: absolute;
  bottom: -42%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #3aa9ff 0%, #1a4d7a 45%, #0a1a26 76%);
  box-shadow: 0 0 90px rgba(58, 169, 255, 0.35);
}

.atlas-orb {
  position: absolute;
  top: 26%;
  left: 22%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ec8ff;
  box-shadow: 0 0 14px rgba(126, 200, 255, 0.9);
}

.atlas-ping {
  position: absolute;
  top: 38%;
  right: 28%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd27e;
  box-shadow: 0 0 10px rgba(255, 210, 126, 0.9);
  animation: atlas-blink 3s ease-in-out infinite;
}

.atlas-ping-2 {
  top: 52%;
  right: auto;
  left: 34%;
  background: #ff9d7e;
  box-shadow: 0 0 10px rgba(255, 157, 126, 0.9);
  animation-delay: 1.4s;
}

@keyframes atlas-blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* Hunch — trivia on instinct */
.art-hunch {
  background: radial-gradient(120% 140% at 30% 15%, #2a1d4d 0%, #150f2b 55%, #0a0812 100%);
  flex-direction: column;
  gap: 26px;
}

.hunch-word {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #3ad0ff 0%, #a06bff 45%, #ff5f7e 75%, #ffb24d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hunch-answers {
  display: flex;
  gap: 12px;
}

.hunch-ans {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #d9d3ff;
  background: rgba(160, 107, 255, 0.12);
  border: 1px solid rgba(160, 107, 255, 0.35);
  border-radius: 12px;
  transform: rotate(-2deg);
}

.hunch-ans:nth-child(2n) {
  transform: rotate(2deg);
}

.hunch-ans.is-right {
  color: #0a1410;
  background: #34e08b;
  border-color: #34e08b;
  box-shadow: 0 0 22px rgba(52, 224, 139, 0.45);
  animation: hunch-pop 2.8s ease-in-out infinite;
}

@keyframes hunch-pop {
  0%, 100% { transform: rotate(2deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.12); }
}

/* Track — running, measured */
.art-track {
  background: radial-gradient(120% 140% at 50% 100%, #1a1608 0%, #08090a 65%);
}

.track-lane {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(201, 133, 0, 0.16);
}

.track-lane:nth-of-type(1) { top: 25%; }
.track-lane:nth-of-type(2) { top: 50%; }
.track-lane:nth-of-type(3) { top: 75%; }

.track-path {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.track-path svg {
  width: 100%;
  height: 70%;
}

.track-path polyline {
  fill: none;
  stroke: var(--p-track);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(201, 133, 0, 0.55));
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: track-run 5s ease-out infinite;
}

@keyframes track-run {
  0% { stroke-dashoffset: 1200; }
  55%, 100% { stroke-dashoffset: 0; }
}

.track-pill {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffd79a;
  background: rgba(201, 133, 0, 0.16);
  border: 1px solid rgba(201, 133, 0, 0.4);
  border-radius: 999px;
  padding: 5px 13px;
}

/* Velvet — music, generated */
.art-velvet {
  background: radial-gradient(120% 140% at 50% 100%, #1c1533 0%, #0a0812 65%);
  flex-direction: column;
  gap: 20px;
}

.velvet-eq {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: clamp(70px, 12vw, 110px);
}

.velvet-eq span {
  width: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #c9b6ff 0%, #9085e9 60%, #6a5bc4 100%);
  animation: velvet-bounce 1.6s ease-in-out infinite;
}

.velvet-eq span:nth-child(1)  { height: 30%; animation-delay: -1.4s; }
.velvet-eq span:nth-child(2)  { height: 70%; animation-delay: -1.1s; }
.velvet-eq span:nth-child(3)  { height: 45%; animation-delay: -0.8s; }
.velvet-eq span:nth-child(4)  { height: 95%; animation-delay: -0.5s; }
.velvet-eq span:nth-child(5)  { height: 55%; animation-delay: -1.6s; }
.velvet-eq span:nth-child(6)  { height: 75%; animation-delay: -0.2s; }
.velvet-eq span:nth-child(7)  { height: 40%; animation-delay: -0.9s; }
.velvet-eq span:nth-child(8)  { height: 85%; animation-delay: -1.2s; }
.velvet-eq span:nth-child(9)  { height: 50%; animation-delay: -0.4s; }
.velvet-eq span:nth-child(10) { height: 65%; animation-delay: -1.5s; }
.velvet-eq span:nth-child(11) { height: 35%; animation-delay: -0.7s; }
.velvet-eq span:nth-child(12) { height: 60%; animation-delay: -1s; }

@keyframes velvet-bounce {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

.velvet-word {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #d9d3ff;
}

/* Dropzone — a video game */
.art-dropzone {
  background: radial-gradient(120% 140% at 50% 50%, #23100f 0%, #0a0707 70%);
}

.dz-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(230, 103, 103, 0.4);
}

.dz-ring-1 { width: 64px;  height: 64px;  animation: dz-pulse 2.4s ease-out infinite; }
.dz-ring-2 { width: 122px; height: 122px; animation: dz-pulse 2.4s ease-out infinite 0.5s; }
.dz-ring-3 { width: 180px; height: 180px; animation: dz-pulse 2.4s ease-out infinite 1s; }

@keyframes dz-pulse {
  0% { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.15); }
}

.dz-faller {
  position: absolute;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(230, 103, 103, 0.85);
  animation: dz-fall 2.4s cubic-bezier(0.5, 0, 0.8, 0.4) infinite;
}

@keyframes dz-fall {
  0% { transform: translateY(-30px); opacity: 0; }
  20% { opacity: 1; }
  48%, 100% { transform: translateY(calc(50% + 46%)); opacity: 0; }
}

.dz-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--p-dropzone);
  box-shadow: 0 0 16px rgba(230, 103, 103, 0.8);
}

.dz-pill {
  position: absolute;
  bottom: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffb3b3;
  background: rgba(230, 103, 103, 0.16);
  border: 1px solid rgba(230, 103, 103, 0.4);
  border-radius: 999px;
  padding: 5px 13px;
}

/* Placard — the museum label */
.placard {
  background: var(--placard-bg);
  color: var(--placard-ink);
  border-radius: 3px;
  padding: 22px 24px 20px;
  max-width: 340px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 14px 30px -14px rgba(0, 0, 0, 0.8);
}

.placard-no {
  display: block;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--placard-ink-dim);
  margin-bottom: 10px;
}

.placard-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.placard-year {
  font-weight: 500;
  color: var(--placard-ink-dim);
  font-size: 1rem;
}

.placard-medium {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--placard-ink-dim);
  margin-top: 4px;
}

.placard-materials {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  margin-top: 12px;
  color: var(--placard-ink);
}

.placard-materials .plus { color: #0c7a3d; }
.placard-materials .minus { color: #b03535; }

.placard-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(23, 24, 26, 0.12);
}

.spark-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.spark-bar {
  width: 100%;
  border-radius: 2px 2px 1px 1px;
  min-height: 2px;
  display: block;
}

.spark-bar-wrap .tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #17181a;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.64rem;
  white-space: nowrap;
  color: #f0efe8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
  font-variant-numeric: tabular-nums;
}

.spark-bar-wrap:hover .tip {
  opacity: 1;
}

.placard-links {
  display: flex;
  gap: 16px;
  margin-top: 14px;
}

.placard-links a {
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.placard-visit {
  color: var(--placard-ink);
  border-bottom: 1.5px solid var(--placard-ink);
  padding-bottom: 1px;
}

.placard-repo {
  color: var(--placard-ink-dim);
}

.placard-links a:hover {
  opacity: 0.65;
}

/* Catalogue note */
.catalogue-note {
  text-align: center;
  margin-top: 70px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.site-footer a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-footer a:hover {
  color: var(--accent);
}

/* Small screens: stack the wall */
@media (max-width: 720px) {
  .piece {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 0 48px;
  }

  .piece-flip .frame-wrap { order: 0; }
  .piece-flip .placard {
    order: 1;
    justify-self: start;
    text-align: left;
  }
  .piece-flip .placard-links { justify-content: flex-start; }
  .piece-flip .placard-spark { direction: ltr; }

  .placard {
    max-width: none;
  }

  .gallery-entry {
    margin-bottom: 50px;
  }
}
