:root {
  --bg-fallback: #0a0a0a;
  --text: rgba(255, 255, 255, 0.96);
  --text-muted: rgba(255, 255, 255, 0.55);
  --quote-mark: rgba(255, 255, 255, 0.32);
  --quote-mark-strong: rgba(255, 255, 255, 0.55);
}

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

html,
body {
  min-height: 100%;
  background: var(--bg-fallback);
}

html {
  /* eliminates the ~translucent gap iOS Safari leaves above the chrome */
  background: var(--bg-fallback);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ===== BACKGROUND STAGE ===== */

.bg-stage {
  position: fixed;
  inset: 0;
  /* iOS Safari: fixed elements lose under-chrome coverage unless we
     explicitly extend past the dynamic safe areas */
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100lvh;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-fallback);
}

/* shared motion wrapper — both layers ride this transform so they stay locked */
.bg-motion {
  position: absolute;
  inset: -12%;
  animation: bg-zoom 89s ease-in-out infinite alternate;
  will-change: transform;
  backface-visibility: hidden;
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  /* identical pan on both layers → perfectly synced */
  animation: bg-pan 113s ease-in-out infinite alternate;
  will-change: background-position;
  backface-visibility: hidden;
}

/* dark layer is the always-on background — 100% opacity, never fades */
.bg-layer--dark {
  background-image: url('assets/bg-dark-1600.webp');
  opacity: 1;
}

/* light layer is the only one that opacity-animates — fades in / out over the dark */
.bg-layer--light {
  background-image: url('assets/bg-light-1600.webp');
  animation:
    bg-pan 113s ease-in-out infinite alternate,
    bg-fade 67s ease-in-out infinite;
  will-change: background-position, opacity;
}

@media (min-width: 1024px) {
  .bg-layer--dark  { background-image: url('assets/bg-dark-2400.webp'); }
  .bg-layer--light { background-image: url('assets/bg-light-2400.webp'); }
}

.bg-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at center,
      transparent 0%,
      transparent 40%,
      rgba(0, 0, 0, 0.55) 100%
    );
}

/* shared pan path — both layers walk it identically; multi-stop, asymmetric percentages
   so it doesn't feel like a metronome back-and-forth */
@keyframes bg-pan {
  0%   { background-position: 28% 32%; }
  13%  { background-position: 58% 22%; }
  27%  { background-position: 71% 51%; }
  39%  { background-position: 44% 73%; }
  54%  { background-position: 24% 49%; }
  68%  { background-position: 63% 64%; }
  81%  { background-position: 36% 25%; }
  92%  { background-position: 70% 41%; }
  100% { background-position: 47% 55%; }
}

/* zoom path also asymmetric — multi-stop, irregular percentages */
@keyframes bg-zoom {
  0%   { transform: scale(1.08); }
  19%  { transform: scale(1.17); }
  34%  { transform: scale(1.11); }
  52%  { transform: scale(1.24); }
  71%  { transform: scale(1.13); }
  88%  { transform: scale(1.20); }
  100% { transform: scale(1.09); }
}

/* ONLY the top (light) layer opacity-animates.
   Long holds at 1 and 0, sharp transitions in between → you always see ONE
   distinct image, never a 50/50 mid-blend. Bottom layer is always 100%. */
@keyframes bg-fade {
  0%, 44%   { opacity: 1; }
  50%, 94%  { opacity: 0; }
  100%      { opacity: 1; }
}

/* ===== HERO ===== */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 4rem);
  text-align: center;
}

.hero__logo {
  width: clamp(220px, 28vw, 380px);
  height: auto;
  margin-bottom: clamp(2.5rem, 7vh, 4.5rem);
  filter: drop-shadow(0 6px 32px rgba(0, 0, 0, 0.55));
  opacity: 0;
  animation: hero-rise 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s forwards;
}

.hero__quote {
  position: relative;
  max-width: 720px;
  padding: 0 clamp(2rem, 5vw, 3.5rem);
  opacity: 0;
  animation: hero-rise 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.75s forwards;
}

.hero__mark {
  position: absolute;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.hero__mark--open {
  top: -0.15em;
  left: 0;
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: var(--quote-mark);
}

.hero__mark--close {
  bottom: -0.55em;
  right: 0;
  font-size: clamp(4.5rem, 9vw, 7rem);
  color: var(--quote-mark-strong);
}

.hero__text {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.hero__attr {
  margin-top: clamp(1.75rem, 4.5vh, 2.75rem);
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  font-style: italic;
  font-weight: 300;
  color: var(--text-muted);
  text-align: right;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.hero__attr sup {
  font-size: 0.7em;
  margin-left: 1px;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
  .bg-motion,
  .bg-layer { animation: none !important; }
  .bg-layer--light { opacity: 0.55; }
  .hero__logo,
  .hero__quote {
    animation: none !important;
    opacity: 1;
  }
}
