/* ==========================================================================
   Tajik Air — дизайн-система 2026
   Тёмная премиальная тема: Midnight Blue / Dark Slate + светящийся электрик.

   1. Токены          — палитра, радиусы, тени, типографика, тайминги
   2. База            — сброс, скроллбар, выделение, фокус
   3. Утилиты         — подмножество Tailwind CSS (имена классов совпадают
                        один-в-один, поэтому разметку можно перенести на
                        полноценную сборку Tailwind без правок)
   4. Движение        — reveal, tap, skeleton, shimmer

   Порядок подключения: theme.css → style.css → flight.css
   ========================================================================== */

/* ── 1. Токены ──────────────────────────────────────────────────────────── */
:root {
  /* Полотно: от почти чёрного полуночного к глубокому сланцевому */
  --bg-950: #04080f;
  --bg-900: #060d1a;
  --bg-850: #0a1424;
  --bg-800: #0e1c30;
  --bg-750: #13253d;
  --bg-700: #1a3050;

  /* Слои стекла */
  --glass: rgba(10, 20, 36, .62);
  --glass-strong: rgba(8, 16, 30, .86);
  --glass-soft: rgba(255, 255, 255, .045);
  --glass-hover: rgba(255, 255, 255, .075);

  /* Границы — тонкие, почти невидимые, как у Linear */
  --edge: rgba(255, 255, 255, .09);
  --edge-strong: rgba(255, 255, 255, .16);
  --edge-soft: rgba(255, 255, 255, .05);

  /* Акцент: светящийся электрик-голубой */
  --accent-400: #7dd3fc;
  --accent-500: #38bdf8;
  --accent-600: #0ea5e9;
  --accent-700: #0284c7;
  --accent-glow: rgba(56, 189, 248, .35);
  --accent-glow-soft: rgba(56, 189, 248, .14);
  --accent-ink: #04121e;   /* текст на заливке акцентом */

  /* Наследие бренда — приглушённое золото для второстепенных акцентов */
  --gold-300: #e6cb95;
  --gold-500: #c9a35a;
  --gold-600: #a5813c;

  /* Текст: пастельно-белый по убыванию контраста */
  /* Контраст посчитан на самой светлой подложке — поле виджета rgb(14,22,37).
     Даже самый тихий тон проходит WCAG AA (4.5:1) для мелкого текста. */
  --text: #e9eff8;         /* 16.4:1 */
  --text-soft: #b7c6da;    /*  9.9:1 */
  --text-muted: #8b9cb5;   /*  6.5:1 */
  --text-faint: #7688a1;   /*  5.0:1 — подписи, метки полей, даты */

  /* Состояния */
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, .12);
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, .12);

  /* Радиусы — Tailwind-совместимая шкала */
  --radius-lg: 12px;    /* rounded-lg  */
  --radius-xl: 16px;    /* rounded-xl  */
  --radius-2xl: 20px;   /* rounded-2xl */
  --radius-3xl: 28px;   /* rounded-3xl */
  --radius-full: 999px;

  /* Тени: мягкие, многослойные, без «грязного» чёрного */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px -4px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, .62);
  --shadow-xl: 0 32px 72px -20px rgba(0, 0, 0, .72);
  --shadow-glow: 0 0 0 1px var(--accent-glow-soft), 0 18px 48px -16px var(--accent-glow);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .06);

  /* Тайминги — упругие, короткие, без «резины» */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.32, .64, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);
  --t-fast: 150ms;
  --t: 260ms;
  --t-slow: 520ms;

  --container: 1200px;
  --gutter: 24px;
  --header-h: 76px;

  --font-sans: Manrope, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  color-scheme: dark;
}

