/* HERO: the game's title screen. The living dusk city (js/game/backdrop.js, the game's own painter)
   behind the wordmark, a shade so the copy reads, and Col. Reyes on the radio. */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 600px; max-height: 1400px;
  display: flex; align-items: center;
  background: var(--bg-0);
}

/* art: the painted poster first, the live painting fades in over it once the worker has painted */
.hero__art { position: absolute; inset: 0; z-index: -2; }
.hero__poster, .hero__live { position: absolute; top: 0; left: 0; display: block; max-width: none; }
.hero__poster { width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; animation: hero-poster 2.4s var(--ease-out) both; }
@keyframes hero-poster { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
/* the live painting is sized like the window (the painter works in window pixels) */
.hero__live { width: 100vw; height: 100vh; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.hero.is-live .hero__live { opacity: 1; }
.hero__embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* the title screen's scrim: the copy reads, the monster and the squad stay lit */
.hero__shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,6,7,.88) 0%, rgba(5,6,7,.66) 26%, rgba(5,6,7,.2) 48%, rgba(5,6,7,0) 62%),
    linear-gradient(0deg, var(--bg-0) 0%, rgba(5,6,7,.55) 14%, transparent 34%),
    linear-gradient(180deg, rgba(5,6,7,.55) 0%, transparent 18%),
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.5) 100%);
}

.hero__inner { position: relative; display: grid; justify-items: start; gap: 22px; padding-top: var(--nav-h); }
.hero__inner > * { max-width: 640px; }

/* the wordmark, its letters rising like on the game's title screen */
.hero__logo { width: min(600px, 44vw); margin: 4px 0 0; }
.hero__logo .logo { width: 100%; height: auto; overflow: visible; }
.hero__logo .lt { animation: lg-letter 1100ms var(--ease-out) both; animation-delay: calc(350ms + var(--i) * 75ms); }
@keyframes lg-letter { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
.hero__logo .logo__hive { animation: lg-hive 1400ms var(--ease-out) 1050ms both, lg-pulse 4s ease-in-out 2.5s infinite; }
@keyframes lg-hive { 0% { opacity: 0; filter: blur(4px); } 60% { opacity: 1; filter: none; } 100% { opacity: .85; } }
@keyframes lg-pulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
.hero__logo .logo__eye { animation: lg-eye 3.2s ease-in-out infinite; }
@keyframes lg-eye { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.hero__sub-title { display: flex; align-items: center; gap: 16px; margin-top: 18px; animation: hero-slide 900ms var(--ease-out) 1000ms both; }
.hero__sub-title i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-3)); }
.hero__sub-title span { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.25rem, 2.3vw, 2.1rem); line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
@keyframes hero-slide { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

.hero__line { font-size: clamp(1.1rem, 1.7vw, 1.45rem); color: var(--bone-2); }
.hero__line strong { color: var(--bone); font-weight: 600; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero__radio svg { width: 14px; height: 14px; }
/* playing: amber, with a stop square and "Stop transmission" (hero.js) */
.hero__radio.is-on { --btn-fg: var(--amber); --btn-line: rgba(255, 177, 46, 0.5); }

.hero__platforms { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 4px; font-family: var(--f-display); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone-3); }
.hero__platforms li { display: inline-flex; align-items: center; gap: 6px; }
.hero__platforms li + li::before { content: ''; width: 4px; height: 4px; margin: 0 14px; border-radius: 50%; background: var(--bone-4); }
.hero__platforms small { font: inherit; font-size: 0.72rem; padding: 1px 6px; border-radius: var(--r-1); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255, 177, 46, 0.4); }

