/* ===================================================
   MEORIYA Landing — айдентика (по брендбуку)
   Глубокий бордо · тёплый бежевый · благородное золото
   =================================================== */
:root {
  --color-bordeaux: #81152A;
  --color-bordeaux-deep: #6A1023;
  --color-beige: #EDD9CC;
  --color-chocolate: #3C1E24;
  --color-gold: #D4AF37;
  --color-gold-light: #F5E6A8;
  --color-foil: #D9B57A;
  --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #F5E6A8 50%, #D4AF37 100%);
  --gradient-foil: linear-gradient(120deg, #F5E6A8 0%, #D9B57A 40%, #F5E6A8 68%, #C9A063 100%);

  --font-head: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-text: 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --topbar-h: 60px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--color-bordeaux);
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-text);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-beige);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Фирменный фон: золотые линии-дуги по краям бордового поля */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/static/img/swirl-wide.svg') center / cover no-repeat;
  pointer-events: none;
}
@media (max-aspect-ratio: 1/1) {
  body::before { background-image: url('/static/img/swirl-tall.svg'); }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { display: block; }

.hidden { display: none !important; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* Орнамент: линия — ромб — линия */
.ornament {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 auto;
}
.ornament i {
  flex: 0 1 72px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-foil));
}
.ornament i:last-child { transform: scaleX(-1); }
.ornament b {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--gradient-gold);
}
.ornament--top { margin-bottom: 26px; }

/* ===== ВЕРХНЯЯ ПАНЕЛЬ ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--topbar-h);
  padding: env(safe-area-inset-top) var(--gutter) 0;
  box-sizing: content-box;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.topbar--solid {
  background: rgba(129, 21, 42, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(217, 181, 122, .35);
}
.topbar__logo svg { height: 16px; width: auto; aspect-ratio: 432 / 60; }
.topbar__cta {
  padding: 9px 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--color-gold-light);
  border: 1px solid rgba(217, 181, 122, .7);
  border-radius: 999px;
  transition: all .3s ease;
}
@media (hover: hover) {
  .topbar__cta:hover { background: rgba(212, 175, 55, .15); box-shadow: 0 0 18px rgba(212, 175, 55, .35); }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: clamp(480px, 82svh, 780px);
  overflow: hidden;
  display: grid; place-items: center;
}
.hero__image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 60% center;
  transform: scale(1.04);
  animation: heroZoom 14s ease-out forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(60, 30, 36, .55) 0%, rgba(129, 21, 42, .1) 35%, rgba(129, 21, 42, .55) 78%, var(--color-bordeaux) 100%);
}
.hero__overlay {
  position: relative; z-index: 1;
  width: 100%; padding: calc(var(--topbar-h) + 16px) var(--gutter) 56px;
  display: flex; justify-content: center;
}
.hero__plaque {
  position: relative;
  width: min(100%, 640px);
  padding: 44px clamp(24px, 6vw, 64px) 40px;
  text-align: center;
  background: rgba(129, 21, 42, .85);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(217, 181, 122, .55);
  box-shadow: 0 24px 60px rgba(40, 8, 16, .45);
  animation: rise .9s var(--ease) both;
}
.hero__plaque::before {
  content: ''; position: absolute; inset: 7px;
  border: 1px solid rgba(217, 181, 122, .22);
  pointer-events: none;
}
.logo { display: block; }
.logo svg { width: min(100%, 440px); height: auto; margin: 0 auto; aspect-ratio: 432 / 60; }
.hero__plaque .ornament { margin: 24px auto 18px; }
.hero__tagline {
  font-size: 14px; font-weight: 500;
  letter-spacing: 3px; text-transform: uppercase; line-height: 1.7;
  color: var(--color-beige);
}
.hero__cta {
  display: inline-block; margin-top: 28px;
  padding: 14px 34px;
  font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--color-chocolate);
  background: var(--gradient-gold);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(245, 230, 168, .5), 0 8px 24px rgba(0, 0, 0, .25);
  transition: all .3s ease;
}
@media (hover: hover) {
  .hero__cta:hover { box-shadow: 0 0 25px rgba(212, 175, 55, .6); transform: translateY(-2px); }
}
.hero__cta:active { transform: scale(.98); }

.hero__scroll {
  position: absolute; z-index: 1; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: 24px; height: 40px;
  border: 1px solid rgba(245, 230, 168, .7); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--color-gold-light);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ===== ЛИНИЯ ПРОДУКТОВ ===== */
