/* Rebel Space — teaser page */

/* Jost, Latin and Cyrillic subsets (the Russian page used to fall back to a system face) */
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-300-normal.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-cyrillic-300-normal.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-cyrillic-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #02050b;
  --ink: #e6edf5;
  --ink-2: #93a6ba;
  --line: rgba(190, 215, 240, 0.18);
  --accent: #5fd2ff;
  --gutter: clamp(18px, 3.2vw, 44px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ the screen */
.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.screen { position: absolute; inset: 0; z-index: -1; background: #000; }

.teaser,
.poster,
.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.teaser { background: #000; }

/* The poster sits over the video until playback starts, then dissolves into the
   teaser's own black opening. Without JavaScript the video's poster attribute is used. */
.poster { display: none; }
.js .poster {
  display: block;
  opacity: 1;
  transition: opacity 1.4s var(--ease);
}
.js.is-playing .poster { opacity: 0; }

.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(2, 5, 11, 0.55) 0%, rgba(2, 5, 11, 0) 18%),
    linear-gradient(to top, rgba(2, 5, 11, 0.78) 0%, rgba(2, 5, 11, 0.35) 16%, rgba(2, 5, 11, 0) 34%);
}

/* ------------------------------------------------------------------ header */
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(var(--gutter), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-right: -0.42em;
}
.brand:focus-visible { outline: 1px solid var(--accent); outline-offset: 6px; border-radius: 2px; }

.status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 1px rgba(95, 210, 255, 0.55);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* EN / RU switch: always visible, top centre */
.switches {
  position: absolute;
  top: max(var(--gutter), env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 10px;
}
.ver {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(3, 8, 16, 0.38);
}
.ver a {
  padding: 6px 12px 6px 13px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.3s, background-color 0.3s;
}
.ver a:hover { color: var(--ink); }
.ver a[aria-current="page"] { color: var(--ink); background: rgba(95, 210, 255, 0.16); }
.ver a:focus-visible { outline: 1px solid var(--accent); outline-offset: -3px; }

/* ------------------------------------------------------------------ bottom dock */
.dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) max(var(--gutter), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}

.pitch { max-width: 31em; }
.lede {
  margin: 0;
  font-weight: 300;
  font-size: clamp(15px, 1.2vw, 19px);
  line-height: 1.6;
  color: rgba(230, 237, 245, 0.86);
  text-wrap: pretty;
}
.meta {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.meta::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(to right, var(--accent), rgba(95, 210, 255, 0));
}

/* The header and the pitch arrive on the emblem's bell (or at once when the teaser can't play),
   and from then on they stay. Short and staggered, so the arrival reads as part of the cut rather
   than as a slow fade that drifts in somewhere after it. */
.js .top,
.js .lede,
.js .meta {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js.is-revealed .top,
.js.is-revealed .lede,
.js.is-revealed .meta {
  opacity: 1;
  transform: none;
}
.js.is-revealed .lede { transition-delay: 0.14s; }
.js.is-revealed .meta { transition-delay: 0.3s; }

/* ------------------------------------------------------------------ controls */
.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.controls {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.ctl {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(3, 8, 16, 0.38);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  font: 500 11px/1 "Jost", system-ui, sans-serif;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.ctl span { margin-right: -0.26em; }
.ctl svg { width: 15px; height: 15px; flex: none; }
.ctl:hover { color: var(--ink); border-color: rgba(95, 210, 255, 0.45); }
.ctl:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.ctl[hidden] { display: none; }

.ctl-primary { color: var(--ink); border-color: rgba(95, 210, 255, 0.5); }

#sound .on { display: none; }
#sound[aria-pressed="true"] { color: var(--ink); border-color: rgba(95, 210, 255, 0.45); }
#sound[aria-pressed="true"] .on { display: inline; }
#sound[aria-pressed="true"] .off { display: none; }

/* The community link (Telegram): present from the first frame, quiet while the teaser plays,
   lit when the emblem forms. */
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 22px 0 18px;
  border: 1px solid rgba(95, 210, 255, 0.42);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(6, 22, 36, 0.46);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: 500 11px/1 "Jost", system-ui, sans-serif;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.9s var(--ease), border-color 0.9s var(--ease), box-shadow 0.9s var(--ease);
}
.cta span { margin-right: -0.26em; }
.cta svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, rgba(200, 240, 255, 0) 38%, rgba(200, 240, 255, 0.28) 50%, rgba(200, 240, 255, 0) 62%);
  transform: translateX(-110%);
}
.js.is-revealed .cta {
  border-color: rgba(95, 210, 255, 0.72);
  background: rgba(20, 70, 100, 0.42);
  box-shadow: 0 0 24px -6px rgba(95, 210, 255, 0.55);
}
.js.is-revealed .cta::after { animation: sheen 1.5s var(--ease) 0.5s both; }
@keyframes sheen { to { transform: translateX(110%); } }
.cta:hover { border-color: rgba(95, 210, 255, 0.9); background: rgba(30, 95, 130, 0.5); }
.cta:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------------------------ small screens */
/* mid widths: the community link stacks over the teaser controls, so the pitch keeps its measure */
@media (max-width: 1100px) {
  .actions { flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
}

@media (max-width: 720px) {
  .actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .cta { width: 100%; min-height: 48px; }
  /* the switch drops below the header instead of running over the brand and the status */
  .switches { top: calc(max(var(--gutter), env(safe-area-inset-top)) + 46px); }
  .brand-name { font-size: 11px; letter-spacing: 0.36em; }
  .status { font-size: 10px; letter-spacing: 0.24em; }
  .dock { flex-direction: column; align-items: stretch; gap: 20px; }
  .pitch { max-width: 26em; }
  .meta { font-size: 10px; letter-spacing: 0.2em; margin-top: 12px; }
  .meta::before { display: none; }
  .controls { justify-content: flex-start; flex-wrap: wrap; }
  .veil {
    background:
      linear-gradient(to bottom, rgba(2, 5, 11, 0.6) 0%, rgba(2, 5, 11, 0) 16%),
      linear-gradient(to top, rgba(2, 5, 11, 0.88) 0%, rgba(2, 5, 11, 0.5) 22%, rgba(2, 5, 11, 0) 40%);
  }
}

@media (max-width: 380px) {
  .status { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .pitch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .status .dot { animation: none; opacity: 0.8; }
  .js .top, .js .lede, .js .meta, .js .poster, .cta { transition: none; }
  .js.is-revealed .cta::after { animation: none; }
}
