@import url('./haptics.css');

.film-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1);
  pointer-events: none;
}
body:not(.video-background) .film-background { display: none; }
body.video-background .water-background { visibility: hidden; }
body.video-background .water-time { display: none; }
body.video-background:not(.landing) .film-background { filter: brightness(0.55); }

@media (prefers-reduced-motion: no-preference) {
  .film-background { transition: filter 700ms ease-in-out; }
}

.background-toggle, .haptic-control:has(> .background-toggle) {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}
.background-toggle {
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  padding: 8px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.background-toggle[hidden] { display: none; }
.background-toggle:focus-visible, .site-logo a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

body.landing main { flex: 1; }

@media (max-width: 767px) {
  /* Match the poster's sky/grass edges where Safari exposes the page backdrop. */
  :root:has(body.video-background) {
    --backdrop-sky: #799abb;
    --backdrop-grass: #496131;
    background-color: var(--backdrop-sky);
    background-image: linear-gradient(var(--backdrop-sky), var(--backdrop-grass));
    background-attachment: fixed;
  }
  :root:has(body.video-background:not(.landing)) {
    --backdrop-sky: #435567;
    --backdrop-grass: #28351b;
  }
  .background-toggle, .haptic-control:has(> .background-toggle) { grid-column: 1 / -1; }
}
