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

:root {
  --bg:     #070707;
  --surface:#0d0d0d;
  --dim:    #363636;
  --ash:    #2a2a2a;
  --text:   #464646;
  --card-w: min(78vw, 900px);
  --card-h: calc(var(--card-w) * 9 / 16);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  cursor: none;
}

/* Custom cursor */
#cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--dim);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.2s;
  opacity: 0.8;
}
#cursor-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 1px solid rgba(80, 80, 80, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, width 0.2s ease, height 0.2s ease;
}

/* Stage */
#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card deck container */
#deck {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
}

/* Individual card */
.card {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  overflow: hidden;
  will-change: transform, opacity;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.5),
    0 8px 24px rgba(0,0,0,0.6),
    0 24px 64px rgba(0,0,0,0.4);
  transform-origin: center bottom;
  backface-visibility: hidden;
}

.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Vignette overlay on each card */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* UI elements */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 28px 40px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(7,7,7,0.85) 0%, transparent 100%);
  pointer-events: none;
}

#wordmark {
  font-family: 'Uncial Antiqua', serif;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.9;
}

#counter {
  position: fixed;
  top: 28px; right: 40px;
  font-family: 'Crimson Text', serif;
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 0.15em;
  color: var(--ash);
  font-style: italic;
  z-index: 100;
  pointer-events: none;
}

/* Scroll hint */
#hint {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#hint span {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
  font-family: 'Cinzel', serif;
}

.scroll-icon {
  width: 22px; height: 34px;
  border: 1px solid var(--ash);
  border-radius: 11px;
  position: relative;
  opacity: 0.5;
}
.scroll-icon::before {
  content: '';
  position: absolute;
  top: 5px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 6px;
  background: var(--dim);
  border-radius: 2px;
  animation: scrollDot 2s ease infinite;
}

@keyframes scrollDot {
  0% { top: 5px; opacity: 1; }
  80% { top: 18px; opacity: 0; }
  100% { top: 5px; opacity: 0; }
}

/* Progress track */
#progress-track {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.pip {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ash);
  opacity: 0.4;
  transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.pip.active {
  background: var(--text);
  opacity: 1;
  transform: scale(1.6);
}
.pip.past {
  background: var(--dim);
  opacity: 0.6;
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#lightbox.open {
  opacity: 1;
  pointer-events: all;
}
#lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#lightbox-img {
  position: relative;
  z-index: 1;
  width: min(200vw, 200vh * 16 / 9);
  max-width: 92vw;
  max-height: 92vh;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.9), 0 0 0 1px rgba(80,80,80,0.08);
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  user-select: none;
  -webkit-user-drag: none;
}
#lightbox.open #lightbox-img {
  transform: scale(1);
}
#lightbox-close {
  position: absolute;
  top: 24px; right: 28px;
  z-index: 2;
  background: none;
  border: none;
  color: var(--dim);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: none;
  padding: 8px 12px;
  transition: color 0.2s ease;
}
#lightbox-close:hover { color: var(--text); }

/* Cursor enlarges over clickable card */
.card.clickable { cursor: none; }
body.over-card #cursor-ring {
  width: 52px; height: 52px;
  border-color: rgba(80, 80, 80, 0.45);
}
body.over-card #cursor {
  transform: translate(-50%, -50%) scale(1.4);
}
