/* ============================================================================
 * styles.css — Neighbourhood Tour
 * Dark, quiet, gold-accented. Everything sits on top of a full-bleed video.
 * ==========================================================================*/

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:            #07090b;
  --ink:           #f5f2ec;
  --ink-muted:     rgba(245, 242, 236, .64);
  --ink-faint:     rgba(245, 242, 236, .40);

  --gold:          #c9a96a;
  --gold-bright:   #e2c894;
  --gold-line:     rgba(201, 169, 106, .38);

  --glass:         rgba(10, 12, 14, .46);
  --glass-strong:  rgba(10, 12, 14, .66);
  --hairline:      rgba(245, 242, 236, .14);

  --font-display:  "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-ui:       "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                   "Helvetica Neue", Arial, sans-serif;

  --ease:          cubic-bezier(.22, .61, .36, 1);
  --ui-fade:       420ms;

  --pad:           clamp(18px, 3.2vw, 44px);
  --safe-t:        env(safe-area-inset-top, 0px);
  --safe-b:        env(safe-area-inset-bottom, 0px);
  --safe-l:        env(safe-area-inset-left, 0px);
  --safe-r:        env(safe-area-inset-right, 0px);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ── Stage ──────────────────────────────────────────────────────────────── */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* 100dvh where supported keeps mobile browser chrome from cropping the video */
  height: 100%;
  height: 100dvh;
}

/* ── Pannable surface ───────────────────────────────────────────────────── */
.pan-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  /* The drag is handled in JS; let it own the gesture instead of the page. */
  touch-action: none;
}

/* Always exactly 16:9 and never smaller than the viewport, so precisely one
   axis overflows and becomes draggable. In portrait that is the width. */
.pan-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: max(100%, calc(100vh * 16 / 9));
  width: max(100%, calc(100dvh * 16 / 9));
  height: max(100%, calc(100vw * 9 / 16));
  will-change: transform;
}

.pan-stage.is-pannable { cursor: -webkit-grab; cursor: grab; }
.pan-stage.is-dragging { cursor: -webkit-grabbing; cursor: grabbing; }

/* Nudge shown on screens where the frame is wider than the display */
.pan-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--pad) + var(--safe-b) + 46px);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  -webkit-transition: opacity var(--ui-fade) var(--ease);
  transition: opacity var(--ui-fade) var(--ease);
}

.pan-hint.is-visible { opacity: 1; }

.pan-hint svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  -webkit-animation: nudge 2.8s ease-in-out infinite;
  animation: nudge 2.8s ease-in-out infinite;
}

/* Hidden whenever the tour is not in a state the visitor can look around in */
body.state-loading .pan-hint,
body.state-transitioningToDestination .pan-hint,
body.state-transitioningBack .pan-hint { opacity: 0; }

/* ── Video layers ───────────────────────────────────────────────────────── */
/* Own stacking context: the layers inside swap z-index while cross-fading, and
   without this they would climb over the scrim and the whole UI. */
.video-layers {
  position: absolute;
  inset: 0;
  z-index: 0;
  isolation: isolate;
  background: var(--bg);
}

.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  -webkit-transition: opacity 650ms var(--ease);
  transition: opacity 650ms var(--ease);
  will-change: opacity;
  /* Deliberately transparent: a dark background here would fade in over the
     outgoing layer as a flash of black whenever a frame is not painted yet.
     The backdrop lives on .video-layers instead. */
  background: transparent;
  pointer-events: none;
}

.scene-video.is-active { opacity: 1; }

/* Shown when a scene's media is missing or unplayable */
.scene-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: var(--pad);
  background:
    radial-gradient(120% 90% at 50% 30%, #1b2430 0%, #0d1218 55%, #07090b 100%);
}

.scene-fallback__eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.scene-fallback__title {
  font-family: var(--font-display);
  font-size: clamp(34px, 7vw, 72px);
  font-weight: 300;
  letter-spacing: .01em;
  line-height: 1.05;
}

.scene-fallback__note {
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 34ch;
}

/* Legibility scrim: darkens the edges where the UI lives.
   z-index keeps it above the video layers (0/1), birds (2) and fallback (3). */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(4,6,8,.55) 0%, rgba(4,6,8,0) 26%),
    linear-gradient(to top,    rgba(4,6,8,.66) 0%, rgba(4,6,8,0) 38%),
    radial-gradient(130% 110% at 50% 50%, rgba(4,6,8,0) 45%, rgba(4,6,8,.5) 100%);
}

