:root {
  color-scheme: light;
  --bg: #fafaf7;
  --bg-alt: #f2f2ec;
  --surface: #ffffff;
  --ink: #15171c;
  --muted: #555a66;
  --line: #e2e2da;
  --accent: #2b45e8;
  --accent-strong: #1f35c4;
  --accent-soft: #eceffe;
  --on-accent: #ffffff;
  --disabled-bg: #e4e4dd;
  --disabled-ink: #5e626c;

  --font: "IBM Plex Sans", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-th: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 20px;
  --radius: 14px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.i18n-pending body { visibility: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
}
html:lang(th) body {
  font-family: var(--font-th);
  line-height: 1.75;
}

.nw { white-space: nowrap; }

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
html:lang(th) :is(h1, h2, h3) { line-height: 1.4; letter-spacing: 0; }
p, ul, ol { margin: 0; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 860px; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}
.skip:focus { top: 12px; color: #fff; }

/* Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.logo > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 13px;
}
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 16px; font-weight: 500; }
.nav a:hover { color: var(--ink); }

.lang-switch {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch button {
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 14px/1 var(--font);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 12px;
  border: 2px solid transparent;
  font: 600 17px/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
html:lang(th) .btn { font-family: var(--font-th); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:disabled { background: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* Первый экран */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 112px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}
.eyebrow {
  margin-bottom: 20px;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
html:lang(th) .eyebrow { letter-spacing: 0; font-size: 16px; }
h1 { font-size: clamp(44px, 7.2vw, 88px); line-height: 1.02; letter-spacing: -0.035em; }
html:lang(th) h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.3; }
h1 .accent { display: block; color: var(--accent); }
.lead {
  max-width: 34em;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(19px, 1.9vw, 22px);
}
.hero-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
  font-weight: 500;
  font-size: 17px;
}
.hero-facts li { position: relative; padding-left: 22px; }
.hero-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-note { margin-top: 16px; color: var(--muted); font-size: 15px; }