.line { padding: 0 var(--gutter); }
.line__list {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(217, 181, 122, .4);
  border-bottom: 1px solid rgba(217, 181, 122, .4);
}
.line__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 26px 12px; text-align: center;
  border-left: 1px solid rgba(217, 181, 122, .2);
}
.line__item:first-child { border-left: 0; }
.line__num {
  font-family: var(--font-head); font-weight: 700; font-size: 30px; line-height: 1;
  background: var(--gradient-foil); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.line__name {
  font-size: 12px; font-weight: 500; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--color-beige);
}

/* ===== ВОПРОСЫ ===== */
.questions-section {
  position: relative;
  padding: 72px 0 0;
  scroll-margin-top: calc(var(--topbar-h) - 8px);
}
.questions__greeting {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(28px, 4.4vw, 46px); line-height: 1.15;
  letter-spacing: .04em; text-transform: uppercase; text-align: center;
  max-width: 900px; margin: 0 auto 26px; text-wrap: balance;
  background: var(--gradient-foil); -webkit-background-clip: text; background-clip: text;
  color: var(--color-gold); -webkit-text-fill-color: transparent;
}
.questions__subtitle,
.questions__instruction {
  max-width: 760px; margin: 0 auto 18px;
  text-align: center; font-size: clamp(15px, 1.7vw, 18px);
}
.questions__subtitle { color: var(--color-beige); }
.questions__instruction { font-weight: 500; color: var(--color-gold-light); margin-bottom: 44px; }

.questions__list {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  max-width: 820px; margin: 0 auto;
}

.question-card {
  position: relative;
  display: grid; grid-template-columns: 44px 1fr 26px; align-items: center; column-gap: 14px;
  padding: 20px 22px;
  background: rgba(237, 217, 204, .08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(212, 175, 55, .4);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, transform .3s ease, opacity .5s ease;
}
@media (hover: hover) {
  .question-card:hover { background: rgba(237, 217, 204, .15); transform: translateY(-2px); }
}
.question-card.selected {
  border: 1px solid var(--color-gold);
  box-shadow: 0 0 0 1px var(--color-gold), 0 10px 30px rgba(212, 175, 55, .12); /* итого рамка 2px без сдвига вёрстки */
  background: rgba(212, 175, 55, .12);
}
.question-card__input { position: absolute; opacity: 0; pointer-events: none; }
.question-card__num {
  font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1;
  color: var(--color-foil); opacity: .85;
}
.question-card.selected .question-card__num { color: var(--color-gold-light); opacity: 1; }
.question-card__text { font-size: 16px; line-height: 1.55; }

.question-card__checkbox {
  position: relative; width: 22px; height: 22px; justify-self: end;
  border: 2px solid var(--color-gold); border-radius: 50%;
  transition: background .3s ease, transform .3s ease;
}
.question-card__checkbox::after {
  content: ''; position: absolute; left: 5.5px; top: 1.5px;
  width: 5px; height: 10px;
  border: solid var(--color-bordeaux); border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .3s ease;
}
.question-card__input:checked ~ .question-card__checkbox { background: var(--color-gold); transform: scale(1.08); }
.question-card__input:checked ~ .question-card__checkbox::after { transform: rotate(45deg) scale(1); }
.question-card__input:focus-visible ~ .question-card__checkbox { outline: 2px solid var(--color-gold-light); outline-offset: 3px; }

/* появление карточек при прокрутке (включается из JS) */
.reveal-on .question-card:not(.in) { opacity: 0; transform: translateY(18px); }

/* ===== ЛИПКАЯ ПАНЕЛЬ ДЕЙСТВИЯ ===== */
.action-bar {
  position: sticky; bottom: 0; z-index: 20;
  margin-top: 28px;
  padding: 34px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(129, 21, 42, .99) 68%, rgba(129, 21, 42, 0) 100%);
}
.action-bar__inner {
  max-width: 820px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.action-bar__info { flex: 1 1 auto; min-width: 0; }
.questions__counter {
  margin-bottom: 8px;
  font-size: 14px; font-weight: 500; letter-spacing: .5px;
  color: var(--color-gold-light);
}
.progress { height: 4px; border-radius: 4px; background: rgba(237, 217, 204, .2); overflow: hidden; }
.progress__bar {
  display: block; height: 100%; width: 0;
  background: var(--gradient-gold); border-radius: 4px;
  transition: width .4s var(--ease);
}

/* ===== КНОПКИ ===== */
.btn-primary {
  flex: 0 0 auto;
  padding: 18px 40px;
  font-family: var(--font-text); font-weight: 600; font-size: 15px; letter-spacing: 1px;
  color: var(--color-chocolate);
  background: var(--gradient-gold);
  border: none; border-radius: 8px;
  /* двойная рамка: тонкая бордовая обводка внутри */
  box-shadow: inset 0 0 0 3px var(--color-gold), inset 0 0 0 4px var(--color-bordeaux);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .3s ease, transform .3s ease, opacity .3s ease;
}
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    box-shadow: inset 0 0 0 3px var(--color-gold), inset 0 0 0 4px var(--color-bordeaux), 0 0 25px rgba(212, 175, 55, .6);
  }
}
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  display: block; margin: 30px auto 0;
  padding: 15px 36px;
  font-family: var(--font-text); font-weight: 600; font-size: 13px; letter-spacing: 1.5px;
  color: var(--color-gold);
  background: transparent;
  border: 1px solid var(--color-gold); border-radius: 8px;
  cursor: pointer;
  transition: all .3s ease;
}
.btn-secondary:active { transform: scale(.98); }
/* на светлой карточке результата — бордовый акцент для контраста */
.result-card .btn-secondary { color: var(--color-bordeaux); border-color: var(--color-bordeaux); }
@media (hover: hover) {
  .result-card .btn-secondary:hover { background: var(--color-bordeaux); color: var(--color-beige); box-shadow: 0 8px 22px rgba(129, 21, 42, .3); }
}

