/* ============================================================
   Runic Oracle — Northern tradition design
   ============================================================ */

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

:root {
  --bg: #070707;
  --bg2: #0d0d0e;
  --bg3: #121110;
  --card: rgba(24, 18, 12, .72);
  --card-solid: #161310;
  --line: rgba(255, 140, 46, .16);
  --line-strong: rgba(255, 140, 46, .5);
  --gold: #ff8c2e;
  --gold2: #ffb066;
  --ice: #ffb066;
  --ink: #f2ece4;
  --dim: #9a8f82;
  --grad: linear-gradient(135deg, #ff8c2e 0%, #ffb066 45%, #cc5a10 100%);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --serif: 'Cinzel', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(255, 140, 46, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 140, 46, .06), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

.container { width: min(1140px, 92%); margin-inline: auto; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.18; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); margin-bottom: .8rem; color: var(--ink); }
h3 { font-size: 1.12rem; color: var(--ink); }
p { color: var(--dim); }
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold2); }

.gold { color: var(--gold2); }

/* ========== КНОПКИ ========== */
.btn {
  display: inline-block;
  padding: .85rem 1.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: .02em;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s, box-shadow .25s, background .2s, border-color .2s;
  position: relative;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad);
  background-size: 200% auto;
  color: #131009 !important;
  box-shadow: 0 4px 22px rgba(201, 164, 92, .28);
  animation: goldShift 6s ease-in-out infinite;
}
@keyframes goldShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-primary:hover { box-shadow: 0 8px 34px rgba(201, 164, 92, .45); }
.btn-outline { border-color: var(--gold); color: var(--gold2); background: rgba(201,164,92,.05); }
.btn-outline:hover { background: rgba(201,164,92,.14); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold2); }
.btn-lg { font-size: 1.1rem; padding: 1.05rem 2.3rem; }

/* ========== HERO ========== */
.hero { position: relative; padding: 1rem 0 4.5rem; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(rgba(255,140,46,.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 50% 0%, transparent, rgba(10,14,20,.9) 80%);
}

.nav {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  padding: 1.2rem 0 2.8rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}
.logo { font-family: var(--serif); font-weight: 900; font-size: 1.35rem; color: var(--gold2); letter-spacing: .06em; display: flex; align-items: center; gap: .55rem; line-height: 1.15; }
.logo:hover { color: var(--gold2); }
.logo-rune { color: var(--gold); font-size: 1.3em; }
.logo-div { color: var(--gold); opacity: .7; margin: 0 .1em; }

.nav-links { display: flex; gap: 1.7rem; font-size: .95rem; flex-wrap: wrap; }
.nav-links a { color: var(--dim); }
.nav-links a:hover { color: var(--gold2); }

.nav-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.lang-switch {
  display: flex; gap: 2px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
}
.lang-btn {
  border: 0; background: transparent; color: var(--dim);
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; padding: .3rem .5rem; border-radius: 3px;
  cursor: pointer; transition: all .18s;
}
.lang-btn:hover { color: var(--gold2); }
.lang-btn.active { background: var(--grad); color: #131009; }

.hero-content { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr .75fr; gap: 3rem; align-items: center; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .3em; font-size: .74rem;
  font-weight: 700; color: var(--gold); margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2.7rem, 7vw, 4.6rem); font-weight: 900; margin-bottom: 1.2rem; }
.hero-sub { font-size: 1.14rem; max-width: 540px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }

.hero-stats { display: flex; gap: 2.6rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.9rem; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--serif); font-size: 2.1rem; font-weight: 900; color: var(--gold2); }
.stat-label { font-size: .85rem; color: var(--dim); }

