
/* ---------- Story page: camera viewfinder ---------- */
/* Camera = assets/story-camera.webp (Caleb Woods, Unsplash licence), 2000×1745, background cut out.
   Positions below were measured on an 814×710 copy: same framing, so the % still hold.
   Every overlay is placed in % of that image (x/814, y/710):
   screen 260,375 → 290×229 · speed dial centre 92,568 r79 · shutter button centre 644,542 r26.
   Swap the photo → re-measure these. */
.story-main { padding-top: 0; }
.story-hero {
  min-height: 100vh; min-height: 100svh; margin-bottom: clamp(60px, 10vw, 120px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 56px; overflow: hidden;
  background: radial-gradient(50% 50% at 50% 55%, rgba(255, 190, 120, .06), transparent 70%), #000;
}
.story-stage {
  position: relative; flex: none;
  width: min(88vw, 80svh * 814 / 710);
  aspect-ratio: 814 / 710;
}
.camera-img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }

/* moving parts: circular copies of the photo, cut out and animated in place */
.dial-rot, .shutter-cap {
  position: absolute; border-radius: 50%; pointer-events: none;
  background-image: url(story-camera.webp); background-repeat: no-repeat;
}
.dial-rot {
  left: 1.597%; top: 68.873%; width: 19.41%; height: 22.254%;
  background-size: 515.19% auto; background-position: 1.982% 88.587%;
  transition: transform .35s cubic-bezier(.2, 1.5, .4, 1);
}
.shutter-cap {
  left: 75.921%; top: 72.676%; width: 6.388%; height: 7.324%;
  background-size: 1565.38% auto; background-position: 81.102% 78.419%;
  transition: transform .07s ease-out, filter .07s;
}
.shutter-cap.down { transform: scale(.86); filter: brightness(.75); }

/* viewfinder screen */
.vf {
  position: absolute; left: 31.941%; top: 52.817%; width: 35.627%; height: 32.254%;
  overflow: hidden; background: #000; cursor: pointer; border-radius: 1.4% / 1.8%;
}
.vf__videos video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
}
.vf__videos video.on { opacity: 1; }
/* ground glass: edge falloff + a bit of glare so it sits in the photo, not on top of it */
.vf__screen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,.07), transparent 40%);
  box-shadow: inset 0 0 40px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.85);
}
/* focal-plane shutter: metal slats, bright leading edges */
.vf__curtain {
  position: absolute; inset: -2px; pointer-events: none; z-index: 2;
  transform: translateY(-101%);
  background:
    linear-gradient(180deg, rgba(255,255,255,.18) 0, transparent 1.2%, transparent 98.8%, rgba(255,255,255,.18) 100%),
    repeating-linear-gradient(180deg, #0c0c0c 0 19.4%, #262522 19.4% 20%);
  box-shadow: 0 0 18px rgba(0,0,0,.9);
}
.vf.flash .vf__videos { animation: vf-flash .28s ease-out; }
@keyframes vf-flash { from { filter: brightness(1.45) contrast(1.05); } to { filter: none; } }

/* hit areas over the dial (back) and shutter (next) */
.cam-btn {
  position: absolute; border: 0; background: none; border-radius: 50%; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.cam-btn--back { left: -0.369%; top: 66.62%; width: 23.342%; height: 26.761%; }
.cam-btn--next { left: 72.359%; top: 68.592%; width: 13.514%; height: 15.493%; }
.cam-btn span {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px);
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.55); text-shadow: 0 1px 3px #000; white-space: nowrap; transition: color .2s;
}
.cam-btn--next span { top: 88%; }
.cam-btn:hover span { color: #fff; }
/* soft ring so people find the controls */
.cam-btn::after {
  content: ''; position: absolute; inset: 14%; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35); opacity: 0; transition: opacity .2s;
}
.cam-btn--next::after { inset: 24%; }
.cam-btn:hover::after, .cam-btn:focus-visible::after { opacity: 1; }
.story-stage.hint .cam-btn::after { animation: cam-hint 1.6s ease-out 2; }
@keyframes cam-hint { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }
.cam-btn:focus-visible { outline: none; }