/* ── Hotspots ───────────────────────────────────────────────────────────── */
.hotspot-layer {
  position: absolute;
  inset: 0;
  /* Inside .pan-stage, on top of everything: videos (0/1), birds (2),
     fallback (3) and scrim (4). */
  z-index: 5;
  opacity: 1;
  -webkit-transition: opacity var(--ui-fade) var(--ease);
  transition: opacity var(--ui-fade) var(--ease);
}

.hotspot-layer.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  -webkit-animation: hotspot-in 700ms var(--ease) both;
  animation: hotspot-in 700ms var(--ease) both;
  -webkit-animation-delay: var(--delay, 0s);
  animation-delay: var(--delay, 0s);
}

.hotspot:focus { outline: none; }

.hotspot:focus-visible .hotspot__pin {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

.hotspot__pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .04);
  color: var(--gold-bright);
  -webkit-transition: -webkit-transform 320ms var(--ease), background 320ms var(--ease),
                      border-color 320ms var(--ease);
  transition: transform 320ms var(--ease), background 320ms var(--ease),
              border-color 320ms var(--ease);
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .hotspot__pin { background: rgba(10, 12, 14, .74); }
}

.hotspot__pin svg { width: 20px; height: 20px; display: block; }

/* Pulsing ring */
.hotspot__pin::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  -webkit-animation: pulse 3.4s var(--ease) infinite;
  animation: pulse 3.4s var(--ease) infinite;
  -webkit-animation-delay: var(--delay, 0s);
  animation-delay: var(--delay, 0s);
  pointer-events: none;
}

.hotspot:hover .hotspot__pin,
.hotspot:focus-visible .hotspot__pin {
  -webkit-transform: scale(1.09);
  transform: scale(1.09);
  background: var(--glass-strong);
  border-color: var(--gold);
}

.hotspot__label {
  position: absolute;
  top: calc(100% + 11px);
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  text-align: center;
  -webkit-transition: background 320ms var(--ease), border-color 320ms var(--ease);
  transition: background 320ms var(--ease), border-color 320ms var(--ease);
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .hotspot__label { background: rgba(10, 12, 14, .74); }
}

/* Keep labels inside the frame near the left / right edges */
.hotspot[data-align="right"] .hotspot__label {
  left: auto;
  right: -6px;
  -webkit-transform: none;
  transform: none;
  text-align: right;
  align-items: flex-end;
}

.hotspot[data-align="left"] .hotspot__label {
  left: -6px;
  -webkit-transform: none;
  transform: none;
  text-align: left;
  align-items: flex-start;
}

.hotspot__title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
}

.hotspot__sub {
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--ink-muted);
}

.hotspot__sub:empty { display: none; }

.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label {
  background: var(--glass-strong);
  border-color: var(--gold-line);
}

/* On pointer devices the subtitle is a hover reveal; on touch it stays visible */
@media (hover: hover) and (pointer: fine) {
  .hotspot__sub {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    -webkit-transition: max-height 300ms var(--ease), opacity 300ms var(--ease);
    transition: max-height 300ms var(--ease), opacity 300ms var(--ease);
  }

  .hotspot:hover .hotspot__sub,
  .hotspot:focus-visible .hotspot__sub {
    max-height: 20px;
    opacity: 1;
  }
}

/* ── Brand ──────────────────────────────────────────────────────────────── */
.brand {
  position: absolute;
  top: calc(var(--pad) + var(--safe-t));
  left: calc(var(--pad) + var(--safe-l));
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  -webkit-transition: opacity var(--ui-fade) var(--ease),
                      -webkit-transform var(--ui-fade) var(--ease);
  transition: opacity var(--ui-fade) var(--ease), transform var(--ui-fade) var(--ease);
}

.brand__mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--gold-line);
  border-radius: 3px;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold);
  border-radius: 1px;
  opacity: .55;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }

.brand__name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.brand__sub {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Back button ────────────────────────────────────────────────────────── */
.back-btn {
  position: absolute;
  top: calc(var(--pad) + var(--safe-t));
  left: calc(var(--pad) + var(--safe-l));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px 10px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: 0;
  -webkit-transform: translateX(-8px);
  transform: translateX(-8px);
  -webkit-transition: opacity var(--ui-fade) var(--ease),
                      -webkit-transform var(--ui-fade) var(--ease),
                      background 300ms var(--ease), border-color 300ms var(--ease);
  transition: opacity var(--ui-fade) var(--ease), transform var(--ui-fade) var(--ease),
              background 300ms var(--ease), border-color 300ms var(--ease);
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .back-btn,
  .dest-panel,
  .loader,
  .toast { background: rgba(10, 12, 14, .8); }
}

.back-btn.is-visible {
  opacity: 1;
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

.back-btn:hover,
.back-btn:focus-visible {
  background: var(--glass-strong);
  border-color: var(--gold-line);
  outline: none;
}

.back-btn svg { width: 17px; height: 17px; flex: none; color: var(--gold); }

/* ── Overview hint ──────────────────────────────────────────────────────── */
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--pad) + var(--safe-b));
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  pointer-events: none;
  -webkit-transition: opacity var(--ui-fade) var(--ease),
                      -webkit-transform var(--ui-fade) var(--ease);
  transition: opacity var(--ui-fade) var(--ease), transform var(--ui-fade) var(--ease);
}