/* ── 2. База ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg-950);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Живое полотно: две мягкие световые сферы, приклеенные к вьюпорту.
   Даёт глубину, которой не хватает плоскому тёмному фону. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -8%, rgba(56, 189, 248, .13), transparent 62%),
    radial-gradient(52rem 38rem at 92% 8%, rgba(129, 140, 248, .10), transparent 60%),
    radial-gradient(70rem 50rem at 50% 108%, rgba(14, 165, 233, .08), transparent 64%),
    linear-gradient(180deg, var(--bg-950) 0%, var(--bg-900) 42%, var(--bg-950) 100%);
}

body.modal-open { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-glow); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Скроллбар в тон теме */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); background-clip: content-box; }

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 6000;
  left: 16px; top: 12px;
  padding: 12px 20px;
  color: var(--accent-ink);
  background: var(--accent-500);
  border-radius: var(--radius-lg);
  font-weight: 700;
  box-shadow: var(--shadow-glow);
  transform: translateY(-220%);
  transition: transform var(--t) var(--ease-spring);
}
.skip-link:focus { transform: translateY(0); }

/* ==========================================================================
   3. Утилиты — подмножество Tailwind CSS
   Имена и значения совпадают с Tailwind, поэтому разметка, написанная на
   этих классах, без единой правки переедет на полноценную сборку Tailwind.
   Здесь собрано только то, что реально используется в разметке сайта.
   ========================================================================== */

