/* ── Тема: светлая по умолчанию, тёмная — по настройке устройства ── */
:root {
  --bg: #f7f5fb;
  --surface: #ffffff;
  --surface-2: #f1eef8;
  --text: #1f1b3a;
  --muted: #5f5a7d;
  --line: #e4e0ef;
  --night: #1d1847;
  --night-2: #2d2569;
  --night-text: #f1edff;
  --night-muted: #bdb5e6;
  --gold: #d4a93c;
  --gold-hover: #e3b94c;
  --gold-ink: #1f1b3a;
  --gold-text: #9a7414;
  --emerald: #17805f;
  --emerald-bg: #e2f3ec;
  --danger: #b3261e;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 24, 71, .06), 0 8px 28px rgba(29, 24, 71, .08);
  --serif: Georgia, "PT Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110e29;
    --surface: #1a163d;
    --surface-2: #221d4d;
    --text: #ece9f7;
    --muted: #aaa4c8;
    --line: #2f295f;
    --night: #0c0a21;
    --night-2: #1d1850;
    --gold: #e2bb54;
    --gold-hover: #ecc865;
    --gold-text: #e6c064;
    --emerald: #4cc79c;
    --emerald-bg: #153a30;
    --danger: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--emerald); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 700; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); }
.center { text-align: center; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.section { padding: clamp(48px, 8vw, 88px) 0; }
[hidden] { display: none !important; }

.eyebrow { font: 600 .78rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: .6em; }
.eyebrow-accent { color: var(--emerald); }

.test-banner { background: #ffe38a; color: #3b2f00; text-align: center; font-size: .85rem; padding: 6px 16px; }

/* ── Кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 0; border-radius: 12px; padding: .8em 1.3em; font: 600 1rem/1.2 var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, transform .15s, box-shadow .15s; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; }
.btn-gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 6px 18px rgba(212, 169, 60, .35); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-gold[disabled] { opacity: .6; cursor: progress; }
.btn-outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--gold); }
.btn-ghost { background: transparent; color: var(--emerald); }
.btn-lg { font-size: 1.08rem; padding: .95em 1.6em; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 10px; }

/* ── Шапка ── */
.site-header { background: var(--night); color: var(--night-text); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(255,255,255,.06); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 700 1.1rem var(--serif); }
.brand svg { color: var(--gold); flex: none; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--night-muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: #fff; }
@media (max-width: 760px) {
  .nav { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .nav a:nth-child(3) { display: none; }
  .brand span { font-size: 1rem; }
}
@media (max-width: 480px) { .nav a:nth-child(4) { display: none; } }

/* ── Ночной блок (герой) ── */
.night { background: radial-gradient(1200px 500px at 80% -10%, var(--night-2), transparent 60%), var(--night); color: var(--night-text); position: relative; overflow: hidden; }
.stars { position: absolute; inset: 0; background-image:
  radial-gradient(1.2px 1.2px at 12% 22%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 28% 68%, #fff6 50%, transparent 51%),
  radial-gradient(1.4px 1.4px at 47% 14%, #f1dca0aa 50%, transparent 51%), radial-gradient(1px 1px at 63% 44%, #fff5 50%, transparent 51%),
  radial-gradient(1.3px 1.3px at 78% 76%, #f1dca099 50%, transparent 51%), radial-gradient(1px 1px at 88% 30%, #fff7 50%, transparent 51%),
  radial-gradient(1px 1px at 8% 86%, #fff5 50%, transparent 51%), radial-gradient(1.2px 1.2px at 38% 90%, #fff6 50%, transparent 51%);
  pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: clamp(48px, 9vw, 104px) 0; }
.hero h1 { color: #fff; }
.lead { font-size: 1.15rem; color: var(--night-muted); max-width: 34em; }
.hint { font-size: .85rem; color: var(--night-muted); margin-top: 14px; }
@media (max-width: 820px) { .hero-inner { grid-template-columns: 1fr; text-align: center; } .lead { margin-inline: auto; } }

.daily-stage { display: flex; justify-content: center; min-height: 340px; align-items: center; }
.deck-back { position: relative; width: 190px; height: 326px; }
.card-back { position: absolute; inset: 0; border-radius: 14px; border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 50%, rgba(241,220,160,.25) 0 18%, transparent 19%), repeating-linear-gradient(45deg, rgba(241,220,160,.07) 0 8px, transparent 8px 16px), linear-gradient(160deg, #332a7a, #16123a);
  box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.card-back::after { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 2.2rem; }
.card-back:nth-child(1) { transform: rotate(-9deg) translateX(-26px); }
.card-back:nth-child(2) { transform: rotate(2deg); }
.card-back:nth-child(3) { transform: rotate(10deg) translateX(26px); }
.deck-back.is-drawing .card-back:nth-child(2) { animation: lift .6s ease forwards; }
@keyframes lift { to { transform: translateY(-30px) rotate(0) scale(1.04); opacity: 0; } }

.flip { width: 210px; perspective: 1200px; }
.flip-inner { position: relative; aspect-ratio: 300 / 516; transform-style: preserve-3d; animation: flip .9s cubic-bezier(.3,.7,.2,1) forwards; }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; overflow: hidden; }
.flip-face.back { transform: rotateY(0); }
.flip-face.front { transform: rotateY(180deg); }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@media (prefers-reduced-motion: reduce) { .flip-inner { animation-duration: .01s; } .deck-back.is-drawing .card-back { animation: none; } }

/* ── Карта Таро ── */
.tarot-card { border-radius: 12px; overflow: hidden; background: #f4efe2; box-shadow: var(--shadow); aspect-ratio: 300 / 516; }
.tarot-card img { width: 100%; height: 100%; object-fit: cover; }
.tarot-card.is-rev img { transform: rotate(180deg); }
.rev-tag { font: 600 .72rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--emerald); background: var(--emerald-bg); padding: 3px 8px; border-radius: 99px; vertical-align: middle; }

.chips { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--emerald-bg); color: var(--emerald); font-size: .84rem; padding: 4px 11px; border-radius: 99px; }

/* ── Результат карты дня ── */
.daily-result { padding: 48px 0 16px; }
.daily-grid { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; background: var(--surface); border-radius: calc(var(--radius) + 4px); padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow); }
.daily-grid h2 { margin-bottom: .2em; }
.daily-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 1.4em 0 0; padding-top: 1.2em; border-top: 1px solid var(--line); }
.countdown { font-size: .9rem; color: var(--muted); }
@media (max-width: 720px) { .daily-grid { grid-template-columns: 1fr; } .daily-grid .tarot-card { max-width: 220px; margin: 0 auto; } }

/* ── Предложение расклада ── */
.offer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 0 0 1.5em; }
.checks li { padding-left: 30px; position: relative; margin-bottom: .45em; }
.checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%; background: var(--emerald-bg); box-shadow: inset 0 0 0 1.5px var(--emerald); }
.checks li::after { content: ""; position: absolute; left: 6px; top: .62em; width: 6px; height: 3px; border-left: 2px solid var(--emerald); border-bottom: 2px solid var(--emerald); transform: rotate(-45deg); }
.price-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.price { font: 700 2rem var(--serif); }
.fan { position: relative; height: 320px; }
.fan-card { position: absolute; left: 50%; top: 10px; width: 150px; height: 258px; margin-left: -75px; border-radius: 14px; border: 2px solid var(--gold);
  background: linear-gradient(160deg, var(--night-2), var(--night)); box-shadow: var(--shadow); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; color: var(--gold); font: 600 .8rem var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.fan-card:nth-child(1) { transform: rotate(-14deg) translateX(-70px); }
.fan-card:nth-child(3) { transform: rotate(14deg) translateX(70px); }
.fan-caption { text-align: center; font: 600 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); margin: 0; }
.fan-card::before { content: "✦"; position: absolute; top: 42%; font-size: 1.8rem; }
@media (max-width: 820px) { .offer-grid { grid-template-columns: 1fr; } .offer-visual { order: -1; } .fan { height: 290px; transform: scale(.85); } }

/* ── Шаги ── */
.steps-list { list-style: none; counter-reset: s; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps-list li { counter-increment: s; background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.steps-list li::before { content: counter(s); font: 700 1.6rem var(--serif); color: var(--gold-text); }
.steps-list span { color: var(--muted); font-size: .95rem; }
@media (max-width: 720px) { .steps-list { grid-template-columns: 1fr; } }

/* ── Таролог ── */
.tarolog-wrap { background: var(--surface-2); }
.tarolog { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: center; background: var(--surface); border-radius: calc(var(--radius) + 6px); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); border: 1.5px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.tarolog-photo { width: 240px; height: 240px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); background: var(--surface-2); }
.tarolog-price { font: 700 1.3rem var(--serif); color: var(--gold-text); }
@media (max-width: 720px) { .tarolog { grid-template-columns: 1fr; text-align: center; } .tarolog-photo { margin: 0 auto; width: 180px; height: 180px; } }

/* ── FAQ ── */
.faq { max-width: 800px; }
.faq details { background: var(--surface); border-radius: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-size: 1.4rem; color: var(--gold-text); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 16px; margin: 0; color: var(--muted); }

/* ── Диалог заказа ── */
.order-dialog { border: 0; border-radius: 20px; padding: 0; width: min(520px, 100% - 24px); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.order-dialog::backdrop { background: rgba(12, 10, 33, .65); backdrop-filter: blur(3px); }
.dialog-close-form { position: absolute; right: 6px; top: 6px; margin: 0; }
.order-form { padding: 28px clamp(18px, 5vw, 32px) 24px; }
.order-form h2 { margin-right: 30px; }
.field { display: block; margin: 0 0 16px; position: relative; }
.field > span:first-child { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--emerald); }
.counter { position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; margin-bottom: 16px; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--emerald); }
.form-error { color: var(--danger); font-size: .92rem; margin: 0 0 12px; }

/* ── Страница расклада ── */
.reading { padding: 40px 0 72px; }
.question { font: italic 1.2rem/1.5 var(--serif); margin: 0 0 28px; padding: 14px 20px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 12px 12px 0; }
.spread-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 3vw, 28px); margin: 12px 0 36px; }
.spread-col { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.spread-col .tarot-card { width: 100%; max-width: 220px; }
.pos-label { font: 600 .74rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--emerald); }
.pos-name { font: 600 .95rem var(--serif); }
.position { background: var(--surface); border-radius: calc(var(--radius) + 2px); padding: clamp(20px, 4vw, 36px); margin-bottom: 20px; box-shadow: var(--shadow); }
.pos-head { display: grid; grid-template-columns: 110px 1fr; gap: 22px; align-items: start; margin-bottom: 18px; }
.pos-head h3 { margin-bottom: .2em; }
.ask { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border-radius: 12px; padding: 14px 18px; font-family: var(--serif); }
.locked { filter: blur(6px); user-select: none; pointer-events: none; opacity: .75; -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent); }
.locked-section h2 { margin-bottom: .6em; }
.pay-box { margin: 0 0 28px; background: var(--night); color: var(--night-text); border-radius: 20px; padding: 24px clamp(18px, 4vw, 32px); box-shadow: 0 20px 50px rgba(0,0,0,.3); text-align: center; z-index: 5; }
.pay-box h2 { color: #fff; }
.pay-box .muted, .pay-box .small { color: var(--night-muted); }
.glossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.glossary dt { font-weight: 700; font-family: var(--serif); }
.glossary dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .glossary dl { grid-template-columns: 1fr; gap: 2px; } .glossary dd { margin-bottom: 10px; } .pos-head { grid-template-columns: 84px 1fr; gap: 14px; } }

/* ── Личная ссылка ── */
.link-box { background: var(--surface); border: 2px solid var(--gold); border-radius: 20px; padding: clamp(18px, 4vw, 30px); margin: 0 0 32px; box-shadow: var(--shadow); text-align: left; }
.link-row { display: flex; gap: 10px; margin: 12px 0; }
.link-input { flex: 1; min-width: 0; font: 600 1rem var(--sans); padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); }
.link-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mail-status { margin: 16px 0 0; font-size: .93rem; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; transform: translateY(1px); }
.dot.ok { background: var(--emerald); }
.dot.err { background: var(--danger); }
.dot.wait { background: var(--gold); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 520px) { .link-row { flex-direction: column; } .link-actions .btn { flex: 1; } }

