/*
 * ENDBRINGER - Version 3 comparison concepts
 * Two isolated hero treatments built from the committed Version 2 baseline.
 */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.v3-compare .hero {
  --scene-x: 0px;
  --scene-y: 0px;
  --scene-rx: 0deg;
  --scene-ry: 0deg;
  --light-shift: 0px;
}

.v3-compare .hero-stone-v3 {
  perspective: 1100px;
}

.v3-compare .hero-stone-art {
  position: absolute;
  z-index: 0;
  inset: -1.4%;
  display: block;
  overflow: hidden;
  transform: perspective(1100px)
    translate3d(var(--scene-x), var(--scene-y), 0)
    rotateX(var(--scene-rx))
    rotateY(var(--scene-ry));
  transform-origin: 32% 42%;
  transition: transform 280ms cubic-bezier(0.2, 0.75, 0.2, 1);
  will-change: transform;
}

.v3-compare .hero-stone-art img {
  inset: 0;
}

.v3-motion .hero-stone-fallback {
  z-index: 0;
}

.v3-motion .hero-wall-video {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: left center;
  opacity: 0;
  filter: brightness(0.91) contrast(1.06) saturate(0.92);
  pointer-events: none;
  transition: opacity 650ms ease, filter 360ms ease;
}

.v3-motion .hero-wall-video.has-frame {
  opacity: 1;
}

.v3-compare .stone-vignette {
  background:
    linear-gradient(90deg, rgba(2, 1, 1, 0.12) 0%, transparent 17%, transparent 48%, rgba(2, 1, 1, 0.28) 67%, rgba(2, 1, 1, 0.72) 100%),
    linear-gradient(to bottom, rgba(2, 1, 1, 0.58) 0%, transparent 13%, transparent 73%, rgba(2, 1, 1, 0.76) 100%),
    radial-gradient(ellipse at 28% 48%, transparent 22%, rgba(0, 0, 0, 0.24) 72%);
}

.v3-compare .hero-footnote {
  display: none;
}

/* The wordmark and mouth-driven light are physical parts of the art. */

.v3-mouthfire .hero-copy {
  margin-top: clamp(5.5rem, 10vh, 7.5rem);
}

.v3-mouthfire .hero-stone-art img {
  filter: brightness(0.84) contrast(1.08) saturate(0.9);
  transform: translateX(-2.4%) scale(1.015);
}

.js .v3-mouthfire .hero-stone-art img {
  filter: brightness(0.23) contrast(1.17) saturate(0.56);
  transform: translateX(-2.4%) scale(1.045);
}

.js.is-ready .v3-mouthfire .hero-stone-art img {
  filter: brightness(0.84) contrast(1.08) saturate(0.9);
  transform: translateX(-2.4%) scale(1.015);
}

.v3-mouthfire .hero-eyebrow {
  margin-bottom: 0.55rem;
}

.v3-mouthfire .baked-title-slot {
  display: block;
  width: min(100%, 44rem);
  height: clamp(15rem, 19vw, 18.5rem);
  pointer-events: none;
}

.v3-mouthfire .baked-title-slot::after {
  display: none;
}

.v3-mouthfire .hero-decree {
  max-width: 29rem;
  margin-top: 1.75rem;
}

.v3-mouthfire .hero-actions {
  margin-top: 1.45rem;
}

.v3-mouthfire .mouth-glow {
  position: absolute;
  z-index: 3;
  top: 38.4%;
  left: 30.7%;
  display: block;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--light-shift));
}

.v3-mouthfire .mouth-glow::before,
.v3-mouthfire .mouth-glow::after {
  position: absolute;
  left: 50%;
  content: "";
  pointer-events: none;
  mix-blend-mode: screen;
}

.v3-mouthfire .mouth-glow::before {
  top: 50%;
  width: clamp(9rem, 12vw, 13rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 229, 150, 0.34) 0 3%, rgba(255, 117, 35, 0.19) 15%, rgba(175, 34, 9, 0.07) 42%, transparent 70%);
  filter: blur(5px);
  transform: translate(-50%, -50%);
}

