:root {
  --ivory: #f4efe8;
  --paper: #fbf8f4;
  --ink: #1c1512;
  --ink-2: #4b3f3a;
  --muted: #8a7d76;
  --line: rgba(28, 21, 18, 0.1);
  --bronze: #a2775a;
  --glass: rgba(251, 248, 244, 0.72);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 28px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Плёночное зерно поверх всего */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-style: italic; color: var(--bronze); }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }

/* ---------- Шапка ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) var(--gutter) 12px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.bar.solid {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-color: var(--line);
}
.mark {
  font-family: var(--serif); font-size: 22px; text-decoration: none; letter-spacing: 0.01em;
}
.lang {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: rgba(28, 21, 18, 0.06);
}
.lang button {
  border: 0; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  padding: 7px 12px; border-radius: 999px; color: var(--muted);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.lang button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(28, 21, 18, 0.08); }

/* ---------- Аура: мягкие подвижные пятна вместо фото ---------- */
.aura { position: absolute; inset: 0; overflow: hidden; background: var(--a3, #f1e7de); }
.aura i {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  filter: blur(42px); opacity: 0.9; will-change: transform;
}
.aura i:nth-child(1) { background: var(--a1); top: -18%; left: -12%; animation: drift1 16s var(--ease) infinite alternate; }
.aura i:nth-child(2) { background: var(--a2); bottom: -26%; right: -18%; width: 80%; animation: drift2 19s var(--ease) infinite alternate; }
.aura i:nth-child(3) { background: var(--a3); top: 30%; left: 30%; width: 45%; opacity: 0.8; animation: drift3 13s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(28%, 22%) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-24%, -18%) scale(0.92); } }
@keyframes drift3 { to { transform: translate(-30%, 20%) scale(1.3); } }

/* ---------- Появление при скролле ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(22px); filter: blur(6px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}
[data-reveal].in { opacity: 1; transform: none; filter: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 58px; padding: 0 10px 0 26px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); text-decoration: none;
  font-weight: 600; font-size: 16px; letter-spacing: 0.01em;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 10px 30px -12px rgba(28, 21, 18, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn .ic {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); transition: transform 0.35s var(--ease);
}
.btn:hover .ic { transform: translateX(3px); }
.btn.wide { width: 100%; }
.btn.loading { pointer-events: none; }
.btn.loading .ic svg { display: none; }
.btn.loading .ic::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
svg { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) 36px; isolation: isolate;
}
.hero .aura { z-index: -1; --a1: #e2b49b; --a2: #b98468; --a3: #f1e2d6; }
.hero .aura::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(244, 239, 232, 0) 40%, var(--ivory) 100%);
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bronze); }
.hero h1 {
  font-family: var(--serif); font-weight: 400; margin: 18px 0 18px;
  font-size: clamp(58px, 17vw, 148px); line-height: 0.9; letter-spacing: -0.025em;
}
.hero p { margin: 0 0 28px; max-width: 36ch; color: var(--ink-2); font-size: 17px; }
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 40px;
  border-top: 1px solid var(--line); padding-top: 18px;
}
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats b { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; }
.stats span { font-size: 12px; color: var(--muted); }

/* ---------- Бегущая строка ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 16px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee span {
  font-family: var(--serif); font-style: italic; font-size: 30px; white-space: nowrap; padding-right: 28px;
  display: inline-flex; align-items: center; gap: 28px;
}
.marquee span::after { content: "✦"; font-style: normal; font-size: 13px; color: var(--bronze); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Секции ---------- */
.section { padding: 80px var(--gutter); max-width: 1180px; margin: 0 auto; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.section h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 12vw, 84px);
  line-height: 0.95; letter-spacing: -0.02em; margin: 10px 0 12px;
}
.section > p.lead { margin: 0 0 36px; color: var(--ink-2); max-width: 40ch; }

/* ---------- Карточки программ ---------- */
.programs { display: grid; gap: 16px; }
.card {
  position: relative; display: block; text-decoration: none; border-radius: var(--r); overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.card:active { transform: scale(0.985); }
.card .cover { position: relative; aspect-ratio: 5 / 4; }
.card .cover .aura { transition: transform 1.2s var(--ease); }
.card:hover .cover .aura { transform: scale(1.06); }
.num {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  font-family: var(--serif); font-size: 18px; padding: 6px 14px; border-radius: 999px;
  background: rgba(251, 248, 244, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.cover-title {
  position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; margin: 0;
  font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 11vw, 56px); line-height: 0.95; letter-spacing: -0.02em;
}
.card-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px 20px; }
.card-body p { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.price { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze); margin-bottom: 6px; }
.go {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); transition: transform 0.45s var(--ease);
}
.card:hover .go { transform: rotate(-45deg); }

