/* Te Ara Tūhura — Prototype One (camera → open portal → 360). */

:root {
  --bg: #0a0c0b;
  --ink: #e8efe9;
  --moss: #7fd1a8;
  --dim: rgba(232, 239, 233, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* camera passthrough (boot) */
#camera-feed {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #0a0c0b; z-index: 0; display: none;
}
body.mode-camera #camera-feed { display: block; }

/* 360 canvas (portal) */
#scene { position: fixed; inset: 0; z-index: 1; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#scene canvas { display: block; }
body.mode-camera #scene { display: none; }

/* prev/next film (portal only) */
.zone {
  position: fixed; top: 0; bottom: 0; width: 16vw; z-index: 5; cursor: pointer;
  display: flex; align-items: center;
}
#zone-left { left: 0; justify-content: flex-start; padding-left: max(8px, env(safe-area-inset-left)); }
#zone-right { right: 0; justify-content: flex-end; padding-right: max(8px, env(safe-area-inset-right)); }
body.mode-camera .zone { display: none; }

/* ‹ › cues on the tap zones; a tap flashes its arrow so you can see it registered */
.edge-arrow {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(10, 12, 11, 0.32); border: 1px solid rgba(232, 239, 233, 0.22);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0.6; pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), background 0.6s var(--ease);
}
.edge-arrow svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.zone.flash .edge-arrow {
  opacity: 1; transform: scale(1.25); background: rgba(127, 209, 168, 0.6); border-color: var(--moss);
  transition: none;
}

/* hotspots: a pulsing moss dot pinned in the film (main.js places them each frame); 44px tap target */
#hotspots { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
body.mode-camera #hotspots { display: none; }
.hotspot {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border: 0; background: none;
  padding: 0; cursor: pointer; display: none; pointer-events: auto;
}
.hotspot.on { display: block; }
.hotspot .dot {
  position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--moss); border: 2px solid var(--ink); box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}