/* ── Статусные страницы ── */
.status-page { padding: 56px 0 80px; text-align: center; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); margin: 0 auto 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thanks-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--emerald); color: #fff; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 18px; }
.error-card, .test-pay { background: var(--surface); border-radius: 20px; padding: 40px 24px; box-shadow: var(--shadow); }
.err-code { font: 700 4rem/1 var(--serif); color: var(--gold-text); margin-bottom: 10px; }

/* ── Справочник карт ── */
.lead-dark { font-size: 1.1rem; color: var(--muted); max-width: 44em; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px; margin: 16px 0 44px; }
.grid-card { text-decoration: none; color: var(--text); text-align: center; font-size: .88rem; display: flex; flex-direction: column; gap: 8px; }
.grid-card:hover .tarot-card { transform: translateY(-3px); }
.grid-card .tarot-card { transition: transform .2s; }
.card-page-grid { display: grid; grid-template-columns: 300px 1fr; gap: 44px; margin-top: 16px; }
.card-page-img { position: sticky; top: 80px; align-self: start; }
.meaning { margin-bottom: 28px; }
.crumbs a { color: var(--muted); }
.cta-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--surface); padding: 20px 24px; border-radius: 16px; margin: 24px 0; box-shadow: var(--shadow); }
.cta-strip p { margin: 0; flex: 1 1 220px; font-weight: 600; }
.prev-next { display: flex; justify-content: space-between; gap: 16px; }
@media (max-width: 720px) { .card-page-grid { grid-template-columns: 1fr; } .card-page-img { position: static; max-width: 220px; margin: 0 auto; } }

/* ── Документы ── */
.legal { padding: 40px 0 72px; }
.legal h2 { font-size: 1.25rem; margin-top: 1.6em; }
.draft-badge { background: #fff1c2; color: #5a4500; border: 1px dashed #c9a227; padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 24px; }

/* ── Подвал ── */
.site-footer { background: var(--night); color: var(--night-muted); padding: 40px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--night-text); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { text-decoration: underline; }
.brand-footer { color: var(--night-text); margin-bottom: 10px; }
.site-footer .muted { color: var(--night-muted); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: .92rem; z-index: 100; box-shadow: var(--shadow); }

.pay-again { text-align: center; margin: 8px 0 24px; }
.pay-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--night) 94%, transparent); color: var(--night-text); backdrop-filter: blur(6px); transform: translateY(110%); transition: transform .25s; }
.pay-bar.show { transform: none; }
.pay-bar span { font-size: .9rem; color: var(--night-muted); }
@media (max-width: 420px) { .pay-bar span { display: none; } .pay-bar .btn { width: 100%; } }
.page-reading .site-footer { padding-bottom: 90px; }
section[id], .daily-result { scroll-margin-top: 76px; }
