:root {
  --cream: #f8f2e7;
  --paper: #fffaf1;
  --flour: #efe4d2;
  --crust: #8a4f22;
  --crust-dark: #5e3414;
  --ink: #2a1f17;
  --muted: #74665a;
  --line: #e4d6c0;
  --accent: #c66a2b;
  --ok: #4f7a3a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(94, 52, 20, .10);
  --serif: 'Lora', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--crust-dark); }
h1 { font-size: clamp(34px, 6vw, 58px); margin: 0 0 18px; letter-spacing: -.5px; }
h2 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 14px; }
h3 { font-size: 21px; margin: 28px 0 10px; }
a { color: var(--crust); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 14px 26px; font: 600 16px/1 var(--sans);
  background: var(--crust); color: #fff; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--crust-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--crust); box-shadow: inset 0 0 0 1.5px var(--crust); }
.btn.ghost:hover { background: var(--flour); }
.btn.small { padding: 10px 18px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Шапка */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(248, 242, 231, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 20px var(--serif); color: var(--crust-dark); text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 10px; }

/* Главная */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero p.sub { font-size: 20px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .art { width: 100%; max-width: 420px; justify-self: center; filter: drop-shadow(0 24px 30px rgba(94,52,20,.25)); }
.badges { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; color: var(--muted); font-size: 15px; }
.badges b { color: var(--ink); }

section.block { padding: 56px 0; }
section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-sub { color: var(--muted); margin: 0 0 32px; max-width: 40em; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
section.alt .card { background: var(--cream); }
.card h3 { margin-top: 6px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); }
.icon { font-size: 28px; }

.program { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: n; }
.program li {
  counter-increment: n; display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.program li::before {
  content: counter(n); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--crust); color: #fff; font: 700 18px var(--serif);
}
.program b { display: block; font-family: var(--serif); font-size: 19px; color: var(--crust-dark); }
.program span { color: var(--muted); font-size: 15px; }
.program em { font-style: normal; color: var(--muted); font-size: 14px; white-space: nowrap; }

.price-box {
  max-width: 520px; margin: 0 auto; text-align: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 36px 28px; box-shadow: var(--shadow);
}
.price { font: 700 52px var(--serif); color: var(--crust-dark); margin: 8px 0; }
.price-box ul { text-align: left; display: inline-block; margin: 8px 0 24px; padding: 0; list-style: none; }
.price-box li { padding: 4px 0 4px 28px; position: relative; }
.price-box li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.demo-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }

/* ---------- Атмосфера: фото-фоны ---------- */
.photo-bg { position: relative; isolation: isolate; color: #fff8ec;
  background: #2a1f17 var(--bg) center / cover no-repeat; }
.photo-bg::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(30,20,12,.55) 0%, rgba(30,20,12,.72) 100%); }
.photo-bg h1, .photo-bg h2, .photo-bg h3 { color: #fff8ec; }
@media (min-width: 900px) and (hover: hover) { .photo-bg { background-attachment: fixed; } }

/* Бумажная текстура */
.paper { background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.kicker { font: 700 13px var(--sans); letter-spacing: 3px; text-transform: uppercase; color: #f3c98f; margin-bottom: 12px; }
.kicker.dark { color: var(--accent); }

/* Шапка поверх первого экрана */
header.top.over-hero { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; transition: background .3s, border-color .3s; }
header.top.over-hero .logo { color: #fff8ec; transition: color .3s; }
header.top.over-hero .btn.ghost { color: #fff8ec; box-shadow: inset 0 0 0 1.5px rgba(255,248,236,.7); }
header.top.over-hero.scrolled { background: rgba(248,242,231,.92); backdrop-filter: blur(8px); border-color: var(--line); }
header.top.over-hero.scrolled .logo { color: var(--crust-dark); }
header.top.over-hero.scrolled .btn.ghost { color: var(--crust); box-shadow: inset 0 0 0 1.5px var(--crust); }

/* Первый экран */
.hero.photo-bg { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 110px 0 80px; }
.hero.photo-bg::before { background: linear-gradient(100deg, rgba(25,16,9,.88) 0%, rgba(25,16,9,.62) 55%, rgba(25,16,9,.35) 100%); }
.hero.photo-bg .wrap { width: 100%; }
.hero.photo-bg h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -1px; margin-bottom: 20px; }
.hero.photo-bg .sub { color: rgba(255,248,236,.85); }
.hero.photo-bg .badges { color: rgba(255,248,236,.75); gap: 28px; }
.hero.photo-bg .badges b { color: #fff8ec; display: block; font: 700 17px var(--serif); }
.btn.light { background: #fff8ec; color: var(--crust-dark); }
.btn.light:hover { background: #f3c98f; }
.btn.outline { background: transparent; color: #fff8ec; box-shadow: inset 0 0 0 1.5px rgba(255,248,236,.7); }
.btn.outline:hover { background: rgba(255,248,236,.12); }
.polaroid { margin: 0; justify-self: center; background: #fffaf1; padding: 14px 14px 18px; border-radius: 6px;
  transform: rotate(3deg); box-shadow: 0 30px 60px rgba(0,0,0,.45); max-width: 340px; }
.polaroid img { width: 100%; display: block; border-radius: 3px; aspect-ratio: 3 / 4; object-fit: cover; }
.polaroid figcaption { font: italic 20px var(--serif); color: var(--crust-dark); text-align: center; margin-top: 10px; }
.scroll-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); color: rgba(255,248,236,.8); text-decoration: none; font-size: 26px; animation: bob 2s infinite; }
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* Галерея хлеба */
.bread-gallery { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-auto-rows: 260px; gap: 16px; }
.bread-gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.bread-gallery figure.tall { grid-row: span 2; }
.bread-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.bread-gallery figure:hover img { transform: scale(1.05); }
.bread-gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 12px;
  font: 600 18px var(--serif); color: #fff8ec; background: linear-gradient(transparent, rgba(25,16,9,.75)); }

/* Знакомство с автором */
.about { background: var(--paper); }
.about .wrap { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; }
.about-photo { margin: 0; position: sticky; top: 96px; }
.about-photo img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center top; border-radius: 20px; display: block; box-shadow: 0 30px 60px rgba(94,52,20,.25); }
.about-photo::after { content: ''; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid #e8c39a; border-radius: 20px; z-index: -1; }
.about-photo { isolation: isolate; }
.about-text p { color: var(--ink); }
.about-text .lead { font-size: 20px; }
.signature { font: italic 600 24px var(--serif); color: var(--crust); margin-top: 22px; }
.about-links { margin-top: 24px; }
.about-card { display: block; text-decoration: none; padding: 18px 22px; border-radius: 16px; background: #fff3df; border: 1px solid #f0d6aa; color: var(--ink); transition: border-color .2s, transform .2s; }
.about-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.about-card b { display: block; font: 700 20px var(--serif); color: var(--crust-dark); margin-bottom: 4px; }
.about-card span { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) {
  .about .wrap { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { position: relative; top: 0; max-width: 320px; margin: 0 auto; }
}

/* Цитата */
.quote { padding: 120px 0; text-align: center; }
.quote blockquote { margin: 0 auto; max-width: 820px; font: italic 600 clamp(24px, 3.4vw, 36px)/1.35 var(--serif); }
.quote blockquote::before { content: '«'; display: block; font-size: 70px; line-height: .6; color: #f3c98f; margin-bottom: 18px; }

/* Как проходит обучение */
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.process .step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.process img { width: 100%; height: 220px; object-fit: cover; display: block; }
.process .step > div { padding: 18px 20px 22px; }
.process span { font: 700 12px var(--sans); letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.process h3 { margin: 6px 0 6px; }
.process p { margin: 0; color: var(--muted); font-size: 15px; }

/* Цена на фото-фоне */
.price-section { padding: 110px 0; }
.price-section .price-box { background: rgba(255,250,241,.96); color: var(--ink); }
.price-section .price-box h2 { color: var(--crust-dark); }

/* Кабинет */
.cab-hero { padding: 56px 0 48px; }
.cab-hero h1 { font-size: clamp(28px, 4.5vw, 44px); margin: 0 0 8px; }
.cab-hero p { margin: 0; color: rgba(255,248,236,.85); max-width: 40em; }

/* Подвал */
footer.photo-bg { padding: 70px 0 40px; color: rgba(255,248,236,.75); }
footer.photo-bg a { color: #f3c98f; }
.footer-title { font: italic 600 28px var(--serif); color: #fff8ec; margin: 0 0 10px; }
.reviews { columns: 3 260px; column-gap: 16px; }
.reviews a { display: block; break-inside: avoid; margin-bottom: 16px; }
.reviews img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }
@media (max-width: 860px) {
  .bread-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .process { grid-template-columns: 1fr; }
  .hero.photo-bg { padding: 96px 0 70px; }
  .hero.photo-bg .wrap { gap: 28px; }
  .polaroid { max-width: 240px; order: 0; transform: rotate(2deg); }
  .quote { padding: 80px 0; }
  .price-section { padding: 70px 0; }
}

footer { padding: 32px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* Модальное окно входа */
.modal { position: fixed; inset: 0; background: rgba(42,31,23,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.open { display: flex; }
.modal-box { background: var(--paper); border-radius: 20px; width: 100%; max-width: 420px; padding: 28px; position: relative; box-shadow: var(--shadow); }
.modal-close { position: absolute; right: 14px; top: 10px; background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--flour); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; font: 600 15px var(--sans); cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
form label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
form input {
  width: 100%; padding: 12px 14px; font: 16px var(--sans); border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
form input:focus { outline: none; border-color: var(--accent); }
form .btn { width: 100%; margin-top: 20px; }
.error { color: #b23a1d; font-size: 14px; min-height: 20px; margin-top: 10px; }

/* Кабинет */
.cab { display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 32px 0 60px; align-items: start; }
.side { position: sticky; top: 88px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.side h4 { margin: 0 0 4px; font: 700 17px var(--serif); color: var(--crust-dark); }
.progress { height: 8px; background: var(--flour); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress div { height: 100%; background: var(--ok); width: 0; transition: width .3s; }
.progress-text { font-size: 13px; color: var(--muted); }
.lesson-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 4px; }
.lesson-list button {
  width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  padding: 10px; border-radius: 10px; font: 15px/1.35 var(--sans); color: var(--ink);
}
.lesson-list button:hover { background: var(--flour); }
.lesson-list button.active { background: var(--flour); font-weight: 600; }
.lesson-list .mark {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 12px; color: var(--muted); background: #fff;
}
.lesson-list .done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }

.lesson { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 40px; min-width: 0; }
.lesson .meta { color: var(--muted); font-size: 14px; }
.lesson h2 { margin-top: 6px; }
.lesson .lead { font-size: 19px; color: var(--ink); }
.lesson ul, .lesson ol { padding-left: 22px; }
.lesson li { margin: 6px 0; }
.lesson table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; display: block; overflow-x: auto; }
.lesson th, .lesson td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lesson th { background: var(--flour); font-weight: 600; }
.lesson .small { font-size: 13px; color: var(--muted); }
.lesson .note { background: #fff3df; border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 22px 0; }
.lesson .formula { font: 600 18px var(--serif); background: var(--flour); padding: 14px 18px; border-radius: 10px; text-align: center; }
.lesson ol.steps { list-style: none; padding: 0; counter-reset: s; }
.lesson ol.steps li { counter-increment: s; position: relative; padding: 0 0 14px 46px; margin: 0; }
.lesson ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--crust); color: #fff; display: grid; place-items: center; font: 700 14px var(--sans);
}
.lesson ul.check { list-style: none; padding: 0; }
.lesson ul.check li { padding-left: 28px; position: relative; }
.lesson ul.check li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.lesson .tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lesson .tools div { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.lesson .tools span { display: block; font-size: 14px; color: var(--muted); }
.lesson .timeline { display: flex; flex-wrap: wrap; gap: 8px; }
.lesson .timeline div { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.lesson .timeline b { display: block; color: var(--crust); }
.lesson video, .lesson img { max-width: 100%; border-radius: 12px; }
.lesson a.download { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--ink); background: #fff3df; border: 1px solid #f0d6aa; border-radius: 14px; padding: 16px 18px; margin: 20px 0; }
.lesson a.download:hover { border-color: var(--accent); }
.lesson a.download small { color: var(--muted); font-size: 14px; }
.lesson .download-icon { flex: none; width: 52px; height: 60px; border-radius: 8px; background: var(--crust); color: #fff; display: grid; place-items: center; font: 700 14px var(--sans); }
.lesson .recipe { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; margin: 12px 0; }
.lesson .recipe p { margin: 8px 0 4px; }
.lesson .recipe ul { margin: 4px 0 8px; }
.lesson h4 { font: 700 17px var(--serif); color: var(--crust-dark); margin: 20px 0 6px; }
.lesson figure.vid { margin: 18px 0; }
.lesson figure.vid video { width: 100%; max-height: 70vh; background: #000; display: block; }
.lesson figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.lesson .rounds { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.lesson video.round { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; background: var(--flour); display: block; margin: 16px 0; }
.lesson .rounds video.round { margin: 0; }
.lesson .gallery { display: grid; gap: 10px; margin: 16px 0; }
.lesson .gallery.g1 { grid-template-columns: minmax(0, 520px); }
.lesson .gallery.g2 { grid-template-columns: repeat(2, 1fr); }
.lesson .gallery.g3 { grid-template-columns: repeat(3, 1fr); }
.lesson .gallery img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1; }
.lesson .gallery.g1 img { aspect-ratio: auto; height: auto; }
@media (max-width: 560px) {
  .lesson video.round { width: 160px; height: 160px; }
  .lesson .gallery.g3 { grid-template-columns: repeat(2, 1fr); }
}
.lesson-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }

.paywall { max-width: 560px; margin: 60px auto; text-align: center; }
.banner { background: #e8f1df; border: 1px solid #c9dcb8; color: #33521f; padding: 14px 18px; border-radius: 12px; margin-top: 24px; }
.banner.warn { background: #fff3df; border-color: #f0d6aa; color: #7a4a10; }

@media (max-width: 860px) {
  .hero { padding: 40px 0; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .art { max-width: 260px; order: -1; }
  .features { grid-template-columns: 1fr; }
  .program li { grid-template-columns: 44px 1fr; }
  .program li::before { width: 38px; height: 38px; }
  .program em { grid-column: 2; }
  .cab { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .side { position: static; }
  .lesson { padding: 24px 18px; }
  .lesson .tools { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  .nav .hide-mobile { display: none; }
}

/* Юридические страницы */
.legal { max-width: 820px; padding: 40px 20px 60px; }
.legal h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 4px; }
.legal h2 { font-size: 21px; margin: 30px 0 8px; }
.legal p, .legal li { font-size: 16px; }
.legal .small { color: var(--muted); font-size: 14px; }
.fill { background: #ffe8a3; color: #6b4300; padding: 0 5px; border-radius: 4px; font-weight: 600; }
.box-legal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.legal-footer { padding: 28px 0; text-align: center; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.legal-footer a, .footer-links a { color: inherit; }
.footer-links { margin-top: 10px; font-size: 14px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 400 !important; color: var(--muted); margin-top: 14px !important; line-height: 1.4; }
.consent input { width: auto !important; margin-top: 2px; flex: none; }
.pay-terms { font-size: 13px; color: var(--muted); margin-top: 10px; }
