/* static/shared/omni-theme.css */
:root {
  --canvas: #FFF6ED;
  --card: #FFFFFF;
  --ink: #23201C;
  --muted: #9A918A;
  --accent: #FF5C39;
  --accent-2: #7A5CFF;
  --accent-3: #0FC2A0;
  --accent-4: #FFB020;
  --gold: #C99A4B;

  --radius-base: 20px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 48px rgba(35, 32, 28, 0.06);
  --shadow-lift: 0 24px 60px rgba(35, 32, 28, 0.11);
  --space-air: clamp(24px, 4vw, 56px);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Завораживающий светлый градиент-меш без тёмноты */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(420px circle at 14% 18%, rgba(255, 92, 57, 0.22), transparent 68%),
    radial-gradient(480px circle at 84% 22%, rgba(122, 92, 255, 0.20), transparent 70%),
    radial-gradient(440px circle at 52% 84%, rgba(15, 194, 160, 0.20), transparent 70%),
    radial-gradient(320px circle at 78% 72%, rgba(255, 176, 32, 0.16), transparent 65%);
  filter: blur(52px);
  mix-blend-mode: soft-light;
}

/* Лёгкое зерно (grain 3–4%) поверх фона */
.grain {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Супрематические фоновые плоскости + медленный овальный blob-морф */
@keyframes omniBlobMorph {
  0% {
    border-radius: 30% 70% 62% 38% / 44% 34% 66% 56%;
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    border-radius: 70% 30% 38% 62% / 56% 66% 34% 44%;
    transform: translate(12px, -10px) rotate(6deg);
  }
  100% {
    border-radius: 30% 70% 62% 38% / 44% 34% 66% 56%;
    transform: translate(0, 0) rotate(0deg);
  }
}

.sup-plane {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  animation: omniBlobMorph 10s ease-in-out infinite;
}

.sup-plane--coral {
  width: 300px;
  height: 240px;
  top: 8%;
  right: 6%;
  background: var(--accent);
}

.sup-plane--violet {
  width: 260px;
  height: 260px;
  bottom: 12%;
  left: 4%;
  background: var(--accent-2);
  animation-duration: 12s;
}

.sup-plane--mint {
  width: 200px;
  height: 180px;
  top: 52%;
  right: 18%;
  background: var(--accent-3);
  animation-duration: 9s;
}

/* Контейнер с воздухом Малевича */
.omni-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-air);
}

/* Портал входа (Hero) */
.portal-hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 64px);
  display: grid;
  gap: 28px;
  max-width: 820px;
}

.portal-hero__title {
  margin: 0;
  font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.portal-hero__usp {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--muted);
  max-width: 580px;
}

.portal-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}

/* Кинетическая типографика */
@keyframes omniKineticRise {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.kinetic {
  display: inline-block;
}

.kinetic-char {
  display: inline-block;
  opacity: 0;
  animation: omniKineticRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Сетка карточек */
.omni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(22px, 3vw, 36px);
  margin-top: 32px;
}

/* Овальные/блоб карточки БЕЗ overflow:hidden (для наполнения за рамки) */
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-base);
  padding: 28px 30px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  --mx: 50%;
  --my: 50%;
}

.card:nth-child(4n + 1) {
  border-radius: 28px 999px 28px 999px;
}

.card:nth-child(4n + 2) {
  border-radius: 999px 20px 999px 20px;
}

.card:nth-child(4n + 3) {
  border-radius: 38% 62% 55% 45% / 45% 38% 62% 55%;
}

.card:nth-child(4n + 4) {
  border-radius: 44px 20px 48px 20px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

/* Солнечный зайчик / призма следует за курсором */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--mx) var(--my),
    rgba(255, 176, 32, 0.26),
    rgba(255, 92, 57, 0.10) 45%,
    transparent 72%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover::before {
  opacity: 1;
}

/* Деталь, выходящая за рамки карточки */
.card-accent {
  position: absolute;
  top: -12px;
  right: -12px;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(10px, -10px);
  box-shadow: 0 10px 24px rgba(255, 92, 57, 0.30);
  pointer-events: none;
}

.card-accent--violet {
  background: var(--accent-2);
  box-shadow: 0 10px 24px rgba(122, 92, 255, 0.30);
}

.card-accent--mint {
  background: var(--accent-3);
  box-shadow: 0 10px 24px rgba(15, 194, 160, 0.30);
}

.card-accent--gold {
  background: var(--gold);
  box-shadow: 0 10px 24px rgba(201, 154, 75, 0.30);
}

/* Кнопки-пилюли (в т.ч. магнитные CTA) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 10px 26px rgba(255, 92, 57, 0.26);
}

.btn:hover {
  box-shadow: 0 14px 32px rgba(255, 92, 57, 0.36);
}

.btn--secondary {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.btn--violet {
  background: var(--accent-2);
  box-shadow: 0 10px 26px rgba(122, 92, 255, 0.26);
}

/* Тумблер-пилюля */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: rgba(154, 145, 138, 0.28);
  border: none;
  padding: 3px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.toggle[aria-checked="true"],
.toggle.is-active {
  background: var(--accent-3);
}

.toggle::after {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(35, 32, 28, 0.18);
  transition: transform 0.2s ease;
}

.toggle[aria-checked="true"]::after,
.toggle.is-active::after {
  transform: translateX(22px);
}

/* Чипы, бейджи и баннеры */
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(122, 92, 255, 0.12);
  color: var(--accent-2);
}

.badge--gold {
  background: rgba(201, 154, 75, 0.16);
  color: var(--gold);
}

.banner {
  padding: 18px 24px;
  border-radius: 26px 999px 26px 999px;
  background: rgba(255, 176, 32, 0.14);
  color: var(--ink);
  margin: 16px 0;
}

/* Заглушка неподключенной услуги */
.stub {
  padding: 36px;
  border-radius: 34px 20px 34px 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed rgba(154, 145, 138, 0.35);
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.stub__title {
  margin: 0;
  font-size: 1.25rem;
}

.stub__desc {
  margin: 0;
  color: var(--muted);
  max-width: 440px;
}

/* Модальные окна (<dialog>) */
.modal,
dialog {
  border: none;
  border-radius: 32px;
  padding: 30px 32px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(35, 32, 28, 0.18);
  max-width: 480px;
  width: calc(100% - 32px);
}

dialog::backdrop {
  background: rgba(35, 32, 28, 0.32);
  backdrop-filter: blur(4px);
}

/* Виджет поддержки слева снизу */
.support-widget {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 950;
}

/* Кнопка и попап ИИ-помощника справа снизу */
.assistant-popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 950;
}

.chat-log {
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 18px;
  background: var(--canvas);
}

.chat-msg {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--card);
  font-size: 0.92rem;
}
