/* ============ CINEMATIC HERO DESIGN SYSTEM · Поток Спирали ============ */
/* Palette: pure black bg, white text, gray-400 subtitle, glass pills, one solid CTA */

:root {
  --bg: #000;
  --text: #fff;
  --muted: #9ca3af;
  --warm: #ffbd80;
  --border-soft: rgba(255, 255, 255, .14);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) {
  body { overflow: hidden; }
}

/* ---------- BACKGROUND VIDEO (z-index 0) ---------- */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* ---------- BOTTOM BLUR OVERLAY — only blur, NO dark gradient (z-index 1) ---------- */
.bottom-blur {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 45%);
  mask-image: linear-gradient(to top, black 0%, transparent 45%);
}

/* ---------- DIM OVERLAY (страница анкеты: гасит яркость фона) ---------- */
.dim {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(0, 0, 0, .55);
}

/* ---------- LIQUID GLASS (reusable) ---------- */
.liquid-glass {
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 20%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.15) 80%, rgba(255,255,255,0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- BLUR-FADE-UP ANIMATION ---------- */
@keyframes blurFadeUp {
  from { opacity: 0; filter: blur(20px); transform: translateY(40px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
.animate-blur-fade-up {
  opacity: 0;
  animation: blurFadeUp 1s ease-out forwards;
}

/* ---------- PAGE FRAME ---------- */
.page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .page { height: 100svh; }
}

/* ---------- NAVBAR (z-index 50) ---------- */
.navbar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  height: 32px;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
}
.logo-text { font-size: 14px; font-weight: 700; letter-spacing: .22em; white-space: nowrap; }
.logo-text i { font-style: normal; opacity: .4; margin: 0 4px; }

.nav-links { display: none; align-items: center; gap: 28px; }
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: color .2s;
}
.nav-links a:hover { color: #d1d5db; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.pill {
  display: none;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.avatar {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: default;
}
.menu-btn { display: flex; cursor: pointer; color: #fff; }
.menu-btn .icon-close { display: none; }
.menu-btn.open .icon-menu { display: none; }
.menu-btn.open .icon-close { display: block; }
.menu-btn svg { transition: transform .5s ease-out, opacity .5s ease-out; }
.menu-btn.open svg { transform: rotate(180deg); }

/* ---------- MOBILE MENU ---------- */
.mobile-menu {
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 16px;
  background: rgba(9, 9, 11, .95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  box-shadow: 0 25px 50px rgba(0,0,0,.6);
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: transform .5s ease-out, opacity .5s ease-out;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  padding: 12px;
  border-radius: 8px;
  transform: translateX(-12px);
  opacity: 0;
  transition: transform .4s ease-out, opacity .4s ease-out, background .2s;
}
.mobile-menu.open a { transform: translateX(0); opacity: 1; }
.mobile-menu.open a:nth-child(1) { transition-delay: 50ms; }
.mobile-menu.open a:nth-child(2) { transition-delay: 100ms; }
.mobile-menu.open a:nth-child(3) { transition-delay: 150ms; }
.mobile-menu.open a:nth-child(4) { transition-delay: 200ms; }
.mobile-menu.open a:nth-child(5) { transition-delay: 250ms; }
.mobile-menu a:hover { background: rgba(31, 41, 55, .5); }
.mobile-menu-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #1f2937;
}
.mobile-menu-foot .pill, .mobile-menu-foot .avatar { display: flex; }

/* ---------- HERO (bottom of viewport) ---------- */
.hero {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 16px 32px;
  min-height: 0;
}
@media (min-width: 768px) {
  .hero { justify-content: flex-end; }
  /* Quiz page: card vertically centered, not pinned to the bottom. */
  .hero--quiz { justify-content: center; padding-top: 12px; padding-bottom: 32px; }
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: stretch;
  min-height: 0;
}
.hero-copy { flex: 1; min-width: 0; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 12px;
  color: #e5e7eb;
}
.meta-item { display: inline-flex; align-items: center; gap: 8px; color: #e5e7eb; }
.meta-item strong { font-weight: 500; }
.meta-dim { color: var(--muted); }

.title {
  margin: 0 0 16px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
  font-size: 36px;
}
.subtitle {
  margin: 0 0 24px;
  max-width: 42rem;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row .btn-solid, .cta-row .btn-glass { flex: 1 1 100%; justify-content: center; }
@media (min-width: 640px) {
  .cta-row .btn-solid, .cta-row .btn-glass { flex: 0 0 auto; }
}

/* The only solid element: white CTA */
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font: 500 15px 'Inter', sans-serif;
  padding: 10px 24px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-solid:hover { background: #e5e7eb; }
.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  color: #fff;
  font: 500 15px 'Inter', sans-serif;
  padding: 10px 24px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-glass:hover { background: rgba(255,255,255,.08); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- GLASS PANEL ---------- */
.hero-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; width: 100%; }
.assessment-card {
  border-radius: 24px;
  padding: 26px 22px;
  color: #fff;
}
/* Internal scroll only on desktop hero; mobile and quiz page scroll naturally. */
@media (min-width: 768px) {
  .hero:not(.hero--quiz) .assessment-card { max-height: 46svh; overflow-y: auto; }
  .hero--quiz .assessment-card { max-height: 68svh; overflow-y: auto; }
}
.assessment-card { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }

/* Quiz page: single centered column */
.hero--quiz .hero-inner--single { justify-content: center; }
.hero-panel--single { width: 100%; max-width: 680px; margin: 0 auto; }
.assessment-card::-webkit-scrollbar { width: 6px; }
.assessment-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 3px; }

.view { display: none; }
.view.active { display: block; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--warm);
}
.assessment-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.view-heading p:not(.eyebrow) { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; }

.steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.steps li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
}
.steps span { color: var(--warm); font-size: 12px; font-weight: 600; }

/* Form */
.fields-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.field { display: grid; gap: 6px; }
.field label { color: #e5e7eb; font-size: 12px; }
.field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,.4);
  color: #fff;
  font: 400 14px 'Inter', sans-serif;
  padding: 11px 12px;
  outline: none;
}
.field input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; color: #e5e7eb; font-size: 12px; line-height: 1.5; }
.consent input { margin-top: 3px; accent-color: #fff; }
.consent a { color: #fff; text-underline-offset: 2px; }
.form-error { margin: 0 0 12px; color: #fca5a5; font-size: 13px; }

/* Quiz */
.quiz-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #e5e7eb; }
.quiz-meta .eyebrow { margin: 0; }
.progress-track { height: 2px; margin: 14px 0 22px; background: rgba(255,255,255,.14); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: #fff; transition: width .25s ease; }
.question-number { margin: 0 0 8px; color: var(--warm); font-size: 22px; font-weight: 300; }
.question-text { margin: 0; min-height: 0; font-size: 21px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.answer-list { display: grid; gap: 8px; margin: 20px 0 14px; }
.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,.03);
  color: #fff;
  font: 400 14px 'Inter', sans-serif;
  padding: 12px 14px;
  text-align: left;
  transition: background .18s, border-color .18s;
}
.answer:hover, .answer.selected { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.1); }
.answer-key {
  display: grid;
  flex: none;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  font-size: 11px;
}
.answer.selected .answer-key { background: #fff; color: #000; border-color: #fff; }
.quiz-controls { display: flex; justify-content: space-between; align-items: center; }
.text-button { cursor: pointer; border: 0; padding: 6px 0; background: transparent; color: #e5e7eb; font: 400 14px 'Inter', sans-serif; }
.text-button:hover:not(:disabled) { color: #fff; }
.text-button:disabled { cursor: not-allowed; opacity: .35; }

.result-status { margin: 10px 0 14px; color: var(--warm); font-size: 19px; }
.result-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.hero-foot { margin-top: 18px; color: rgba(255,255,255,.55); font-size: 11px; letter-spacing: .08em; }

/* ---------- POLICY PAGE ---------- */
.policy-page {
  min-height: 100vh;
  min-height: 100svh;
  overflow-y: auto;
  background: #000;
  padding: 0;
}
.policy-wrap { position: relative; z-index: 10; max-width: 880px; margin: 0 auto; padding: 90px 16px 60px; }
.policy-content {
  border-radius: 24px;
  padding: 34px 24px;
  line-height: 1.65;
}
.policy-content h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; margin: 14px 0 18px; }
.policy-content h2 { font-size: 19px; font-weight: 600; margin: 26px 0 8px; }
.policy-content p, .policy-content li { color: #d1d5db; font-size: 14px; }
.policy-content .back { display: inline-flex; color: #fff; font-size: 14px; text-decoration: none; border-radius: 999px; padding: 8px 16px; }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 640px) {
  .navbar { padding: 20px 24px; }
  .hero { padding: 0 24px 40px; }
  .title { font-size: 48px; }
  .subtitle { font-size: 18px; }
  .meta-row { font-size: 14px; }
  .meta-item svg { width: 20px; height: 20px; }
  .pill, .avatar { display: inline-flex; }
  .logo { height: 40px; }
  .btn-solid, .btn-glass { padding: 12px 32px; }
  .assessment-card { padding: 32px 30px; }
  .fields-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  .navbar { padding: 24px 48px; }
  .hero { padding: 0 48px 64px; }
  .hero-inner { flex-direction: row; align-items: flex-end; gap: 32px; }
  .title { font-size: 56px; }
  .subtitle { font-size: 20px; margin-bottom: 32px; }
  .hero-panel { max-width: 460px; }
  .hero-panel--single { max-width: 680px; }
  .hero-inner--single { flex-direction: column; align-items: stretch; }
}

@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
  .mobile-menu { display: none; }
  .title { font-size: 72px; }
  .hero-panel { max-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  .animate-blur-fade-up { animation: none; opacity: 1; }
  * { transition-duration: .01ms !important; }
}
