:root {
  --bg: #fffaf6;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: #fff5ed;
  --text: #1a1824;
  --text-soft: #5c5d6e;
  --line: rgba(40, 32, 72, 0.08);
  --accent: #ff7d5a;
  --accent-dark: #e35b36;
  --accent-soft: #ffe7de;
  --accent-calm: #8f79ff;
  --shadow-sm: 0 4px 16px rgba(40, 32, 72, 0.06);
  --shadow: 0 16px 48px rgba(40, 32, 72, 0.1);
  --shadow-lg: 0 24px 64px rgba(40, 32, 72, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1200px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.6;
  background: radial-gradient(ellipse at 20% 0%, rgba(255,194,164,.22), transparent 50%),
              radial-gradient(ellipse at 80% 0%, rgba(143,121,255,.09), transparent 40%),
              var(--bg);
  color: var(--text); min-height: 100dvh; overflow-x: clip;
}

img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul { padding-left: 0; list-style: none; }

.hero, .section { width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto; }

/* ========== HEADER ========== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,250,246,.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto; padding: 10px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); white-space: nowrap; flex-shrink: 0;
}
.brand-logo { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.brand-accent { color: var(--accent-dark); }
.brand-light { font-weight: 600; color: var(--text-soft); }

.site-nav { display: flex; align-items: center; gap: 4px; font-size: .9rem; font-weight: 500; }
.site-nav a {
  padding: 8px 16px; border-radius: 999px; color: var(--text-soft);
  transition: background var(--transition), color var(--transition); white-space: nowrap;
}
.site-nav a:hover { background: rgba(40,32,72,.06); color: var(--text); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; flex-shrink: 0; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle span + span { margin-top: 5px; }

/* ========== HERO ========== */
.hero { display: grid; grid-template-columns: 1fr minmax(360px,540px); gap: 40px; align-items: center; padding: 56px 0 64px; }
.hero-home { padding-top: 72px; padding-bottom: 72px; }
.hero-compact { grid-template-columns: 1fr; padding-bottom: 24px; }
.hero-copy, .hero-visual { border-radius: var(--radius-xl); overflow: hidden; }
.hero-copy { padding: 44px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.hero-visual { border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.hero-visual img { height: 100%; object-fit: cover; }

/* ========== CHIPS ========== */
.eyebrow, .chip, .pricing-label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.chip-soft { background: rgba(143,121,255,.12); color: #5d4ddf; }

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 { letter-spacing: -0.035em; color: var(--text); }
h1 { margin-top: 16px; font-size: clamp(2.2rem,4.5vw,3.8rem); font-weight: 800; line-height: 1.02; }
h2 { margin-top: 14px; font-size: clamp(1.6rem,2.8vw,2.6rem); font-weight: 800; line-height: 1.08; }
h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
p, li { color: var(--text-soft); line-height: 1.7; }
.lead { margin-top: 16px; font-size: 1.1rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ========== BUTTONS ========== */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 28px; border: none; border-radius: 999px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button-primary { background: linear-gradient(135deg, var(--accent), #ff9b6e); color: #fff; box-shadow: 0 12px 32px rgba(255,125,90,.3); }
.button-primary:hover { box-shadow: 0 16px 40px rgba(255,125,90,.38); }
.button-secondary { background: var(--surface-strong); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }

/* ========== LISTS ========== */
.trust-list, .feature-list { margin: 20px 0 0; display: flex; flex-direction: column; gap: 8px; }
.trust-list li, .feature-list li { position: relative; padding-left: 20px; }
.trust-list li::before, .feature-list li::before { content: ""; position: absolute; left: 0; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .6; }
.feature-list-large { font-size: 1.02rem; }

/* ========== SECTIONS ========== */
.section { padding: 72px 0; }
.section-muted { position: relative; z-index: 0; }
.section-muted::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: var(--surface-muted); z-index: -1; }
.section-heading { margin-bottom: 44px; max-width: 640px; }
.section-heading p { margin-top: 12px; }

/* ========== GRIDS ========== */
.offer-grid, .steps-grid, .media-grid, .promise-grid, .faq-grid, .legal-grid { display: grid; gap: 20px; }
.offer-grid { grid-template-columns: repeat(2, 1fr); }
.steps-grid, .promise-grid, .faq-grid, .legal-grid { grid-template-columns: repeat(3, 1fr); }
.media-grid { grid-template-columns: repeat(3, 1fr); }

/* ========== CARDS ========== */
.offer-card, .step-card, .promise-card, .faq-card, .pricing-card, .legal-card, .media-card {
  border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(12px);
  border-radius: var(--radius-xl); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.offer-card:hover, .step-card:hover, .promise-card:hover, .pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.offer-card-media img { aspect-ratio: 4/3; object-fit: cover; }
.offer-card-copy, .step-card, .promise-card, .faq-card, .pricing-card, .legal-card, .media-card-copy { padding: 28px; }
.offer-card-copy { display: flex; flex-direction: column; gap: 12px; }
.offer-card-copy .button { align-self: flex-start; margin-top: 8px; }
.step-number { display: inline-block; font-size: .85rem; font-weight: 800; color: var(--accent-dark); margin-bottom: 8px; }
.step-card h3 { margin-bottom: 8px; }
.media-card-wide img { height: 100%; object-fit: cover; }

/* ========== PRICING ========== */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pricing-grid-two { grid-template-columns: repeat(2, 1fr); max-width: 820px; }
.pricing-card { display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.pricing-card-featured { border-color: rgba(255,125,90,.3); background: linear-gradient(180deg, rgba(255,248,243,.98), rgba(255,255,255,.96)); box-shadow: var(--shadow-lg); position: relative; }
.pricing-price { color: var(--text); font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; }
.pricing-features { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.pricing-features li { position: relative; padding-left: 20px; font-size: .94rem; }
.pricing-features li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pricing-card .button { margin-top: auto; width: 100%; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: .9rem; font-weight: 500; color: var(--text-soft); transition: color var(--transition); }
.back-link:hover { color: var(--accent-dark); }

/* ========== FOOTER ========== */
.site-footer { background: var(--text); margin-top: 24px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 32px; width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto; padding: 48px 0 32px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-accent { color: var(--accent); }
.footer-brand .brand-light { color: rgba(255,255,255,.6); }
.footer-tagline { margin-top: 10px; font-size: .88rem; color: rgba(255,255,255,.45); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: .9rem; padding-top: 6px; }
.footer-nav a { color: rgba(255,255,255,.65); transition: color var(--transition); }
.footer-nav a:hover { color: #fff; }
.footer-bottom { grid-column: 1/-1; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; color: rgba(255,255,255,.35); }

/* ========== RESPONSIVE ========== */
@media (max-width: 980px) {
  .hero, .offer-grid, .steps-grid, .media-grid, .promise-grid, .faq-grid, .legal-grid, .pricing-grid, .pricing-grid-two { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; padding-bottom: 48px; }
  .hero-home { padding-top: 48px; }
  .media-card-wide { grid-row: auto; }
  .section { padding: 56px 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  .hero, .section { width: min(calc(100% - 24px), var(--max-width)); }
  .header-inner { width: min(calc(100% - 24px), var(--max-width)); position: relative; }

  .nav-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; }

  .site-nav {
    position: absolute; top: 100%; left: -12px; right: -12px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(255,250,246,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 8px 16px 16px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .site-nav a { display: block; padding: 14px 16px; font-size: 1rem; border-radius: var(--radius-sm); border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: none; }

  .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(3px, 4px); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(3px, -4px); }

  .footer-inner { width: min(calc(100% - 24px), var(--max-width)); padding: 36px 0 24px; }
  .footer-nav { gap: 16px; }
  .hero-copy, .offer-card-copy, .step-card, .promise-card, .faq-card, .pricing-card, .legal-card, .media-card-copy { padding: 24px; }
  .hero-visual { min-height: 220px; }
  h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  .pricing-price { font-size: 1.8rem; }
  .section { padding: 48px 0; }
}

/* ========== STORY PREVIEW (JSON из references/) ========== */
.story-preview-wrap {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  /* Шрифты и цвета «сказочной» рамки (наследуются разворотом) */
  --story-font-display: "Alice", "Literata", ui-serif, Georgia, serif;
  --story-font-body: "Literata", ui-serif, Georgia, "Times New Roman", serif;
  --story-frame: #b8956a;
  --story-frame-deep: #8f6f45;
  --story-frame-light: rgba(201, 166, 107, 0.65);
  --story-frame-mist: rgba(184, 149, 106, 0.14);
  --story-corners-url: url("./assets/story-book-corners.svg");
}
body[data-page="adaptation"] .story-preview-wrap {
  --story-frame: #9885c4;
  --story-frame-deep: #6b5a9e;
  --story-frame-light: rgba(152, 133, 196, 0.7);
  --story-frame-mist: rgba(143, 121, 255, 0.12);
  --story-corners-url: url("./assets/story-book-corners-calm.svg");
}
.story-preview-heading {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.story-preview-wrap .story-preview-lead {
  margin-top: 10px;
  font-size: 0.95rem;
  max-width: 52ch;
}
.js-story-preview { min-height: 120px; }
.story-preview__status {
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  border: 1px dashed var(--line);
  color: var(--text-soft);
  font-size: 0.95rem;
}
.story-preview__status code {
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(40, 32, 72, 0.06);
}
.story-preview__status--error {
  border-color: rgba(255, 125, 90, 0.35);
  background: rgba(255, 231, 222, 0.5);
  color: var(--text);
}
.story-preview__shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.story-preview__head {
  max-width: 640px;
}
.story-preview__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.story-preview__title {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
}
.story-preview__dedication {
  margin: 14px 0 0;
  padding: 16px 20px 16px 22px;
  border-left: none;
  border-radius: var(--radius-md);
  font-family: var(--story-font-body);
  font-size: 1.02rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  background:
    linear-gradient(90deg, var(--story-frame) 0%, var(--story-frame) 4px, transparent 4px),
    linear-gradient(var(--story-frame-mist), var(--story-frame-mist)),
    #fffefb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.85),
    inset 0 0 0 2px var(--story-frame-light),
    0 4px 20px rgba(40, 32, 72, 0.06);
}
body[data-page="birthday"] .story-preview__dedication {
  background:
    linear-gradient(90deg, var(--accent) 0%, var(--accent) 4px, transparent 4px),
    linear-gradient(rgba(255, 125, 90, 0.08), rgba(255, 125, 90, 0.08)),
    #fffefb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.85),
    inset 0 0 0 2px rgba(255, 125, 90, 0.28),
    0 4px 20px rgba(40, 32, 72, 0.06);
}
.story-preview__meta {
  margin-top: 12px;
  font-size: 0.88rem;
}
.story-preview__meta a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.story-preview__meta a:hover {
  color: var(--text);
}

/* Карточка карусели */
.story-preview__card {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.story-preview__counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(40, 32, 72, 0.06);
  border: 1px solid var(--line);
}

/* Тёмная подложка + рамка */
.story-preview__book {
  position: relative;
  padding: clamp(10px, 2.5vw, 20px) clamp(12px, 3vw, 26px) clamp(14px, 3.5vw, 28px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(165deg, #4a3d32 0%, #2e2620 42%, #1c1814 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 32px 64px -24px rgba(26, 24, 36, 0.55),
    0 12px 28px rgba(26, 24, 36, 0.22);
}
.story-preview__book::before {
  content: "";
  position: absolute;
  inset: clamp(7px, 1.6vw, 12px) clamp(9px, 2vw, 15px);
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--story-frame) 55%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 250, 240, 0.06);
  pointer-events: none;
}
.story-preview__book::after {
  content: "";
  position: absolute;
  inset: clamp(9px, 1.8vw, 14px) clamp(11px, 2.2vw, 17px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

/* Фиксированная высота: все слайды — одинаковый размер окна */
.story-preview__book {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(260px, 42vw, 520px);
}
.story-preview__spread-img {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  max-height: clamp(260px, 42vw, 520px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--story-frame) 30%, rgba(40, 30, 20, 0.5)),
    0 2px 0 rgba(255, 255, 255, 0.15) inset,
    0 20px 48px rgba(0, 0, 0, 0.16);
  background: #f7f0e4;
}

.story-preview__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding-top: 20px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.story-preview__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.story-preview__btn:disabled:hover {
  transform: none;
}

/* Обложка на десктопе: портрет, прижата вправо */
.story-preview__book--cover {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .story-preview__book {
    min-height: clamp(240px, 65vh, 520px);
  }
  .story-preview__spread-img {
    max-height: clamp(240px, 65vh, 520px);
  }
  .story-preview__book--cover {
    justify-content: center;
  }
}

/* Адаптация: спокойные цвета */
body[data-page="adaptation"] .story-preview__dedication {
  background:
    linear-gradient(90deg, var(--accent-calm) 0%, var(--accent-calm) 4px, transparent 4px),
    linear-gradient(rgba(143, 121, 255, 0.09), rgba(143, 121, 255, 0.09)),
    #fffefb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.85),
    inset 0 0 0 2px rgba(143, 121, 255, 0.32),
    0 4px 20px rgba(40, 32, 72, 0.06);
}
body[data-page="adaptation"] .story-preview__badge {
  color: #5d4ddf;
  background: rgba(143, 121, 255, 0.15);
}