.hint__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  -webkit-animation: blink 2.6s ease-in-out infinite;
  animation: blink 2.6s ease-in-out infinite;
}

/* ── Destination panel ──────────────────────────────────────────────────── */
.dest-panel {
  position: absolute;
  left: calc(var(--pad) + var(--safe-l));
  bottom: calc(var(--pad) + var(--safe-b));
  max-width: min(460px, calc(100vw - 2 * var(--pad)));
  padding: 22px 26px 24px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  opacity: 0;
  -webkit-transform: translateY(14px);
  transform: translateY(14px);
  -webkit-transition: opacity var(--ui-fade) var(--ease),
                      -webkit-transform var(--ui-fade) var(--ease);
  transition: opacity var(--ui-fade) var(--ease), transform var(--ui-fade) var(--ease);
}

.dest-panel.is-visible {
  opacity: 1;
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

.dest-panel__eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}

.dest-panel__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 300;
  letter-spacing: .01em;
  line-height: 1.05;
}

.dest-panel__desc {
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-muted);
}

.dest-panel__desc:empty { display: none; }

.dest-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.dest-panel__meta:empty { display: none; }

.dest-panel__meta li {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Loader ─────────────────────────────────────────────────────────────── */
.loader {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 26px 34px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  -webkit-transition: opacity 280ms var(--ease);
  transition: opacity 280ms var(--ease);
  pointer-events: none;
  z-index: 4;
}

.loader.is-visible { opacity: 1; }

.loader__ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 169, 106, .22);
  border-top-color: var(--gold);
  -webkit-animation: spin 900ms linear infinite;
  animation: spin 900ms linear infinite;
}

.loader__text {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Tap to start (autoplay blocked) ────────────────────────────────────── */
.tap-start {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 8, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 5;
}

.tap-start__btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 15px 28px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--glass-strong);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.tap-start__btn:hover { border-color: var(--gold); }
.tap-start__btn svg { width: 18px; height: 18px; color: var(--gold); }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--pad) + var(--safe-t));
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 2 * var(--pad)));
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-muted);
  text-align: center;
  opacity: 0;
  -webkit-transition: opacity 300ms var(--ease);
  transition: opacity 300ms var(--ease);
  pointer-events: none;
  z-index: 6;
}

.toast.is-visible { opacity: 1; }

/* ── Hidden preload pool ────────────────────────────────────────────────── */
.preload-pool {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── State-driven UI visibility ─────────────────────────────────────────── */
body.state-loading .hint,
body.state-transitioningToDestination .hint,
body.state-destination .hint,
body.state-transitioningBack .hint {
  opacity: 0;
  -webkit-transform: translateX(-50%) translateY(10px);
  transform: translateX(-50%) translateY(10px);
}

body.state-loading .brand,
body.state-transitioningToDestination .brand,
body.state-destination .brand,
body.state-transitioningBack .brand {
  opacity: 0;
  -webkit-transform: translateX(-10px);
  transform: translateX(-10px);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  :root { --pad: 16px; }

  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: 17px; }
  .brand__sub  { display: none; }

  /* 44px keeps the pin at the recommended minimum tap-target size. */
  .hotspot { width: 44px; height: 44px; }
  .hotspot__pin svg { width: 18px; height: 18px; }
  .hotspot__label { padding: 6px 11px; }
  .hotspot__title { font-size: 12px; }
  .hotspot__sub { font-size: 10px; }

  .hint {
    max-width: calc(100vw - 2 * var(--pad));
    padding: 8px 14px;
    font-size: 10.5px;
    letter-spacing: .06em;
    white-space: normal;
    text-align: center;
  }

  .dest-panel {
    left: var(--pad);
    right: var(--pad);
    max-width: none;
    padding: 18px 20px 20px;
    border-radius: 14px;
  }

  .dest-panel__desc { font-size: 13px; }
  .dest-panel__meta { gap: 6px; margin-top: 12px; }

  .back-btn { padding: 9px 15px 9px 11px; font-size: 11.5px; }
}

