/* База: шрифты, токены тем, типографика, кнопки, карточки, общие эффекты. */

@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/NunitoSans-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --container: 1200px;
  --nav-h: 72px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --primary: #1a56db;
  --primary-2: #2563eb;
  --primary-light: #60a5fa;
  --cyan: #22d3ee;
  --success: #10b981;
  --danger: #ef4444;
  --rating: #f59e0b;
  --transition-theme: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

html[data-theme='dark'] {
  --bg: #000000;
  --bg-alt: #060608;
  --bg-elevated: #1c1c1e;
  --bg-elevated-2: #2c2c2e;
  --glass: rgba(28, 28, 30, 0.55);
  --glass-strong: rgba(10, 10, 14, 0.72);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f5f9;
  --text-muted: #9ca3af;
  --text-soft: #cbd5e1;
  --bubble-out: #2563eb;
  --bubble-in: #2c2c2e;
  --nav-bg: rgba(6, 6, 12, 0.62);
  --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --soft-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --hero-1: #0c0325;
  --hero-2: #070b19;
  --hero-3: #000000;
  --pattern-color: rgba(59, 130, 246, 0.07);
  --input-fill: rgba(255, 255, 255, 0.07);
  --selection: rgba(37, 99, 235, 0.45);
}

html[data-theme='light'] {
  --bg: #fcfcfc;
  --bg-alt: #f2f2f7;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #f6f6f6;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(252, 252, 252, 0.86);
  --border: #e5e7eb;
  --border-strong: #d6dbe4;
  --text: #0f172a;
  --text-muted: #4b5563;
  --text-soft: #334155;
  --primary-light: #1d4ed8;
  --success: #047857;
  --danger: #b91c1c;
  --rating: #b45309;
  --bubble-out: #eef6fc;
  --bubble-in: #ffffff;
  --nav-bg: rgba(252, 252, 252, 0.72);
  --card-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --soft-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  --hero-1: #0c0325;
  --hero-2: #101a3a;
  --hero-3: #1b2a55;
  --pattern-color: rgba(26, 86, 219, 0.06);
  --input-fill: rgba(15, 23, 42, 0.04);
  --selection: rgba(26, 86, 219, 0.22);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  transition: var(--transition-theme);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked {
  overflow: hidden;
}

img,
video,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
  background: var(--bg-elevated-2);
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-solid {
  fill: currentColor;
  stroke: none;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.55em;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.15rem, 4.6vw, 4rem);
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.75rem);
}

h3 {
  font-size: clamp(1.12rem, 1.6vw, 1.4rem);
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

strong {
  color: var(--text);
}

::selection {
  background: var(--selection);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 6px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  transition: transform 0.25s var(--ease-out), background 0.25s ease, border-color 0.25s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 21px;
  height: 21px;
}

html[data-theme='dark'] .icon-sun {
  display: block;
}
html[data-theme='dark'] .icon-moon {
  display: none;
}
html[data-theme='light'] .icon-sun {
  display: none;
}
html[data-theme='light'] .icon-moon {
  display: block;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(64px, 8vw, 118px) 0;
  background: var(--bg);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(32px, 4.5vw, 56px);
}

.section-head p {
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-light);
}

.grad-text {
  background: linear-gradient(100deg, #60a5fa, #22d3ee 60%, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme='light'] .grad-text {
  background-image: linear-gradient(100deg, #1d4ed8, #0e7490 60%, #4338ca);
}

html[data-theme='light'] .hero .grad-text {
  background-image: linear-gradient(100deg, #60a5fa, #22d3ee 60%, #818cf8);
}

html[data-theme='light'] .beta-badge,
html[data-theme='light'] .soon-tag {
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.35);
  background: #fef3c7;
}

.brand-text-inline {
  color: var(--primary-light);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.15;
  text-align: center;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
  will-change: transform;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2) 70%, #3b82f6);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.45);
}

.btn-glass {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.btn-glass:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--glass-strong);
}

.btn-lg {
  min-height: 54px;
  padding: 16px 26px;
  font-size: 1.02rem;
}

.btn-wide {
  width: 100%;
}

.card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: var(--transition-theme), transform 0.35s var(--ease-out);
  overflow: hidden;
}

.nojs-nav {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: calc(var(--nav-h) + 12px) 0 12px;
  position: relative;
  z-index: 90;
  background: var(--bg);
}

.nojs-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-fill);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.spotlight::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 50%),
    rgba(59, 130, 246, 0.17),
    transparent 45%
  );
}

.spotlight:hover::before,
.spotlight:focus-within::before {
  opacity: 1;
}

.spotlight > * {
  position: relative;
  z-index: 1;
}

.card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-head h3 {
  margin-bottom: 6px;
}

.card-head p {
  margin: 0;
  font-size: 0.94rem;
}

.card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--primary-light);
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin-bottom: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: pulse-dot 2.4s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  70% {
    box-shadow: 0 0 0 11px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.chips-row li,
.soon-tag,
.scene-chip,
.ai-tags span,
.story-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
}

.soon-tag {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.check-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.check-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-soft);
  font-size: 0.97rem;
}

.check-list svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 3px;
  color: var(--success);
  stroke-width: 2.4;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--input-fill);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-soft);
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-ui {
  position: relative;
  flex: none;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.switch-ui > span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.28s var(--ease-out), background 0.25s ease;
}

.switch-row input:checked ~ .switch-ui {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.5);
}

.switch-row input:checked ~ .switch-ui > span {
  transform: translateX(19px);
  background: #10b981;
}

.switch-row input:focus-visible ~ .switch-ui {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.switch-row-inline {
  max-width: 330px;
}

.theme-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--input-fill);
  font-weight: 700;
  color: var(--text-soft);
}

.theme-row svg {
  width: 20px;
  height: 20px;
}

.theme-row span:not(.switch-ui) {
  flex: 1;
  text-align: left;
}

.link-btn {
  display: inline;
  padding: 0;
  color: var(--primary-light);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--input-fill);
}

.copy-btn svg {
  width: 18px;
  height: 18px;
}

/* Появление при прокрутке (только когда JS активен — без JS контент виден) */
.js .reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.97);
  filter: blur(8px);
  transition:
    opacity 0.72s var(--ease-out),
    transform 0.72s var(--ease-out),
    filter 0.72s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Верхняя полоса прогресса */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--cyan));
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.7);
  will-change: transform;
}

/* Тост */
.toast-region {
  position: fixed;
  z-index: 140;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(100% - 32px, 460px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.35s var(--ease-out);
}

.toast.is-hiding {
  animation: toast-out 0.25s ease forwards;
}

.toast-action {
  margin-left: auto;
  flex: none;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.18);
  color: var(--primary-light);
  font-weight: 800;
  font-size: 0.82rem;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Модальные окна */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 860px);
  max-height: min(86dvh, 900px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.32s var(--ease-out);
  overflow: hidden;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-body {
  padding: 20px 24px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.modal-body h3 {
  margin: 26px 0 10px;
  font-size: 1.02rem;
  color: var(--text);
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  margin: 0 0 12px;
  color: var(--text-soft);
  line-height: 1.6;
}

.modal-body ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-body a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-foot {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Cookie-баннер */
.cookie-banner {
  position: fixed;
  z-index: 130;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100% - 32px, 760px);
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
  animation: toast-in 0.4s var(--ease-out);
}

.cookie-banner p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.cookie-actions {
  flex: none;
}

.cookie-actions .btn {
  min-height: 42px;
  padding: 9px 18px;
}

/* Служебное */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