.hotspot .pulse {
  position: absolute; left: 4px; top: 4px; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--moss); animation: hotspot-pulse 1.8s var(--ease) infinite;
}
@keyframes hotspot-pulse { from { transform: scale(0.5); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

/* info card: slides up from the bottom; any tap on it closes it, the film keeps playing */
#info-card {
  position: fixed; left: 50%; bottom: max(5vh, calc(env(safe-area-inset-bottom) + 12px)); z-index: 7;
  width: min(86vw, 420px); padding: 18px 20px 14px; border-radius: 18px;
  background: rgba(10, 12, 11, 0.72); border: 1px solid rgba(127, 209, 168, 0.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  text-align: center; cursor: pointer;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
#info-card[hidden] { display: none; }
#info-card.show { opacity: 1; transform: translate(-50%, 0); }
#info-card .card-title { font-size: 1.15rem; letter-spacing: 0.08em; color: var(--ink); }
#info-card .card-text { margin-top: 6px; font-size: 0.95rem; color: var(--moss); }
#info-card .card-close { margin-top: 10px; font-size: 0.66rem; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }

#scene-label {
  position: fixed; left: 50%; bottom: max(7vh, env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  font-size: 0.95rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink); opacity: 0; pointer-events: none; z-index: 6;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
#scene-label.show { opacity: 1; transform: translate(-50%, 0); }
#scene-label { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
#scene-label .title { white-space: nowrap; }
#scene-label .latlon {
  font-size: 0.66rem; letter-spacing: 0.12em; opacity: 0.8; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* loading ring: .loading eases the fill toward 90% (the browser can't say how long), .done completes it and fades */
#loading-ring {
  position: fixed; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  z-index: 6; pointer-events: none; opacity: 0; transition: opacity 0.4s var(--ease) 0.25s;
}
#loading-ring circle { fill: none; stroke-width: 3.5; }
#loading-ring .track { stroke: rgba(10, 12, 11, 0.35); }
#loading-ring .fill {
  stroke: #9a9a9a; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; /* grey (Jon, 8 Nov) */
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}
body.mode-portal #loading-ring.loading { opacity: 1; transition: opacity 0.15s; }
#loading-ring.loading .fill { stroke-dashoffset: 10; transition: stroke-dashoffset 6s cubic-bezier(0.1, 0.7, 0.3, 1); }
#loading-ring.done .fill { stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s ease-out; }

#back {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 40;
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(232, 239, 233, 0.25);
  background: rgba(10, 12, 11, 0.5); backdrop-filter: blur(6px); color: var(--ink);
  font-size: 0.8rem; cursor: pointer;
}
#back[hidden] { display: none; }
#back, #clip-prev { display: none !important; } /* Jon, 8 Nov: no back button or previous-clip arrow */

/* Jon, 8 Nov: first screen, one tap brings up the motion and camera prompts; text matches the aim text */
#tap-start {
  position: fixed; inset: 0; z-index: 50; background: #000; cursor: pointer;
  display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
#tap-start.gone { display: none; }

/* Jon, 9 Nov: a marker's clip fills the screen until it ends */
#feature { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; z-index: 60; }
#feature[hidden] { display: none; }
/* a named marker: white rather than the old green, its name underneath */
.hotspot.labelled .dot { background: #fff; border-color: rgba(255, 255, 255, 0.55); }
.hotspot.labelled .pulse { border-color: #fff; }
.hotspot .label {
  position: absolute; top: 44px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: #fff;
  font-size: 1.05rem; letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

/* Jon, 9 Nov: the scene's year above the next arrow; goes with the arrow while a clip loads */
#clip-year {
  position: fixed; left: 0; right: 0; bottom: calc(116px + env(safe-area-inset-bottom)); margin: 0; z-index: 40; pointer-events: none; display: none;
  text-align: center; font-size: 1.28rem; letter-spacing: 0.42em; padding-left: 0.42em; color: var(--ink); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
body.mode-portal #clip-year:not(:empty) { display: block; }
#clip-year { font-variant-numeric: tabular-nums; } /* digits don't jump about while counting */
#tap-start p { margin: 0; font-size: 1.28rem; letter-spacing: 0.08em; color: var(--dim); }

/* Jon, 8 Nov: while a clip loads the forward arrow is replaced by a circling ring in the same spot */
#loading-ring {
  left: 50%; top: auto; bottom: calc(52px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; margin: 0 0 0 -27px; z-index: 41; transition: opacity 0.15s;
}
#loading-ring .track { stroke: rgba(232, 239, 233, 0.18); }
#loading-ring.loading { animation: ring-circle 1.1s linear infinite; }
#loading-ring { visibility: hidden; } /* Jon, 8 Nov: no ring while loading; element kept because the arrow and text key off its .loading class */
#loading-ring.loading .fill, #loading-ring.done .fill { stroke-dashoffset: 72; transition: none; }
@keyframes ring-circle { to { transform: rotate(360deg); } }
#loading-ring.loading ~ #clip-nav #clip-next { background: transparent; border-color: transparent; }
#loading-ring.loading ~ #clip-nav #clip-next svg { visibility: hidden; }

/* scale-through warp: moss covers, then irises away to reveal the 360 */
#warp {
  position: fixed; inset: 0; z-index: 25; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #a9e6c6 0%, #7fd1a8 46%, #5bbf93 100%);
  clip-path: circle(150% at 50% 50%);
  transition: opacity 0.32s var(--ease), clip-path 0.62s var(--ease);
}
#warp.on { opacity: 1; }
#warp { display: none; } /* Paratutai (Jon, 8 Nov): no green flash on entering */
#warp.reveal { clip-path: circle(0% at 50% 50%); } /* iris away → step through into the world */
#warp.dark { background: radial-gradient(circle at 50% 50%, #16241d 0%, #0a0c0b 72%); } /* ?iris=dark variant */

/* launch over the camera */
#portal-launch {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem;
  background: radial-gradient(120% 120% at 50% 45%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
#portal-launch.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
/* Paratutai (Jon, 8 Nov): island outline fills the screen over the camera; ring and text sit below its waterline (58% down) */
#rock-outline {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.65));
}
#open-portal { display: none; } /* Jon, 8 Nov: no dot or ring, the whole screen is the button */
body.mode-camera { background: #000; } /* Jon, 8 Nov: camera at 50% over black */
#camera-feed { background: #000; opacity: 0.5; }
/* Jon, 8 Nov: no native play/pause icon over the camera as the app loads (iOS Safari) */
#camera-feed::-webkit-media-controls { display: none !important; -webkit-appearance: none; }
#camera-feed::-webkit-media-controls-panel { display: none !important; -webkit-appearance: none; }
#camera-feed::-webkit-media-controls-play-button { display: none !important; -webkit-appearance: none; }
#camera-feed::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
#camera-feed::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
#portal-launch { cursor: pointer; justify-content: flex-end; gap: 0.75rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); }

.portal-btn {
  position: relative; width: 150px; height: 150px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; display: grid; place-items: center;
  transition: transform 0.75s var(--ease), opacity 0.6s var(--ease);
}
.portal-btn .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(127, 209, 168, 0.7);
  box-shadow: 0 0 44px rgba(127, 209, 168, 0.25), inset 0 0 26px rgba(127, 209, 168, 0.1);
  animation: pulse 3.2s var(--ease) infinite;
}
.portal-btn .core {
  width: 20px; height: 20px; border-radius: 50%; background: var(--moss);
  box-shadow: 0 0 26px rgba(127, 209, 168, 0.9);
  transition: transform 0.3s var(--ease);
}
.portal-btn:active .core { transform: scale(0.8); }
.portal-btn.warp { transform: scale(22); opacity: 0; } /* fly through it */

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 0.4; }
  100% { transform: scale(1); opacity: 0.9; }
}

.wordmark {
  font-size: 0.9rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--ink); padding-left: 0.42em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}