/* Раскладка */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.contents { display: contents; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.self-start { align-self: flex-start; }

.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-6 { grid-column: span 6 / span 6; }
.row-span-2 { grid-row: span 2 / span 2; }

/* Положение */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* Размеры */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Отступы */
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* Скругления */
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-3xl { border-radius: var(--radius-3xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Границы */
.border { border-width: 1px; border-style: solid; }
.border-0 { border-width: 0; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-white\/5 { border-color: rgba(255, 255, 255, .05); }
.border-white\/10 { border-color: rgba(255, 255, 255, .1); }
.border-white\/20 { border-color: rgba(255, 255, 255, .2); }
.border-transparent { border-color: transparent; }

/* Фоны */
.bg-transparent { background-color: transparent; }
.bg-white\/5 { background-color: rgba(255, 255, 255, .05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, .1); }
.bg-slate-900\/60 { background-color: rgba(10, 20, 36, .6); }
.bg-slate-900\/80 { background-color: rgba(8, 16, 30, .8); }
.bg-slate-950\/70 { background-color: rgba(4, 8, 15, .7); }

/* Размытие «стекла» */
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); }
.backdrop-blur-lg { backdrop-filter: blur(16px) saturate(170%); -webkit-backdrop-filter: blur(16px) saturate(170%); }
.backdrop-blur-xl { backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }

/* Тени */
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-glow { box-shadow: var(--shadow-glow); }
.shadow-none { box-shadow: none; }

/* Типографика */
.text-xs { font-size: .75rem; line-height: 1.5; }
.text-sm { font-size: .875rem; line-height: 1.6; }
.text-base { font-size: 1rem; line-height: 1.65; }
.text-lg { font-size: 1.125rem; line-height: 1.55; }
.text-xl { font-size: 1.25rem; line-height: 1.45; }
.text-2xl { font-size: 1.5rem; line-height: 1.3; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: .025em; }
.tracking-widest { letter-spacing: .16em; }
.leading-tight { line-height: 1.25; }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.text-white { color: #fff; }
.text-slate-100 { color: var(--text); }
.text-slate-300 { color: var(--text-soft); }
.text-slate-400 { color: var(--text-muted); }
.text-cyan-300 { color: var(--accent-400); }
.text-cyan-400 { color: var(--accent-500); }

/* Прочее */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.object-cover { object-fit: cover; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.list-none { list-style: none; }
.isolate { isolation: isolate; }
.will-change-transform { will-change: transform; }

/* Переходы и трансформации */
.transition {
  transition-property: color, background-color, border-color, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: var(--ease-out);
  transition-duration: var(--t);
}
.transition-transform { transition: transform var(--t) var(--ease-out); }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }
.duration-700 { transition-duration: 700ms; }
.ease-out { transition-timing-function: var(--ease-out); }

.scale-105 { transform: scale(1.05); }
.-translate-y-1 { transform: translateY(-.25rem); }

/* Состояния */
.hover\:-translate-y-1:hover { transform: translateY(-.25rem); }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, .1); }
.hover\:border-white\/20:hover { border-color: rgba(255, 255, 255, .2); }
.hover\:shadow-glow:hover { box-shadow: var(--shadow-glow); }
.hover\:text-white:hover { color: #fff; }
.active\:scale-\[0\.98\]:active { transform: scale(.98); }

/* Групповые состояния */
.group:hover .group-hover\:scale-105 { transform: scale(1.05); }
.group:hover .group-hover\:scale-110 { transform: scale(1.1); }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:text-white { color: #fff; }
.group:hover .group-hover\:translate-x-1 { transform: translateX(.25rem); }

/* Брейкпоинты Tailwind */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:col-span-3 { grid-column: span 3 / span 3; }
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:block { display: block; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:row-span-2 { grid-row: span 2 / span 2; }
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:block { display: block; }
}

/* ==========================================================================
   4. Движение — появление при прокрутке, нажатия, скелетоны
   Аналог Framer Motion на чистом CSS: `.reveal` → `.is-visible` уже
   переключает существующий IntersectionObserver в js/script.js.
   ========================================================================== */

/* whileInView: блок всплывает снизу с лёгким масштабом.
   Селектор начинается с `.js` — класс ставит js/script.js. Без скриптов
   правило не срабатывает и содержимое остаётся видимым. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px) scale(.985);
  transition:
    opacity 700ms var(--ease-out),
    transform 700ms var(--ease-out);
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Каскад: дети сетки въезжают по очереди, задержка задаётся порядком.
   Работает без JS — на :nth-child(). */
/* fill-mode именно `backwards`: после проигрыша элемент возвращается к своим
   обычным стилям, иначе `transform: none` из кадра `to` перебил бы hover. */
.js .reveal.is-visible > * {
  animation: riseIn 620ms var(--ease-out) backwards;
}
.js .reveal.is-visible > *:nth-child(1)  { animation-delay:  40ms; }
.js .reveal.is-visible > *:nth-child(2)  { animation-delay:  90ms; }
.js .reveal.is-visible > *:nth-child(3)  { animation-delay: 140ms; }
.js .reveal.is-visible > *:nth-child(4)  { animation-delay: 190ms; }
.js .reveal.is-visible > *:nth-child(5)  { animation-delay: 240ms; }
.js .reveal.is-visible > *:nth-child(6)  { animation-delay: 290ms; }
.js .reveal.is-visible > *:nth-child(7)  { animation-delay: 340ms; }
.js .reveal.is-visible > *:nth-child(8)  { animation-delay: 380ms; }
.js .reveal.is-visible > *:nth-child(n+9) { animation-delay: 420ms; }

/* Каскад нужен только сеткам карточек — у текстовых блоков он мешает */
.js .reveal.no-stagger.is-visible > *,
.js .section-heading.is-visible > *,
.js .reveal.is-visible > br,
.js .reveal.is-visible > script { animation: none; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* whileTap: нажатие «продавливает» элемент.
   data-tap проставляет js/motion.js всем кнопкам и ссылкам-кнопкам. */
[data-tap] { transition: transform 120ms var(--ease-out); }
[data-tap]:active:not(:disabled) { transform: scale(.98); }
[data-tap].is-tapped { transform: scale(.98); }

/* Skeleton — современная замена спиннерам */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius-2xl);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, .07) 45%,
    rgba(125, 211, 252, .11) 55%,
    transparent 100%);
  animation: shimmer 1.6s var(--ease-io) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.skeleton-line {
  height: 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .07);
  border: 0;
}
.skeleton-line.is-lg { height: 20px; }
.skeleton-line.is-sm { height: 9px; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-stack { display: grid; gap: 10px; }

/* Картинки проявляются из размытия, а не «прыгают».
   Намеренно только opacity и filter: transform оставлен компонентам —
   иначе это правило перебивало бы их масштаб при наведении. */
img[data-fade] {
  opacity: 0;
  filter: blur(12px);
  transition: opacity 600ms var(--ease-out), filter 600ms var(--ease-out);
}
img[data-fade].is-loaded {
  opacity: 1;
  filter: none;
}

/* Пульсирующая точка «в эфире» */
.pulse-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-500);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulseRing 2.4s var(--ease-io) infinite;
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* Уважение к системной настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .skeleton::after { animation: none; }
}
