/* SparkTail project — скандинавский стиль: ночь, камень, руны, янтарь и мох */
@import url(/static/fonts/fonts.css);

:root {
  --night: #0b0c0b;
  --night-2: #121412;
  --stone: #1b1e1b;
  --stone-2: #252925;
  --line: #2f342f;
  --bone: #efe6d2;
  --bone-dim: #b9b2a2;
  --muted: #8a877d;
  --ember: #f07a2a;
  --ember-hi: #ff9a4f;
  --moss: #4fb862;
  --moss-dim: #2e6f3b;
  --radius: 4px;
  --wrap: 1160px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,184,98,.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(240,122,42,.05), transparent 70%);
  background-attachment: fixed;
  color: var(--bone);
  font: 400 1.125rem/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ember); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember-hi); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ember); color: #000; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Руны и орнамент ---------- */
.runes {
  font-family: 'Segoe UI Historic', 'Noto Sans Runic', serif;
  color: var(--moss);
  letter-spacing: .5em;
  font-size: .95rem;
  opacity: .8;
  user-select: none;
}
.divider {
  display: flex; align-items: center; gap: 18px;
  margin: 0 auto 28px; max-width: 520px; color: var(--moss);
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--moss-dim), transparent);
}
.divider svg { width: 34px; height: 34px; flex: none; }
.eyebrow {
  display: inline-block; font: 500 .8rem/1 var(--sans); letter-spacing: .28em; text-transform: uppercase;
  color: var(--moss); margin-bottom: 14px;
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,12,11,.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--bone); }
.brand img { width: 46px; height: 46px; border-radius: 50%; }
.brand b { font: 700 1.6rem/1 var(--serif); color: var(--ember); letter-spacing: .01em; }
.brand small { display: block; font: 500 .7rem/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--moss); margin-top: 4px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--bone-dim); text-decoration: none; padding: 8px 14px; border-radius: var(--radius);
  font-weight: 500; font-size: 1.02rem; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--bone); background: var(--stone); }