/* Short landscape phones: keep the panel from covering the view */
@media (max-height: 460px) and (orientation: landscape) {
  .dest-panel {
    right: auto;
    max-width: min(360px, 46vw);
    padding: 14px 16px 16px;
  }

  .dest-panel__desc { display: none; }
  .hint { font-size: 10px; }
}

/* ── Motion preferences ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hotspot,
  .hotspot__pin::after,
  .hint__dot { -webkit-animation: none; animation: none; }

  .scene-video {
    -webkit-transition-duration: 1ms;
    transition-duration: 1ms;
  }

  .loader__ring {
    -webkit-animation-duration: 2.4s;
    animation-duration: 2.4s;
  }
}

/* ── Keyframes ──────────────────────────────────────────────────────────── */
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

@-webkit-keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@-webkit-keyframes pulse {
  0%   { opacity: .8; -webkit-transform: scale(1); }
  70%  { opacity: 0;  -webkit-transform: scale(1.85); }
  100% { opacity: 0;  -webkit-transform: scale(1.85); }
}

@keyframes pulse {
  0%   { opacity: .8; transform: scale(1); }
  70%  { opacity: 0;  transform: scale(1.85); }
  100% { opacity: 0;  transform: scale(1.85); }
}

@-webkit-keyframes hotspot-in {
  from { opacity: 0; -webkit-transform: translate(-50%, -46%) scale(.86); }
  to   { opacity: 1; -webkit-transform: translate(-50%, -50%) scale(1); }
}

@keyframes hotspot-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.86); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@-webkit-keyframes nudge {
  0%, 100% { -webkit-transform: translateX(-2px); }
  50%      { -webkit-transform: translateX(2px); }
}

@keyframes nudge {
  0%, 100% { transform: translateX(-2px); }
  50%      { transform: translateX(2px); }
}

/* ── Birds ──────────────────────────────────────────────────────────────────
 * A live overlay rather than baked-in footage: every crossing gets a fresh
 * random height, speed, size and delay, so nothing lines up with the video
 * loop. Sits under the scrim so it picks up the same haze as the picture.
 * ────────────────────────────────────────────────────────────────────────── */
.bird-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.bird {
  position: absolute;
  top: var(--top, 15%);
  left: 0;
  /* Percentage of the picture width, so birds keep their scale on any screen */
  width: calc(var(--scale, 1) * var(--bird-size, 1.5%));
  will-change: transform;
  /* Runs once; app.js re-randomises everything and relaunches it, so the
     rhythm never settles into a pattern the way an infinite loop would. */
  -webkit-animation: bird-cross var(--duration, 26s) linear both;
  animation: bird-cross var(--duration, 26s) linear both;
}

/* Vertical bob, kept on its own element so it composes with the crossing */
.bird__bob {
  -webkit-animation: bird-bob var(--bob, 3.4s) ease-in-out infinite alternate;
  animation: bird-bob var(--bob, 3.4s) ease-in-out infinite alternate;
}

/* Squashing the silhouette vertically reads as a wingbeat at this size */
.bird__glyph {
  display: block;
  width: 100%;
  height: auto;
  color: var(--bird-ink, rgba(24, 30, 38, .5));
  -webkit-animation: bird-flap var(--flap, .5s) ease-in-out infinite;
  animation: bird-flap var(--flap, .5s) ease-in-out infinite;
}

@-webkit-keyframes bird-cross {
  0%        { -webkit-transform: translateX(var(--from, -8%)); opacity: 0; }
  6%, 88%   { opacity: 1; }
  100%      { -webkit-transform: translateX(var(--to, 60%)); opacity: 0; }
}

@keyframes bird-cross {
  0%        { transform: translateX(var(--from, -8%)); opacity: 0; }
  6%, 88%   { opacity: 1; }
  100%      { transform: translateX(var(--to, 60%)); opacity: 0; }
}

@-webkit-keyframes bird-bob {
  from { -webkit-transform: translateY(calc(var(--rise, 2%) * -1)); }
  to   { -webkit-transform: translateY(var(--rise, 2%)); }
}

@keyframes bird-bob {
  from { transform: translateY(calc(var(--rise, 2%) * -1)); }
  to   { transform: translateY(var(--rise, 2%)); }
}

@-webkit-keyframes bird-flap {
  0%, 100% { -webkit-transform: scaleY(1); }
  50%      { -webkit-transform: scaleY(.34); }
}

@keyframes bird-flap {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(.34); }
}

/* No wildlife for visitors who asked for calm */
@media (prefers-reduced-motion: reduce) {
  .bird-layer { display: none; }
}