/* ===== РЕЗУЛЬТАТ ===== */
.result-section { position: relative; padding-bottom: 24px; }
.result__hero { position: relative; height: clamp(300px, 58vh, 600px); overflow: hidden; }
.result__hero-image {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 25%;
}
.result__hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(60, 30, 36, .35) 0%, rgba(129, 21, 42, 0) 35%, rgba(129, 21, 42, .7) 80%, var(--color-bordeaux) 100%);
}
.result__overlay {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  margin-top: clamp(-150px, -14vh, -60px);
  padding: 0 var(--gutter);
}
.result-card {
  width: 100%; max-width: 820px;
  padding: clamp(28px, 5vw, 56px);
  background: rgba(237, 217, 204, .96);
  border: 2px solid #D4AF37;
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(212, 175, 55, .25), 0 30px 70px rgba(40, 8, 16, .35);
  color: var(--color-chocolate);
  opacity: 0; transform: translateY(30px);
  transition: opacity .5s ease, transform .5s ease;
}
.result-card.visible { opacity: 1; transform: translateY(0); }
.result-card .ornament { margin-bottom: 20px; }
.result-card .ornament i { background: linear-gradient(90deg, transparent, #B98F55); }
.result-card .ornament i:last-child { background: linear-gradient(90deg, transparent, #B98F55); }

.result-card__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: 30px; line-height: 1.18; text-align: center;
  color: var(--color-bordeaux); margin-bottom: 20px;
}
.result-card__intro { font-size: 16px; line-height: 1.75; margin-bottom: 30px; }
.result-card__subtitle {
  font-family: var(--font-head); font-weight: 700;
  font-size: 24px; color: var(--color-bordeaux); margin-bottom: 8px;
}
.result-card__program { margin-bottom: 30px; }
.result-card__program li {
  position: relative; padding: 16px 0 16px 28px;
  font-size: 15px; line-height: 1.65;
  border-bottom: 1px solid rgba(129, 21, 42, .14);
}
.result-card__program li:last-child { border-bottom: 0; }
.result-card__program li::before {           /* золотые точки */
  content: ''; position: absolute; left: 4px; top: 25px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gradient-gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .22);
}
.result-card__program li strong {
  display: block; margin-bottom: 2px;
  font-weight: 600; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--color-bordeaux);
}
.result-card__final {
  font-family: var(--font-head); font-weight: 700; font-style: italic;
  font-size: 23px; line-height: 1.4; text-align: center;
  color: var(--color-bordeaux);
  padding: 22px 0; margin-bottom: 24px;
  border-top: 2px solid var(--color-gold); border-bottom: 2px solid var(--color-gold);
}
.result-card__disclaimer { font-size: 12px; line-height: 1.6; color: rgba(60, 30, 36, .6); }

/* ===== ПОДВАЛ ===== */
.footer {
  padding: 56px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  text-align: center;
}
.footer svg { width: 150px; height: auto; margin: 0 auto 14px; aspect-ratio: 432 / 60; opacity: .95; }
.footer p { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: rgba(237, 217, 204, .65); }

/* ===================================================
   АДАПТИВНОСТЬ
   =================================================== */

/* Широкий десктоп: вопросы в две колонки */
@media (min-width: 1100px) {
  .questions__list { max-width: 1120px; grid-template-columns: 1fr 1fr; gap: 16px; }
  .question-card { align-items: start; padding: 24px; }
  .question-card__checkbox { margin-top: 4px; }
  .action-bar__inner { max-width: 1120px; }
}

/* Планшет */
@media (max-width: 1024px) {
  .hero { height: clamp(460px, 70svh, 640px); }
  .hero__plaque { width: min(100%, 580px); padding: 40px 40px 36px; }
  .questions-section { padding-top: 60px; }
  .question-card { padding: 20px; }
  .result-card__title { font-size: 28px; }
}

@media (max-width: 768px) {
  :root { --topbar-h: 56px; }
  .hero { height: clamp(440px, 66svh, 600px); }
  .hero__tagline { font-size: 13px; letter-spacing: 2.4px; }
  .line__name { font-size: 11px; letter-spacing: 1.2px; }
  .line__num { font-size: 26px; }
  .questions-section { padding-top: 52px; }
  .questions__instruction { margin-bottom: 32px; }
  .result-card__final { font-size: 21px; }
}

/* Смартфон */
@media (max-width: 480px) {
  :root { --topbar-h: 52px; --gutter: 16px; }
  .topbar__logo svg { height: 13px; }
  .topbar__cta { padding: 8px 14px; font-size: 11px; letter-spacing: 1px; }

  .hero { height: clamp(430px, 74svh, 600px); }
  .hero__image { object-position: 62% center; }
  .hero__overlay { padding-bottom: 48px; }
  .hero__plaque { padding: 30px 20px 28px; }
  .hero__plaque .ornament { margin: 18px auto 14px; }
  .hero__plaque .ornament i { flex-basis: 44px; }
  .hero__tagline { font-size: 11.5px; letter-spacing: 1.8px; }
  .hero__cta { margin-top: 22px; padding: 14px 28px; width: 100%; }

  /* линия продуктов 2×2 */
  .line__list { grid-template-columns: 1fr 1fr; }
  .line__item { padding: 18px 8px; }
  .line__item:nth-child(3) { border-left: 0; }
  .line__item:nth-child(n+3) { border-top: 1px solid rgba(217, 181, 122, .2); }

  /* вопросы — в одну колонку, крупные зоны нажатия */
  .questions-section { padding-top: 44px; }
  .ornament--top { margin-bottom: 20px; }
  .questions__greeting { font-size: 26px; letter-spacing: .03em; margin-bottom: 18px; }
  .questions__subtitle, .questions__instruction { font-size: 15px; line-height: 1.6; }
  .questions__list { gap: 10px; }
  .question-card {
    grid-template-columns: 30px 1fr 24px; column-gap: 10px;
    padding: 16px 14px; min-height: 64px; border-radius: 12px;
  }
  .question-card__num { font-size: 22px; }
  .question-card__text { font-size: 14.5px; line-height: 1.5; }

  /* липкая панель: счётчик сверху, кнопка на всю ширину */
  .action-bar { padding-top: 26px; }
  .action-bar__inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .questions__counter { margin-bottom: 6px; font-size: 13px; }
  .btn-primary { width: 100%; padding: 17px 12px; font-size: 14px; }

  /* результат: карточка 95% ширины */
  .result__hero { height: clamp(260px, 44vh, 380px); }
  .result__hero-image { object-position: 22% 20%; }
  .result__overlay { padding: 0; margin-top: -70px; }
  .result-card { width: 95%; padding: 26px 18px 30px; border-radius: 14px; }
  .result-card__title { font-size: 25px; }
  .result-card__intro { font-size: 15px; }
  .result-card__subtitle { font-size: 21px; }
  .result-card__program li { font-size: 14.5px; padding-left: 24px; }
  .result-card__final { font-size: 19px; }
  .btn-secondary { width: 100%; }
  .footer svg { width: 120px; }
}

/* Низкие экраны в ландшафте (телефон повёрнут) */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { height: auto; min-height: 420px; }
  .hero__scroll { display: none; }
  .action-bar { padding-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal-on .question-card:not(.in) { opacity: 1; transform: none; }
}
