/* Restalearn landing — hand-written CSS, no build step.
   Themes: light (default, "Calm Study") and dark ("Night Focus" palette on the
   same layout). Explicit choice via html[data-theme]; otherwise system scheme. */

/* Self-hosted fonts (GDPR: no Google Fonts CDN in production) */
@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/youngserif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/youngserif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/karla-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/karla-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Theme tokens ---------- */
:root {
  --bg: #FAF6EE;
  --bg-alt: #FFFFFF;
  --bg-accent: #F1E9D8;
  --card: #FFFFFF;
  --ink: #33302A;
  --muted: #55503F;
  --faint: #8A8272;
  --accent: #4F7A63;
  --accent-hover: #3B5F4C;
  --accent-ink: #FDFBF6;
  --accent2: #C3795B;
  --kicker-lab: #A05F41;
  --border: #E7DFD2;
  --input-border: #D8CFBE;
  --input-bg: #FFFFFF;
  --check-border: #B9AE99;
  --svg-line: #B9AE99;
  --svg-ellipse: #F1E9D8;
  --prism-fill: #FFFFFF;
  --mark-bg: #F1E9D8;
  --mark-ink: #33302A;
}
[data-theme="dark"] {
  --bg: #12141C;
  --bg-alt: #171A24;
  --bg-accent: #171A24;
  --card: #1A1D28;
  --ink: #E9EBF2;
  --muted: #9AA0B4;
  --faint: #9AA0B4;
  --accent: #6FD5CE;
  --accent-hover: #9BE8E2;
  --accent-ink: #0E2321;
  --accent2: #9D8CFF;
  --kicker-lab: #9D8CFF;
  --border: rgba(255, 255, 255, 0.08);
  --input-border: rgba(255, 255, 255, 0.14);
  --input-bg: #12141C;
  --check-border: rgba(255, 255, 255, 0.25);
  --svg-line: #5A6076;
  --svg-ellipse: #1B2030;
  --prism-fill: rgba(111, 213, 206, 0.06);
  --mark-bg: rgba(111, 213, 206, 0.12);
  --mark-ink: #6FD5CE;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141C;
    --bg-alt: #171A24;
    --bg-accent: #171A24;
    --card: #1A1D28;
    --ink: #E9EBF2;
    --muted: #9AA0B4;
    --faint: #9AA0B4;
    --accent: #6FD5CE;
    --accent-hover: #9BE8E2;
    --accent-ink: #0E2321;
    --accent2: #9D8CFF;
    --kicker-lab: #9D8CFF;
    --border: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.14);
    --input-bg: #12141C;
    --check-border: rgba(255, 255, 255, 0.25);
    --svg-line: #5A6076;
    --svg-ellipse: #1B2030;
    --prism-fill: rgba(111, 213, 206, 0.06);
    --mark-bg: rgba(111, 213, 206, 0.12);
    --mark-ink: #6FD5CE;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Karla', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2 {
  font-family: 'Young Serif', Georgia, serif;
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}
h3 { font-size: 18px; font-weight: 700; margin: 0; }
p { margin: 0; }
img, svg { max-width: 100%; height: auto; }

.container { max-width: 1136px; margin-inline: auto; padding-inline: 24px; }
.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.section { padding-block: 88px; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-accent { background: var(--bg-accent); }
.section h2 { font-size: clamp(30px, 4vw, 40px); }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
}

/* ---------- Buttons, inputs ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 12px;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.input {
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--input-bg);
  padding: 13px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  width: 100%;
}
.input::placeholder { color: var(--faint); }
.checkbox-row { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--muted); }
.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

/* ---------- Header ---------- */
.site-header { padding-block: 18px; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 24px;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}
.btn-nav { padding: 10px 20px; font-size: 15px; }

/* ---------- Language menu ---------- */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { color: var(--ink); }
.lang-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.lang-list a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.lang-list a:hover { background: var(--bg-accent); color: var(--ink); }
.lang-list a[aria-current="true"] { font-weight: 700; color: var(--accent); }
.lang-note {
  margin: 4px 0 0;
  padding: 8px 12px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.4;
  color: var(--faint);
  max-width: 220px;
}

