/* ==========================================================================
   FLAГSTRИК
   ========================================================================== */

/* Fonts ------------------------------------------------------------------ */
@font-face { font-family: "TildaSans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/TildaSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "TildaSans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/TildaSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "TildaSans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/TildaSans-Semibold.woff2") format("woff2"); }
@font-face { font-family: "TildaSans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/TildaSans-Bold.woff2") format("woff2"); }

/* Tokens ----------------------------------------------------------------- */
:root {
  --bg: #191919;
  --ink: #dedede;
  --accent: #b71111;
  --card: #ffffff12;
  --card-border: #ffffff26;
  --sans: "TildaSans", Arial, sans-serif;
  --system: Arial, Helvetica, sans-serif;
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #ffffff33 transparent;
}

body {
  background: var(--bg);
  font-family: var(--system);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

::selection { background: var(--accent); color: #fff; text-shadow: none; }

::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ffffff33; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #ffffff55; }

a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 8px; }

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

/* Hero ------------------------------------------------------------------- */
.hero {
  padding-bottom: 43px;
  background: linear-gradient(180deg, #c41414 0%, #8c0e0e 50%, #3a0505 100%);
}

.hero__stage {
  position: relative;
  height: 460px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.hero__ring {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: min(760px, 115vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Logo + shimmer + stars */
.logo {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  width: min(600px, 92vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: filter .2s ease-out;
}
.logo.is-lit { filter: brightness(1.1) drop-shadow(0 0 20px rgba(255, 255, 255, .15)); }

.logo__box { position: relative; width: 100%; max-width: 48rem; margin: 0 auto; aspect-ratio: 16 / 9; }

.logo__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transform: scale(1.08);
  user-select: none; -webkit-user-drag: none;
}

.logo__shine {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  transform: scale(1.08);
  -webkit-mask: var(--logo-mask) center / contain no-repeat;
          mask: var(--logo-mask) center / contain no-repeat;
}
.logo__shine::before {
  content: ""; position: absolute; top: 0; left: -150%;
  width: 33.333%; height: 100%;
  transform: skewX(-25deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  animation: shimmer 4s infinite;
}

.logo__star { position: absolute; object-fit: contain; pointer-events: none; user-select: none; }
.logo__star--1 { width: 8%; top: 28%; left: 12%; animation: star-1 14s infinite; }
.logo__star--2 { width: 6%; top: 10%; left: 24%; animation: star-2 18s infinite; }
.logo__star--3 { width: 4%; top: 12%; left: 40%; animation: star-3 11s infinite; }

@keyframes shimmer { 0% { left: -150%; } 30%, 100% { left: 150%; } }

@keyframes star-1 {
  0%   { transform: translateY(0) rotate(0); }
  14%  { transform: translateY(-4px) rotate(70deg); }
  37%  { transform: translateY(6px) rotate(140deg); }
  52%  { transform: translateY(-2px) rotate(220deg); }
  81%  { transform: translateY(4px) rotate(290deg); }
  100% { transform: translateY(0) rotate(360deg); }
}
@keyframes star-2 {
  0%   { transform: translateY(0) rotate(0); }
  22%  { transform: translateY(5px) rotate(45deg); }
  38%  { transform: translateY(-3px) rotate(130deg); }
  65%  { transform: translateY(4px) rotate(210deg); }
  79%  { transform: translateY(-5px) rotate(280deg); }
  100% { transform: translateY(0) rotate(360deg); }
}
@keyframes star-3 {
  0%   { transform: translateY(0) rotate(0); }
  18%  { transform: translateY(-6px) rotate(80deg); }
  43%  { transform: translateY(2px) rotate(160deg); }
  61%  { transform: translateY(-4px) rotate(240deg); }
  88%  { transform: translateY(5px) rotate(310deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

/* Marquee ---------------------------------------------------------------- */
.marquee {
  display: flex; align-items: center;
  height: 40px; overflow: hidden;
  background: #dedede;
  user-select: none; -webkit-user-select: none;
}
.marquee__track {
  display: flex; flex: none;
  will-change: transform;
}
.marquee__item {
  display: flex; align-items: center; flex: none;
  height: 40px; padding: 0 10px;
  font: 700 18px/1.5 var(--system);
  color: var(--accent);
  white-space: nowrap;
}

/* City ------------------------------------------------------------------- */
.city {
  padding: 43px 20px 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

.city__inner { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem 4rem; }

.about {
  max-width: 42rem; margin: 0 auto;
  font-size: 1rem; line-height: 1.625; text-align: center;
}
.about strong { font-weight: 700; }

.people {
  display: grid; grid-template-columns: 1fr;
  gap: 1.5rem 2.5rem;
  margin-top: 2.5rem;
}

.person {
  position: relative;
  border-radius: .75rem;
  transform-style: preserve-3d;
  will-change: transform;
}
.person::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), #ffffff59, transparent 60%);
  transition: opacity .2s ease-out;
}
.person:hover::before { opacity: 1; }

.person__inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .75rem;
  border: 1px solid var(--card-border); border-radius: .75rem;
  background: var(--card);
  transition: border-color .15s;
}
.person__inner:hover { border-color: var(--accent); }

.person__avatar {
  position: relative; z-index: 10; flex-shrink: 0;
  width: 4rem; height: 4rem;
  border-radius: .375rem;
  background: var(--card-border);
  object-fit: cover; image-rendering: pixelated;
}
.person__avatar--letter {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; color: #fff;
}
.person__name {
  position: relative; z-index: 10;
  font-size: 1.125rem; line-height: 1.5556; font-weight: 500; color: var(--ink);
}

/* Footer ----------------------------------------------------------------- */
.credit {
  display: flex; justify-content: center; align-items: flex-start; gap: .4em;
  height: 70px; padding-top: 20px;
  background: #000; color: #fff;
  font: 400 14px/1.5 var(--system);
}
.credit > * { opacity: .4; }
.credit a:hover { opacity: 1; }

/* Telegram button -------------------------------------------------------- */
.tg {
  position: fixed; right: 64px; bottom: 46px; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px;
  border: 1px solid #ffffff59; border-radius: 50%;
  background: rgba(255, 255, 255, .3); color: #fff;
  transition: background-color .12s, border-color .12s, color .12s;
}
.tg:hover { background: var(--accent); border-color: var(--accent); }
.tg svg { width: 26px; height: 26px; transform: rotate(-45deg); transition: transform .5s; }
@media (hover: hover) { .tg:hover svg { transform: none; } }

/* Grain overlay (the tile itself is generated in js/grain.js) ------------ */
.grain {
  position: fixed; inset: 0; z-index: 2147483647;
  pointer-events: none; isolation: isolate;
  mix-blend-mode: overlay; opacity: .13;
  background-size: 128px 128px;
  animation: grain 40ms steps(10) infinite;
  will-change: background-position;
}
@keyframes grain {
  0%   { background-position: 0 0; }
  10%  { background-position: -5% -10%; }
  20%  { background-position: -15% 5%; }
  30%  { background-position: 7% -25%; }
  40%  { background-position: -5% 25%; }
  50%  { background-position: -15% 10%; }
  60%  { background-position: 15% 0; }
  70%  { background-position: 0 15%; }
  80%  { background-position: 3% 10%; }
  90%  { background-position: 10% 3%; }
  100% { background-position: 0 0; }
}

/* Breakpoints ------------------------------------------------------------ */
@media (min-width: 48rem) {
  .city__inner { padding-left: 3rem; padding-right: 3rem; }
  .about { font-size: 1.125rem; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4rem; }
}

@media (max-width: 640px) {
  .hero { padding-bottom: 30px; }
  .hero__stage { height: calc((100vw - 40px) / 2.2 + 110px); }
  .hero__ring { width: calc(100vw - 8px); }
  .logo { width: calc((100vw - 40px) / 1.08); }
  .tg { right: 20px; bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo__shine::before, .logo__star, .grain { animation: none; }
}
