:root {
  --primary: #6366f1;
  --secondary: #ec4899;
  --bg: #0f172a;
  --bg-deep: #0b1120;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --grad: linear-gradient(135deg, var(--primary), var(--secondary));
  --radius: 18px;
  --nav-h: 72px;
  --shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
  --ease: cubic-bezier(0.22, 0.7, 0.24, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(99, 102, 241, 0.18), transparent 68%),
    radial-gradient(760px 520px at 92% 4%, rgba(236, 72, 153, 0.13), transparent 68%);
}

img,
canvas,
svg {
  max-width: 100%;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5.2vw, 4.25rem);
  font-weight: 800;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

p {
  color: var(--muted);
}

ul {
  margin: 0;
  padding: 0;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

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

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(16px, 4vw, 44px);
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand::before {
  content: "";
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: url("../img/brand-mark.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.45));
  transition: transform 0.35s var(--ease);
}

.brand:hover::before,
.brand:focus-visible::before {
  transform: rotate(-10deg) scale(1.1);
}

.nav-links,
.footer-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links a,
.footer-links a {
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transition: right 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  right: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.lang select {
  min-height: 38px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang select:hover,
.lang select:focus-visible {
  border-color: var(--primary);
  background: #243147;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  box-shadow: 0 14px 32px rgba(236, 72, 153, 0.34);
}

.btn-ghost {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(99, 102, 241, 0.14);
  border-color: var(--primary);
}

.btn-outline {
  color: var(--text);
  background: transparent;
  border-color: rgba(236, 72, 153, 0.55);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: rgba(236, 72, 153, 0.12);
  border-color: var(--secondary);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(60px, 9vw, 116px) 20px clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  margin-bottom: 24px;
  padding: 7px 15px;
  border: 1px solid rgba(99, 102, 241, 0.42);
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.16);
}

.lead {
  max-width: 720px;
  margin: 0 auto 30px;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 5vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  gap: 2px;
}

.stat b {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 92px) 20px;
}

.section-head,
.head {
  max-width: 760px;
  margin: 0 auto clamp(30px, 4.5vw, 52px);
  text-align: center;
}

.section-head p,
.head p {
  margin-bottom: 0;
}

.tag {
  display: inline-block;
  margin-bottom: 12px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tag-soft {
  margin-bottom: 10px;
  padding: 4px 11px;
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  -webkit-text-fill-color: #c7d2fe;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.18);
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--shadow);
}

.card:focus-within {
  border-color: var(--primary);
}

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

.ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  list-style: none;
}

.service li {
  padding: 4px 10px 4px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  position: relative;
}

.service li::before {
  content: "✓";
  position: absolute;
  left: 7px;
  color: #f0abfc;
  font-weight: 800;
}

.step {
  align-items: flex-start;
}

.num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(236, 72, 153, 0.28);
}

.meta {
  margin: 4px 0 18px;
  font-size: 0.85rem;
}

.meta span:last-child {
  color: var(--text);
  font-weight: 700;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.card-actions .btn {
  flex: 1 1 auto;
  padding-inline: 14px;
  font-size: 0.85rem;
}

#templates .card[data-template] {
  overflow: hidden;
  cursor: default;
}

#templates .card[data-template]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

#templates .card[data-template]:hover::before,
#templates .card[data-template].active::before,
#templates .card[data-template][data-selected="true"]::before {
  opacity: 1;
}

#templates .card[data-template].active,
#templates .card[data-template][data-selected="true"] {
  border-color: var(--primary);
  background: #223051;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4), var(--shadow);
}

.stage-wrap {
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(11, 17, 32, 0.98));
  box-shadow: var(--shadow);
}

#preview canvas#stage {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-deep);
  animation: sceneIn 0.55s var(--ease) both;
}

#preview canvas#stage.is-active,
#preview canvas#stage.scene-enter,
#preview .stage-wrap.visible canvas#stage {
  animation: sceneIn 0.45s var(--ease) both;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.player-controls .btn {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.85rem;
}