/* ------- появление hero при загрузке ------- */
.hero-text { animation: fadeUp .9s cubic-bezier(.22,.68,.35,1) both; }
.hero-text .eyebrow { animation: fadeUp .8s .05s cubic-bezier(.22,.68,.35,1) both; }
.hero-text h1 { animation: fadeUp .9s .12s cubic-bezier(.22,.68,.35,1) both; }
.hero-text .hero-sub { animation: fadeUp .9s .2s cubic-bezier(.22,.68,.35,1) both; }
.hero-text .hero-actions { animation: fadeUp .9s .28s cubic-bezier(.22,.68,.35,1) both; }
.hero-text .hero-stats { animation: fadeUp .9s .38s cubic-bezier(.22,.68,.35,1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------- кольцо рун ------- */
.hero-visual { display: flex; justify-content: center; }
.rune-ring { position: relative; width: min(320px, 78vw); aspect-ratio: 1; }
.ring-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(90deg);
  animation: ringSpin 80s linear infinite;
  will-change: transform;
}
@keyframes ringSpin {
  from { transform: rotate(90deg); }
  to   { transform: rotate(450deg); }
}
.ring-text {
  font-size: 17.5px; fill: var(--gold); opacity: .92; letter-spacing: 6px;
  font-family: 'Segoe UI Historic', 'Noto Sans Runic', 'DejaVu Sans', serif;
}
.hero-avatar {
  position: absolute; inset: 16.5%;
  width: 67%; height: 67%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  box-shadow: 0 0 50px rgba(201,164,92,.25), 0 0 0 8px rgba(201,164,92,.05);
}

/* ========== РАЗДЕЛИТЕЛЬ ========== */
.orn-divider {
  display: flex; align-items: center; gap: 1rem;
  max-width: 360px; margin: 0 auto 2.8rem; color: var(--gold);
}
.orn-divider::before, .orn-divider::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(to right, transparent, var(--line-strong));
}
.orn-divider::after { background: linear-gradient(to left, transparent, var(--line-strong)); }
.orn-divider span { font-size: 1.4rem; line-height: 1; }

/* ========== СЕКЦИИ ========== */
.section { padding: 4.8rem 0; position: relative; }
.section-dark { background: linear-gradient(180deg, rgba(11,10,9,.75), rgba(6,6,6,.88)); }
.section-head { max-width: 700px; margin-bottom: 3rem; }
.section-head h2 { color: var(--ink); }

/* ========== О боте ========== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.5rem; }
.feature-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2.1rem 2rem;
  backdrop-filter: blur(6px);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  opacity: 0; transform: translateY(24px);
}
.feature-card.in-view { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease, border-color .25s, box-shadow .25s; }
.feature-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.feature-icon { font-size: 2.1rem; color: var(--gold2); margin-bottom: 1rem; }

/* ========== Бесплатно ========== */
.free-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.5rem; }
.free-card {
  position: relative;
  background: linear-gradient(160deg, rgba(28,20,12,.7), rgba(16,12,8,.9));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2.2rem;
  opacity: 0; transform: translateY(24px);
}
.free-card.in-view { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }
.free-card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(201,164,92,.08), transparent 40%);
  pointer-events: none;
}
.free-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.free-badge {
  background: rgba(201,164,92,.12); color: var(--gold2);
  border: 1px solid var(--line-strong);
  border-radius: 3px; padding: .25rem .85rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .18em;
}
.free-rune { font-size: 2.3rem; color: var(--gold); }
.free-list { list-style: none; margin-top: 1.2rem; }
.free-list li { position: relative; padding-left: 1.6rem; color: var(--dim); font-size: .93rem; margin-bottom: .45rem; }
.free-list li::before { content: 'ᛟ'; position: absolute; left: 0; color: var(--gold); font-size: .78rem; top: .12em; }

/* ========== Расклады ========== */
.spreads-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.5rem; }
.spread-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.9rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  opacity: 0; transform: translateY(24px);
}
.spread-card.in-view { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease, border-color .25s, box-shadow .25s; }
.spread-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.spread-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.spread-rune { font-size: 2rem; color: var(--gold); }
.spread-price {
  font-family: var(--serif); font-weight: 700; color: var(--gold2);
  background: rgba(201,164,92,.1); border: 1px solid var(--line-strong);
  padding: .25rem .85rem; border-radius: 3px; font-size: .88rem;
}