/* ---------- Hero ---------- */
.hero .container { display: flex; align-items: center; gap: 64px; padding-block: 64px 96px; }
.hero-copy { flex: 1 1 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-size: clamp(38px, 5.5vw, 62px); }
.hero-sub { font-size: 18px; line-height: 1.65; color: var(--muted); max-width: 520px; }
.hero-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.btn-hero { padding: 16px 34px; font-size: 17px; }
.hero-note { font-size: 13px; color: var(--faint); }
.hero-art { flex: 0 0 420px; }
.prism-ellipse { fill: var(--svg-ellipse); }
.prism-line { stroke: var(--svg-line); }
.prism-line-fill { fill: var(--svg-line); }
.prism-shape { fill: var(--prism-fill); stroke: var(--accent); }
.prism-accent { stroke: var(--accent); }
.prism-accent-fill { fill: var(--accent); }
.prism-warm { stroke: var(--accent2); }
.prism-faint { stroke: var(--faint); }
.prism-faint-rect { stroke: var(--faint); fill: var(--bg); }
.prism-label { fill: var(--faint); font-family: 'Karla', sans-serif; font-size: 13px; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 48px; }
.step { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.step h3 { font-size: 20px; }
.step p { font-size: 16px; color: var(--muted); }
.step-icon { color: var(--accent); }

/* ---------- Why AI ---------- */
.why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin-top: 44px; }
.why-item { display: flex; gap: 18px; }
.why-item svg { flex: 0 0 auto; margin-top: 4px; color: var(--accent2); }
.why-item div { display: flex; flex-direction: column; gap: 6px; }
.why-item p { font-size: 16px; color: var(--muted); }

/* ---------- Lab ---------- */
.lab .container { display: flex; gap: 64px; align-items: flex-start; }
.lab-copy { flex: 1 1 0; display: flex; flex-direction: column; gap: 18px; }
.lab-copy .kicker { color: var(--kicker-lab); }
.lab-copy p { font-size: 18px; line-height: 1.65; color: var(--muted); }
.lab-copy .lab-invite { font-size: 15px; color: var(--faint); }
.lab-points { flex: 0 0 400px; display: flex; flex-direction: column; gap: 14px; }
.lab-points .card { padding: 20px 24px; font-weight: 500; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 16px; margin-top: 44px; max-width: 880px; }
.faq-list details { padding: 0; }
.faq-list summary {
  cursor: pointer;
  padding: 24px 30px;
  font-size: 18px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--faint);
  line-height: 1;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { padding: 0 30px 24px; font-size: 16px; color: var(--muted); max-width: 760px; }