.v3-mouthfire .mouth-glow::after {
  top: -0.3rem;
  width: clamp(19rem, 28vw, 31rem);
  height: clamp(18rem, 26vw, 29rem);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 169, 71, 0.42), rgba(195, 54, 16, 0.15) 31%, transparent 69%);
  filter: blur(9px);
  clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
  transform: translateX(-50%);
  transform-origin: 50% 0;
}

.is-ready .v3-mouthfire .mouth-glow {
  animation:
    v3-light-catch 900ms cubic-bezier(0.2, 1.1, 0.3, 1) 1.25s both,
    v3-mouth-breathe 3.6s ease-in-out 2.2s infinite alternate;
}

/* Rendered sconces motivate a centered, accessible live title. */

.v3-sconces .hero-copy {
  margin-top: clamp(11rem, 22vh, 14rem);
}

.v3-sconces .hero-eyebrow {
  margin-bottom: 0.85rem;
}

.v3-sconces .title-stage {
  display: flex;
  width: min(100%, 43.5rem);
  justify-content: center;
}

.v3-sconces .title-stage::after,
.v3-sconces .wordmark::before {
  display: none;
}

.v3-sconces .wordmark {
  display: inline-flex;
  justify-content: center;
  color: #d5a15f;
  font-size: clamp(4rem, 5.35vw, 6.9rem);
  letter-spacing: -0.055em;
  line-height: 0.78;
  -webkit-text-stroke: 0.85px rgba(32, 14, 6, 0.96);
  filter: none;
  text-shadow:
    -2px -2px 1px rgba(255, 205, 125, 0.62),
    1px 1px 0 rgba(47, 20, 8, 0.98),
    3px 4px 0 rgba(20, 8, 4, 0.94),
    5px 7px 7px rgba(0, 0, 0, 0.92),
    -0.12em 0 1.25rem rgba(243, 93, 25, 0.13),
    0.12em 0 1.25rem rgba(243, 93, 25, 0.13);
}

.v3-sconces .title-letter {
  min-width: 0;
  color: #d5a15f;
  background: linear-gradient(180deg, #f2c67f 0%, #c38443 39%, #7b4826 70%, #382116 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.is-ready .v3-sconces .wordmark {
  color: #d5a15f;
  filter: none;
  animation: none;
}

.v3-sconces .hero-decree {
  margin-top: 1.65rem;
}

.v3-sconces .hero-actions {
  margin-top: 1.55rem;
}

.v3-sconces .sconce-glow {
  position: absolute;
  z-index: 3;
  top: 41.5%;
  display: block;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--light-shift));
}

.v3-sconces .sconce-glow-left {
  left: 7.8%;
}

.v3-sconces .sconce-glow-right {
  left: 44.2%;
}

.v3-sconces .sconce-glow::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(13rem, 18vw, 20rem);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, rgba(255, 218, 135, 0.28) 0 4%, rgba(255, 119, 35, 0.16) 17%, rgba(163, 39, 11, 0.065) 42%, transparent 70%);
  filter: blur(7px);
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
}

.is-ready .v3-sconces .sconce-glow-left {
  animation:
    v3-light-catch 850ms cubic-bezier(0.2, 1.1, 0.3, 1) 1.28s both,
    v3-sconce-left 3.25s ease-in-out 2.15s infinite alternate;
}

.is-ready .v3-sconces .sconce-glow-right {
  animation:
    v3-light-catch 850ms cubic-bezier(0.2, 1.1, 0.3, 1) 1.44s both,
    v3-sconce-right 3.85s ease-in-out 2.35s infinite alternate;
}

@keyframes v3-light-catch {
  from { opacity: 0; }
  58% { opacity: 0.64; }
  to { opacity: 0.38; }
}

@keyframes v3-mouth-breathe {
  0%, 100% { opacity: 0.34; }
  36% { opacity: 0.45; }
  47% { opacity: 0.37; }
  74% { opacity: 0.48; }
}

@media (min-width: 1101px) {
  .v3-mouthfire .baked-title-slot {
    margin-top: 4.5rem;
  }

  .v3-sconces .hero-copy {
    transform: translateY(2.5rem);
  }
}

@keyframes v3-sconce-left {
  0%, 100% { opacity: 0.22; }
  38% { opacity: 0.31; }
  51% { opacity: 0.25; }
  79% { opacity: 0.34; }
}

