/*
 * Territory Rumble: coming soon.
 * Colours and type follow the game's garage: dark teal-black, cream text, the orange #f2622b, and the logo in a heavy
 * condensed italic. The game uses Impact; Anton (SIL Open Font Licence, self-hosted) is the match on every device.
 */
@font-face {
  font-family: "Anton";
  src: url(/fonts/anton-latin-v27.woff2) format("woff2");
  font-display: swap;
}

:root {
  --ink: #071314;
  --ink-text: #192426;
  --panel: rgba(11, 19, 20, .62);
  --line: rgba(255, 255, 255, .16);
  --cream: #f3ead7;
  --text: #f6efdf;
  --muted: #c9c3b2;
  --orange: #f2622b;
  --display: Anton, Impact, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); color: var(--text); font: 16px/1.5 Arial, Helvetica, sans-serif; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--ink); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
svg { display: block; fill: currentColor; }

/* Hero: poster (and, once uploaded, the muted loop) behind the title */
.hero {
  position: relative; isolation: isolate; flex: 1 0 auto;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 92vh; min-height: 92svh;
  padding: 96px var(--gutter) max(40px, env(safe-area-inset-bottom));
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -2; background: var(--ink); }
.hero-media img, .hero-media video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 32%;
}
.hero-loop { opacity: 0; transition: opacity .9s ease; }
.hero-loop.is-playing { opacity: 1; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(7, 19, 20, .96) 0%, rgba(7, 19, 20, .78) 34%, rgba(7, 19, 20, .2) 62%, rgba(7, 19, 20, 0) 74%),
    linear-gradient(180deg, rgba(7, 19, 20, .5) 0%, rgba(7, 19, 20, 0) 16%);
}
/* A kerb along the bottom edge */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: repeating-linear-gradient(-60deg, var(--orange) 0 18px, var(--cream) 18px 36px);
}

.hero-copy { position: relative; max-width: 640px; }
.kicker {
  margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: #e4dcc6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.kicker::before { content: ""; width: 22px; height: 3px; background: var(--orange); }

.logo {
  margin: 0; font: 400 clamp(3.1rem, 16.5vw, 8rem)/.86 var(--display); text-transform: uppercase; letter-spacing: -.004em;
  transform: skewX(-9deg); transform-origin: left bottom;
  text-shadow: 0 4px 0 #091112, 0 12px 30px rgba(0, 0, 0, .5);
}
.logo span { display: block; color: var(--cream); white-space: nowrap; }
.logo b { display: block; font-weight: 400; font-size: 1.42em; color: var(--orange); white-space: nowrap; }

.soon {
  display: inline-block; margin: 20px 0 0; padding: 7px 14px 6px;
  font: 400 clamp(1.3rem, 5.6vw, 1.75rem)/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-text); background: var(--cream); transform: skewX(-9deg); transform-origin: left bottom;
}
.line {
  margin: 18px 0 0; max-width: 34ch; font-size: clamp(1rem, 3.9vw, 1.15rem); line-height: 1.45; color: var(--muted);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}