/* ---------- Join ---------- */
.join .container { display: flex; gap: 64px; }
.join-copy { flex: 1 1 0; display: flex; flex-direction: column; gap: 16px; }
.join-copy p { font-size: 18px; line-height: 1.65; color: var(--muted); }
.join-contact { font-size: 15px; color: var(--muted); margin-top: 8px; }
.contact-mark {
  background: var(--mark-bg);
  color: var(--mark-ink);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
}
.join-form { flex: 0 0 460px; padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.field-note { margin-top: -8px; font-size: 13px; line-height: 1.45; color: var(--faint); }
.form-note { margin-top: -4px; font-size: 13px; line-height: 1.5; color: var(--faint); }

/* ---------- Waitlist form while the sign-up handler is not live ---------- */
/* The form stays whole and visible — fields, both ticks, the policy link —
   because that markup is the consent mechanism. Only sending is off; joining
   happens by email until Brevo is connected (docs/decisions.md, 2026-08-26). */
.input:disabled { background: var(--bg-accent); color: var(--faint); cursor: not-allowed; }
.checkbox-row input[type="checkbox"]:disabled { cursor: not-allowed; }
/* Рамка нужна в тёмной теме: без неё выключенная кнопка сливается с карточкой,
   а её должно быть видно — на неё смотрит комплаенс. */
.btn:disabled,
.btn:disabled:hover {
  background: var(--bg-accent);
  color: var(--faint);
  border: 1px solid var(--input-border);
  cursor: not-allowed;
}
.form-stub {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border: 1px dashed var(--input-border);
  border-radius: 14px;
}
.stub-lead { font-size: 14px; line-height: 1.55; color: var(--muted); }
.stub-links { display: flex; flex-wrap: wrap; gap: 10px; }
/* Акцентная заливка обязательна: рядом стоит выключенная кнопка того же
   размера, и рабочая ссылка не должна выглядеть так же, как неактивная. */
.stub-links a {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.stub-links a:hover { background: var(--accent-hover); color: var(--accent-ink); }
.stub-hint { font-size: 13px; line-height: 1.5; color: var(--faint); }
.status .form-stub { margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 32px 40px; font-size: 14px; color: var(--faint); }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .links { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- Legal document pages (Privacy Policy) ---------- */
.legal { padding-block: 48px 88px; }
.legal .container { max-width: 820px; }
.doc-head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.doc-head h1 { font-size: clamp(32px, 4.6vw, 46px); }
.doc-meta { font-size: 14px; color: var(--faint); }
.doc-meta span + span::before { content: "·"; margin: 0 8px; color: var(--border); }

.legal h2 {
  font-family: 'Young Serif', Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  margin: 56px 0 0;
  scroll-margin-top: 24px;
  text-wrap: balance;
}
.legal h3 { font-size: 18px; margin: 34px 0 0; }
.legal p, .legal ul, .legal ol { margin-top: 16px; color: var(--muted); }
.legal li { margin-top: 8px; }
.legal ul, .legal ol { padding-left: 22px; }
.legal strong { color: var(--ink); }
.legal a { text-decoration: underline; text-underline-offset: 2px; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--mark-bg);
  color: var(--mark-ink);
  border-radius: 5px;
  padding: 1px 6px;
}

/* Summary card at the top of the document */
.doc-summary { margin-top: 36px; padding: 28px 32px; }
.doc-summary h2 { margin-top: 0; font-size: 22px; }
.doc-summary p:first-of-type { margin-top: 14px; }

/* Table of contents */
.doc-toc { margin-top: 36px; padding: 24px 28px; }
.doc-toc p { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.doc-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 36px; font-size: 15px; }
.doc-toc li { margin: 0 0 8px; break-inside: avoid; }
.doc-toc a { color: var(--muted); text-decoration: none; }
.doc-toc a:hover { color: var(--accent); text-decoration: underline; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 20px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
.legal th, .legal td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--muted); }
.legal th { color: var(--ink); }
.legal thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom-color: var(--input-border);
}
.legal tbody th { font-weight: 700; }
.legal td:last-child, .legal th:last-child { padding-right: 0; }

/* Footnote-ish closing line */
.doc-updated { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--faint); }
.doc-back { margin-top: 32px; font-size: 15px; }

/* Footer: storage note and the "forget my settings" control */
.storage-note { color: var(--faint); }
.linklike {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.linklike:hover { color: var(--accent-hover); }
.linklike[disabled] { color: var(--faint); text-decoration: none; cursor: default; }

/* ---------- Waitlist status pages (confirm, unsubscribe) ---------- */
/* Short pages: keep the footer at the bottom instead of mid-screen. */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
.status .container { max-width: 620px; }
.status-icon { color: var(--accent); }
.status .doc-head { gap: 12px; }
.status-form { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 28px; }
.status-form .input { max-width: 340px; }
.status-note { font-size: 15px; }
/* Honeypot: off-screen for people, tempting for naive bots. */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .section { padding-block: 64px; }
  .legal { padding-block: 32px 64px; }
  .doc-toc ol { columns: 1; }
  .site-nav { display: none; }
  .hero .container { flex-direction: column; align-items: flex-start; gap: 40px; padding-block: 40px 64px; }
  .hero-art { flex: 0 0 auto; max-width: 420px; }
  .steps { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .lab .container { flex-direction: column; }
  .lab-points { flex: 1 1 auto; width: 100%; }
  .join .container { flex-direction: column; }
  .join-form { flex: 1 1 auto; width: 100%; }
}
@media (max-width: 560px) {
  .btn-hero { width: 100%; }
  .legal h2 { font-size: 23px; margin-top: 44px; }
  .doc-summary, .doc-toc { padding: 22px 20px; }
  .btn-nav { padding: 10px 12px; font-size: 13px; }
  .site-header .container { padding-inline: 16px; gap: 10px; }
  .header-actions { gap: 8px; }
  .wordmark { font-size: 20px; }
  .lang-menu summary { padding: 8px 10px; }
  .lang-menu .lang-code { display: none; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}
