/* =========================================================
   Терракотовая тема Екатерины Кривошеиной.
   Светлая — по умолчанию (:root). Тёмная — body.dark (переключатель).
   Общее для всех страниц. Специфика страниц — инлайн в самих html.
   ========================================================= */
:root {
  --accent:       #C1502E;              /* терракота */
  --accent-soft:  rgba(193,80,46,.14);
  --spot:         rgba(193,80,46,.13);
  --bg:           #FBF3EC;              /* тёплый светлый фон */
  --card:         #ffffff;
  --card-border:  #EEDFD3;
  --text:         #2B211C;
  --muted:        #8A7A70;
  --btn:          #ffffff;
  --btn-border:   #EAD9CC;
  --icon:         #A6836F;
  --card-shadow:  0 20px 50px rgba(120,60,35,.10);
  --radius:       22px;
  --radius-btn:   14px;
}

/* Тёмная тема (тёплая, не холодная — под психологическую тематику) */
body.dark {
  --accent:       #E0724A;
  --accent-soft:  rgba(224,114,74,.16);
  --spot:         rgba(224,114,74,.14);
  --bg:           #1A1512;
  --card:         #241D18;
  --card-border:  #3A2E26;
  --text:         #F3E9E1;
  --muted:        #A8968A;
  --btn:          #241D18;
  --btn-border:   #3A2E26;
  --icon:         #C9A992;
  --card-shadow:  0 24px 70px rgba(0,0,0,.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  position: relative;
  transition: background .45s ease, color .45s ease;
}

/* Спотлайт за курсором (только desktop, на тач-устройствах скрыт) */
.spotlight {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 70%);
  transition: background .15s ease-out;
}
@media (hover: none) { .spotlight { display: none; } }

/* Переключатель темы */
.theme-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 20;
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: var(--btn); border: 1px solid var(--btn-border); color: var(--text);
  transition: transform .2s, background .45s, border-color .45s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.06); }
.theme-toggle svg { width: 19px; height: 19px; fill: currentColor; }
/* по умолчанию тема светлая → показываем луну (клик = уйти в тёмную) */
.theme-toggle .sun  { display: none; }
.theme-toggle .moon { display: block; }
body.dark .theme-toggle .sun  { display: block; }
body.dark .theme-toggle .moon { display: none; }

/* Футер с юридическими ссылками — общий для всех страниц */
.footer {
  text-align: center; margin-top: 26px; color: var(--muted); font-size: .78rem;
  line-height: 1.7;
}
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--accent); }
.footer .legal { display: block; margin-top: 6px; }

/* Reveal-анимация появления */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .6s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* Toast (уведомления «скопировано» и т.п.) */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 12px; font-size: .88rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Cookie-баннер (152-ФЗ: уведомление + явное согласие). Показывается один раз,
   выбор хранится в localStorage. Разметку создаёт common.js — на всех страницах. */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 12px 34px rgba(43,33,28,.18);
  transform: translateY(24px); opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
}
.cookie-banner.show { transform: translateY(0); opacity: 1; }
.cookie-banner p { flex: 1 1 320px; margin: 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.cookie-banner a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner button {
  flex: 0 0 auto; padding: 11px 22px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-btn);
  font-family: inherit; font-weight: 600; font-size: .9rem;
  transition: transform .18s, box-shadow .18s;
}
.cookie-banner button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(193,80,46,.3); }
@media (max-width: 520px) {
  .cookie-banner { padding: 14px; gap: 12px; }
  .cookie-banner button { width: 100%; }
}
