/* SACC QR page — shared design tokens + CRT/OSD primitives.
   Palette and type follow sharjahanimation.com; TV vocabulary follows the invite box. */

:root {
  --bg: #141414;
  --panel: #1a1a1a;
  --panel-2: #2a2a2a;
  --line: rgba(255, 255, 255, 0.08);
  --blue: #3a49e3;
  --yellow: #fedb00;
  --red: #d9120e;
  --text: #efefef;
  --muted: #9e9e9e;
  /* box print accents — used only inside TV artwork */
  --peri: #4952a2;
  --navy: #1b2a6b;
  --olive: #5e6b3a;

  --r-sm: 14px;
  --r: 20px;
  /* Noto Kufi Arabic: Archivo has no Arabic letters, so the browser takes each Arabic glyph from the next face, and its
     file downloads only when Arabic is on screen (unicode-range). A stand-in, as Archivo is for PP Frama: swap here. */
  --font: "Archivo", "Noto Kufi Arabic", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* The box's stand covers the phone's edges. Its opening measures ≈ 13.5 × 6.6 cm off the render (unconfirmed);
     phones run ≈ 60 CSS px per cm, so a 6.1" phone loses ~3 mm a side horizontally, a 6.7" one ~9 mm, plus a
     sliver top and bottom. CALIBRATION KNOB: tune these two with a real phone in a real stand.
     All UI chrome pads by --safe-*, so it stays clear of the frame; the picture itself stays full bleed.
     iPhones already report ~47–59 px side insets in landscape, so the max() mostly matters on Android. */
  --stand-x: 28px;
  --stand-y: 10px;
  --safe-t: max(env(safe-area-inset-top, 0px), var(--stand-y));
  --safe-r: max(env(safe-area-inset-right, 0px), var(--stand-x));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--stand-y));
  --safe-l: max(env(safe-area-inset-left, 0px), var(--stand-x));
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; }

/* Headline voice: the site's PP Frama 800 italic uppercase. Archivo stands in. */
.h {
  font-weight: 800;
  font-style: italic;
  font-stretch: 112%;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.92;
}
/* Type is sized for a phone in a stand at arm's length, not in the hand: nothing under 11px (5 Oct 2026, was 10–13px) */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Yellow CTA, black text — the site's BOOK YOUR PASS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--yellow); color: #141414;
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn--ghost { background: rgba(255,255,255,0.1); color: var(--text); }

/* ── Round buttons. Colour rule (5 Oct 2026, "it's a Netflix reference"): the interface is black/white/grey and
   colour comes from the content (posters, films, scenes). Yellow is kept for the brand mark and the ONE main action
   per screen — the ON/OFF knob is the box's yellow button. The other knobs used to be the box's red
   SOUND / PLAY / PAUSE / CREATE buttons; they're neutral glass now, like a streaming player's controls. ── */
.knob {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.14); backdrop-filter: blur(6px);
  color: #fff;
}
.knob--yellow {
  background: radial-gradient(circle at 35% 30%, #fff39a, var(--yellow) 55%, #b89a00);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.25), 0 4px 10px rgba(0,0,0,0.5);
  color: #141414;
}
.knob:active { transform: scale(0.94); }
.knob svg { width: 20px; height: 20px; fill: currentColor; }

/* ── Static channel previews (SACC.art) ── */
.art-n { font-size: 96px; color: rgba(255,255,255,0.14); }
.art-sac { font-size: 40px; color: var(--yellow); text-align: center; }
.art-sac i { display: block; width: 70%; height: 0.2em; margin: 0.05em auto 0; border: 3px solid currentColor; border-radius: 50%; }
.art-plus { font-size: 80px; font-weight: 300; color: rgba(255,255,255,0.6); }

/* ── Player (SACC.mountPlayer): one <video>, a stage for savers/iframes, static canvas, OSD ── */
.player { background: #000; overflow: hidden; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player .stage { position: absolute; inset: 0; }
.player .stage:empty { display: none; }
.player .stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .stage .dojan { position: absolute; left: 50%; top: 50%; height: 72%; width: auto; transform: translate(-50%, -50%); }
.player .stage__msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted); }
.player .stage__msg h2 { font-size: 44px; margin: 0; color: var(--text); }
.player .stage__msg p { margin: 0; }
.player .tap { position: absolute; inset: 0; z-index: 1; }   /* catches taps meant for the OSD before an embed swallows them */
.player .static { z-index: 2; width: 100%; height: 100%; }
.player .osd { z-index: 3; background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.7)); }
.player .osd .btn--ghost { background: rgba(255,255,255,0.14); backdrop-filter: blur(6px); }
.player .osd .btn svg { fill: currentColor; }

/* ── CRT overlay: scanlines + vignette + faint flicker. Lives ON TOP of the picture, never baked in. ── */
.crt { position: relative; }
.crt::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.18) 2px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: multiply;
  animation: crt-flicker 4s steps(1) infinite;
}
@keyframes crt-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.94; }
  95% { opacity: 1; }
  97% { opacity: 0.97; }
}