#progressBar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 220px;
  min-width: 100px;
  height: 8px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary)) 0 0 / var(--progress, 0%) 100% no-repeat,
    rgba(148, 163, 184, 0.22);
  cursor: pointer;
  transition: filter 0.2s ease;
}

#progressBar:hover,
#progressBar:focus-visible {
  filter: brightness(1.2);
}

#progressBar::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

#progressBar::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

#progressBar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 3px solid var(--text);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.55);
  cursor: grab;
}

#progressBar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--text);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.55);
  cursor: grab;
}

.scene-text {
  min-height: 1.6em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.scene-text:not(:empty) {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  animation: sceneIn 0.4s var(--ease) both;
}

.scene-text.is-visible,
.scene-text.is-active {
  animation: sceneIn 0.4s var(--ease) both;
}

.thumb-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 24px;
}

.thumb-form,
.contact-info,
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

label {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

input[type="text"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

input:hover,
textarea:hover {
  border-color: rgba(99, 102, 241, 0.5);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #0d1529;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.thumb-preview {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--bg-deep);
  box-shadow: var(--shadow);
}

#thumbCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--bg-deep);
  animation: sceneIn 0.55s var(--ease) both;
}

#thumbCanvas.is-active,
#thumbCanvas.scene-enter {
  animation: sceneIn 0.45s var(--ease) both;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.faq-list details:hover,
.faq-list details[open] {
  border-color: rgba(99, 102, 241, 0.5);
  background: #223051;
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  margin: 0;
  padding: 0 22px 20px;
  font-size: 0.94rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.contact-info {
  gap: 18px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.contact-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-item small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact-item span {
  overflow-wrap: anywhere;
  font-weight: 600;
}

#leadForm .btn {
  margin-top: 6px;
}

.lead-status {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.9rem;
}

.lead-status:not(:empty) {
  padding: 10px 14px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
}

.lead-status.error {
  border-color: rgba(236, 72, 153, 0.5);
  background: rgba(236, 72, 153, 0.12);
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px;
}

.footer-inner p {
  margin: 0;
  font-size: 0.85rem;
}

@keyframes sceneIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-inner > * {
  animation: fadeUp 0.65s var(--ease) both;
}

.hero-inner > :nth-child(2) { animation-delay: 0.06s; }
.hero-inner > :nth-child(3) { animation-delay: 0.12s; }
.hero-inner > :nth-child(4) { animation-delay: 0.18s; }
.hero-inner > :nth-child(5) { animation-delay: 0.24s; }

@media (max-width: 1000px) {
  .nav-links {
    gap: 14px;
    font-size: 0.85rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  :root {
    --nav-h: 112px;
  }

  .nav {
    flex-wrap: wrap;
    align-content: center;
    gap: 8px 14px;
    padding: 10px 16px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 20px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .lang span {
    display: none;
  }

  .hero {
    padding-block: 52px 56px;
  }

  .hero-actions {
    margin-bottom: 36px;
  }

  .stats {
    gap: 18px;
  }

  .stat {
    min-width: 96px;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .thumb-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-controls {
    flex-wrap: wrap;
  }

  #progressBar {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
  }

  .section-head,
  .head {
    text-align: left;
  }

  .section-head p,
  .head p {
    margin-inline: 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 116px;
  }

  .nav-actions .btn {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .lang select {
    min-height: 36px;
    padding: 5px 7px;
    font-size: 0.8rem;
  }

  h1 {
    font-size: 2.1rem;
  }

  .badge {
    font-size: 0.72rem;
  }

  .hero-actions,
  .card-actions {
    flex-direction: column;
  }

  .hero-actions .btn,
  .card-actions .btn {
    width: 100%;
  }

  .stats {
    flex-direction: column;
    align-items: center;
  }

  .stat {
    width: 100%;
    padding-block: 10px;
    border-bottom: 1px solid var(--border);
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .card {
    padding: 20px;
  }

  .player-controls .btn {
    flex: 1 1 auto;
  }

  .faq-list summary {
    padding: 16px;
  }

  .faq-list details p {
    padding: 0 16px 18px;
  }
}

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

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