:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

body {
  -webkit-font-smoothing: antialiased;
}

.experience {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #000;
  touch-action: none;
  user-select: none;
}

.intro,
.artwork {
  --feed-y: 100%;
  --feed-scale: 0.985;
  --feed-opacity: 0;
  position: absolute;
  inset: 0;
  opacity: var(--feed-opacity);
  pointer-events: none;
  transform: translateY(var(--feed-y)) scale(var(--feed-scale));
  transition:
    opacity 360ms ease,
    transform 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.intro.is-active,
.artwork.is-active {
  --feed-y: 0%;
  --feed-scale: 1;
  --feed-opacity: 1;
  pointer-events: auto;
}

.intro.is-adjacent,
.artwork.is-adjacent {
  pointer-events: none;
}

.intro.is-dragging,
.artwork.is-dragging {
  transition: none;
}

.intro {
  display: grid;
  align-content: center;
  min-height: 100dvh;
  padding: clamp(28px, 7vw, 88px);
}

.intro-copy {
  width: min(82vw, 680px);
}

.intro-kicker {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 12ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 12vw, 7.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.intro-copy p:last-child {
  max-width: 36rem;
  margin: clamp(24px, 5vh, 42px) 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: clamp(0.98rem, 3.5vw, 1.18rem);
  line-height: 1.5;
}

.intro-guide {
  position: absolute;
  left: clamp(18px, 5vw, 56px);
  right: clamp(18px, 5vw, 56px);
  bottom: calc(clamp(18px, 5vw, 56px) + env(safe-area-inset-bottom));
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.art-card {
  --bloom: 0.12;
  --frame-fit: cover;
  --frame-rotate: 0deg;
  --frame-scale: 1.002;
  --glow-scale: 1.05;
  --motion-blur: 0px;
  --motion-shift: 0px;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  cursor: grab;
  transform: translateZ(0);
}

.art-card:active {
  cursor: grabbing;
}

.sequence-frame,
.sequence-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--frame-fit);
  pointer-events: none;
}

.sequence-frame {
  z-index: 2;
  filter: blur(var(--motion-blur));
  transform: translateX(var(--motion-shift)) rotate(var(--frame-rotate)) scale(var(--frame-scale));
}

.sequence-glow {
  z-index: 1;
  opacity: var(--bloom);
  filter: blur(18px) saturate(1.1) brightness(1.35);
  transform: rotate(var(--frame-rotate)) scale(var(--glow-scale));
  mix-blend-mode: screen;
}

.artwork[data-artwork="1"] .art-card {
  --frame-fit: contain;
  --frame-rotate: 90deg;
  --frame-scale: 2.35;
  --glow-scale: 2.42;
}

.artwork[data-artwork="2"] .art-card {
  --frame-fit: contain;
  --frame-scale: 2.25;
  --glow-scale: 2.32;
}

@media (orientation: landscape), (min-width: 760px) {
  .art-card,
  .artwork[data-artwork="1"] .art-card,
  .artwork[data-artwork="2"] .art-card {
    --frame-fit: contain;
    --frame-rotate: 0deg;
    --frame-scale: 1;
    --glow-scale: 1.02;
  }
}

.caption {
  position: absolute;
  left: clamp(18px, 5vw, 56px);
  right: clamp(18px, 5vw, 56px);
  bottom: calc(clamp(18px, 5vw, 56px) + env(safe-area-inset-bottom));
  z-index: 3;
  width: min(78vw, 520px);
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.82rem, 2.6vw, 0.98rem);
  font-style: italic;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  pointer-events: none;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.72);
}

.index-toggle {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: clamp(14px, 4vw, 28px);
  z-index: 20;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.index-toggle__grid {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 9px 0 0 currentColor, 0 9px 0 currentColor, 9px 9px 0 currentColor;
}

.index-panel {
  position: fixed;
  inset: 0;
  z-index: 19;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: calc(18px + env(safe-area-inset-top)) clamp(16px, 4vw, 34px)
    calc(18px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.index-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.index-panel__bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-right: 52px;
}

.index-view-toggle,
.index-close {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.index-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
}

.index-item {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 190px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.index-item img,
.index-item__placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #050505;
  object-fit: cover;
}

.index-item__placeholder {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.34);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 8vw, 2.8rem);
  font-style: italic;
}

.index-item > span:last-child {
  display: block;
  padding: 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.15;
}

.index-panel[data-view="list"] .index-items {
  grid-template-columns: 1fr;
  gap: 1px;
  align-content: start;
}

.index-panel[data-view="list"] .index-item {
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto;
  align-items: center;
  min-height: 68px;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.index-panel[data-view="list"] .index-item img,
.index-panel[data-view="list"] .index-item__placeholder {
  width: 56px;
  height: 56px;
  aspect-ratio: 1;
}

.index-panel[data-view="list"] .index-item__placeholder {
  font-size: 1rem;
}

@media (min-width: 760px) {
  .index-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .index-panel[data-view="list"] .index-items {
    width: min(680px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
}
