/* AI-хуки. Дизайн-код v1: білий і сірий, чорнило, один помаранчевий акцент */
:root {
  --bg: #FFFFFF; --surface: #F4F3F0; --surface-2: #EAE8E3; --line: #E4E1DB;
  --ink: #0E0E0F; --ink-2: #55534F; --muted: #8E8A83;
  --accent: #FF4A1C; --accent-ink: #C2330E; --accent-soft: #FFEAE2;
  --display: 'Inter Tight', system-ui, sans-serif; --text: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r-s: 10px; --r-m: 18px; --r-l: 28px;
  --gut: 16px; --col: 680px; --wide: 900px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.62 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Верх */
.top { position: fixed; inset: 0 0 auto 0; z-index: 20; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 var(--gut); background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 15px/1 var(--display); min-width: 0; }
.brand strong { background: var(--ink); color: #fff; padding: 6px 8px; border-radius: 8px; font-weight: 700; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now { flex: none; font: 500 12px/1 var(--mono); color: var(--ink-2); text-decoration: none; background: var(--surface); padding: 8px 12px; border-radius: 99px; }
.bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }

/* Рейка зліва на широких екранах */
.rail { display: none; }
@media (min-width: 1240px) {
  .rail { display: block; position: fixed; left: 22px; top: 86px; width: 170px; z-index: 5; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .past-hero .rail { opacity: 1; pointer-events: auto; }
  .rail ol { list-style: none; margin: 0; padding: 0; }
  .rail a { display: flex; align-items: center; gap: 8px; padding: 4px 0; text-decoration: none; font-size: 13px; line-height: 1.3; color: var(--muted); }
  .rail a b { font: 500 11px/1 var(--mono); width: 16px; flex: none; }
  .rail a:hover { color: var(--ink); }
  .rail a.on { color: var(--ink); font-weight: 600; }
}

/* Hero */
.hero { background: var(--surface); padding: 84px var(--gut) 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.hero > * { min-width: 0; }
.kicker, .num { font: 500 12px/1.5 var(--mono); color: var(--ink-2); margin: 0 0 14px; }
h1 { font: 700 clamp(42px, 10vw, 80px)/.98 var(--display); letter-spacing: -.035em; margin: 0 0 18px; }
h1 em { font-style: normal; color: var(--muted); }
.lede { font-size: 18px; line-height: 1.5; color: var(--ink-2); margin: 0; max-width: 34em; }
.hero .row { margin-top: 22px; }
@media (min-width: 960px) {
  .hero { min-height: 100svh; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; padding: 84px clamp(32px, 5vw, 80px) 40px; gap: 40px; }
  h1 { font-size: clamp(48px, 5.6vw, 88px); }
}

/* Кнопки */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-2); border-radius: 99px; max-width: 100%; }
.seg button { border: 0; background: none; padding: 10px 16px; min-height: 42px; border-radius: 99px; cursor: pointer; font: 500 14px/1.2 var(--text); color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 22px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font: 600 15px/1.2 var(--text); text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: #2a2a2c; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: #fff; color: var(--ink); }
.btn.accent { background: var(--accent); color: var(--ink); }
.btn.accent:hover { background: #FF6A42; color: var(--ink); }
.btn.ghost-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.btn.ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

/* Стаття */
.col { width: min(var(--col), 100% - var(--gut) * 2); margin-inline: auto; }
.wide { width: min(var(--wide), 100vw - 32px); margin-inline: calc((min(var(--wide), 100vw - 32px) - 100%) / -2); }
.author { padding-top: 56px; }
.h-small { font: 700 28px/1.1 var(--display); letter-spacing: -.02em; margin: 0 0 20px; }
.author-grid { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.author-grid img { width: 110px; height: 143px; object-fit: cover; object-position: 50% 85%; border-radius: var(--r-m); }
.author-grid p:first-child { margin-top: 0; }
@media (min-width: 640px) { .author-grid { grid-template-columns: 160px 1fr; gap: 24px; } .author-grid img { width: 160px; height: 208px; } }
.chapter { padding-top: 72px; }
.chapter h2 { font: 700 clamp(32px, 7vw, 50px)/1.04 var(--display); letter-spacing: -.03em; margin: 0 0 24px; }
h3 { font: 700 24px/1.18 var(--display); letter-spacing: -.02em; margin: 44px 0 12px; scroll-margin-top: 72px; }
h4 { font: 700 18px/1.25 var(--display); margin: 0 0 8px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 16px; padding-left: 20px; }
li { margin-bottom: 6px; }
li::marker { color: var(--muted); }
code { font: 500 .88em/1 var(--mono); background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.small { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.pull { font: 700 clamp(24px, 5vw, 32px)/1.14 var(--display); letter-spacing: -.02em; margin: 32px 0; }
.note { background: var(--surface); border-radius: var(--r-m); padding: 16px 18px; font-size: 16px; line-height: 1.5; margin: 20px 0; }
.note p:last-child { margin: 0; }
.note b { font-family: var(--display); }

/* Коротко */
.tldr { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tldr li { margin: 0; background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; font-size: 16px; line-height: 1.45; }
.tldr b { font-family: var(--display); }

/* Таблиці */
.tbl { overflow-x: auto; margin: 20px 0; border-radius: var(--r-m); box-shadow: 0 0 0 1px var(--line); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; min-width: 520px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 13px/1.3 var(--display); background: var(--surface); color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 500; }
.y { color: var(--ink); font-weight: 600; }
.n { color: var(--muted); }
.tbl-2 table { min-width: 0; }

/* Добре / поки слабо */
.pair { display: grid; gap: 12px; margin: 20px 0; }
.pair > div { background: var(--surface); border-radius: var(--r-l); padding: 20px; }
.pair .weak { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.pair ul { font-size: 15.5px; line-height: 1.45; margin: 0; }
@media (min-width: 720px) { .pair { grid-template-columns: 1.1fr 1fr; width: min(var(--wide), 100vw - 32px); margin-inline: calc((min(var(--wide), 100vw - 32px) - 100%) / -2); } }

/* До і після */
.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 24px 0 8px; }
.ba figure { margin: 0; }
.ba .frame { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-m); overflow: hidden; background: var(--surface-2); }
.ba img, .ba video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba video { opacity: 0; transition: opacity .2s; }
.ba .playing video { opacity: 1; }
.ba .tgl { position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; }
.ba .tgl svg { width: 16px; height: 16px; }
.ba .i-pause, .ba .playing .i-play { display: none; }
.ba .playing .i-pause { display: block; }
.ba figcaption { margin-top: 8px; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.ba figcaption b { display: block; font: 700 16px/1.2 var(--display); color: var(--ink); }
.ba figure:last-child figcaption b { color: var(--accent-ink); }
.ba .arr { font: 500 20px/1 var(--mono); color: var(--muted); }
@media (min-width: 720px) { .ba { width: 560px; max-width: 100%; } }

/* Кроки й промпти */
.steps { list-style: none; padding: 0; margin: 24px 0 0; counter-reset: st; }
.steps > li { margin: 0 0 36px; padding-left: 0; }
.st-h { display: flex; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.st-h b { flex: none; font: 500 12px/1 var(--mono); background: var(--ink); color: #fff; padding: 6px 9px; border-radius: 99px; }
.st-h h3 { margin: 0; }
.prompt { background: var(--ink); color: #fff; border-radius: var(--r-m); margin: 14px 0; overflow: hidden; }
.prompt-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.12); font: 500 12px/1.3 var(--mono); color: rgba(255,255,255,.6); }
.copy { border: 0; background: #fff; color: var(--ink); padding: 8px 14px; min-height: 36px; border-radius: 99px; font: 600 13px/1 var(--text); cursor: pointer; }
.copy:hover { background: var(--surface); }
.copy.ok { background: var(--accent); }
.prompt pre { margin: 0; padding: 14px 16px 16px; white-space: pre-wrap; word-break: break-word; font: 400 14.5px/1.6 var(--mono); }
.prompt mark { background: rgba(255,74,28,.28); color: #fff; border-radius: 3px; padding: 0 2px; }
.after { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.after::before { content: '→ '; color: var(--accent-ink); font-family: var(--mono); }

/* Чекліст */
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.check li { margin: 0; }
.check label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: var(--r-s); background: #fff; cursor: pointer; font-size: 15.5px; line-height: 1.4; }
.check label:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.check input { flex: none; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--ink); }
.check input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 4px 0 14px; }
.meter i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s; }
.meter.full i { background: var(--accent); }

/* FAQ */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { padding: 16px 28px 16px 0; font: 600 18px/1.3 var(--display); cursor: pointer; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 2px; top: 14px; font: 500 20px/1.2 var(--mono); color: var(--muted); }
details[open] summary::after { content: '−'; }
details > *:last-child { margin-bottom: 18px; }

/* Заклик */
.push { margin-top: 56px; padding: 28px 24px; background: var(--surface); border-radius: var(--r-l); box-shadow: inset 0 0 0 2px var(--accent); }
.push h2 { margin: 0 0 12px; font: 700 clamp(28px, 5vw, 38px)/1.08 var(--display); letter-spacing: -.025em; }
.push p { margin: 0 0 12px; }
.push .row { margin-top: 18px; }
.push .small { margin: 14px 0 0; }

/* Кінець */
.end { background: var(--ink); color: #fff; padding: 56px 0 40px; margin-top: 72px; }
.end img { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 16px; }
.end p { font-size: 18px; line-height: 1.5; }
.end .small { color: rgba(255,255,255,.65); font-size: 14px; margin-top: 22px; }
.end a:hover { color: #fff; }

/* Тост */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Hero: три кліпи віялом */
.hero-clips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.hero-clips .frame:nth-child(2) { transform: translateY(-18px); }
.hero-clips .frame { box-shadow: 0 0 0 1px var(--line); }

/* Кліпи: спільна рамка з кнопкою */
.frame { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-m); overflow: hidden; background: var(--surface-2); }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame video { opacity: 0; transition: opacity .2s; }
.frame.playing video { opacity: 1; }
.tgl { position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; }
.tgl svg { width: 16px; height: 16px; }
.i-pause, .playing .i-play { display: none; }
.playing .i-pause { display: block; }
.frame.wide-f { aspect-ratio: 27 / 16; }

.clips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
@media (min-width: 720px) { .clips { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(var(--wide), 100vw - 32px); margin-inline: calc((min(var(--wide), 100vw - 32px) - 100%) / -2); } }
.clips figure, .shot { margin: 0; }
.clips figcaption, .shot figcaption { margin-top: 8px; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.clips figcaption b, .shot figcaption b { display: block; font: 700 16px/1.2 var(--display); color: var(--ink); }
.tag { display: inline-block; margin-top: 4px; font: 500 11px/1.4 var(--mono); background: var(--surface); padding: 3px 8px; border-radius: 99px; color: var(--ink-2); }

/* Референси: картинки до кроків */
.refs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.refs figure { margin: 0; }
.refs img { width: 100%; height: auto; border-radius: var(--r-s); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.refs figcaption { font: 500 12px/1.4 var(--mono); color: var(--ink-2); margin-top: 6px; }
.refs .full { grid-column: 1 / -1; }
.refs.sheets { grid-template-columns: 1fr; }
@media (min-width: 640px) { .refs.sheets { grid-template-columns: 1fr 1fr; } }

/* Ціни */
.costs { display: grid; gap: 10px; margin: 20px 0; }
@media (min-width: 640px) { .costs { grid-template-columns: repeat(3, 1fr); } }
.cost { background: var(--surface); border-radius: var(--r-l); padding: 20px; }
.cost b { display: block; font: 700 34px/1 var(--display); letter-spacing: -.03em; margin-bottom: 6px; }
.cost span { display: block; font: 600 15px/1.3 var(--display); }
.cost p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.cost.hi { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }

/* Чого навчились: картки урок → фраза */
.lessons { display: grid; gap: 10px; margin: 20px 0; }
@media (min-width: 720px) { .lessons { grid-template-columns: 1fr 1fr; width: min(var(--wide), 100vw - 32px); margin-inline: calc((min(var(--wide), 100vw - 32px) - 100%) / -2); } }
.lesson { background: var(--surface); border-radius: var(--r-l); padding: 18px 20px; }
.lesson h4 { margin: 0 0 6px; }
.lesson p { font-size: 15.5px; line-height: 1.45; margin: 0 0 8px; color: var(--ink-2); }
.lesson q { display: block; quotes: none; font: 500 13.5px/1.5 var(--mono); background: #fff; border-radius: var(--r-s); padding: 10px 12px; color: var(--ink); }

/* Великий заклик: одна темна секція на сторінці */
.offer { background: var(--ink); color: #fff; border-radius: var(--r-l); padding: 32px 24px; margin-top: 64px; }
@media (min-width: 720px) { .offer { padding: 44px 44px; width: min(var(--wide), 100vw - 32px); margin-inline: calc((min(var(--wide), 100vw - 32px) - 100%) / -2); } }
.offer .num { color: rgba(255,255,255,.55); }
.offer h2 { font: 700 clamp(32px, 6vw, 52px)/1.02 var(--display); letter-spacing: -.03em; margin: 0 0 16px; }
.offer p { color: rgba(255,255,255,.82); }
.offer ul { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; }
@media (min-width: 640px) { .offer ul { grid-template-columns: 1fr 1fr; } }
.offer li { margin: 0; background: rgba(255,255,255,.07); border-radius: var(--r-m); padding: 14px 16px; font-size: 15.5px; line-height: 1.4; }
.offer li b { display: block; font: 700 22px/1.1 var(--display); color: #fff; margin-bottom: 4px; }
.offer .price { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 4px; }
.offer .price b { font: 700 48px/1 var(--display); letter-spacing: -.03em; }
.offer .price s { color: rgba(255,255,255,.5); font-size: 18px; }
.offer .small { color: rgba(255,255,255,.6); }
.offer .btn.accent { font-size: 16px; min-height: 54px; padding: 14px 28px; }
.offer a:not(.btn) { color: #fff; }

/* Світлий підвал: темна секція на сторінці одна — офер */
.foot { padding: 48px 0 40px; margin-top: 72px; border-top: 1px solid var(--line); }
.foot img { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 14px; }
.foot p { font-size: 17px; line-height: 1.5; }
.foot .small { margin-top: 18px; }

/* версія 2: два рілси поруч */
.clips.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .clips.two { grid-template-columns: repeat(2, 260px); justify-content: start; width: auto; margin-inline: 0; } }
