/* ============================================================
   TRANSMISSION — first-visit intro gate
   Alien/Nostromo deep-signal terminal × FMTG luxury hospitality.
   Self-contained: relies only on kickoff.css design tokens.
   ============================================================ */

.xmit {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  display: flex; flex-direction: column;
  background:
    radial-gradient(140% 120% at 50% 8%, color-mix(in oklch, var(--accent) 7%, transparent), transparent 55%),
    radial-gradient(120% 120% at 50% 120%, #03080E, transparent 60%),
    linear-gradient(170deg, #05101B, #030A12 70%);
  color: var(--ink);
  font-family: var(--font-mono);
  opacity: 1;
  animation: xmitFlicker 7s linear 1s infinite;
}
@keyframes xmitFlicker {
  0%, 96%, 100% { filter: none; }
  97% { filter: brightness(1.12); }
  98% { filter: brightness(.92); }
  99% { filter: brightness(1.05); }
}

/* moving CRT scanlines */
.xmit-scan {
  position: absolute; inset: -2px; pointer-events: none; z-index: 6;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 4px);
  mix-blend-mode: multiply; animation: xmitScanMove 9s linear infinite; opacity: .8;
}
@keyframes xmitScanMove { to { transform: translateY(120px); } }
/* one slow bright sweep crossing the screen */
.xmit-beam {
  position: absolute; left: 0; right: 0; top: -30%; height: 26%; pointer-events: none; z-index: 5;
  background: linear-gradient(180deg, transparent, color-mix(in oklch, var(--accent) 13%, transparent), transparent);
  animation: xmitBeam 6.5s var(--ease) infinite;
}
@keyframes xmitBeam { 0% { top: -30%; } 60%, 100% { top: 130%; } }
/* vignette + faint chromatic edge */
.xmit-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 7;
  background: radial-gradient(125% 95% at 50% 42%, transparent 52%, rgba(0,0,0,.62) 100%);
  box-shadow: inset 0 0 1px 1px rgba(120,200,180,.04);
}
/* big rotating reticle behind content */
.xmit-reticle {
  position: absolute; top: 50%; left: 50%; width: min(86vh, 760px); aspect-ratio: 1; pointer-events: none; z-index: 1;
  translate: -50% -50%; opacity: .085;
  border: 1px solid var(--accent); border-radius: 50%;
  animation: xmitSpin 60s linear infinite;
}
.xmit-reticle::before, .xmit-reticle::after {
  content: ""; position: absolute; inset: 14%; border-radius: 50%; border: 1px solid var(--accent);
}
.xmit-reticle::after { inset: 30%; border-style: dashed; }
.xmit-reticle-cross { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .07; }
.xmit-reticle-cross::before, .xmit-reticle-cross::after { content: ""; position: absolute; background: var(--accent); }
.xmit-reticle-cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.xmit-reticle-cross::after { top: 50%; left: 0; right: 0; height: 1px; }
@keyframes xmitSpin { to { transform: rotate(360deg); } }

/* corner HUD brackets */
.xmit-corner { position: absolute; width: 30px; height: 30px; z-index: 8; border: 0 solid color-mix(in oklch, var(--accent) 55%, transparent); pointer-events: none; }
.xmit-corner.tl { top: 18px; left: 18px; border-top-width: 2px; border-left-width: 2px; }
.xmit-corner.tr { top: 18px; right: 18px; border-top-width: 2px; border-right-width: 2px; }
.xmit-corner.bl { bottom: 18px; left: 18px; border-bottom-width: 2px; border-left-width: 2px; }
.xmit-corner.br { bottom: 18px; right: 18px; border-bottom-width: 2px; border-right-width: 2px; }

/* top status bar */
.xmit-top {
  position: relative; z-index: 9; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 26px 34px 0; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
}
.xmit-top-l, .xmit-top-r { display: flex; align-items: center; gap: 14px; min-width: 0; }
.xmit-rec { display: inline-flex; align-items: center; gap: 7px; color: var(--bad); font-weight: 600; }
.xmit-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: xmitRec 1.1s steps(1) infinite; }
@keyframes xmitRec { 50% { opacity: .15; } }
.xmit-id { color: var(--accent); }
.xmit-sep { color: color-mix(in oklch, var(--accent) 40%, transparent); }
.xmit-skip {
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); text-decoration: none;
  border: 1px solid var(--line); padding: 6px 11px; letter-spacing: .14em; transition: all .18s var(--ease);
}
.xmit-skip:hover { color: var(--ink); border-color: var(--accent); background: color-mix(in oklch, var(--accent) 10%, transparent); }