/* ---------- Как это работает ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: "0" counter(s); grid-row: span 2;
  font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--bronze);
}
.steps b { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.steps span { color: var(--ink-2); }

/* ---------- Что входит ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 22px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 14px; align-items: center; font-weight: 500; }
.checks li::before {
  content: ""; flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--bronze);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a2775a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat;
}

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--line); interpolate-size: allow-keywords; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0; font-family: var(--serif); font-size: 25px; line-height: 1.15;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; font-family: var(--sans); font-weight: 300; font-size: 28px; line-height: 1;
  transition: transform 0.4s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details::details-content { height: 0; overflow: clip; transition: height 0.5s var(--ease), content-visibility 0.5s allow-discrete; }
.faq details[open]::details-content { height: auto; }
.faq p { margin: 0 0 22px; color: var(--ink-2); max-width: 60ch; }

/* ---------- Подвал ---------- */
.foot { padding: 56px var(--gutter) calc(env(safe-area-inset-bottom) + 40px); border-top: 1px solid var(--line); max-width: 1180px; margin: 0 auto; }
.foot .big { font-family: var(--serif); font-size: clamp(54px, 16vw, 140px); line-height: 0.9; letter-spacing: -0.03em; margin: 0 0 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 22px; }
.foot nav a { text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.foot small { color: var(--muted); }

/* ---------- Страница программы ---------- */
.p-hero { position: relative; height: 74svh; min-height: 520px; isolation: isolate; }
.p-hero .aura::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(244, 239, 232, 0) 45%, var(--ivory) 100%);
}
.p-hero-in { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; z-index: 1; }
.p-hero h1 {
  font-family: var(--serif); font-weight: 400; margin: 14px 0 12px;
  font-size: clamp(56px, 16vw, 128px); line-height: 0.9; letter-spacing: -0.025em;
}
.p-hero p { margin: 0; color: var(--ink-2); font-size: 17px; max-width: 34ch; }
.back {
  position: absolute; top: calc(env(safe-area-inset-top) + 72px); left: var(--gutter); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border-radius: 999px;
  background: rgba(251, 248, 244, 0.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.p-body { padding: 24px var(--gutter) 150px; max-width: 760px; margin: 0 auto; display: grid; gap: 52px; }
.p-body h3 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; margin: 0 0 18px; }
.goals { list-style: none; margin: 0; padding: 0; counter-reset: g; }
.goals li {
  counter-increment: g; display: grid; grid-template-columns: 40px 1fr; gap: 12px;
  padding: 18px 0; border-top: 1px solid var(--line); font-size: 17px; color: var(--ink-2);
}
.goals li::before { content: counter(g, decimal-leading-zero); font-family: var(--serif); font-size: 22px; color: var(--bronze); line-height: 1.2; }
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 13px; }
.trust .pay { display: flex; gap: 6px; flex-wrap: wrap; }
.trust .pay span { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-weight: 600; font-size: 11px; color: var(--ink-2); background: var(--paper); }
.hint {
  font-size: 13px; line-height: 1.5; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
}

/* Липкая панель покупки */
.buybar {
  position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px); z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 20px; border-radius: 999px;
  background: rgba(251, 248, 244, 0.78); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line); box-shadow: 0 18px 50px -20px rgba(28, 21, 18, 0.45);
  animation: rise 0.8s var(--ease) 0.25s both;
}
.buybar small { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.buybar .price { font-size: 22px; }
.buybar .btn { height: 52px; padding-left: 20px; gap: 10px; font-size: 15px; white-space: nowrap; flex: none; }
.buybar small, .buybar .price { white-space: nowrap; }
.buybar .btn .ic { width: 36px; height: 36px; }
.buybar ~ .foot { padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }
@keyframes rise { from { transform: translateY(140%); opacity: 0; } }

/* ---------- Страница после оплаты ---------- */
.done { min-height: 100svh; display: grid; place-items: center; padding: 110px var(--gutter) 40px; position: relative; isolation: isolate; }
.done .aura { z-index: -1; --a1: #e8c9b6; --a2: #c9a088; --a3: #f4efe8; opacity: 0.7; }
.done-card {
  width: 100%; max-width: 460px; text-align: center; padding: 36px 24px 28px; border-radius: 32px;
  background: rgba(251, 248, 244, 0.8); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgba(28, 21, 18, 0.5);
}
.done-card h1 { font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1; margin: 18px 0 12px; letter-spacing: -0.02em; }
.done-card p { color: var(--ink-2); margin: 0 0 22px; }
.done-card .tag { margin: 0; }
.check { width: 84px; height: 84px; margin: 0 auto; color: var(--bronze); }
.check circle, .check path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.check circle { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 1s var(--ease) forwards; }
.check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.6s var(--ease) 0.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ring { width: 64px; height: 64px; margin: 10px auto; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--bronze); animation: spin 1s linear infinite; }
.link { display: inline-block; margin-top: 18px; font-weight: 600; font-size: 14px; color: var(--ink-2); }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 76px); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-size: 14px;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Переходы между страницами ---------- */
::view-transition-old(root) { animation: 0.35s var(--ease) both vt-out; }
::view-transition-new(root) { animation: 0.55s var(--ease) both vt-in; }
::view-transition-group(*) { animation-duration: 0.6s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

/* ---------- Планшет и десктоп ---------- */
@media (min-width: 760px) {
  :root { --gutter: 40px; }
  .programs { grid-template-columns: 1fr 1fr; gap: 22px; }
  .programs .card:first-child { grid-column: span 2; }
  .programs .card:first-child .cover { aspect-ratio: 21 / 9; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
  .buybar { left: 50%; right: auto; width: min(560px, calc(100% - 40px)); transform: translateX(-50%); animation-name: rise-c; }
  .hero p { font-size: 19px; }
}
@keyframes rise-c { from { transform: translate(-50%, 140%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .check circle, .check path { stroke-dashoffset: 0; }
}
