:root {
  --ink: #0b0e11;
  --fog: #d6dde2;
  --rec: #f0183f;
  --fog-dim: rgba(214, 221, 226, 0.5);
  /* keeps the figure in frame when the image is cropped on narrow screens */
  --focus: 34% 50%;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--fog);
}

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

/* Both image layers sway together; transform is driven by sway.js. */
.hero__scene {
  position: absolute;
  inset: 0;
  transform: scale(1.09);
  transform-origin: var(--focus);
  will-change: transform;
}

.hero__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus);
}

/* The figure lives on its own layer and only shows up now and then. */
.hero__figure {
  opacity: 0;
  animation: appear 28s ease-in-out 4s infinite;
}

.hero__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at var(--focus), transparent 35%, rgba(5, 7, 9, 0.75) 100%),
    linear-gradient(to top, rgba(5, 7, 9, 0.85) 0%, transparent 35%);
  pointer-events: none;
}

.hero__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.09;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: clamp(28px, 7vh, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.hero__place {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font: 400 1.35rem/1 "VT323", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rec);
  /* soft bloom, like an LCD overlay bleeding into the footage */
  text-shadow: 0 0 6px rgba(240, 24, 63, 0.55), 0 0 18px rgba(240, 24, 63, 0.25);
}

.hero__place svg {
  width: 0.9em;
  height: 0.9em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(240, 24, 63, 0.6));
}

.hero__note {
  margin: 0;
  font: 400 1rem/1 "VT323", monospace;
  letter-spacing: 0.08em;
  color: var(--fog-dim);
}

@keyframes appear {
  0%, 30%   { opacity: 0; }
  45%, 70%  { opacity: 1; }
  85%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__figure { animation: none; opacity: 1; }
}
