/* ══════════════════════════════════════════════════════════════
   HexTV — shared design system
   Token names match the originals so page scripts that use
   var(--surface2), var(--muted) etc. in inline styles keep working.

   Performance rules: no backdrop-filter, no animated blur, and
   animations only on transform/opacity.
══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #e50914;
  --red-dark: #b20710;
  --red-hot: #ff2d3a;
  --amber: #ff8a3d;
  --red-glow: rgba(229, 9, 20, 0.22);
  --black: #050507;
  --dark: #0a0a0e;
  --surface: #111116;
  --surface2: #1a1a21;
  --surface3: #23232c;
  --glass: rgba(20, 20, 27, 0.9);
  --glass-strong: rgba(10, 10, 14, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #f6f6f8;
  --muted: #9a9aa8;
  --muted2: #5f5f6c;
  --imdb-gold: #f5c518;
  --green: #22c55e;
  --topbar-h: 56px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --grad-red: linear-gradient(135deg, #ff2d3a 0%, #e50914 45%, #b20710 100%);
  --grad-heat: linear-gradient(90deg, #e50914, #ff5a36 55%, #ff8a3d);
}

html { -webkit-text-size-adjust: 100%; font-size: 15px; }
body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(229, 9, 20, 0.45); color: #fff; }

:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; border-radius: 6px; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #34343f; }

/* Ambient background — static soft light, painted once */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at 0% 0%, rgba(229, 9, 20, 0.14), transparent 60%),
    radial-gradient(60vmax 60vmax at 100% 100%, rgba(255, 106, 46, 0.08), transparent 60%),
    var(--black);
}

/* ── Brand ─────────────────────────────────────────── */
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.05em; line-height: 1;
  color: var(--red); white-space: nowrap;
}
.brand .brand-text { color: var(--red); }
.brand .brand-text span { color: #fff; }
.brand-mark {
  width: 24px; height: 24px; flex: none; background: url(../img/hextv-h.svg) center / contain no-repeat;
  filter: drop-shadow(0 3px 8px rgba(229, 9, 20, 0.55));
  transition: transform 0.4s var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }

/* ── Reaction icon colours (room + landing mock) ──── */
.rx-fire { color: #ff7a1a; }
.rx-laugh, .rx-clap { color: #f5c518; }
.rx-surprise { color: #8ab4ff; }
.rx-heart { color: #ff3b5c; }
.rx-wow { color: #ff5a1f; }

/* ── Buttons ───────────────────────────────────────── */
.btn[hidden] { display: none; }
.btn {
  --bh: 38px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: var(--bh); padding: 0 1.05rem; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-ui); font-size: 0.86rem; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), background 0.25s, border-color 0.25s;
}
.btn:active { transform: scale(0.96); }
.btn-lg { --bh: 44px; padding: 0 1.35rem; font-size: 0.92rem; }
.btn-sm { --bh: 32px; padding: 0 0.85rem; font-size: 0.8rem; }
.btn-primary { background: var(--grad-red); color: #fff; box-shadow: 0 6px 18px -8px rgba(229, 9, 20, 0.9); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.7s var(--ease);
}
.btn-primary:hover { box-shadow: 0 10px 26px -8px rgba(229, 9, 20, 1); transform: translateY(-1px); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-glass { background: rgba(255, 255, 255, 0.07); color: #fff; border-color: rgba(255, 255, 255, 0.16); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; text-decoration: none; font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-hover); }

/* ── Shared headings ───────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red-hot);
}
.kicker::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: var(--grad-heat); }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.02em; line-height: 0.95; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red-hot); flex-shrink: 0; position: relative; }
.pulse-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--red-hot);
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

/* ── Scroll reveal (transform + opacity only) ──────── */
.reveal { opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ══════════════════════════════════════════════════════════════
   PRELOADER — the logo pulses while a thin line fills, then fades away
   (transform/opacity only, so it stays smooth on phones)
══════════════════════════════════════════════════════════════ */
.preloader {
  position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
  background: radial-gradient(ellipse at center, #11070a 0%, #040405 70%);
  transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
}
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.pl-logo { position: relative; width: 64px; height: 64px; }
.pl-mark {
  position: absolute; inset: 6px; background: url(../img/hextv-h.svg) center / contain no-repeat;
  filter: drop-shadow(0 10px 24px rgba(229, 9, 20, 0.75));
  animation: plPulse 1.6s var(--ease) infinite;
}
.pl-halo { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(229, 9, 20, 0.55); animation: plHalo 1.6s var(--ease) infinite; }
@keyframes plPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes plHalo { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.7); opacity: 0; } }
.pl-name {
  font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.06em; line-height: 1; color: var(--red);
  opacity: 0; transform: translateY(6px); animation: plIn 0.6s var(--ease) 0.15s forwards;
}
.pl-name span { color: #fff; }
@keyframes plIn { to { opacity: 1; transform: none; } }
.pl-line { width: 140px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pl-line span { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: var(--grad-heat); transition: transform 0.3s var(--ease); }
.preloader.quick .pl-name { animation-duration: 0.25s; animation-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .pl-mark, .pl-halo { animation: none; } }

/* ── Page transition curtain (between pages) ───────── */
.curtain {
  position: fixed; inset: 0; z-index: 9995; pointer-events: none;
  background: #07070a;
  transform: scaleY(0); transform-origin: bottom;
}
.curtain::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad-heat); }
.curtain.cover { animation: curtainIn 0.42s cubic-bezier(0.76, 0, 0.24, 1) forwards; }
.curtain.reveal-out { transform: scaleY(1); transform-origin: top; animation: curtainOut 0.55s cubic-bezier(0.76, 0, 0.24, 1) 0.05s forwards; }
@keyframes curtainIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes curtainOut { from { transform: scaleY(1); } to { transform: scaleY(0); } }

/* ── Utilities ─────────────────────────────────────── */
.muted { color: var(--muted); }
.hide { display: none !important; }

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

/* ── Inside the Windows/Android apps (js/inapp.js): no website home page ── */
.in-app .top-links a[href="index.html"] { display: none !important; }
