/* Endless — сайт. Палитра и голос — бренд/философия.md («Цвет и голос»), правила знака — бренд/README.md.
   Светлая тема: бумага / чернила / глубокий лайм. Тёмная: чернила / графит / лайм. Лайм — только там, где движение. */

:root {
  --bg: #f4f3ee;            /* бумага */
  --bg-2: #ffffff;
  --card: #ffffff;
  --text: #181818;          /* чернила */
  --muted: #6b6a64;
  --line: rgba(24, 24, 24, .12);
  --lime: #8fb400;          /* глубокий лайм на светлом; лайм #CCFE00 на белый не ставим */
  --btn-bg: #181818;
  --btn-fg: #f4f3ee;
  --ok: #8fb400;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181818;          /* чернила */
    --bg-2: #222221;        /* графит */
    --card: #222221;
    --text: #f4f3ee;
    --muted: #a3a29b;
    --line: rgba(244, 243, 238, .12);
    --lime: #ccfe00;
    --btn-bg: #ccfe00;
    --btn-fg: #181818;
    --ok: #ccfe00;
    color-scheme: dark;
  }
}

/* подпись знака — только Montserrat 600; подсет под буквы «Endless Transformation», OFL (fonts/LICENSE.txt) */
@font-face {
  font-family: "Montserrat Brand";
  src: url("fonts/Montserrat-600-endless.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(32px, 6vw, 52px); }
h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 14px; }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
section { padding: 56px 0; }
@media (min-width: 720px) { section { padding: 84px 0; } }
.lead { font-size: 20px; color: var(--muted); max-width: 34em; }

/* знак */
.mark { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }
.mark circle:last-child { fill: var(--lime); }
.brand { display: inline-flex; align-items: center; gap: .45em; font-family: "Montserrat Brand", Montserrat, Inter, sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -.01em; text-decoration: none; }
.brand .mark { font-size: 30px; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
@media (max-width: 719px) { .nav .hide-m { display: none; } }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .12s, opacity .12s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }

/* первый экран */
.hero { padding-top: 36px; padding-bottom: 56px; }
@media (min-width: 900px) { .hero { padding-top: 72px; padding-bottom: 96px; } }
/* разделы — section.wrap: класс .wrap снимал вертикальные отступы section, разделы слипались (13.11) */
section.wrap { padding-top: 48px; padding-bottom: 48px; }
@media (min-width: 720px) { section.wrap { padding-top: 72px; padding-bottom: 72px; } }
section.hero.wrap { padding-top: 36px; padding-bottom: 56px; }
@media (min-width: 900px) { section.hero.wrap { padding-top: 72px; padding-bottom: 96px; } }
.hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; } }
.hero h1 { max-width: 14em; }
.hero .sub { margin: 16px 0 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; max-width: 22em; }
.hero .sub + .lead { margin-top: 14px; }
.hero .lead { margin: 18px 0 28px; }
.hero-mark { display: grid; place-items: center; }
.hero-mark svg { width: min(72vw, 360px); height: auto; color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .hero-mark .r1 { animation: appear .7s cubic-bezier(.2,.7,.2,1) both; }
  .hero-mark .r2 { animation: appear .7s .3s cubic-bezier(.2,.7,.2,1) both; }
  .hero-mark .d  { animation: appear .6s .65s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* форма листа ожидания */
.wait { display: grid; gap: 10px; max-width: 520px; }
.wait .row { display: flex; gap: 10px; flex-wrap: wrap; }
.wait input, .wait select {
  flex: 1 1 200px; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; font-size: 16px;
}
.wait input:focus, .wait select:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.wait .btn { flex: 0 0 auto; }
.wait .note { font-size: 13px; color: var(--muted); }
.wait .done { display: none; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.wait .done b { color: var(--ok); }
.wait.sent form { display: none; }
.wait.sent .done { display: block; }
.wait .err { display: none; font-size: 14px; color: #c0392b; }
.wait.failed .err { display: block; }

/* карточки и сетки */
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

/* сцены: реплика → карточки */
.scene { display: grid; gap: 12px; }
.scene .say { justify-self: end; max-width: 90%; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 15px; }
.scene .cards { display: grid; gap: 8px; }
.scene .item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.scene .item .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; display: block; }
.scene .item .dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-top: 7px; }
.scene .who { font-size: 12px; color: var(--muted); }

/* сравнение */
.cmp { display: grid; gap: 10px; }
.cmp .row { display: grid; gap: 6px; padding: 16px 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .cmp .row { grid-template-columns: 160px 1fr 1fr; gap: 20px; } }
.cmp .row:last-child { border-bottom: 1px solid var(--line); }
.cmp .k { font-weight: 600; }
.cmp .a { color: var(--muted); }
.cmp .b::before { content: "Endless · "; color: var(--muted); font-size: 13px; }
.cmp .a::before { content: "ChatGPT · "; font-size: 13px; }
@media (min-width: 720px) { .cmp .a::before, .cmp .b::before { content: none; } .cmp .head { display: grid !important; } }
.cmp .head { display: none; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; border: 0; }

/* факты */
.facts { display: grid; gap: 14px; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts div { padding-top: 12px; border-top: 2px solid var(--line); }
.facts b { display: block; margin-bottom: 4px; }
.facts ol { padding-left: 1.2em; margin: 6px 0 8px; }
.facts li { margin: 2px 0; }

/* основатель */
.founder { display: grid; gap: 24px; align-items: start; }
@media (min-width: 720px) { .founder { grid-template-columns: 240px 1fr; gap: 40px; } }
.portrait { aspect-ratio: 4 / 5; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 14px; }

/* длинный текст (страницы данных, политика и т. п.) */
.doc { max-width: 720px; padding-top: 36px; padding-bottom: 72px; }
.doc h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 10px; }
.doc h2 { font-size: 22px; margin: 36px 0 10px; }
.doc h3 { font-size: 17px; margin: 22px 0 6px; }
.doc ul, .doc ol { padding-left: 1.2em; margin: 0 0 14px; }
.doc li { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 18px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 500; font-size: 13px; }
.draft { padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin: 12px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; }

/* день с ассистентом */
.day { display: grid; gap: 28px; }
.day .t { display: grid; gap: 14px; }
@media (min-width: 720px) { .day .t { grid-template-columns: 180px 1fr; gap: 28px; } }
.day .when { color: var(--muted); font-size: 14px; padding-top: 6px; }
.day .when b { display: block; color: var(--text); font-size: 20px; letter-spacing: -.01em; }

/* подвал */
footer { border-top: 1px solid var(--line); padding: 32px 0 44px; color: var(--muted); font-size: 14px; }
footer .cols { display: grid; gap: 18px; }
@media (min-width: 720px) { footer .cols { grid-template-columns: 1fr auto; align-items: start; } }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer .links a { text-decoration: none; }
footer .links a:hover { color: var(--text); }
footer .tag { margin-top: 10px; color: var(--text); }

/* телефон: в шапке только знак и кнопка */
.show-m { display: none; }
@media (max-width: 719px) { .show-m { display: inline; } .hero-mark svg { width: min(56vw, 240px); } }
.scene .who { display: block; }
.wait .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.wait .consent input { margin: 4px 0 0; width: 16px; height: 16px; accent-color: var(--lime); flex: 0 0 auto; }

/* переключатель языка (с 01.11): в шапке — короткий код другого языка, в подвале — оба названия */
.nav .lang { font-size: 13px; font-weight: 600; letter-spacing: .06em; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.nav .lang:hover { color: var(--text); border-color: currentColor; }
footer .langs { margin-top: 12px; }
footer .langs a { text-decoration: none; }
footer .langs a[aria-current] { color: var(--text); font-weight: 600; }
footer .langs a:hover { color: var(--text); }

/* главная /en/: кнопка входа над формой листа ожидания */
.hero .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 26px; }
.hero .cta .small { max-width: 20em; }

/* кадры с настоящих телефонов (16.11): на телефоне – лента вбок, на широком – сетка */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: 64%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
@media (min-width: 720px) { .shots { grid-auto-columns: 31%; margin: 0; padding-left: 0; padding-right: 0; } }
@media (min-width: 1000px) { .shots { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; } .shots.c4 { grid-template-columns: repeat(4, 1fr); } }
.shot { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; }
.shot h3 { font-size: 17px; margin-bottom: 4px; }
.shot p { font-size: 14px; color: var(--muted); margin: 0 0 12px; flex: 1; }
.shot img, .hero-shot img { display: block; width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); background: var(--bg-2); }
.shots-h { margin: 36px 0 14px; }
.hero-shot { display: grid; place-items: center; }
.hero-shot img { width: min(70vw, 320px); border-radius: 28px; box-shadow: 0 18px 50px rgba(24, 24, 24, .14); }

/* к запуску (16.11, сессия «Сайт к запуску») */
/* пропуск к содержанию: видна только с клавиатуры */
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
a:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
/* тихая строка «Есть версия на русском» на en у человека с русским браузером (site.js) */
.lang-hint { display: block; text-align: center; padding: 10px 16px; font-size: 14px; background: var(--card); border-bottom: 1px solid var(--line); text-decoration: none; }
.lang-hint[hidden] { display: none; }
/* первый экран входит один раз при загрузке (решение Армена: анимации не гасим по reduced-motion) */
.hero-text > *, .hero-shot { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .22s; }
.hero-shot { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero h1 { max-width: 13em; }
.hero-text .small a { color: var(--text); }
.hero .trust { margin: -12px 0 20px; max-width: 34em; font-size: 13px; line-height: 1.5; }
/* кнопки отвечают на палец и мышь */
.btn { transition: transform .12s, opacity .12s, background-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.ghost:hover { border-color: currentColor; }

/* одна фраза → записи, рядом настоящий разговор */
.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr .9fr; gap: 56px; } }
.split .scene { margin-top: 26px; max-width: 520px; }
.scene .say { font-size: 16px; }
.scene .item { background: var(--card); font-size: 15px; }
.scene .item .k { margin-bottom: 2px; }
.side-shot { display: grid; place-items: center; }
.side-shot img { display: block; width: min(70vw, 300px); height: auto; border-radius: 26px; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(24, 24, 24, .12); }

/* сферы: каждая карточка ведёт в свой раздел путеводителя */
.areas { display: grid; gap: 12px; margin-top: 36px; }
@media (min-width: 560px) { .areas { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .areas { grid-template-columns: repeat(4, 1fr); } }
.area { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: transform .15s, border-color .15s; }
.area:hover { transform: translateY(-2px); border-color: var(--muted); }
.area b { font-size: 17px; letter-spacing: -.01em; }
.area span { font-size: 14px; color: var(--muted); line-height: 1.45; flex: 1; }
.area i { font-style: normal; font-size: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.shots.c4 { margin-top: 0; }

/* вопросы и ответы */
.faq { display: grid; gap: 0; max-width: 760px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font-weight: 600; font-size: 18px; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 40em; }
.faq details p a { color: var(--text); }

/* последний призыв и 404 */
.card.close { padding: 28px; }
.card.close h2 { font-size: 26px; }
.nf { min-height: 60vh; }
.nf h2 { margin-top: 48px; font-size: 24px; }
.nf .lead { margin: 14px 0 22px; }

/* телефон: кнопки первого экрана на всю ширину, нажатие не меньше 44 px */
@media (max-width: 559px) {
  .hero .cta .btn, .card.close .btn { flex: 1 1 100%; }
  .card.close p:last-child { display: flex; flex-wrap: wrap; gap: 10px; }
  .nav .btn.sm, .nav .lang { min-height: 40px; display: inline-flex; align-items: center; }
}
/* бывшие инлайн-стили (CSP сайта без 'unsafe-inline', Безопасность 16.11) */
.lead-gap { margin-bottom: 28px; }
.more { margin-top: 22px; }
.note { margin-top: 16px; }
.foot-brand { font-size: 18px; }
footer .co { margin-top: 6px; }
.acts { margin: 0; }
/* почему Endless – второй слой бренда (сверка текстов 16.11) */
.why { display: grid; gap: 4px; max-width: 760px; }
.why .lead { color: var(--text); margin: 0 0 14px; }
/* манифест «Почему Endless» (/why/, /ru/why/): длинный текст, блоки ## с воздухом */
.manifest h1 { margin-bottom: 8px; }
.manifest h2 { font-size: 24px; margin: 40px 0 10px; }
.manifest p { font-size: 18px; line-height: 1.6; }
.manifest p:last-child { margin-top: 36px; }
.manifest p:last-child a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 12px; background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; }
.wrap.doc.manifest { max-width: 1040px; }
.manifest > * { max-width: 680px; }
/* узкий телефон (Облако-QA 16.11: Galaxy S25 360×645 – строка про Telegram уходила ниже первого экрана): плотнее первый экран,
   кнопки в ряд, если помещаются */
@media (max-width: 559px) {
  section.hero.wrap { padding-top: 16px; padding-bottom: 40px; }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 17px; margin: 12px 0 18px; }
  .hero .cta { margin-bottom: 14px; gap: 8px; }
  .hero .trust { margin: -4px 0 14px; }
  .hero .cta .btn { flex: 1 1 auto; padding: 12px 14px; }
  .top { padding-top: 12px; padding-bottom: 12px; }
}
@media (max-width: 340px) {
  .hero h1 { font-size: 26px; }
  .hero .lead { font-size: 16px; line-height: 1.45; }
  .hero .cta .btn { font-size: 15px; padding: 11px 12px; }
}