/* center stage */
.xmit-stage {
  position: relative; z-index: 9; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 28px; gap: 0;
  width: 100%; max-width: 760px; margin: 0 auto;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.xmit-stage::-webkit-scrollbar { width: 0; height: 0; }

/* boot log */
.xmit-boot { width: 100%; max-width: 460px; margin-bottom: 26px; text-align: left; display: flex; flex-direction: column; gap: 5px; }
.xmit-boot-line {
  font-size: 11px; letter-spacing: .06em; color: var(--ink-3); opacity: 0;
  display: flex; align-items: center; gap: 9px;
}
.xmit-boot-line.show { opacity: 1; }
.xmit-boot-line .bl-mark { color: var(--accent); }
.xmit-boot-line .bl-ok { margin-left: auto; color: var(--good); letter-spacing: .12em; }
.xmit-boot-line.warn .bl-ok { color: var(--warn); }

/* waveform / equalizer */
.xmit-wave { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin: 0 0 22px; opacity: 0; transition: opacity .5s var(--ease); }
.xmit-wave.show { opacity: .9; }
.xmit-wave span { width: 3px; background: linear-gradient(180deg, var(--accent), color-mix(in oklch, var(--good) 70%, var(--accent))); animation: xmitWave 1.1s var(--ease) infinite; }
@keyframes xmitWave { 0%, 100% { height: 5px; } 50% { height: 24px; } }

/* eyebrow */
.xmit-eyebrow {
  font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--accent);
  opacity: 0; transform: translateY(8px); transition: all .6s var(--ease);
}
.xmit-eyebrow.show { opacity: 1; transform: none; }

/* headline */
.xmit-title {
  font-family: var(--font-serif); font-weight: 700; line-height: 1.02; letter-spacing: -.01em;
  font-size: clamp(34px, 6.4vw, 68px); margin: 16px 0 18px;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold), color-mix(in oklch, var(--gold) 70%, #fff 0%));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 38px color-mix(in oklch, var(--accent) 30%, transparent);
}

/* decoded message */
.xmit-msg {
  font-family: var(--font-sans); font-size: clamp(15px, 1.9vw, 18px); line-height: 1.7; color: var(--ink-2);
  max-width: 560px; margin: 0 auto; text-wrap: pretty;
  opacity: 0; transform: translateY(10px); transition: all .7s var(--ease);
}
.xmit-msg.show { opacity: 1; transform: none; }
.xmit-msg b { color: var(--ink); font-weight: 600; }

/* rules panel */
.xmit-rules {
  width: 100%; max-width: 520px; margin: 30px auto 0; padding: 4px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.xmit-rule {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-align: left;
  opacity: 0; transform: translateY(8px); transition: all .5s var(--ease);
}
.xmit-rule.show { opacity: 1; transform: none; }
.xmit-rule + .xmit-rule { box-shadow: inset 1px 0 0 var(--line-soft); }
.xmit-rule:nth-child(odd) { box-shadow: none; }
.xmit-rule:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
.xmit-rule i { color: var(--accent); font-size: 17px; flex: none; }
.xmit-rule-body { min-width: 0; }
.xmit-rule-k { display: block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.xmit-rule-v { display: block; font-family: var(--font-sans); font-size: 13.5px; color: var(--ink); font-weight: 500; margin-top: 2px; }
.xmit-rule-v .pts { color: var(--accent); font-family: var(--font-mono); font-weight: 600; }

/* CTA */
.xmit-cta-wrap { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 16px; opacity: 0; transform: translateY(12px); transition: all .7s var(--ease); }
.xmit-cta-wrap.show { opacity: 1; transform: none; }
.xmit-cta {
  position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--on-accent); padding: 17px 34px; border: 0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  box-shadow: 0 8px 30px -8px color-mix(in oklch, var(--accent) 70%, transparent);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
  overflow: hidden;
}
.xmit-cta:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 40px -10px color-mix(in oklch, var(--accent) 80%, transparent); }
.xmit-cta:active { transform: translateY(0); }
.xmit-cta::after { /* sheen */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
  animation: xmitSheen 3.4s var(--ease) infinite;
}
@keyframes xmitSheen { 0% { left: -60%; } 55%, 100% { left: 140%; } }
.xmit-cta i { font-size: 18px; }
.xmit-cta-sub { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
.xmit-cta-sub .blink { color: var(--accent); animation: xmitRec 1.1s steps(1) infinite; }

/* language / channel relay strip */
.xmit-channels {
  width: 100%; max-width: 560px; margin: 30px auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  opacity: 0; transform: translateY(10px); transition: all .7s var(--ease);
}
.xmit-channels.show { opacity: 1; transform: none; }
.xmit-channels-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-3);
}
.xmit-channels-label i { color: var(--accent); font-size: 13px; letter-spacing: 0; }
.xmit-channels-label::before, .xmit-channels-label::after { content: ""; }
.xmit-channels-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.xmit-chan {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px;
  border: 1px solid var(--line); background: color-mix(in oklch, var(--accent) 4%, transparent);
  font: inherit; color: inherit; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.xmit-chan:hover { border-color: color-mix(in oklch, var(--accent) 55%, var(--line)); background: color-mix(in oklch, var(--accent) 9%, transparent); }
.xmit-chan:active { transform: translateY(1px); }
.xmit-chan:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xmit-chan.is-active { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 16%, transparent); }
.xmit-chan.is-active .xmit-chan-freq { color: var(--gold-bright); }
.xmit-chan-flag { border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--line); }
.xmit-chan-code { font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: .06em; color: var(--ink); }
.xmit-chan-freq { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--accent); padding-left: 2px; }

