/* THRONESHARD 0.5.6 — Homepage Cinematic Hero R14.2 */
:root {
  --ts-hero-gold: #e6bf6a;
  --ts-hero-ivory: #f4e5ba;
  --ts-hero-black: #050403;
}

html.ts-home-cinematic-active,
body.ts-home-cinematic-active {
  background: var(--ts-hero-black);
}

body.ts-home-cinematic-active {
  overflow-x: hidden;
}

/* R14.2 — THRONESHARD homepage scrollbar: anthracite rail + hairline gold thumb. */
html.ts-home-cinematic-active {
  scrollbar-width: thin;
  scrollbar-color: rgba(211, 166, 78, .74) rgba(10, 9, 8, .58);
}
html.ts-home-cinematic-active::-webkit-scrollbar {
  width: 8px;
}
html.ts-home-cinematic-active::-webkit-scrollbar-track {
  background: rgba(10, 9, 8, .58);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.012);
}
html.ts-home-cinematic-active::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(240, 205, 128, .88), rgba(173, 119, 43, .78)) content-box;
  background-clip: content-box;
}
html.ts-home-cinematic-active::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(255, 225, 154, .98), rgba(202, 148, 63, .90)) content-box;
  background-clip: content-box;
}

/* The existing first hero becomes a true device-height cinematic stage. */
.ts-home-hero-videoized {
  position: relative !important;
  isolation: isolate;
  /* Break out of the legacy centered/max-width homepage wrapper. */
  width: 100vw !important;
  max-width: none !important;
  left: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  height: 100svh !important;
  min-height: 100svh !important;
  max-height: 100svh !important;
  overflow: hidden !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: clamp(76px, 8.5vh, 116px) !important;
  padding-bottom: clamp(32px, 5vh, 70px) !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  background: #050403 !important;
}

@supports (height: 100dvh) {
  .ts-home-hero-videoized {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
  }
}

.ts-home-hero-videoized > *:not(.ts-home-hero-media) {
  position: relative;
  z-index: 3;
}

.ts-home-hero-media {
  position: absolute !important;
  z-index: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  pointer-events: none;
  overflow: hidden;
  background: #050403;
}

.ts-home-hero-video {
  position: absolute;
  inset: 0;
  width: 100vw !important;
  max-width: none !important;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  background: #050403;
  transform: scale(1.035);
  filter: blur(8px);
  -webkit-filter: blur(8px);
}

/* Readability without making the video look like a dark rectangle. */
.ts-home-hero-media::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(4, 3, 2, .90) 0%,
      rgba(4, 3, 2, .76) 25%,
      rgba(4, 3, 2, .43) 48%,
      rgba(4, 3, 2, .10) 72%,
      rgba(4, 3, 2, .05) 100%),
    linear-gradient(180deg,
      rgba(3, 2, 2, .54) 0%,
      rgba(3, 2, 2, .08) 21%,
      rgba(3, 2, 2, .03) 70%,
      rgba(3, 2, 2, .62) 100%);
  pointer-events: none;
}

.ts-home-hero-media::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    radial-gradient(circle at 22% 54%, rgba(178, 122, 35, .10), transparent 35%),
    radial-gradient(circle at 74% 48%, transparent 28%, rgba(0,0,0,.22) 100%);
  box-shadow: inset 0 0 16vw rgba(0,0,0,.48);
  pointer-events: none;
}