/* Reyes on the radio: speaker, wave meter and the line, word by word */
.hero__sub {
  position: absolute; left: max(var(--gutter), (100% - var(--wrap)) / 2); bottom: clamp(56px, 8vh, 96px); z-index: 2; width: min(680px, calc(100% - 2 * var(--gutter)));
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center;
  padding: 14px 44px 16px 14px; transform: translateY(14px); opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20,24,29,.78), rgba(10,12,15,.72));
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(236,230,217,.07), 0 20px 60px rgba(0,0,0,.4);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: opacity var(--d-med) var(--ease-out), transform var(--d-med) var(--ease-out);
}
.hero__sub.is-on { opacity: 1; transform: none; pointer-events: auto; }
.hero__avatar { grid-row: span 2; position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line-2); }
.hero__avatar .reyes { position: absolute; width: 170%; left: -35%; top: -18%; -webkit-mask-image: none; mask-image: none; }
/* name, role and meter each stay whole and wrap as units on a narrow box */
.hero__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; white-space: nowrap; font-family: var(--f-display); font-weight: 600; font-size: var(--t-micro); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--bone-3); }
.hero__who b { color: var(--amber); font-weight: 700; }
.hero__wave { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.hero__wave i { width: 3px; height: 100%; background: var(--amber); transform: scaleY(var(--h, .3)); transform-origin: center; transition: transform 60ms linear; }
.hero__text { font-size: clamp(1rem, 1.35vw, 1.15rem); line-height: 1.4; color: var(--bone); min-height: 2.8em; }
.hero__close { position: absolute; top: 8px; right: 12px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--bone-3); }
.hero__close:hover { color: var(--bone); }
.hero__close svg { width: 14px; height: 14px; }
/* the ring inside the button: the box's cut corner would clip one outside it */
.hero__close:focus-visible { outline-offset: -2px; }
/* closed: the speaker and the close button leave the tab order and screen readers once the box has faded
   (the line itself stays rendered, empty: it is the live region) */
.hero__who, .hero__close { visibility: hidden; transition: visibility 0s linear var(--d-med); }
.hero__sub.is-on .hero__who, .hero__sub.is-on .hero__close { visibility: visible; transition-delay: 0s; }

/* scroll cue */
.hero__scroll { position: absolute; left: 50%; bottom: 22px; width: 24px; height: 44px; transform: translateX(-50%); display: grid; justify-items: center; }
.hero__scroll span { position: relative; width: 1px; height: 100%; background: var(--line-2); overflow: hidden; }
/* moved with transform (from -40% to 110% of the line), so the endless cue never re-lays out the page */
.hero__scroll span::after { content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 40%; background: var(--amber); transform: translateY(-100%); animation: hero-cue 2.2s var(--ease-in-out) infinite; }
@keyframes hero-cue { to { transform: translateY(275%); } }

@media (max-width: 900px), (orientation: portrait) {
  /* z-index: the hero stacks over the sections after it (under the top bar), so the transmission box,
     which rides along under the top bar while he talks, is never buried by them */
  .hero { z-index: 10; align-items: flex-end; height: auto; min-height: 100svh; max-height: none; padding-bottom: 96px; }
  .hero__poster { object-position: 70% 30%; height: 72%; }
  .hero__shade {
    background:
      linear-gradient(0deg, var(--bg-0) 0%, var(--bg-0) 34%, rgba(5,6,7,.7) 52%, rgba(5,6,7,0) 70%),
      linear-gradient(180deg, rgba(5,6,7,.6) 0%, transparent 16%);
  }
  .hero__inner { gap: 16px; }
  .hero__logo { width: min(440px, 82vw); }
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 220px; }
  .hero__platforms { gap: 8px 18px; }
  .hero__platforms li + li::before { display: none; }
  /* hung from the top bar, over the painting: the copy and both buttons sit at the bottom of the hero */
  .hero__sub { position: fixed; left: var(--gutter); top: var(--nav-h); bottom: auto; transform: translateY(-14px); }
  .hero__scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__live, .hero__embers { display: none; }
}
:root[data-motion='off'] .hero__live, :root[data-motion='off'] .hero__embers { display: none; }

/* the hero's copy enters on load (not on scroll: it is the first thing on screen) */
[data-hero-in] { animation: hero-rise 900ms var(--ease-out) both; animation-delay: calc(500ms + var(--i, 0) * 120ms); }
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
