:root {
  --abyss: #0c2a33;
  --lagoon: #1b6b73;
  --deep: #10343c;
  --foam: #dde9e2;
  --foam-2: #cfdfd6;
  --lantern: #f2b24a;
  --plum: #2e1a3f;
  --plum-2: #44285a;
  --coral: #e5755a;
  --ink: #14262b;
  --paper: #eef3ec;
  --gutter: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: 'Alegreya', Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--abyss);
}
img, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 3px; border-radius: 4px; }

.draft {
  margin: 0; padding: 6px var(--gutter); text-align: center;
  font-size: .9rem; line-height: 1.3; background: var(--lantern); color: var(--abyss); max-width: none;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 720px; }

h1, h2, h3 { font-weight: 800; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 6vw, 3rem); margin-bottom: .6em; max-width: 22ch; text-wrap: balance; }
h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: .35em; }
p { margin: 0 0 1em; max-width: 62ch; }
.intro { font-size: 1.15rem; opacity: .92; max-width: 60ch; margin-bottom: 1.6em; }

/* Акты: фон меняется, как море, лес и дом в самих сказках */
.act { padding: clamp(48px, 9vw, 104px) 0; }
.foam { background: var(--foam); color: var(--ink); }
.foam.alt { background: var(--foam-2); }
.paper { background: var(--paper); color: var(--ink); }
.deep { background: var(--deep); color: #eaf3ef; }
.plum { background: var(--plum); color: #f7ecd6; }

/* Первый экран */
.hero { position: relative; min-height: calc(100svh - 2rem); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: var(--abyss); isolation: isolate; }
.hero .hero-pic { position: absolute; inset: 0; margin: 0; z-index: -2; }
.hero-pic img, .hero-pic video { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(12,42,51,.96) 0%, rgba(12,42,51,.78) 34%, rgba(12,42,51,.12) 70%, rgba(12,42,51,0) 100%); }
.hero-text { padding: 0 var(--gutter) clamp(32px, 7vw, 72px); max-width: 1100px; width: 100%; margin: 0 auto; color: #f4f8f5; }
h1 { font-size: clamp(2.7rem, 11vw, 6.2rem); max-width: 12ch; margin-bottom: .3em; text-wrap: balance; text-shadow: 0 2px 22px rgba(0,0,0,.45); }
.lead { font-size: clamp(1.15rem, 3.4vw, 1.45rem); max-width: 40ch; margin-bottom: 1.4em; text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn { display: inline-block; padding: .7em 1.2em; border-radius: 999px; background: var(--lantern); color: var(--abyss);
  font-weight: 700; text-decoration: none; font-size: 1.05rem; line-height: 1.2; }
.btn:hover { background: #ffc566; }
.btn.ghost { background: transparent; color: #f4f8f5; box-shadow: inset 0 0 0 2px rgba(244,248,245,.7); }
.btn.ghost:hover { background: rgba(244,248,245,.14); }

/* Оживающие картинки */
.live { position: relative; }
.live[data-live], .live[data-hero] { cursor: pointer; }
.live video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.live.on video { opacity: 1; }

/* Лента примеров: на телефоне горизонтальная прокрутка, на широком экране колонки */
.strip { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 18px; scrollbar-width: thin; scrollbar-color: var(--lantern) transparent; -webkit-overflow-scrolling: touch; }
.strip figure { flex: 0 0 82%; max-width: 420px; margin: 0; scroll-snap-align: center; background: #0a2128; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
/* Кадр у всех карточек один, 4:3, чтобы картинка и ролик совпадали и лента не прыгала */
.strip .frame { position: relative; aspect-ratio: var(--ar, 4 / 3); overflow: hidden; }
.strip .frame img, .strip .frame video { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 30%); }
.strip .frame video { position: absolute; inset: 0; }
.strip figcaption { padding: 12px 16px 16px; font-size: 1.02rem; line-height: 1.45; color: #dbe9e3; }
.strip .badge { position: absolute; right: 10px; top: 10px; background: rgba(12,42,51,.78); color: #f4f8f5; font-size: .85rem; line-height: 1; padding: 6px 10px; border-radius: 999px; pointer-events: none; }
.strip .live.on .badge { opacity: 0; }
@media (min-width: 820px) {
  .strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; overflow: visible; margin: 0; padding: 0; }
  .strip figure { max-width: none; }
}

/* Герои */
.cast { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
.cast li { text-align: left; }
.cast img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 6%; border-radius: 999px 999px 14px 14px; margin-bottom: 12px; background: var(--foam-2); box-shadow: 0 6px 18px rgba(12,42,51,.2); }
.cast h3 { font-size: 1.15rem; }
.cast p { font-size: 1rem; line-height: 1.45; margin: 0; }
@media (min-width: 700px) { .cast { grid-template-columns: repeat(4, 1fr); gap: 28px 22px; } }

/* Отрывки */
.excerpts { display: grid; gap: 40px; }
.ex { margin: 0; display: grid; gap: 16px; }
.ex img { width: 100%; max-height: 300px; object-fit: cover; object-position: 50% 18%; border-radius: 14px; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
.ex blockquote { margin: 0; padding-left: 18px; border-left: 3px solid var(--lantern); font-weight: 500; font-size: 1.2rem; line-height: 1.6; }
.ex blockquote.poem { font-style: italic; }
.ex blockquote p { margin: 0; }
.ex figcaption { font-size: 1rem; color: #e3d2b4; margin-top: 12px; padding-left: 21px; }
@media (min-width: 820px) {
  .ex { grid-template-columns: 320px 1fr; align-items: center; gap: 36px; }
  .ex img { height: 260px; }
  .ex:nth-child(even) { grid-template-columns: 1fr 320px; }
  .ex:nth-child(even) img { order: 2; }
}

/* Версии */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.chip { font: inherit; font-size: 1rem; line-height: 1.2; padding: .6em 1em; border-radius: 999px; border: 2px solid var(--lagoon); background: transparent; color: var(--ink); cursor: pointer; }
.chip:hover { background: rgba(27,107,115,.12); }
.chip[aria-pressed="true"] { background: var(--lagoon); color: #fff; }
.vpanel { margin: 0; padding: 22px; background: #f4f8f5; border-radius: 18px; box-shadow: 0 6px 22px rgba(12,42,51,.14); display: grid; gap: 16px; }
.vpanel[hidden] { display: none; }
.vpanel > div { display: grid; gap: 2px; align-content: start; }
.vpanel dt { font-size: .98rem; font-weight: 700; color: var(--lagoon); }
.vpanel dd { margin: 0; font-size: 1.15rem; line-height: 1.45; }
.js .vpanel { animation: swap .35s ease; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .vpanel { animation: none; } }
@media (min-width: 820px) {
  .vpanel { grid-template-columns: repeat(5, 1fr); padding: 28px; gap: 22px; }
}

/* Как рождается сказка */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 28px 62px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--lantern); color: var(--abyss); font-weight: 800; font-size: 1.25rem; display: grid; place-items: center; }
.steps li::after { content: ""; position: absolute; left: 20px; top: 46px; bottom: 4px; width: 2px; background: rgba(242,178,74,.4); }
.steps li:last-child::after { display: none; }
.steps p { margin: 0; }

/* Человек и нейросеть */
.two { display: grid; gap: 20px; }
.col { background: #f4f8f5; border-radius: 18px; padding: 22px; box-shadow: 0 6px 22px rgba(12,42,51,.12); }
.col ul { margin: 0; padding-left: 1.2em; }
.col li { margin-bottom: .5em; }
@media (min-width: 760px) { .two { grid-template-columns: 3fr 2fr; } }

/* Два способа */
.ways { display: grid; gap: 22px; margin-bottom: 24px; }
.way { background: #fff; border-radius: 20px; padding: 26px 22px; box-shadow: 0 8px 28px rgba(12,42,51,.14); border-top: 6px solid var(--lagoon); }
.way:nth-child(2) { border-top-color: var(--plum-2); }
.way .when { font-style: italic; color: #3c5058; }
.terms { margin: 18px 0 0; display: grid; gap: 8px; }
.terms div { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; border-top: 1px solid #d7e2db; padding-top: 8px; }
.terms dt { font-weight: 700; min-width: 6.5em; }
.terms dd { margin: 0; }
.tbd { color: #56676d; font-style: italic; }
.note { font-size: 1.1rem; max-width: 62ch; padding: 14px 18px; border-left: 4px solid var(--lantern); background: rgba(242,178,74,.16); border-radius: 0 12px 12px 0; margin: 24px 0 0; }
@media (min-width: 820px) { .ways { grid-template-columns: 1fr 1fr; gap: 28px; } .way { padding: 32px 30px; } }

/* Что получает семья */
.gets { margin: 0 0 1.4em; padding-left: 1.2em; }
.gets li { margin-bottom: .8em; padding-left: .2em; max-width: 62ch; }
.gets b { font-weight: 800; }

/* Вопросы */
details { border-top: 1px solid rgba(20,38,43,.25); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid rgba(20,38,43,.25); }
summary { cursor: pointer; font-weight: 700; font-size: 1.2rem; list-style: none; padding-right: 28px; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 2px; top: -2px; font-size: 1.6rem; color: var(--lagoon); }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; }

/* Контакты, подвал */
.empty { border: 2px dashed rgba(234,243,239,.5); border-radius: 16px; padding: 22px; font-size: 1.15rem; max-width: 40ch; }
.foot { background: var(--abyss); color: #cfe0d9; padding: 40px 0 56px; }
.foot p { margin: 0 0 .4em; font-weight: 700; font-size: 1.2rem; }
.foot .small { font-weight: 400; font-size: .95rem; opacity: .8; }

@media (prefers-reduced-motion: reduce) { .live video { transition: none; } }