/* Remove ONLY the old right-hand card fan once detected by JS. */
.ts-hero-old-artwork {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ts-home-hero-videoized .ts-hero-layout {
  width: min(100% - clamp(36px, 8vw, 160px), 1180px) !important;
  min-height: 0 !important;
  margin-inline: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  grid-template-columns: minmax(0, 760px) !important;
  gap: 0 !important;
}

.ts-home-hero-videoized .ts-hero-copy {
  width: min(100%, 760px) !important;
  max-width: 760px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

/* R14.2 — restore the copy to the original centered homepage content line.
   The Hero itself is full-bleed, but its text must not hug the viewport edge. */
.ts-home-hero-videoized > .ts-hero-copy {
  margin-left: max(21px, calc((100vw - 1340px) / 2)) !important;
  margin-right: auto !important;
}

.ts-home-hero-videoized h1 {
  max-width: 760px !important;
  margin-top: 0 !important;
  margin-bottom: clamp(18px, 2.4vh, 30px) !important;
  font-size: clamp(3.15rem, 5.4vw, 6.2rem) !important;
  line-height: .91 !important;
  letter-spacing: -.045em !important;
  text-wrap: balance;
  color: #f6e9c2 !important;
  text-shadow:
    0 2px 0 rgba(0,0,0,.35),
    0 12px 42px rgba(0,0,0,.72),
    0 0 62px rgba(186,126,40,.07);
}

.ts-home-hero-videoized p {
  text-shadow: 0 2px 18px rgba(0,0,0,.85);
}

/* Preserve the existing CTA visual identity but make it sit cleanly over motion. */
.ts-home-hero-videoized a,
.ts-home-hero-videoized button {
  position: relative;
  z-index: 4;
}

/* Existing header/nav is placed over the cinematic rather than reserving a strip. */
.ts-home-nav-videoized {
  position: fixed !important;
  z-index: 10020 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  background: linear-gradient(180deg, rgba(5,4,3,.78) 0%, rgba(5,4,3,.25) 72%, transparent 100%) !important;
  border-bottom-color: rgba(221,176,81,.15) !important;
  box-shadow: none !important;
  backdrop-filter: blur(3px) saturate(1.05);
  -webkit-backdrop-filter: blur(3px) saturate(1.05);
  transition: background .32s ease, border-color .32s ease, backdrop-filter .32s ease, box-shadow .32s ease;
}

.ts-home-nav-videoized.ts-nav-scrolled {
  background: rgba(7,6,5,.84) !important;
  border-bottom-color: rgba(221,176,81,.22) !important;
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 10px 40px rgba(0,0,0,.24) !important;
}

.ts-home-nav-videoized a {
  text-shadow: 0 2px 12px rgba(0,0,0,.78);
}

/* Sound control only becomes visually assertive when autoplay is blocked. */
.ts-home-hero-sound {
  position: fixed;
  z-index: 10040;
  right: clamp(14px, 2vw, 30px);
  bottom: clamp(14px, 2vw, 28px);
  min-width: 42px;
  height: 42px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(226,185,92,.38);
  border-radius: 999px;
  color: #f0d58e;
  background: rgba(7,6,5,.60);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0,0,0,.28), inset 0 0 20px rgba(198,138,44,.04);
  cursor: pointer;
  font: 700 10px/1 system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .58;
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease, background .2s ease;
}

.ts-home-hero-sound:hover,
.ts-home-hero-sound:focus-visible,
.ts-home-hero-sound.ts-audio-needs-gesture {
  opacity: 1;
  border-color: rgba(240,203,116,.75);
  background: rgba(11,9,6,.78);
}

.ts-home-hero-sound:hover { transform: translateY(-1px); }
.ts-home-hero-sound-icon { font-size: 14px; line-height: 1; }

/* Tablet / compact desktop */
@media (max-width: 980px) {
  .ts-home-hero-media::before {
    background:
      linear-gradient(90deg, rgba(4,3,2,.89) 0%, rgba(4,3,2,.68) 46%, rgba(4,3,2,.22) 100%),
      linear-gradient(180deg, rgba(3,2,2,.56), rgba(3,2,2,.05) 32%, rgba(3,2,2,.48));
  }
  .ts-home-hero-videoized .ts-hero-layout {
    width: min(100% - 42px, 920px) !important;
  }
  .ts-home-hero-videoized .ts-hero-copy {
    width: min(74vw, 700px) !important;
  }
}

/* Mobile portrait: video still fills the full first screen. */
@media (max-width: 700px) {
  .ts-home-hero-videoized {
    padding: 88px 22px 30px !important;
    align-items: flex-end !important;
  }
  .ts-home-hero-video {
    object-position: 60% 50%;
  }
  .ts-home-hero-media::before {
    background:
      linear-gradient(180deg, rgba(4,3,2,.28) 0%, rgba(4,3,2,.20) 35%, rgba(4,3,2,.88) 100%),
      linear-gradient(90deg, rgba(4,3,2,.52), rgba(4,3,2,.12));
  }
  .ts-home-hero-videoized .ts-hero-layout,
  .ts-home-hero-videoized .ts-hero-copy {
    width: 100% !important;
    max-width: none !important;
  }
  .ts-home-hero-videoized > .ts-hero-copy {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .ts-home-hero-videoized h1 {
    font-size: clamp(2.65rem, 13vw, 4.6rem) !important;
    line-height: .92 !important;
    max-width: 100% !important;
  }
}

/* Mobile landscape: prioritize vertical room, as requested. */
@media (orientation: landscape) and (max-height: 620px) {
  .ts-home-hero-videoized {
    padding-top: 66px !important;
    padding-bottom: 18px !important;
  }
  .ts-home-hero-videoized .ts-hero-layout {
    width: min(100% - 64px, 1100px) !important;
  }
  .ts-home-hero-videoized .ts-hero-copy {
    width: min(62vw, 680px) !important;
  }
  .ts-home-hero-videoized h1 {
    font-size: clamp(2.7rem, 6.7vw, 4.8rem) !important;
    margin-bottom: 12px !important;
  }
  .ts-home-hero-videoized p {
    font-size: clamp(.82rem, 1.35vw, 1rem) !important;
    line-height: 1.42 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ts-home-nav-videoized,
  .ts-home-hero-sound { transition: none !important; }
  .ts-home-hero-video { transform: scale(1.035); }
}