@keyframes v3-sconce-right {
  0%, 100% { opacity: 0.24; }
  33% { opacity: 0.34; }
  58% { opacity: 0.27; }
  81% { opacity: 0.32; }
}

@media (max-width: 1200px) {
  .v3-mouthfire .baked-title-slot {
    height: clamp(13.5rem, 21vw, 16rem);
  }

  .v3-sconces .wordmark {
    font-size: clamp(3.6rem, 5.15vw, 5.35rem);
  }
}

@media (max-width: 1100px) {
  .v3-motion .hero-wall-video {
    display: none;
  }

  .v3-compare .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 3.75rem;
    padding-top: 9rem;
  }

  .v3-compare .hero-stone {
    right: 0;
    bottom: auto;
    height: 54rem;
  }

  .v3-compare .hero-stone::after {
    position: absolute;
    z-index: 8;
    right: 0;
    bottom: 0;
    left: 0;
    height: 10rem;
    content: "";
    background: linear-gradient(to bottom, transparent, var(--ink));
  }

  .v3-compare .hero-stone-art {
    inset: -0.8% -1.4%;
    transform-origin: 50% 34%;
  }

  .v3-compare .hero-stone-art img {
    object-position: center 36%;
  }

  .v3-compare .stone-vignette {
    background:
      linear-gradient(to bottom, rgba(2, 1, 1, 0.56), transparent 10%, transparent 73%, rgba(2, 1, 1, 0.82)),
      radial-gradient(ellipse at 50% 44%, transparent 20%, rgba(0, 0, 0, 0.27) 76%);
  }

  .v3-mouthfire .hero-copy {
    width: min(38rem, 100%);
    min-height: 34rem;
    margin-top: 16.5rem;
  }

  .v3-mouthfire .baked-title-slot {
    width: 100%;
    height: clamp(15rem, 38vw, 18rem);
  }

  .v3-mouthfire .mouth-glow {
    top: 30.8%;
    left: 50%;
  }

  .v3-mouthfire .hero-stone-art img,
  .js .v3-mouthfire .hero-stone-art img,
  .js.is-ready .v3-mouthfire .hero-stone-art img {
    transform: scale(1.015);
  }

  .v3-sconces .hero-copy {
    width: min(38rem, 100%);
    min-height: 31rem;
    margin-top: 20rem;
  }

  .v3-sconces .title-stage {
    width: 100%;
  }

  .v3-sconces .wordmark {
    font-size: clamp(3.7rem, 12.4vw, 6rem);
  }

  .v3-sconces .sconce-glow {
    top: 45.4%;
  }

  .v3-sconces .sconce-glow-left {
    left: 11.2%;
  }

  .v3-sconces .sconce-glow-right {
    left: 88.8%;
  }

  .v3-compare .trailer-plane {
    margin-top: -0.8rem;
  }

  .v3-compare .trailer-frame,
  .js.is-ready .v3-compare .trailer-frame {
    transform: perspective(1100px) rotateY(-1deg) rotateX(0.3deg);
  }

  .js.is-ready .v3-compare .trailer-frame:hover,
  .js.is-ready .v3-compare .trailer-frame:focus-within {
    transform: none;
  }

  .v3-compare .hero-embers {
    inset: 0 16% 42% 16%;
  }
}