/* Обложка */
.hero-cover { display: flex; justify-content: center; }
.cover {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 210 / 297;
  container-type: inline-size;
}
.cover::before {
  /* Край следующих страниц — намёк на документ, без лишнего декора. */
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(14px, 14px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.cover-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 9cqi 8cqi 7cqi;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 24px 48px -24px rgba(31, 53, 196, 0.55);
  overflow: hidden;
}
.cover-kicker {
  font-size: 3.6cqi;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
html:lang(th) .cover-kicker { letter-spacing: 0.02em; font-size: 4.2cqi; }
.cover-title {
  margin-top: 9cqi;
  font-size: 13.5cqi;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}
.cover-title span { display: block; }
.cover-title-sub { color: #dfe4ff; }
html:lang(th) .cover-title-sub { font-size: 10.4cqi; line-height: 1.45; letter-spacing: 0; margin-top: 2cqi; }
.cover-sub { margin-top: 5cqi; font-size: 4.6cqi; line-height: 1.4; opacity: 0.92; max-width: 26ch; }
.cover-term {
  display: flex;
  flex-direction: column;
  gap: 1.4cqi;
  margin-top: auto;
  padding: 5cqi;
  border-radius: 2.4cqi;
  background: rgba(10, 18, 80, 0.32);
  font-family: var(--mono);
  font-size: 3.9cqi;
}
.cover-term code { font: inherit; white-space: nowrap; }
.cover-term .ok { color: #b9f5c9; }
.cover-term .dots { display: flex; gap: 1.4cqi; margin-bottom: 1.6cqi; }
.cover-term .dots i { width: 2.2cqi; height: 2.2cqi; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
.cover-foot {
  display: flex;
  justify-content: space-between;
  gap: 4cqi;
  margin-top: 6cqi;
  padding-top: 4cqi;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 3.5cqi;
  font-weight: 500;
}
.cover-foot span:last-child { flex: none; white-space: nowrap; }
.cover-legal { margin-top: 2.5cqi; font-size: 2.9cqi; opacity: 0.75; }

/* Секции */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-num {
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 15px;
}
h2 { font-size: clamp(34px, 4.6vw, 54px); }
html:lang(th) h2 { font-size: clamp(30px, 4vw, 46px); }
h3 { font-size: 22px; letter-spacing: -0.01em; }
.section-intro { margin-top: 18px; color: var(--muted); font-size: 19px; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panel {
  padding: clamp(24px, 3.2vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel-muted { background: transparent; }
.panel h3 { margin-bottom: 20px; }
.panel > p { color: var(--muted); }

.check-list, .dash-list { display: grid; gap: 14px; padding: 0; list-style: none; }
.check-list li, .dash-list li { position: relative; padding-left: 34px; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%232B45E8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.dash-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.8em;
  width: 14px;
  height: 2px;
  background: var(--ink);
}

/* Результаты */
.outcomes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 0;
  list-style: none;
  counter-reset: outcome;
}
.outcomes li {
  counter-increment: outcome;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.outcomes li::before {
  content: counter(outcome, decimal-leading-zero);
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 15px;
}
.outcomes h3 { margin-bottom: 10px; font-size: 21px; }
.outcomes p { color: var(--muted); font-size: 17px; }

/* Программа */
.program { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.program li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 104px;
  align-items: center;
  gap: 8px 20px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}
.p-num { color: var(--muted); font-family: var(--mono); font-size: 15px; }
.p-title { font-size: 19px; font-weight: 500; }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.p-pages { color: var(--muted); font-size: 15px; text-align: right; white-space: nowrap; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-snap { border-color: transparent; background: var(--accent-soft); color: var(--accent-strong); }

/* Проекты */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
}
.project-meta { color: var(--accent-strong); font-family: var(--mono); font-size: 14px; }
html:lang(th) .project-meta { font-family: var(--font-th); font-weight: 600; }
.project h3 { font-size: 24px; }
.project p { color: var(--muted); font-size: 17px; }
.project .project-learn {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
}

/* Что входит */
.file-badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.langs { margin-top: 48px; }
.langs h3 { margin-bottom: 16px; }
.lang-list { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.lang-list li {
  display: grid;
  grid-template-columns: 56px 160px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 20px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.lang-code { font-family: var(--mono); font-size: 15px; color: var(--accent-strong); }
.lang-name { font-weight: 600; }
.lang-book { color: var(--muted); }
.lang-format { color: var(--muted); font-size: 15px; white-space: nowrap; }
.note { margin-top: 16px; color: var(--muted); font-size: 16px; }
.notice {
  display: grid;
  gap: 10px;
  margin-top: 40px;
  padding: 24px 28px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  font-size: 17px;
}

/* Цена */
.price-card {
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 56px);
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--ink);
  text-align: center;
}
.price-name { margin-top: 10px; color: var(--muted); }
.price-value {
  margin-block: 22px 28px;
  font-size: clamp(44px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.price-value.is-tba { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); }
.price-list { text-align: left; max-width: 440px; margin: 0 auto 32px; }
.buy-slot { display: contents; }
.buy-slot-wide .btn { width: 100%; }
.price-foot { margin-top: 16px; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 22px 48px 22px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 16px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 16px no-repeat;
}
.faq details[open] summary::after { background: linear-gradient(var(--accent), var(--accent)) center / 16px 2px no-repeat; }
.faq summary:hover { color: var(--accent-strong); }
.faq details p { padding-bottom: 24px; max-width: 46em; color: var(--muted); }

/* Подвал */
.site-footer {
  padding-block: 56px 32px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 16px;
  color: var(--muted);
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 32px; }
.footer-title { margin-bottom: 12px; color: var(--ink); font-weight: 600; }
.legal-list { display: grid; gap: 6px; padding: 0; list-style: none; }
.is-missing, .missing-hint { color: #7a7e88; }
.missing-hint { font-style: italic; }
.contact-line { display: block; }
.seller { margin-top: 12px; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }

/* Планшет */
@media (max-width: 960px) {
  .nav { display: none; }
  .lang-switch { margin-left: auto; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-cover { order: 2; }
  .cover { max-width: 320px; }
  .outcomes, .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :last-child { grid-column: 1 / -1; }
}

/* Телефон */
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 58px; }
  body { font-size: 17px; }
  .logo { font-size: 15px; gap: 8px; }
  .logo-mark { width: 28px; height: 28px; font-size: 12px; }
  .lang-switch button { min-width: 40px; padding: 0 8px; font-size: 13px; }
  .hero-facts { grid-template-columns: minmax(0, 1fr); }
  .cta-row .btn { width: 100%; }
  .cover { max-width: 280px; }
  .two-col, .outcomes, .projects, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .program li { grid-template-columns: 36px minmax(0, 1fr) auto; align-items: baseline; padding-block: 16px; }
  .p-title { grid-column: 2 / 4; }
  .p-tags { grid-column: 2; justify-content: flex-start; }
  .p-pages { grid-column: 3; }
  .p-title { font-size: 18px; }
  .lang-list li { grid-template-columns: 40px minmax(0, 1fr); }
  .lang-book, .lang-format { grid-column: 2; }
  .faq summary { font-size: 18px; }
  .notice { padding: 20px; }
}

/* Очень узкие экраны: оставляем в шапке только знак, чтобы переключатель языка помещался. */
@media (max-width: 360px) {
  .logo > span:last-child { display: none; }
}