/* CRT power-on: a bright line that opens into the picture */
.power-on { animation: power-on 0.7s var(--ease) both; transform-origin: center; }
@keyframes power-on {
  0% { transform: scale(1, 0.004); filter: brightness(4); }
  45% { transform: scale(1, 0.004); filter: brightness(4); }
  70% { transform: scale(1, 1); filter: brightness(2); }
  100% { transform: scale(1, 1); filter: brightness(1); }
}

/* DVD-style bouncing logotype (SACC.bounce) */
.bounce-logo { position: absolute; left: 0; top: 0; will-change: transform; text-align: center; transition: color 0.15s; }
.bounce-logo .h { display: block; font-size: 64px; letter-spacing: -0.04em; }
.bounce-logo i { display: block; width: 68%; height: 12px; margin: 2px auto 0; border: 3px solid currentColor; border-radius: 50%; }

/* Static burst between channels: a tiny canvas scaled up */
.static {
  position: absolute; inset: 0; pointer-events: none;
  image-rendering: pixelated;
  opacity: 0; transition: opacity 0.12s;
}
.static.on { opacity: 0.9; }

/* ── On-screen display (tap to show, fades after 3 s) ── */
.osd {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 0.25s var(--ease);
  padding: calc(14px + var(--safe-t)) calc(18px + var(--safe-r)) calc(14px + var(--safe-b)) calc(18px + var(--safe-l));
  display: grid; grid-template-rows: auto 1fr auto;
}
.osd.show { opacity: 1; pointer-events: auto; }
.osd__top, .osd__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.osd__ch { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 22px; color: rgba(255,255,255,0.75); letter-spacing: 0.06em; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.osd__title { font-size: 26px; }
.osd__row { display: flex; gap: 10px; align-items: center; }

/* ── Portrait gate: turn the phone and put it in the TV ── */
.rotate {
  position: fixed; inset: 0; z-index: 50; display: none;
  place-items: center; text-align: center; background: var(--bg); padding: 24px;
}
@media (orientation: portrait) and (max-width: 700px) { .rotate { display: grid; } }
.rotate__phone {
  width: 54px; height: 100px; border: 3px solid var(--yellow); border-radius: 10px; margin: 0 auto 22px;
  animation: rotate-phone 2.4s var(--ease) infinite;
}
@keyframes rotate-phone {
  0%, 20% { transform: rotate(0); }
  55%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0); }
}

/* iPhone Safari only (html.swipe, set by SACC.swipeFullscreen): Safari won't grant fullscreen, but it
   collapses its bar when a finger scrolls the document. So give the document somewhere to scroll.
   Every screen is position:fixed, so nothing moves — the stage just grows into the freed space. */
html.swipe, html.swipe body { height: auto; min-height: 100%; overflow: visible; }
html.swipe body::after { content: ""; display: block; height: 220vh; }
.hint__arrow { display: inline-block; font-weight: 800; animation: nudge 1.1s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-4px); } }

/* The prompt for that swipe. Shown after ON/OFF while Safari's bar is still up; hides itself once it's gone. */
.hint {
  position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px);
  padding: 10px; padding-inline-start: 16px; border-radius: 999px; background: var(--yellow); color: #141414;
  font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.hint b { font-weight: 800; }
.hint button { height: 34px; padding: 0 12px; border-radius: 999px; background: #141414; color: var(--yellow); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 12px; }

/* Starfield from the box tray, as a repeating background layer */
.stars {
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 8%, rgba(255,255,255,0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 60%, rgba(255,255,255,0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 45%, rgba(255,255,255,0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 25% 85%, rgba(255,255,255,0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 82%, rgba(255,255,255,0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 30%, rgba(255,255,255,0.35) 50%, transparent 51%);
  background-size: 260px 220px;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Arabic (shared/i18n.js sets <html lang="ar" dir="rtl">). Arabic has no italic and no capitals, and letter-spacing
   pulls its joined letters apart, so the Latin headline voice (.h .eyebrow .btn, the news graphics) is undone here.
   !important because a dozen rules set letter-spacing. The SACC TV wordmarks carry lang="en" and keep their italic.
   Line-height: Arabic letters reach higher and lower than Latin capitals; .h's 0.92 clipped them. ── */
:lang(ar) { letter-spacing: 0 !important; font-style: normal !important; }
:lang(ar) .h { line-height: 1.25; }
:lang(ar) .osd__ch { font-family: var(--font); }   /* the monospace stack has no Arabic */
[dir="rtl"] .osd [data-act="prev"] svg, [dir="rtl"] .osd [data-act="next"] svg { transform: scaleX(-1); }   /* CH−/CH+ chevrons point the way the row now runs */
/* the language toggles (shared/i18n.js): text in the other language's own script */
.lang { font-weight: 700; font-size: 15px; color: #fff; }