/* bottom signal strip */
.xmit-foot {
  position: relative; z-index: 9; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 34px 24px; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
}
.xmit-foot-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.xmit-foot-bars span { width: 3px; background: var(--good); }
.xmit-foot-bars span:nth-child(1) { height: 4px; } .xmit-foot-bars span:nth-child(2) { height: 7px; }
.xmit-foot-bars span:nth-child(3) { height: 10px; } .xmit-foot-bars span:nth-child(4) { height: 12px; }

/* exit warp on CTA */
.xmit.is-out { animation: xmitOut .8s var(--ease) forwards; }
@keyframes xmitOut {
  0% { opacity: 1; filter: brightness(1); transform: scale(1); }
  18% { filter: brightness(2.2) saturate(0); }
  30% { transform: scaleY(.004) scaleX(1); opacity: 1; filter: brightness(3); }
  55% { transform: scaleY(.004) scaleX(.0); opacity: .9; }
  100% { transform: scaleY(.004) scaleX(0); opacity: 0; }
}

/* short viewports — tighten vertical rhythm so the CTA + channel strip stay visible */
@media (max-height: 720px) {
  .xmit-stage { justify-content: flex-start; padding-top: 14px; padding-bottom: 14px; }
  .xmit-boot { margin-bottom: 14px; }
  .xmit-wave { height: 18px; margin-bottom: 12px; }
  .xmit-title { margin: 8px 0 10px; font-size: clamp(30px, 5.2vw, 52px); }
  .xmit-rules { margin-top: 16px; }
  .xmit-rule { padding: 9px 16px; }
  .xmit-cta-wrap { margin-top: 18px; gap: 10px; }
  .xmit-cta { padding: 13px 28px; }
  .xmit-channels { margin-top: 16px; gap: 10px; }
}
@media (max-height: 560px) {
  .xmit-boot { display: none; }
  .xmit-wave { display: none; }
  .xmit-title { margin: 4px 0 8px; }
  .xmit-rules { margin-top: 12px; }
  .xmit-channels { margin-top: 12px; }
}