.story-controls {
  height: 56px; display: flex; align-items: center; gap: 28px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.story-controls button {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; cursor: pointer; padding: 8px 4px;
}
.story-controls button:hover { color: var(--fg); }
.story-controls span { color: var(--fg); min-width: 7ch; text-align: center; }

.story-text .intro { align-items: start; }

@media (max-width: 760px) {
  .story-stage { width: 100vw; }
  .cam-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dial-rot, .shutter-cap { transition: none; }
  .story-stage.hint .cam-btn::after { animation: none; }
}

/* ---------- Range: 3×3 grid at the bottom ---------- */
/* Kept to 640px max so the 1080p source stays sharp (each cell ≈ 213px, source cell 640px). */
.story-range {
  display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px); align-items: center;
}
.story-grid { margin: 0; }
.story-grid video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.story-range__kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.story-range h2 {
  font-weight: 900; font-stretch: 80%; text-transform: uppercase;
  font-size: clamp(32px, 4vw, 56px); line-height: .95; margin: 12px 0 18px;
}
.story-range p:not(.story-range__kicker) { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; color: #cfcfcf; max-width: 40ch; }

@media (max-width: 760px) {
  .story-range { grid-template-columns: 1fr; }
}

/* ---------- QA fixes 21 Nov: leftover caps → sentence case ---------- */
.cam-btn span, .story-controls, .story-range__kicker { text-transform: none; letter-spacing: .03em; }
.cam-btn span { font-size: 12px; }
.story-controls { font-size: 13px; font-weight: 500; }
.story-range__kicker { font-size: 14px; font-weight: 500; }

/* ---------- Controls v2 (29 Nov): make Next / Back obvious ---------- */
/* Glowing pulse on the shutter (Next) and the speed dial (Back), plus callout lines out to labels
   beside the camera. Pulse is strong until the first click, then settles to a slow, faint breathe. */
.cam-btn span { display: none; }                         /* old tiny labels, replaced by callouts */
.cam-btn::after {
  inset: 5%; opacity: 1;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8), 0 0 18px 4px rgba(255, 196, 120, .45);
  animation: cam-pulse 1.8s ease-in-out infinite;
}
.cam-btn--next::after { inset: 21%; }
.cam-btn--back::after { animation-delay: .9s; }          /* the two take turns */
.story-stage.hint .cam-btn::after { animation: cam-pulse 1.8s ease-in-out infinite; }
.cam-btn--back::after, .story-stage.hint .cam-btn--back::after { animation-delay: .9s; }
@keyframes cam-pulse {
  0%, 100% { opacity: .25; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1.08); }
}
.story-stage.used .cam-btn::after { animation-name: cam-pulse-soft; animation-duration: 3.2s; }
@keyframes cam-pulse-soft { 0%, 100% { opacity: .1; transform: scale(.97); } 50% { opacity: .5; transform: scale(1.04); } }
.cam-btn:hover::after { animation: none; opacity: 1; transform: scale(1.08); }

/* callouts: a thin line drops from each control to its label in the row under the camera,
   lined up with the 01 / 05 counter (laptop). Positions are % of the camera photo. */
.cam-callout {
  position: absolute; bottom: -36px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 14px/1 var(--display); letter-spacing: .02em; color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.cam-callout--back { left: 11.3%;  top: 92.4%; }   /* under the speed dial */
.cam-callout--next { left: 79.1%;  top: 81.6%; }   /* under the shutter button */
.cam-callout__line { flex: 1; width: 1px; background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.3)); }
.cam-callout--back .cam-callout__txt { order: 2; }  /* text below the line on both */
.cam-callout__txt { flex: none; white-space: nowrap; }
.cam-callout:hover .cam-callout__txt { text-decoration: underline; text-underline-offset: 4px; }
.cam-callout--next .cam-callout__txt { animation: nudge-r 1.8s ease-in-out infinite; }
.cam-callout--back .cam-callout__txt { animation: nudge-l 1.8s ease-in-out .9s infinite; }
@keyframes nudge-r { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes nudge-l { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
.story-stage.used .cam-callout__txt { animation: none; }
/* laptop: the callouts are the Back / Next, so the row under the camera keeps just the counter */
@media (min-width: 901px) { .story-controls button { visibility: hidden; } }

/* phones: no room beside the camera, so no callouts; the pulse + the Back / Next row do the job */
@media (max-width: 900px) { .cam-callout { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .cam-btn::after, .cam-callout__txt { animation: none !important; }
}