/* Toct12 (Jon, 12 Oct), kept for Kingsland: one scene, no clip title, no prev/next arrows */
#scene-label, .zone { display: none !important; }
.hint { font-size: 0.74rem; letter-spacing: 0.06em; color: var(--dim); }
/* iPhone only: Safari can't go full screen from a page, a Home Screen icon can (Jon, 2026-10-01) */
#a2hs { position: absolute; left: 1rem; right: 1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom)); text-align: center; }
#a2hs[hidden] { display: none; }

/* words under the ring during the black-and-white loading stage (Jon, 2026-10-15) */
#loading-msg {
  position: fixed; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); margin: 0; z-index: 6; pointer-events: none;
  font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink); white-space: nowrap; text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); opacity: 0; transition: opacity 0.3s var(--ease);
}
body.mode-portal #loading-msg { opacity: 1; transition: opacity 0.15s; } /* Jon, 8 Nov: shows while a clip plays, none while loading */
body.mode-portal #loading-ring.loading ~ #loading-msg { opacity: 0; }
#loading-msg { font-size: 0.9rem; line-height: 1.6; white-space: normal; width: 90vw; top: auto; bottom: calc(20px + env(safe-area-inset-bottom)); } /* Jon, 8 Nov: small, under the arrow */

/* Kingsland (Jon, 23 Oct): the line-up prompt 3x larger */
/* Paratutae (Jon, 7 Nov): a third of Kingsland's 2.22rem, then twice that */
.hint.lineup { font-size: 1.48rem; line-height: 1.2; max-width: 90vw; text-align: center; }

/* Paratutae (Jon, 7 Nov): Whatipu lat/long under the aim line (Wikipedia 'Whatipu' 37 01 48 S, 174 28 48 E) */
.latlon-start { display: inline-block; margin-top: 0.4em; font-size: 0.6em; letter-spacing: 0.08em; opacity: 0.8; }

/* 7 Nov (Jon): no title on the start screen; the aim text takes the old title (.wordmark) style. The coordinates line keeps its look. */
.lineup {
  font-size: 0.9rem; letter-spacing: 0.42em; text-transform: uppercase; line-height: 1.6;
  color: var(--ink); padding-left: 0.42em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
  max-width: 90vw; text-align: center;
}
.lineup .latlon-start { font-size: 0.888rem; letter-spacing: 0.08em; text-transform: none; color: var(--dim); opacity: 0.8; text-shadow: none; }
/* 7 Nov (Jon): place + lat/long now sits above the aim text */
.lineup .latlon-start { margin-top: 0; margin-bottom: 0.5em; }

/* 7 Nov (Jon): styles swapped - the place + lat/long line (on top) takes the title style of .lineup, the aim text the small grey style */
.lineup .place-line { display: inline-block; margin-bottom: 0.4em; }
.lineup .aim-small { font-size: 0.888rem; letter-spacing: 0.08em; text-transform: none; color: var(--dim); opacity: 0.8; text-shadow: none; }

/* 7 Nov (Jon): place on line 1 (no colon), lat/long smaller on line 2, aim text a bit bigger */
.lineup .place-line { margin-bottom: 0.1em; }
.lineup .coords { display: inline-block; font-size: 0.68rem; letter-spacing: 0.3em; margin-bottom: 0.7em; opacity: 0.85; }
.lineup .aim-small { font-size: 1.1rem; }

/* 8 Nov (Jon): text sits just beneath the outline's waterline (805/1388 = 58% down), slightly larger */
.lineup { position: absolute; top: calc(58% + 1.5rem); left: 5vw; width: 90vw; margin: 0; font-size: 1.05rem; }
.lineup .aim-small { font-size: 1.28rem; }
.lineup .place-line { margin-bottom: 1em; } /* Jon, 8 Nov: larger gap above the line-up text */