.nav a[aria-current="page"] { color: var(--ember); }
.nav a.btn { margin-left: 8px; color: #120a04; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--bone);
  width: 44px; height: 44px; border-radius: var(--radius); cursor: pointer; padding: 0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: .25s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  background: var(--ember); color: #120a04; text-decoration: none; font-weight: 700;
  padding: 13px 26px; border-radius: var(--radius); border: 1px solid var(--ember);
  transition: background .2s, transform .2s, box-shadow .2s; font-size: 1.05rem; line-height: 1.2;
}
.btn:hover { background: var(--ember-hi); color: #120a04; transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(240,122,42,.55); }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--moss); color: var(--bone); box-shadow: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Герой ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; text-align: center; }
.hero-banner { max-width: 1100px; margin: 0 auto; }
.hero-banner img { width: 100%; }
.hero p.lead { max-width: 680px; margin: 8px auto 30px; font-size: 1.3rem; color: var(--bone-dim); }
.hero .btn-row { justify-content: center; }
.hero .runes { margin-top: 44px; }

/* ---------- Секции ---------- */
.section { padding: 88px 0; position: relative; }
.section.alt { background: var(--night-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head p { color: var(--bone-dim); font-size: 1.2rem; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.split.rev > :first-child { order: 2; }
.split p { color: var(--bone-dim); }

.frame {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--stone); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
}
.frame::after {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(239,230,210,.14); pointer-events: none; border-radius: 2px;
}
.frame figcaption, .caption { font-size: .92rem; color: var(--muted); padding: 10px 14px; }
figure { margin: 0; }

/* Карточки */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: linear-gradient(180deg, var(--stone), var(--night-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; position: relative; transition: border-color .25s, transform .25s;
}
.card:hover { border-color: var(--moss-dim); transform: translateY(-3px); }
.card::before {
  content: ""; position: absolute; top: -1px; left: 28px; width: 48px; height: 2px; background: var(--ember);
}
.card .rune-mark { font-size: 2rem; color: var(--moss); line-height: 1; margin-bottom: 16px; font-family: 'Segoe UI Historic','Noto Sans Runic',serif; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--bone-dim); margin: 0; }

.heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.hero-card { text-align: center; padding: 28px 20px; }
.hero-card img {
  width: 160px; height: 160px; margin: 0 auto 18px; image-rendering: auto;
  background: radial-gradient(circle, rgba(79,184,98,.16), transparent 65%); border-radius: 50%;
}

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.gallery .wide { grid-column: 1 / -1; }
.gallery button { all: unset; cursor: zoom-in; display: block; }
.gallery button:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.gallery img { transition: transform .5s; width: 100%; }
.gallery button:hover img { transform: scale(1.02); }

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: none;
  align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 92vh; max-width: 96vw; width: auto; border: 1px solid var(--line); }

/* Цитата */
.quote {
  font: 500 italic clamp(1.6rem, 3vw, 2.3rem)/1.3 var(--serif); text-align: center; max-width: 820px; margin: 0 auto; color: var(--bone);
}
.quote cite { display: block; margin-top: 18px; font: 500 .85rem var(--sans); letter-spacing: .25em; text-transform: uppercase; color: var(--moss); font-style: normal; }

/* Новости */
.posts { display: grid; gap: 32px; }
.post { display: grid; grid-template-columns: 420px 1fr; gap: 36px; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post > img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.post .body { padding: 32px 32px 32px 0; }
.post time { color: var(--moss); font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; }
.post h3 { margin: 8px 0 14px; font-size: 1.9rem; }
.post p { color: var(--bone-dim); }

article.long { max-width: 760px; margin: 0 auto; }
article.long p { color: var(--bone-dim); font-size: 1.18rem; }
article.long h3 { margin-top: 1.6em; color: var(--bone); }
article.long figure { margin: 32px 0; }

/* Поддержка */
.support-box {
  max-width: 860px; margin: 0 auto; text-align: center; padding: 56px 40px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    radial-gradient(ellipse at top, rgba(240,122,42,.12), transparent 60%),
    linear-gradient(180deg, var(--stone), var(--night-2));
  position: relative;
}
.support-box .emblem { width: 140px; margin: -110px auto 20px; border-radius: 50%; box-shadow: 0 0 0 6px var(--night), 0 0 0 7px var(--line); }
.support-box p { color: var(--bone-dim); font-size: 1.2rem; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 36px 0; text-align: left; }
.tier { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: rgba(0,0,0,.25); }
.tier .price { font: 700 2.4rem/1 var(--serif); color: var(--ember); }
.tier .price small { font: 500 1rem var(--sans); color: var(--muted); }
.tier h3 { font-size: 1.3rem; margin: 10px 0 6px; }
.tier p { font-size: 1rem; margin: 0; }
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }

.socials { display: flex; flex-wrap: wrap; gap: 12px; }
.socials a {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--bone); text-decoration: none; transition: border-color .2s, color .2s;
}
.socials a:hover { border-color: var(--ember); color: var(--ember); }
.socials svg { width: 20px; height: 20px; }

/* Факты */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { background: var(--night-2); padding: 26px 20px; text-align: center; }
.facts b { display: block; font: 700 1.9rem/1.1 var(--serif); color: var(--ember); }
.facts span { color: var(--muted); font-size: .95rem; }

/* Страничный заголовок */
.page-head { padding: 72px 0 40px; text-align: center; }
.page-head p { color: var(--bone-dim); font-size: 1.25rem; max-width: 700px; margin: 0 auto; }

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--line); background: #070807; padding: 40px 0 28px; margin-top: 40px; }
.site-footer .banner { max-width: 760px; margin: 0 auto 20px; opacity: .9; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; color: var(--muted); font-size: .95rem; }
.foot-row nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-row a { color: var(--bone-dim); text-decoration: none; }
.foot-row a:hover { color: var(--ember); }

/* Появление */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .split, .post { grid-template-columns: 1fr; gap: 28px; }
  .split.rev > :first-child { order: 0; }
  .post .body { padding: 0 24px 28px; }
  .cards, .tiers, .ways { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--night); border-bottom: 1px solid var(--line); padding: 12px 16px 20px; gap: 2px;
    transform: translateY(-120%); transition: transform .3s; visibility: hidden;
  }
  .nav-open .nav { transform: none; visibility: visible; }
  .nav a { padding: 14px 12px; font-size: 1.15rem; }
  .nav a.btn { margin: 10px 0 0; }
}
@media (max-width: 600px) {
  body { font-size: 1.06rem; }
  .wrap { padding: 0 16px; }
  .section { padding: 64px 0; }
  .heroes, .gallery { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 56px; }
  .brand small { display: none; }
  .support-box { padding: 44px 20px; }
  .btn { width: 100%; }
}