@media (max-width: 640px) {
  .v3-compare .hero {
    padding-top: 8.4rem;
  }

  .v3-mouthfire .hero-copy {
    min-height: 32rem;
    margin-top: 12rem;
  }

  .v3-compare .hero-stone-art img {
    object-fit: contain;
    object-position: center top;
  }

  .v3-mouthfire .hero-eyebrow {
    margin-bottom: 0;
    top: -1.25rem;
    position: relative;
  }

  .v3-mouthfire .baked-title-slot {
    height: clamp(13.5rem, 68vw, 17rem);
  }

  .v3-mouthfire .hero-decree,
  .v3-sconces .hero-decree {
    max-width: 23rem;
    font-size: clamp(1.12rem, 5vw, 1.4rem);
  }

  .v3-mouthfire .hero-decree {
    margin-top: 0.35rem;
  }

  .v3-mouthfire .hero-actions,
  .v3-sconces .hero-actions {
    margin-top: 1.25rem;
  }

  .v3-sconces .hero-copy {
    min-height: 29rem;
    margin-top: 15.75rem;
  }

  .v3-sconces .hero-eyebrow {
    margin-bottom: 0.6rem;
  }

  .v3-sconces .wordmark {
    font-size: clamp(2.95rem, 13.35vw, 5.1rem);
    letter-spacing: -0.06em;
    -webkit-text-stroke-width: 0.65px;
    text-shadow:
      -1px -1px 1px rgba(255, 205, 125, 0.62),
      1px 1px 0 rgba(47, 20, 8, 0.98),
      2px 3px 0 rgba(20, 8, 4, 0.94),
      3px 5px 5px rgba(0, 0, 0, 0.92),
      0 0 1rem rgba(243, 93, 25, 0.13);
  }
}

@media (max-width: 360px) {
  .v3-mouthfire .hero-eyebrow {
    top: -4rem;
  }

  .v3-mouthfire .baked-title-slot {
    height: 14.5rem;
  }

  .v3-sconces .hero-copy {
    margin-top: 14.5rem;
  }

  .v3-sconces .wordmark {
    font-size: clamp(2.7rem, 13vw, 3.15rem);
  }
}