/* ========== Код Судьбы ========== */
.wyrd-wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 3.5rem; align-items: center; }
.wyrd-list { list-style: none; margin: 1.2rem 0; }
.wyrd-list li { padding-left: 1.7rem; position: relative; color: var(--dim); margin-bottom: .55rem; }
.wyrd-list li::before { content: 'ᛟ'; position: absolute; left: 0; color: var(--gold); font-size: .78rem; top: .16em; }
.wyrd-list strong { color: var(--ink); }
.wyrd-note {
  background: rgba(201,164,92,.07);
  border-left: 2px solid var(--gold);
  padding: 1rem 1.3rem; border-radius: 0 6px 6px 0;
}
.wyrd-card {
  background: linear-gradient(165deg, #241a10, #120d07);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 2.4rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(24px);
}
.wyrd-card.in-view { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }
.wyrd-caption { font-size: .9rem; margin-bottom: 1.4rem; color: var(--gold2); }
.wyrd-card-runes { display: flex; justify-content: center; gap: 1.1rem; }
.wyrd-trio { flex: 1; max-width: 118px; }
.wyrd-trio img {
  width: 100%; border-radius: 6px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.wyrd-trio figcaption { margin-top: .5rem; font-size: 1.5rem; color: var(--gold); font-family: var(--serif); }

/* ========== Талисманы ========== */
.talismans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 1.3rem; }
.talisman-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.6rem 1.2rem 1.8rem;
  text-align: center;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  opacity: 0; transform: translateY(24px);
}
.talisman-card.in-view { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease, border-color .25s, box-shadow .25s; }
.talisman-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.t-card-img { margin-bottom: 1rem; }
.t-card-img img {
  width: 68px; height: 96px; object-fit: cover;
  border-radius: 5px; border: 1px solid var(--line-strong);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.t-emoji { font-size: 1.6rem; display: block; margin-bottom: .5rem; }
.talisman-card h3 { font-size: .98rem; margin-bottom: .3rem; }
.talisman-card p { font-size: .85rem; }

/* ========== История рун ========== */
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.history-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2.1rem 2rem;
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease, border-color .25s, box-shadow .25s;
}
.history-card.in-view { opacity: 1; transform: translateY(0); }
.history-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.history-icon { font-size: 2.1rem; color: var(--gold2); margin-bottom: 1rem; }
.history-card h3 { font-family: var(--serif); color: var(--ink); margin-bottom: .6rem; }

/* ========== Рефералка ========== */
.referral { text-align: center; max-width: 660px; }
.referral-icon { font-size: 3rem; margin-bottom: 1rem; }
.referral p { margin-bottom: 1.8rem; }
.referral strong { color: var(--gold2); }

/* ========== Книга рун ========== */
.book { text-align: center; }
.book > p { max-width: 640px; margin-inline: auto; margin-bottom: 2.4rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1.1rem; }
.book-item { opacity: 0; transform: translateY(20px); }
.book-item.in-view { opacity: 1; transform: translateY(0); transition: opacity .55s ease, transform .55s ease; }
.book-item img {
  width: 100%; border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .25s, border-color .25s;
}
.book-item:hover img { transform: translateY(-4px) scale(1.02); border-color: var(--line-strong); }
.book-item figcaption { margin-top: .5rem; font-size: .82rem; color: var(--dim); }
.book-sym { color: var(--gold); font-size: 1.05rem; font-family: var(--serif); }

/* ========== Финальный CTA ========== */
.final-cta {
  padding: 5rem 0;
  text-align: center;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(201,164,92,.16), transparent 65%),
    var(--bg);
  border-top: 1px solid var(--line);
}
.final-cta p { max-width: 540px; margin-inline: auto; margin-bottom: 2rem; }
.cta-note { font-size: .85rem; margin-top: 1.5rem; margin-bottom: 0 !important; opacity: .8; }

/* ========== Футер ========== */
.footer { border-top: 1px solid var(--line); padding: 3rem 0 1.5rem; background: var(--bg2); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding-bottom: 2rem; }
.footer-links { display: flex; gap: 1.5rem; font-size: .95rem; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 1.5rem; font-size: .85rem; color: var(--dim); text-align: center; }