/* ---------- Разовый платёж ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.donate {
  max-width: 860px; margin: 40px auto 0; padding: 44px 40px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--night-2), var(--stone)); display: grid; gap: 20px;
}
.donate-head { text-align: center; }
.donate-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 6px; }
.donate-head p { color: var(--bone-dim); margin: 0; }
.amounts { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.amounts label { position: relative; cursor: pointer; }
.amounts input { position: absolute; opacity: 0; inset: 0; }
.amounts span {
  display: block; text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--radius);
  font: 700 1.3rem/1.2 var(--serif); color: var(--bone); background: rgba(0,0,0,.25); transition: border-color .2s, color .2s, background .2s;
}
.amounts label:last-child span { font: 500 1rem/1.95 var(--sans); }
.amounts input:checked + span { border-color: var(--ember); color: var(--ember); background: rgba(240,122,42,.08); }
.amounts input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
.field span { color: var(--bone-dim); font-size: .98rem; }
.field em { color: var(--muted); font-style: normal; font-size: .9rem; }
.field input {
  font: inherit; color: var(--bone); background: var(--night); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; width: 100%;
}
.field input:focus { border-color: var(--moss); outline: none; }
.donate .btn { justify-self: center; min-width: 240px; }
.donate .fine { text-align: center; color: var(--muted); font-size: .92rem; margin: 0; }
.notice { padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(0,0,0,.3); text-align: center; }
.notice.ok { border-color: var(--moss); color: #bfe8c6; }
.notice.err { border-color: #b4532a; color: #ffc9a8; }

/* ---------- Документы ---------- */
.legal { max-width: 820px; margin: 0 auto; color: var(--bone-dim); font-size: 1.05rem; }
.legal h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); color: var(--bone); margin-top: 1.8em; }
.legal h3 { font-size: 1.3rem; color: var(--bone); margin: 1.3em 0 .4em; }
.legal section { scroll-margin-top: 90px; border-top: 1px solid var(--line); }
.legal-date { color: var(--muted); font-size: .92rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.legal-nav a { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--bone); }
.legal-nav a:hover { border-color: var(--ember); color: var(--ember); }
.legal-card { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--night-2); margin: 0 0 20px; }
.legal-card dt { color: var(--muted); }
.legal-card dd { margin: 0; color: var(--bone); }
@media (max-width: 600px) {
  .donate { padding: 32px 18px; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .amounts label:last-child { grid-column: 1 / -1; }
  .legal-card { grid-template-columns: 1fr; gap: 2px; }
  .legal-card dd { margin-bottom: 10px; }
}

/* Чёрный фон баннеров растворяется в фоне страницы */
.hero-banner img, .site-footer .banner {
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 62%, transparent 100%);
}
[hidden] { display: none !important; }

/* ---------- CMS: общие классы ---------- */
.prose > :last-child { margin-bottom: 0; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose h3 { margin-top: 1.4em; }
.split .prose, .section-head .prose, .page-head .lead, .hero .lead { color: var(--bone-dim); }
.section-head .prose { font-size: 1.2rem; }
.hero .lead { max-width: 680px; margin: 8px auto 30px; font-size: 1.3rem; }
.page-head .lead { font-size: 1.25rem; max-width: 700px; margin: 0 auto; }
.split .btn-row { margin-top: 24px; }
.center-block { text-align: center; }
.narrow { max-width: 680px; margin: 0 auto 28px; }
.muted { color: var(--muted); }
.center { text-align: center; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--ember); }
.post-links { display: flex; flex-wrap: wrap; gap: 20px; }
.support-box .btn-row { justify-content: center; }
.fine-note { font-size: .95rem; margin-top: 18px; color: var(--muted); }
.fine-note p { margin: 0; color: var(--muted); font-size: .95rem; }
.donate .prose p { margin: 0; color: var(--bone-dim); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field textarea { font: inherit; color: var(--bone); background: var(--night); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; width: 100%; resize: vertical; }
.field textarea:focus { border-color: var(--moss); outline: none; }
.topics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.topics span, .amounts.topics label:last-child span { font: 500 1rem/1.4 var(--sans); padding: 11px 8px; }
.form-status { text-align: center; margin: 0; min-height: 1.4em; color: var(--bone-dim); }
.form-status.ok { color: #bfe8c6; }
.form-status.err { color: #ffc9a8; }
.legal .prose h3 { font-size: 1.25rem; }
.legal .prose p, .legal .prose li { color: var(--bone-dim); }
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .topics { grid-template-columns: 1fr 1fr; }
  .amounts.topics label:last-child { grid-column: auto; }
}