/* Paratutai (Jon, 7 Nov): prev / next clip buttons at the bottom, arrows only */
#clip-nav {
  position: fixed; left: 0; right: 0; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; justify-content: center; gap: 72px; pointer-events: none;
}
#clip-nav[hidden], body.mode-camera #clip-nav { display: none; }
.clip-btn {
  pointer-events: auto; width: 54px; height: 54px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: rgba(10, 12, 11, 0.38); border: 1px solid rgba(232, 239, 233, 0.3);
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.clip-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.clip-btn.flash { transform: scale(1.18); background: rgba(154, 154, 154, 0.6); border-color: #9a9a9a; transition: none; }
/* Jon, 10 Nov: after the last scene the forward arrow returns to the live camera; the arrow, year and text stay */
#scene { transition: opacity 1.5s var(--ease); }
body.cam-on #camera-feed { display: block; opacity: 1; }
body.live-cam #scene { opacity: 0; pointer-events: none; }

/* Jon, 10 Nov: arrow in the centre pointing to the scene's marker, gently flashing; main.js sets its rotation */
#marker-arrow {
  position: fixed; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; z-index: 5;
  pointer-events: none; opacity: 0; transition: opacity 0.5s var(--ease);
}
#marker-arrow.show { opacity: 1; }
#marker-arrow svg {
  width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.6));
}
#marker-arrow.show svg { animation: marker-arrow-flash 1.8s ease-in-out infinite; }
@keyframes marker-arrow-flash { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.95; } }

/* Jon, 11 Nov: during a story the arrow, year and words are not shown, but the arrow's spot still works (#feature is z-index 60) */
body.story-on #clip-nav { z-index: 61; }
body.mode-portal.story-on #clip-year:not(:empty) { display: none; }
body.mode-portal.story-on #loading-msg { opacity: 0; }
body.story-on #clip-next { background: transparent; border-color: transparent; }
body.story-on #clip-next svg { visibility: hidden; }

/* Jon, 11 Nov: the time travel device (year, arrow, words) fades up on the island-graphic screen, 2 s after it (main.js adds .device-on) */
body.mode-camera.device-on #clip-nav:not([hidden]) { display: flex; animation: device-up 0.9s ease both; }
body.mode-camera.device-on #clip-year { display: block; animation: device-up 0.9s ease both; }
body.mode-camera.device-on #loading-msg { opacity: 1; animation: device-up 0.9s ease both; }
@keyframes device-up { from { opacity: 0; } to { opacity: 1; } }

/* Jon, 11 Nov: the camera after the last scene still often had black bars on his iPhone. The camera video is no longer
   hidden with display:none during the scenes (iPhone Safari can lay it out wrongly when it is shown again); it stays laid out
   behind the 360, invisible, the same as on the start screen where it always filled the screen */
#camera-feed { display: block !important; }
body.mode-portal #camera-feed { opacity: 0; }
body.mode-portal.cam-on #camera-feed { opacity: 1; }

/* Jon, 11 Nov: the line-up text the same size as 'Press for time travel' (#loading-msg) */
.lineup .aim-small { font-size: 0.9rem; line-height: 1.6; }

/* Jon, 11 Nov: going from the start screen into the first scene, the arrow and "Press for time travel" stay steady (no fade off and on) */
body.first-load #loading-msg, body.mode-portal.first-load #loading-ring.loading ~ #loading-msg { opacity: 1; transition: none; }
body.first-load #loading-ring.loading ~ #clip-nav #clip-next { background: rgba(10, 12, 11, 0.38); border-color: rgba(232, 239, 233, 0.3); }
body.first-load #loading-ring.loading ~ #clip-nav #clip-next svg { visibility: visible; }

/* Jon, 11 Nov: entering, the start screen's camera (at its 50%) stays behind while the first clip fades up over it */
body.mode-portal.cam-on.enter-cam #camera-feed { opacity: 0.5; }
body.enter-cam #scene { transition-duration: 0.8s; }

/* Jon, 11 Nov: entering, the opening graphic stays until the first scene is ready, then crossfades into it over 0.8 s */
#portal-launch.entering { pointer-events: none; transition: opacity 0.8s ease, visibility 0.8s; }

/* Jon, 11 Nov: a longer, unmistakable fade from the opening graphic into the first clip */
body.enter-cam #scene { transition-duration: 4.5s; }
#portal-launch.entering { transition: opacity 4.5s ease, visibility 4.5s; }

