@property --hero-scale {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

:root {
  --bg: #030201;
  --gold: 218 174 100;
  --rose: 235 184 188;
  --desktop-ratio: 1.7768331562;
  --flare-x: 49.75%;
  --flare-y: 21.1%;
  --aura-x: 50%;
  --aura-y: 44%;
  --aura-width: 39%;
}

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

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  color: #ead6b0;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

@supports (height: 100dvh) {
  body { min-height: 100dvh; }
}

.page {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
}

.ambient,
.ambient img,
.shade,
.particles,
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ambient {
  z-index: -4;
  overflow: hidden;
  display: block;
  background: var(--bg);
}

.ambient img {
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.12);
  filter: blur(clamp(28px, 4.5vw, 76px)) brightness(.23) saturate(1.08);
  animation: ambient-drift 24s ease-in-out infinite alternate;
  will-change: transform;
}

.shade {
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, rgba(178, 103, 33, .12), transparent 42%),
    linear-gradient(180deg, rgba(0,0,0,.52), rgba(0,0,0,.10) 48%, rgba(0,0,0,.62));
  box-shadow: inset 0 0 16vw rgba(0,0,0,.88);
}

.particles {
  z-index: 3;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  width: min(100vw, calc(100svh * var(--desktop-ratio)));
  max-width: 100vw;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  opacity: 0;
  background: #050302;
  box-shadow:
    0 0 clamp(38px, 8vw, 130px) rgba(0,0,0,.96),
    0 0 clamp(18px, 4vw, 72px) rgba(183,115,42,.11);
  transform-style: preserve-3d;
  transform: translate3d(var(--shift-x, 0px), var(--shift-y, 0px), 0) scale(var(--hero-scale, 1));
  filter: blur(10px) brightness(.50);
  transition: opacity 1.15s ease, filter 1.3s ease;
  animation: breathe 13s 2s ease-in-out infinite alternate;
  will-change: transform, filter;
}

@supports (height: 100dvh) {
  .stage { width: min(100vw, calc(100dvh * var(--desktop-ratio))); }
}

.stage.is-ready {
  opacity: 1;
  filter: blur(0) brightness(1);
}

.stage.is-replaying {
  animation: replay-reveal 1.25s cubic-bezier(.16,.84,.27,1) both,
             breathe 13s 1.3s ease-in-out infinite alternate;
}

.hero,
.hero img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero img {
  object-fit: cover;
  object-position: 50% 50%;
  user-select: none;
  -webkit-user-drag: none;
  filter: saturate(1.01) contrast(1.012);
  transform: scale(1.0005);
}

.stage::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 clamp(18px, 2.6vw, 54px) rgba(0,0,0,.34),
    inset 0 0 1px rgba(235,201,142,.16);
}

.light-sweep {
  position: absolute;
  z-index: 4;
  inset: -36% -55%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg,
    transparent 42%,
    rgba(255,238,198,.015) 47%,
    rgba(255,236,188,.18) 50%,
    rgba(255,224,183,.035) 53%,
    transparent 58%);
  mix-blend-mode: screen;
  transform: translateX(-58%) rotate(2deg);
  animation: sweep 9.5s 2.5s cubic-bezier(.18,.7,.2,1) infinite;
}

.diamond-flare {
  position: absolute;
  z-index: 6;
  left: var(--flare-x);
  top: var(--flare-y);
  width: clamp(14px, 2.15%, 39px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255,255,255,.98) 0 3%,
    rgba(255,232,192,.72) 7%,
    rgba(237,178,92,.20) 27%,
    transparent 68%);
  mix-blend-mode: screen;
  opacity: .58;
  filter: drop-shadow(0 0 9px rgba(255,211,139,.66));
  animation: flare 3.8s 1.7s ease-in-out infinite;
}

.diamond-flare::before,
.diamond-flare::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.diamond-flare::before {
  width: 270%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,247,225,.94), transparent);
}

.diamond-flare::after {
  width: 1px;
  height: 270%;
  background: linear-gradient(180deg, transparent, rgba(255,247,225,.94), transparent);
}

.ring-aura {
  position: absolute;
  z-index: 2;
  left: var(--aura-x);
  top: var(--aura-y);
  width: var(--aura-width);
  aspect-ratio: 1.1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse,
    rgba(226,159,75,.085) 0%,
    rgba(211,133,50,.035) 42%,
    transparent 72%);
  mix-blend-mode: screen;
  animation: aura 7.2s ease-in-out infinite alternate;
}

