/* Hagens.org — asymmetric filmstrip carousel */
:root {
  --bg: #0a0a0a;
  --fg: #ece9e3;
  --muted: #6a665e;
  --gap: clamp(10px, 1.2vw, 18px);
  --pad: clamp(20px, 2.4vw, 36px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; }
html, body { overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }

#root { position: relative; width: 100%; height: 100%; }

/* ---------- Stage ---------- */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
}
.stage.is-dragging { cursor: grabbing; }

/* ---------- Track ---------- */
/* The track is a horizontal flex of slides. We translate it leftward as the
   continuous index advances. Each slide's width is computed in JS from its
   distance to the focus index — preview slides are narrow, focus slide wide.   */
.track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: flex-end; /* all cells anchored to bottom */
  gap: var(--gap);
  padding: 0 var(--pad) clamp(70px, 8vh, 110px);
  /* transform set inline (translate3d(-Xpx, 0, 0)) */
  will-change: transform;
}

/* ---------- Slide cell ---------- */
.cell {
  position: relative;
  height: 78vh;
  flex: 0 0 auto;
  /* width set inline (px) */
  background-color: #141414;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  cursor: pointer;
  /* width animates per-frame from JS — no CSS transition (would fight rAF). */
  transition: filter 700ms ease, opacity 700ms ease, background-size 600ms ease;
}
/* When fully focused, show the photo in its native aspect ratio (no crop). */
.cell.is-focus {
  background-size: contain;
  background-color: #0a0a0a;
}
.stage.is-dragging .cell { transition: filter 700ms ease, opacity 700ms ease; }

.cell-tint {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  opacity: 1;
  transition: opacity 700ms ease;
  pointer-events: none;
}
.cell.is-focus .cell-tint { opacity: 0; }
.cell-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.35) 100%);
  opacity: 0;
  transition: opacity 700ms ease;
  pointer-events: none;
}
.cell.is-focus .cell-vignette { opacity: 1; }

.cell-index {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: rgba(236, 233, 227, 0.65);
  pointer-events: none;
  opacity: 1;
  transition: opacity 500ms ease;
}
.cell.is-focus .cell-index {
  color: rgba(236, 233, 227, 0.95);
}

/* ---------- Wordmark (top-left) ---------- */
.wordmark {
  position: absolute;
  top: clamp(20px, 2.4vw, 32px);
  left: clamp(20px, 2.4vw, 32px);
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  mix-blend-mode: difference;
}
.wordmark-name { font-weight: 500; }
.wordmark-meta { color: var(--muted); }

/* ---------- Counter (bottom-right) ---------- */
.counter {
  position: absolute;
  bottom: clamp(20px, 2.4vw, 32px);
  right: clamp(20px, 2.4vw, 32px);
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg);
  mix-blend-mode: difference;
  font-variant-numeric: tabular-nums;
}
.counter-cur { font-size: 14px; }
.counter-sep { color: var(--muted); margin: 0 2px; }
.counter-total { color: var(--muted); }

/* ---------- Hint (bottom-left) ---------- */
.hint {
  position: absolute;
  bottom: clamp(20px, 2.4vw, 32px);
  left: clamp(20px, 2.4vw, 32px);
  z-index: 20;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  mix-blend-mode: difference;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: opacity 600ms ease;
}
.hint.is-faded { opacity: 0; }
.hint-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(236, 233, 227, 0.4);
  border-radius: 2px;
  font-size: 11px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cell, .track { transition: none !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .hint { display: none; }
  .cell { height: 62vh; }
}
