/* ============================================================
   Мистик AI — светлая тема сайта (подключается после style.css на всех страницах)
   Палитра и переменные заданы в :root в style.css; здесь — «бумага», шапка, подвал, кнопки.
   ============================================================ */
body { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
body *, body *::before, body *::after { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }

body::before {
  background:
    radial-gradient(900px 520px at 85% -8%, rgba(107,63,212,.09), transparent 62%),
    radial-gradient(800px 600px at -5% 18%, rgba(176,138,74,.11), transparent 60%),
    var(--bg);
}
body::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .55 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size: 160px;
  opacity: .2;
  mix-blend-mode: multiply;
}

/* шапка */
.site-header { background: rgba(247,241,232,.82); border-bottom: 1px solid var(--border); }
.site-header .wrap { height: 72px; }
.brand { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: .01em; color: var(--text); }
.brand b { font-style: italic; color: var(--violet); font-weight: 500; }
.brand .mark { font-size: 0 !important; width: 34px; height: 34px; border-radius: 50%; display: inline-block !important; vertical-align: middle;
  background: url(/favicon.svg) center/contain no-repeat !important; box-shadow: 0 6px 18px -8px rgba(176,138,74,.7) !important; }
.brand .mark::before { content: none !important; }
.nav a { color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--violet); }
.burger { color: var(--text); }
.btn-primary { background: #25133f; color: #fff; box-shadow: 0 10px 26px -12px rgba(37,19,63,.8); border: 0; }
.btn-primary:hover { background: var(--violet); box-shadow: 0 16px 34px -12px rgba(107,63,212,.8); }
.nav .btn-primary, .nav .btn-primary:hover { color: #fff; }
.btn-ghost { color: var(--text); border-color: var(--border-2); background: transparent; }
.btn-ghost:hover { border-color: var(--violet); background: rgba(107,63,212,.06); }

/* подвал */
.site-footer { background: #25133f; color: #cfc4e6; border: 0; margin-top: 40px; padding: 56px 0 48px; position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, #b08a4a, transparent); }
.site-footer .brand { color: #f7f1e8; }
.site-footer .brand b { color: #cbb8ff; }
.footer-col h4 { color: #b08a4a; }
.footer-col a, .footer-legal, .footer-legal a, .footer-more a { color: #cfc4e6; }
.footer-col a:hover, .footer-more a:hover { color: #fff; }
.footer-about p, .footer-bottom, .footer-disc, .footer-more { color: #9d90bb; }
.footer-bottom { border-top-color: rgba(255,255,255,.12); }

/* кнопки разных редизайнов приводим к одной: баклажан + фиолет при наведении */
html body .btn-primary, html body .cookie-ok, html body #cookie-ok,
html body .palm-redesign .btn-primary, html body .ritual-redesign .btn-primary {
  background: #25133f; color: #fff; border: 0; box-shadow: 0 10px 26px -12px rgba(37,19,63,.8); text-shadow: none;
}
html body .btn-primary:hover { background: var(--violet); }

/* «тёмные акценты»: блоки продажи остаются баклажановыми — внутри возвращаем тёмные переменные */
.so, .dark-accent {
  --text: #fff; --muted: #d6cbef; --muted-2: #b5a7d6; --w: 255,255,255;
  --border: rgba(255,255,255,.18); --border-2: rgba(255,255,255,.28);
  --card: rgba(255,255,255,.07); --card-2: rgba(255,255,255,.1);
  --gold: #e8d3a0; --gold-soft: #f0e2bd; --violet: #cbb8ff;
  background: linear-gradient(135deg, #25133f, #3a1c66) !important;
  color: #e4daf5; border: 0 !important; border-radius: 26px; position: relative; overflow: hidden;
  box-shadow: 0 34px 60px -34px rgba(58,28,102,.75) !important;
}
.so h2, .so h3, .so b { color: #fff !important; }
.so p, .so span, .so-sub { color: #d6cbef; }
.so .so-kick { color: #e8d3a0 !important; }
.so .btn-gold { background: #f7f1e8; color: #25133f; border: 0; box-shadow: none; }
.so .btn-gold:hover { background: #fff; }
.so .so-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.so .so-link { color: #dccdf6; }
.tf-plan-top {
  --text: #fff; --muted: #d6cbef; --muted-2: #b5a7d6; --w: 255,255,255;
  --border: rgba(255,255,255,.18); --border-2: rgba(255,255,255,.28);
  --card: rgba(255,255,255,.07); --gold: #e8d3a0; --gold-soft: #f0e2bd; --violet: #cbb8ff;
  background: linear-gradient(160deg, #25133f, #3a1c66) !important; color: #e4daf5;
  border: 1px solid #b08a4a !important; box-shadow: 0 40px 70px -36px rgba(58,28,102,.8) !important;
}
.tf-plan-top h3, .tf-plan-top b, .tf-plan-top .tf-plan-price { color: #fff; }
.tf-plan-top .btn-primary, .tf-plan-top .btn-gold { background: #f7f1e8; color: #25133f; }
.tf-plan-top .btn-primary:hover { background: #fff; }

html body[class] .btn-primary, html body[class] .cookie-ok,
html body[class] .site-header .btn-primary, html body[class] .cookie-bar .btn {
  background: #25133f; background-image: none; color: #fff; border: 0; box-shadow: 0 10px 26px -12px rgba(37,19,63,.8); text-shadow: none;
}
html body[class] .btn-primary:hover, html body[class] .cookie-bar .btn:hover { background: var(--violet); }
html body[class] .so .btn-gold { background: #f7f1e8; background-image: none; color: #25133f; }
.ritual-redesign [data-sub-offer], .palm-redesign [data-sub-offer] { grid-column: 1 / -1; width: 100%; }

/* ===== телефон: плотнее, инструмент ближе к началу страницы ===== */
@media (max-width: 700px) {
  .site-header .wrap { height: 60px; }
  .tool-head .tool-illus { height: 132px; width: 100%; object-fit: cover; object-position: 50% 42%; border-radius: 20px; margin-bottom: 14px; }
  .tool-head .eyebrow { display: none; }
  .tool-head h1 { font-size: 2.3rem !important; line-height: 1 !important; margin-bottom: 8px !important; }
  .tool-head p { font-size: .96rem !important; line-height: 1.55 !important; margin-bottom: 0 !important; }
  .so { margin: 12px auto; border-radius: 22px; }
  .site-footer { padding: 40px 0 36px; }
}
@media (max-width: 700px) {
  .tf-plan:not(.tf-plan-top) li.n { display: none; }
  .tf-plan { padding: 22px 18px 18px; }
  .tf-plan ul { gap: 7px; margin-bottom: 14px; }
  .tf-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .tf-tile { padding: 14px 13px; }
  .tf-tile span, .tf-tile p { font-size: .84rem; line-height: 1.45; }
}

/* платёжная карточка — главный момент продажи: баклажановый акцент */
.paywall-card {
  --text: #fff; --muted: #d6cbef; --muted-2: #b5a7d6; --w: 255,255,255;
  --border: rgba(255,255,255,.16); --border-2: rgba(255,255,255,.26);
  --card: rgba(255,255,255,.07); --gold: #e8d3a0; --gold-soft: #f0e2bd; --violet: #cbb8ff;
  background: linear-gradient(165deg, #25133f, #3a1c66) !important; color: #e4daf5;
  border: 1px solid #b08a4a !important; box-shadow: 0 40px 70px -36px rgba(58,28,102,.8) !important;
}
.paywall-card h3, .paywall-card b { color: #fff; }
.paywall-card .btn-gold, .paywall-card .btn-primary { background: #f7f1e8; background-image: none; color: #25133f; box-shadow: none; }
.paywall-card .btn-gold:hover, .paywall-card .btn-primary:hover { background: #fff; color: #25133f; }
.paywall-card input { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.paywall-card input::placeholder { color: #b5a7d6; }
html body[class] .paywall-card .btn-primary { background: #f7f1e8; color: #25133f; }
@media (max-width: 700px) {
  .paywall-list, .paywall-card .paywall-list + p { display: none; }   /* тот же состав уже перечислен в карточке тарифа ниже */
}

/* ===== единая сетка страниц-инструментов: шапка, баннер и текст на одной оси ===== */
@media (min-width: 981px) {
  .palm-redesign main.tool > .wrap:first-child,
  .ritual-redesign main.tool > .wrap:first-child { align-items: start; padding: 40px 0 36px; gap: 48px; }
  .palm-redesign main.tool > .wrap:not(:first-child),
  .ritual-redesign main.tool > .wrap:not(:first-child) { width: calc(100% - 64px); max-width: 1200px; padding-inline: 0; }
  .palm-redesign .so-strip, .ritual-redesign .so-strip { max-width: none; margin: 8px 0 18px; }
  .palm-redesign .content, .ritual-redesign .content { max-width: 800px; margin-inline: auto; }
}
@media (min-width: 981px) {
  .palm-redesign .tool-illus, .ritual-redesign .tool-illus { aspect-ratio: 16 / 8.2; margin-bottom: 20px; }
  .palm-redesign .tool-head h1, .ritual-redesign .tool-head h1 { font-size: clamp(2.8rem, 4.4vw, 4.2rem); }
}

/* ===== без «прыжков»: места под то, что дорисовывает скрипт, резервируем заранее ===== */
#site-top:empty { min-height: 72px; }
#site-bottom:empty { min-height: 600px; }
[data-sub-offer][data-variant="strip"]:empty { min-height: 150px; }
@media (max-width: 700px) {
  #site-top:empty { min-height: 60px; }
  #site-bottom:empty { min-height: 900px; }
  [data-sub-offer][data-variant="strip"]:empty { min-height: 330px; }
}
/* на странице «Карта личности» текст лежит в той же сетке, что и форма — растягиваем на всю ширину */
.ritual-redesign main.tool > .wrap:first-child > .content,
.palm-redesign main.tool > .wrap:first-child > .content { grid-column: 1 / -1; width: 100%; max-width: 800px; margin-inline: auto; }

/* Таро: три карты расклада на телефоне — в один ряд, а не две и одна ниже */
@media (max-width: 560px) {
  .spread:has(.tcard:nth-child(3)) { gap: 10px; flex-wrap: nowrap; }
  .spread:has(.tcard:nth-child(3)) .tcard { width: calc((100% - 20px) / 3); max-width: 150px; flex: 0 0 auto; }
  .spread:has(.tcard:nth-child(3)) .tcard-label { font-size: .95rem; min-height: 0; }
}

/* планшет: три карточки «Читайте также» в ряд, а не две и одна ниже */
@media (min-width: 621px) and (max-width: 1000px) {
  .article-grid.related-grid { grid-template-columns: repeat(3, 1fr); }
}