.replay-hit-area {
  position: absolute;
  z-index: 9;
  top: 0;
  right: 0;
  width: 14%;
  height: 10%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.replay-hit-area:focus-visible {
  outline: 1px solid rgba(var(--gold), .75);
  outline-offset: -6px;
}

.grain {
  z-index: 7;
  inset: -35%;
  width: 170%;
  height: 170%;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  animation: grain 8s steps(8) infinite;
}

.loader {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity .75s ease, visibility .75s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader span {
  width: clamp(44px, 5vw, 72px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(var(--gold), .18);
  border-top-color: rgba(232,196,132,.94);
  border-right-color: rgba(var(--rose), .58);
  box-shadow: 0 0 28px rgba(188,121,44,.14);
  animation: spin 1.15s cubic-bezier(.55,.2,.4,.82) infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@keyframes breathe {
  from { --hero-scale: 1; }
  to { --hero-scale: 1.006; }
}

@keyframes replay-reveal {
  0% { opacity: .12; filter: blur(12px) brightness(.38); transform: scale(1.018); }
  100% { opacity: 1; filter: blur(0) brightness(1); transform: scale(1); }
}

@keyframes ambient-drift {
  from { transform: scale(1.12) translate3d(-.7%, -.45%, 0); }
  to { transform: scale(1.17) translate3d(.8%, .55%, 0); }
}

@keyframes sweep {
  0%, 70% { opacity: 0; transform: translateX(-58%) rotate(2deg); }
  76% { opacity: .64; }
  88% { opacity: .20; }
  100% { opacity: 0; transform: translateX(58%) rotate(2deg); }
}

@keyframes flare {
  0%, 100% { opacity: .28; transform: translate(-50%, -50%) scale(.72) rotate(0); }
  47% { opacity: .88; transform: translate(-50%, -50%) scale(1.25) rotate(12deg); }
  59% { opacity: .48; transform: translate(-50%, -50%) scale(.9) rotate(18deg); }
}

@keyframes aura {
  from { opacity: .52; transform: translate(-50%, -50%) scale(.93); }
  to { opacity: .92; transform: translate(-50%, -50%) scale(1.07); }
}

@keyframes grain {
  0% { transform: translate3d(0,0,0); }
  20% { transform: translate3d(4%,-3%,0); }
  40% { transform: translate3d(-5%,2%,0); }
  60% { transform: translate3d(3%,5%,0); }
  80% { transform: translate3d(-2%,-4%,0); }
  100% { transform: translate3d(0,0,0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Art-directed portrait version for phones and portrait tablets. */
@media (orientation: portrait) and (max-width: 1024px) {
  :root {
    --flare-x: 49%;
    --flare-y: 18.45%;
    --aura-x: 50%;
    --aura-y: 39.5%;
    --aura-width: 76%;
  }

  .stage {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100svh;
    aspect-ratio: auto;
    box-shadow: none;
  }

  @supports (height: 100dvh) {
    .stage { height: 100dvh; }
  }

  .hero img {
    object-fit: cover;
    object-position: 50% 50%;
  }

  .ambient img {
    object-position: 50% 50%;
    filter: blur(42px) brightness(.18) saturate(1.08);
  }

  .shade {
    background:
      radial-gradient(circle at 50% 39%, rgba(178,103,33,.12), transparent 39%),
      linear-gradient(180deg, rgba(0,0,0,.30), rgba(0,0,0,.04) 48%, rgba(0,0,0,.36));
    box-shadow: inset 0 0 24vw rgba(0,0,0,.58);
  }

  .diamond-flare { width: clamp(16px, 6vw, 32px); }
  .light-sweep { inset: -20% -95%; }
  .replay-hit-area { display: none; }
}

/* Landscape phones use the desktop artwork but fill the screen. */
@media (orientation: landscape) and (max-height: 600px) {
  .stage {
    width: 100vw;
    height: 100vh;
    height: 100svh;
    max-width: none;
    aspect-ratio: auto;
    box-shadow: none;
  }

  .hero img { object-fit: cover; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .particles { display: none; }
  .stage { transform: none; }
}
