:root {
  /* Палитра: тёплая, ритуальная, без неона и без «эзотерики» */
  --bg: #f5efe6;            /* cream paper */
  --bg-soft: #ece4d6;
  --bg-card: #faf6ee;
  --ink: #2c2419;           /* тёмно-коричневый текст */
  --ink-soft: #6a5b48;
  --ink-mute: #97876f;
  --line: #d8c9b3;
  --accent: #a6633a;        /* тёплый янтарь */
  --accent-soft: #d8a386;
  --accent-deep: #6f4123;
  --shadow: 0 8px 24px -12px rgba(70, 50, 30, 0.25);
  --shadow-lg: 0 20px 60px -20px rgba(70, 50, 30, 0.35);
  --radius: 14px;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(216, 163, 134, 0.18), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  padding: clamp(60px, 12vw, 140px) 24px clamp(40px, 8vw, 80px);
  text-align: center;
}

.hero__inner {
  max-width: 680px;
  margin: 0 auto;
}

.hero__eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 28px;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}

.hero__subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--accent-deep);
  margin: 0 0 36px;
}

.hero__lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 auto 40px;
}

.hero__hint {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin: 18px 0 0;
  letter-spacing: 0.05em;
}

/* ─── КНОПКА «Вытянуть карту» ──────────────────────────── */
.draw-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--ink);
  color: var(--bg-card);
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
}

.draw-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.draw-btn:active { transform: translateY(0); }

.draw-btn__icon {
  font-size: 1.1rem;
  color: var(--accent-soft);
}

.draw-btn--secondary {
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid var(--accent-soft);
  box-shadow: none;
}

.draw-btn--secondary:hover {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: var(--accent-soft);
}

/* ─── ТОС (оглавление по блокам) ────────────────────────── */
.toc {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.toc__list a {
  display: inline-block;
  padding: 6px 4px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
  position: relative;
}

.toc__list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.toc__list a:hover {
  color: var(--accent-deep);
}

.toc__list a:hover::after { transform: scaleX(1); }

/* ─── DECK (сетка по блокам) ────────────────────────────── */
.deck {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.block {
  margin-bottom: 80px;
  scroll-margin-top: 80px;
}

.block:last-child { margin-bottom: 0; }

.block__head {
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.block__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent-deep);
  margin: 0 0 4px;
  letter-spacing: 0.04em;
}

.block__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 6px;
  color: var(--ink);
}

.block__essence {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.card {
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.25s ease;
}

.card:hover { transform: translateY(-4px); }
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: var(--radius);
}

.card__frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease;
}

.card:hover .card__frame { box-shadow: var(--shadow-lg); }

.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .card__frame img { transform: scale(1.04); }

.card__num {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--bg-card);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.04em;
}

.card__caption {
  padding: 0 4px;
}

.card__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  margin: 0 0 2px;
  color: var(--ink);
  line-height: 1.3;
}

.card__metaphor {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
}

/* ─── ABOUT ─────────────────────────────────────────────── */
.about {
  background: var(--bg-soft);
  padding: clamp(60px, 10vw, 100px) 24px;
}

.about__inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.about__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 16px;
}

.about__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin: 0 0 4px;
  color: var(--ink);
}

.about__role {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent-deep);
  margin: 0 0 28px;
  font-size: 1.1rem;
}

.about__text {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  line-height: 1.7;
}

.about__closing {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent-deep);
  font-size: 1.15rem;
  margin: 0;
}

/* ─── FOOTER ────────────────────────────────────────────── */
.footer {
  padding: 36px 24px 48px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.footer__copy {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--ink-mute);
}

.footer__socials {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: 0.92rem;
}

.footer__socials a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.footer__socials a:hover {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.about__link {
  color: var(--accent-deep);
  border-bottom: 1px solid var(--accent-soft);
  transition: color .2s ease, border-color .2s ease;
}

.about__link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── MODAL ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.modal[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 14, 0.6);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 880px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: rise 0.35s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 1.8rem;
  line-height: 1;
  padding: 4px 8px;
  z-index: 2;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal__close:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.modal__image-wrap {
  background: var(--bg-soft);
  display: flex;
  align-items: stretch;
}

.modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius) 0 0 var(--radius);
}

.modal__body {
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
}

.modal__block {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--accent-deep);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.modal__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 16px;
  line-height: 1.15;
  color: var(--ink);
}

.modal__metaphor {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  line-height: 1.5;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.modal__section { margin-bottom: 20px; }

.modal__label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 6px;
}

.modal__question {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.modal__practice {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

.modal__body .draw-btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 720px) {
  .modal__panel {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }
  .modal__image-wrap { aspect-ratio: 2 / 3; max-height: 280px; }
  .modal__image { border-radius: var(--radius) var(--radius) 0 0; }
  .modal__body { padding: 24px 22px 22px; }
  .modal__close { background: var(--bg-card); }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .toc__list { gap: 4px 14px; font-size: 0.8rem; }
}

/* ─── A11y: уважение к reduced motion ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}