/* ========== KASCADДНОЕ ПОЯВЛЕНИЕ (STAGGER) ========== */
.features .feature-card:nth-child(2).in-view { transition-delay: .08s; }
.features .feature-card:nth-child(3).in-view { transition-delay: .16s; }
.free-grid .free-card:nth-child(2).in-view { transition-delay: .08s; }
.spreads-grid .spread-card:nth-child(2).in-view { transition-delay: .06s; }
.spreads-grid .spread-card:nth-child(3).in-view { transition-delay: .12s; }
.spreads-grid .spread-card:nth-child(4).in-view { transition-delay: .18s; }
.spreads-grid .spread-card:nth-child(5).in-view { transition-delay: .24s; }
.spreads-grid .spread-card:nth-child(6).in-view { transition-delay: .30s; }
.talismans-grid .talisman-card:nth-child(2).in-view { transition-delay: .06s; }
.talismans-grid .talisman-card:nth-child(3).in-view { transition-delay: .12s; }
.talismans-grid .talisman-card:nth-child(4).in-view { transition-delay: .18s; }
.talismans-grid .talisman-card:nth-child(5).in-view { transition-delay: .24s; }
.book-grid .book-item:nth-child(2).in-view { transition-delay: .03s; }
.book-grid .book-item:nth-child(3).in-view { transition-delay: .06s; }
.book-grid .book-item:nth-child(4).in-view { transition-delay: .09s; }
.book-grid .book-item:nth-child(5).in-view { transition-delay: .12s; }
.book-grid .book-item:nth-child(6).in-view { transition-delay: .15s; }
.book-grid .book-item:nth-child(7).in-view { transition-delay: .18s; }
.book-grid .book-item:nth-child(8).in-view { transition-delay: .21s; }

/* ========== ДОСТУПНОСТЬ: без анимаций ========== */
@media (prefers-reduced-motion: reduce) {
  .ring-svg, .btn-primary, .hero-text, .hero-text > *, .bg-scene .rays, .bg-scene .tree { animation: none !important; }
  .feature-card, .free-card, .spread-card, .talisman-card, .wyrd-card, .book-item {
    transition: none !important; opacity: 1 !important; transform: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ========== ФОН: ДРЕВО И ЛУЧИ ========== */
.bg-scene {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: .6;
}
.bg-scene svg { width: 100%; height: 100%; display: block; }
.bg-scene .rays { animation: raysDrift 18s ease-in-out infinite; }
.bg-scene .tree {
  animation: treeSway 16s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes raysDrift {
  0%, 100% { opacity: .4; transform: translateX(0); }
  50% { opacity: .85; transform: translateX(24px); }
}
@keyframes treeSway {
  0%, 100% { transform: rotate(-.5deg); }
  50% { transform: rotate(.5deg); }
}

/* ========== ТУЛТИП РУН ========== */
#runeTip {
  position: fixed; z-index: 999;
  max-width: 300px;
  background: rgba(18, 14, 10, .97);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: .75rem .95rem;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  pointer-events: none;
}
#runeTip.show { opacity: 1; visibility: visible; transform: translateY(0); }
#runeTip .tip-name {
  display: block;
  font-family: var(--serif);
  color: var(--gold2);
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .3rem;
}
#runeTip .tip-sym { color: var(--gold); margin-right: .35rem; }

/* Контент выше фона */
.hero, .section, .final-cta, .footer { position: relative; z-index: 1; }

/* ========== ЛЕТАЮЩИЕ РУНЫ + БЛИКИ (FX-слой) ========== */
#fxCanvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .85;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 960px) {
  .hero-content { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-visual { order: -1; }
  .nav { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .nav-actions { width: 100%; justify-content: space-between; }
  .wyrd-wrap { grid-template-columns: 1fr; }
  .section { padding: 3.6rem 0; }
}

@media (max-width: 560px) {
  .nav-links { gap: 1rem; font-size: .9rem; }
  .logo { font-size: 1.02rem; gap: .4rem; flex-wrap: wrap; }
  .hero-stats { gap: 1.4rem; }
  .stat-num { font-size: 1.6rem; }
  .lang-switch { flex-wrap: wrap; }
}