/* responsive */
@media (max-width: 640px) {
  .xmit-top { padding: 18px 18px 0; font-size: 8.5px; letter-spacing: .12em; }
  .xmit-top-l .xmit-coords, .xmit-top-r .xmit-freq { display: none; }
  .xmit-foot { padding: 0 18px 18px; }
  .xmit-foot-mid { display: none; }
  .xmit-rules { grid-template-columns: 1fr; }
  .xmit-rule:nth-child(n+2) { border-top: 1px solid var(--line-soft); box-shadow: none; }
  .xmit-corner { width: 20px; height: 20px; }
  .xmit-stage { padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .xmit, .xmit-scan, .xmit-beam, .xmit-reticle, .xmit-wave span, .xmit-cta::after, .xmit-rec-dot, .xmit-foot-bars span { animation: none !important; }
  .xmit { opacity: 1; }
  .xmit-eyebrow, .xmit-msg, .xmit-rule, .xmit-cta-wrap, .xmit-boot-line, .xmit-channels { opacity: 1 !important; transform: none !important; }
  /* no interference bursts when motion is reduced */
  .xmit-noise, .xmit-tracking { display: none !important; }
}

/* ============================================================
   SIGNAL INTERFERENCE — periodic dropout / break-up
   Driven by transmission.js: .is-glitch (sustained break-up) and
   .is-drop (momentary hard cut) are toggled on the .xmit root.
   ============================================================ */

/* TV-snow static layer (feTurbulence texture, shimmered via JS-free steps) */
.xmit-noise {
  position: absolute; inset: -12%; z-index: 7; pointer-events: none; opacity: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='150' height='150' filter='url(%23n)'/></svg>");
  background-size: 220px 220px; mix-blend-mode: screen; transition: opacity .1s linear;
}
/* horizontal tracking-error band that rolls down during a break-up */
.xmit-tracking {
  position: absolute; left: -6%; right: -6%; height: 13%; top: -30%; z-index: 8; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(150,225,255,.10) 26%, rgba(255,255,255,.20) 50%, rgba(150,225,255,.10) 74%, transparent);
  mix-blend-mode: screen; filter: blur(.5px);
}

/* sustained break-up: filter wobble + noise + scan boost + tracking roll */
.xmit.is-glitch { animation: xmitGlitchFilter .16s steps(2) infinite; }
@keyframes xmitGlitchFilter {
  0%   { filter: contrast(1.3) brightness(1.06) saturate(1.15); }
  50%  { filter: contrast(.82) brightness(.74) saturate(.55) hue-rotate(10deg); }
  100% { filter: contrast(1.45) brightness(1.14); }
}
.xmit.is-glitch .xmit-noise { opacity: .4; animation: xmitNoiseShift .1s steps(3) infinite; }
@keyframes xmitNoiseShift {
  0%   { background-position: 0 0; }
  33%  { background-position: 70px -45px; }
  66%  { background-position: -55px 80px; }
  100% { background-position: 35px 30px; }
}
.xmit.is-glitch .xmit-scan { opacity: 1; animation-duration: 1.4s; }
.xmit.is-glitch .xmit-tracking { opacity: 1; animation: xmitTrackRoll .5s linear infinite; }
@keyframes xmitTrackRoll { 0% { top: -30%; } 100% { top: 122%; } }

/* whole stage jitters; payload text splits into RGB ghosts */
.xmit.is-glitch .xmit-stage { animation: xmitJitter .13s steps(2) infinite; }
@keyframes xmitJitter {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3px, 1px); }
  50%  { transform: translate(2px, -2px); }
  75%  { transform: translate(-2px, -1px); }
  100% { transform: translate(3px, 1px); }
}
.xmit.is-glitch .xmit-title,
.xmit.is-glitch .xmit-eyebrow,
.xmit.is-glitch .xmit-msg,
.xmit.is-glitch .xmit-rule-v,
.xmit.is-glitch .xmit-boot-line { animation: xmitChroma .09s steps(2) infinite; }
@keyframes xmitChroma {
  0%   { text-shadow: 2px 0 rgba(255,42,80,.72), -2px 0 rgba(0,222,255,.72); transform: translateX(0); }
  50%  { text-shadow: -3px 0 rgba(255,42,80,.66), 3px 0 rgba(0,222,255,.66); transform: translateX(2px); }
  100% { text-shadow: 2px 0 rgba(255,42,80,.72), -2px 0 rgba(0,222,255,.72); transform: translateX(-1px); }
}

/* momentary hard cut — signal almost gone */
.xmit.is-drop { animation: none !important; filter: brightness(.05) contrast(2.4) !important; }
.xmit.is-drop .xmit-stage { opacity: .12; transform: translateY(2px) scaleY(.99); }
.xmit.is-drop .xmit-scan { opacity: 1; }
.xmit.is-drop .xmit-noise { opacity: .7; }

/* footer flips to SIGNAL LOST */
.xmit-foot.is-lost { color: var(--bad); }
.xmit-foot.is-lost .xmit-foot-bars span { background: var(--bad); height: 3px !important; animation: xmitRec .28s steps(1) infinite; }
.xmit-top.is-lost .xmit-freq, .xmit-top.is-lost [data-xmit-clock] { color: var(--bad); }