/* Jon, 12 Nov: markers red and pulsing brightly; "Press to play" under the name, in the 'Press for time travel' style */
.hotspot .dot, .hotspot.labelled .dot {
  background: #ff2a2a; border: 2px solid #fff; animation: hotspot-glow 1.2s ease-in-out infinite;
}
.hotspot .pulse, .hotspot.labelled .pulse { border: 3px solid #ff2a2a; animation: hotspot-pulse-red 1.2s ease-out infinite; }
@keyframes hotspot-glow {
  0%, 100% { box-shadow: 0 0 6px 2px rgba(255, 42, 42, 0.6); filter: brightness(1); }
  50% { box-shadow: 0 0 22px 10px rgba(255, 60, 60, 0.95); filter: brightness(1.5); }
}
@keyframes hotspot-pulse-red { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
.hotspot .press {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 0.9rem; line-height: 1.6; letter-spacing: 0.08em; color: var(--ink); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}
/* Jon, 12 Nov: a marker's picture fills the screen; an exit button (top right) returns to the 360 */
#feature-img { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 60; }
#feature-img[hidden] { display: none; }
#feature-exit {
  position: fixed; top: calc(16px + env(safe-area-inset-top)); right: 16px; z-index: 62; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); border: 2px solid rgba(255, 255, 255, 0.8);
}
#feature-exit[hidden] { display: none; }
/* Jon, 12 Nov: a marker with no name has its 'Press to' line straight under the dot */
.hotspot:not(.labelled) .press { top: 44px; }

/* Jon, 12 Nov: pictures pinch to scale (main.js) */
#feature-img { touch-action: none; transform-origin: 50% 50%; will-change: transform; }

/* Jon, 12 Nov: album position, e.g. "1 / 2", at the bottom of a picture */
#feature-count {
  position: fixed; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); margin: 0; z-index: 62; pointer-events: none;
  text-align: center; font-size: 0.9rem; letter-spacing: 0.08em; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}
#feature-count[hidden] { display: none; }
/* Jon, 12 Nov: pictures fill the phone screen, no zoom; back and forward arrows for an album */
#feature-img { object-fit: cover !important; transform: none !important; background: #000; }
.pic-arrow {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 62; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); border: 2px solid rgba(255, 255, 255, 0.8);
}
.pic-arrow[hidden] { display: none; }
#pic-prev { left: 12px; }
#pic-next { right: 12px; }

/* Jon, 12 Nov: photos shown whole (fit to screen); arrows without the circle */
#feature-img { object-fit: contain !important; }
.pic-arrow { background: none; border: 0; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.9)); }
/* Jon, 12 Nov: exit X without the circle */
#feature-exit { background: none; border: 0; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.9)); }

/* Jon, 12 Nov: instant feedback on the album arrows; a photo still loading shows dimmed */
.pic-arrow { transition: transform 0.12s ease, opacity 0.12s ease; }
.pic-arrow:active { transform: translateY(-50%) scale(0.8); opacity: 0.6; }
#feature-img { transition: opacity 0.15s ease; }
#feature-img.pic-loading { opacity: 0.35; }

/* Jon, 12 Nov: no album arrows, swiping is enough. A loading photo was dimmed with opacity, which let the 360 show through:
   dim it with brightness instead so the black backing stays solid */
.pic-arrow, .pic-arrow[hidden] { display: none !important; }
#feature-img { opacity: 1 !important; transition: filter 0.15s ease; }
#feature-img.pic-loading { filter: brightness(0.35); }
/* Jon, 12 Nov: the end of a story fades back into its 360 over 5 s */
#feature { transition: opacity 5s ease; }
#feature.fade-back { opacity: 0; pointer-events: none; }


/* Jon, 16 Nov: the story fades into the next 360 over its last 3 s */
#feature { transition: opacity 3s linear; }

/* Jon, 17 Nov: Jon's koru arrow replaces the drawn arrows, same sizes (it points right; turned to point up for the marker arrow) */
.clip-btn img.koru { width: 22px; height: 22px; display: block; }
#marker-arrow img.koru { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.6)); }
#marker-arrow img.koru.up { transform: rotate(-90deg); }
#marker-arrow.show img.koru { animation: marker-arrow-flash 1.8s ease-in-out infinite; }
#loading-ring.loading ~ #clip-nav #clip-next img, body.story-on #clip-next img { visibility: hidden; }
body.first-load #loading-ring.loading ~ #clip-nav #clip-next img { visibility: visible; }