.line strong { color: var(--text); }
.line a { color: var(--orange); font-weight: 700; text-underline-offset: 3px; }
.hero-plain { justify-content: center; background: radial-gradient(circle at 50% 30%, #24363a 0%, var(--ink) 62%); }
.hero-plain::before { display: none; }

/* The trailer button, or "Trailer coming soon" in the same space */
.trailer-slot { margin-top: 26px; min-height: 68px; }
.watch, .trailer-soon {
  display: inline-flex; align-items: center; gap: 14px; min-height: 68px; margin: 0;
  padding: 10px 26px 10px 12px; border-radius: 15px;
}
.watch {
  border: 0; cursor: pointer; text-align: left; color: #fff8eb;
  background: linear-gradient(100deg, #ff8441 0%, #f2622b 52%, #d84a1b 100%);
  box-shadow: 0 14px 30px -12px rgba(242, 98, 43, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  animation: arrive .45s ease both;
}
.watch:active { transform: translateY(1px) scale(.99); }
.watch:focus-visible, .loop-toggle:focus-visible, .lightbox-close:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.watch-icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: rgba(7, 19, 20, .28); }
.watch-icon svg { width: 24px; height: 24px; }
.watch .watch-icon svg { margin-left: 3px; }
.watch-text { display: flex; flex-direction: column; gap: 4px; font: 400 1.6rem/1 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.watch-text small { font: 800 10px/1 Arial, Helvetica, sans-serif; letter-spacing: .16em; opacity: .9; }
.trailer-soon { color: var(--muted); border: 1px solid var(--line); background: var(--panel); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.trailer-soon .watch-text { font-size: 1.3rem; }
.trailer-soon .watch-icon { background: rgba(255, 255, 255, .08); }

@media (hover: hover) {
  .watch:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 18px 34px -12px rgba(242, 98, 43, 1), inset 0 1px 0 rgba(255, 255, 255, .4); }
  .loop-toggle:hover, .lightbox-close:hover { background: rgba(242, 98, 43, .92); border-color: transparent; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } }

/* Pause control for the background loop: top right on phones, bottom right on wider screens */
.loop-toggle {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: var(--gutter); display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .15s ease;
}
.loop-toggle svg { width: 18px; height: 18px; }
.loop-toggle .icon-play, .loop-toggle.is-paused .icon-pause { display: none; }
.loop-toggle.is-paused .icon-play { display: block; }

.foot { padding: 18px var(--gutter) max(18px, env(safe-area-inset-bottom)); background: var(--ink); }
.foot p { margin: 0; font-size: 12px; letter-spacing: .06em; color: #8f9c95; }

/* Lightbox */
.lightbox {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text); overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(3, 8, 9, .94); }
.lightbox-frame { width: min(100vw - 2 * var(--gutter), 1280px, (100vh - 140px) * 16 / 9); }
@supports (height: 100svh) { .lightbox-frame { width: min(100vw - 2 * var(--gutter), 1280px, (100svh - 140px) * 16 / 9); } }
.trailer { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.trailer-error { margin: 14px 0 0; text-align: center; color: var(--muted); }
.lightbox-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: var(--gutter); z-index: 1; display: grid; place-items: center;
  width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel); transition: background .15s ease;
}
.lightbox-close svg { width: 22px; height: 22px; }

/* Wider screens: copy on the left over a side scrim, as in the game's garage */
@media (min-width: 760px) and (orientation: landscape) {
  .hero { min-height: 100vh; min-height: 100svh; padding: 120px 6vw 72px; }
  .hero::before {
    background:
      linear-gradient(90deg, rgba(7, 19, 20, .86) 0%, rgba(7, 19, 20, .6) 30%, rgba(7, 19, 20, 0) 58%),
      linear-gradient(0deg, rgba(7, 19, 20, .85) 0%, rgba(7, 19, 20, .25) 34%, rgba(7, 19, 20, 0) 52%),
      linear-gradient(180deg, rgba(7, 19, 20, .45) 0%, rgba(7, 19, 20, 0) 16%);
  }
  .logo { font-size: clamp(4.2rem, 8.4vw, 8.4rem); }
  .loop-toggle { top: auto; right: 6vw; bottom: 64px; }
  .foot { padding-inline: 6vw; }
}
/* Short landscape screens (phones on their side) */
@media (orientation: landscape) and (max-height: 520px) {
  .hero { padding-top: 24px; padding-bottom: 28px; }
  .kicker { margin-bottom: 10px; }
  .logo { font-size: clamp(2.2rem, 10vh, 4rem); }
  .soon { margin-top: 12px; font-size: 1.15rem; }
  .line { margin-top: 10px; max-width: 52ch; font-size: .95rem; }
  .trailer-slot { margin-top: 14px; min-height: 56px; }
  .watch, .trailer-soon { min-height: 56px; padding-block: 6px; }
  .watch-icon { width: 40px; height: 40px; }
  .watch-text { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