@media (pointer: coarse) {
  .v3-compare .hero-stone-art {
    will-change: auto;
  }

  .v3-motion .hero-wall-video {
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v3-motion .hero-wall-video,
  .save-data .v3-motion .hero-wall-video {
    display: none;
  }

  .v3-compare .hero-stone-art {
    transform: none;
    transition: none;
    will-change: auto;
  }

  .v3-mouthfire .hero-stone-art img,
  .js .v3-mouthfire .hero-stone-art img,
  .js.is-ready .v3-mouthfire .hero-stone-art img {
    transform: none;
  }

  .v3-mouthfire .mouth-glow,
  .is-ready .v3-mouthfire .mouth-glow,
  .v3-sconces .sconce-glow,
  .is-ready .v3-sconces .sconce-glow {
    opacity: 0.26;
    animation: none;
    transform: none;
  }
}

/* The supplied animation becomes one living altar poster.
   The gameplay tape is summoned into a modal so the two films never compete. */

.v3-motion .hero {
  isolation: auto;
  overflow: visible;
}

.v3-motion .hero-stone-art {
  inset: 0;
  transform: none;
  transition: none;
  will-change: auto;
}

.v3-motion.v3-mouthfire .hero-stone-art img,
.js .v3-motion.v3-mouthfire .hero-stone-art img,
.js.is-ready .v3-motion.v3-mouthfire .hero-stone-art img {
  filter: brightness(0.86) contrast(1.08) saturate(0.9);
  transform: none;
  transition: none;
}

.v3-motion .hero-embers,
.v3-motion .mouth-glow {
  display: none;
}

.v3-motion .stone-vignette {
  z-index: 4;
  background:
    linear-gradient(90deg, rgba(2, 1, 1, 0.06) 0%, transparent 43%, rgba(2, 1, 1, 0.16) 58%, rgba(2, 1, 1, 0.82) 100%),
    linear-gradient(to bottom, rgba(2, 1, 1, 0.54), transparent 15%, transparent 72%, rgba(2, 1, 1, 0.8)),
    radial-gradient(ellipse at 29% 48%, transparent 24%, rgba(0, 0, 0, 0.22) 75%);
}

.v3-motion .trailer-plane {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  width: auto;
  height: 100svh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: auto;
  padding: clamp(4.5rem, 8vh, 6.5rem) clamp(0.75rem, 3vw, 3rem) 2rem;
  background:
    radial-gradient(circle at 50% 43%, rgba(106, 34, 12, 0.16), transparent 34rem),
    rgba(2, 1, 1, 0.78);
  backdrop-filter: blur(1.5px) brightness(0.72) saturate(0.76);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  perspective: none;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.v3-motion.trailer-open .trailer-plane {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 320ms ease, visibility 0s;
}

.v3-motion.trailer-open .hero-wall-video.has-frame {
  filter: brightness(0.58) contrast(1.08) saturate(0.78);
}

body.trailer-open {
  overflow: hidden;
}

.v3-motion .trailer-frame,
.js.is-ready .v3-motion .trailer-frame,
.js.is-ready .v3-motion .trailer-frame:hover,
.js.is-ready .v3-motion .trailer-frame:focus-within {
  width: min(72rem, calc(100vw - clamp(1.5rem, 6vw, 6rem)));
  max-width: 100%;
  opacity: 1;
  transform: translateY(1.25rem) scale(0.975);
  transform-origin: center;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 500ms ease;
}

.v3-motion.trailer-open .trailer-frame,
.js.is-ready .v3-motion.trailer-open .trailer-frame,
.js.is-ready .v3-motion.trailer-open .trailer-frame:hover,
.js.is-ready .v3-motion.trailer-open .trailer-frame:focus-within {
  transform: none;
}

.v3-motion .trailer-caption {
  width: min(72rem, calc(100vw - clamp(1.5rem, 6vw, 6rem)));
  max-width: 100%;
}

.trailer-modal-close {
  position: fixed;
  z-index: 4;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  display: grid;
  width: 3.25rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(212, 145, 82, 0.38);
  border-radius: 50%;
  background: rgba(8, 5, 3, 0.9);
  color: var(--bone);
  cursor: pointer;
  transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.trailer-modal-close::before,
.trailer-modal-close::after {
  position: absolute;
  width: 1.15rem;
  height: 1px;
  content: "";
  background: currentColor;
}

.trailer-modal-close::before {
  transform: rotate(45deg);
}

.trailer-modal-close::after {
  transform: rotate(-45deg);
}

.trailer-modal-close:hover,
.trailer-modal-close:focus-visible {
  border-color: var(--ember-hot);
  background: rgba(61, 20, 7, 0.92);
  outline: 2px solid transparent;
  transform: rotate(5deg);
}

@media (min-width: 1101px) {
  .v3-motion .hero {
    min-height: max(100svh, 52rem);
    grid-template-columns: minmax(0, 1.4fr) minmax(22rem, 0.6fr);
    gap: clamp(2rem, 4vw, 5rem);
  }

  .v3-motion .hero::before {
    z-index: 1;
    background:
      linear-gradient(90deg, transparent 0 52%, rgba(2, 1, 1, 0.28) 64%, rgba(2, 1, 1, 0.9) 100%),
      radial-gradient(ellipse at 79% 50%, rgba(83, 27, 9, 0.09), transparent 25rem);
  }

  .v3-motion .hero-copy {
    grid-column: 2;
    width: min(25rem, 100%);
    max-width: 25rem;
    justify-self: end;
    margin-top: 0;
    padding-left: 0;
    transform: none;
  }

  .v3-motion .baked-title-slot {
    display: none;
  }

  .v3-motion .hero-eyebrow {
    margin-bottom: 1.2rem;
  }

  .v3-motion .hero-decree {
    max-width: 24rem;
    margin-top: 0;
    color: #ead9c3;
    font-size: clamp(1.35rem, 1.75vw, 1.8rem);
    line-height: 1.32;
    text-shadow: 0 2px 10px #000;
  }

  .v3-motion .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    margin-left: 0;
  }
}

@media (max-width: 1100px) {
  .v3-motion .hero::before {
    background: linear-gradient(to bottom, transparent 0 66%, rgba(2, 1, 1, 0.38) 83%, rgba(2, 1, 1, 0.78));
  }

  .v3-motion .trailer-plane {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .v3-motion .trailer-plane {
    padding-top: 5rem;
  }

  .v3-motion .trailer-frame,
  .js.is-ready .v3-motion .trailer-frame,
  .js.is-ready .v3-motion .trailer-frame:hover,
  .js.is-ready .v3-motion .trailer-frame:focus-within,
  .v3-motion .trailer-caption {
    width: calc(100vw - 1.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .v3-motion .hero-wall-video,
  .save-data .v3-motion .hero-wall-video {
    display: none;
  }

  .v3-motion .trailer-plane,
  .v3-motion .trailer-frame,
  .js.is-ready .v3-motion .trailer-frame {
    transition: none;
  }
}
