:root {
  color-scheme: light;
  --paper: #f9f8f1;
  --ink: #182d24;
  --muted: #495e51;
  --forest: #214b39;
  --rule: #d3d9cd;
  --note: #eff1e5;
  font: 100%/1.55 "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, figure, h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
a { color: var(--forest); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #497a37; outline-offset: 4px; }
::selection { background: #d9edab; color: var(--ink); }
.skip { position: absolute; top: 1rem; left: 1rem; transform: translateY(-200%); z-index: 2; background: var(--paper); padding: .7rem; }
.skip:focus { transform: none; }
.wrap { width: min(1060px, calc(100% - 64px)); margin-inline: auto; }
.header { display: flex; align-items: center; gap: 24px; min-height: 72px; border-bottom: 1px solid var(--rule); }
.header nav { display: flex; gap: 23px; margin-left: auto; }
.header a { text-decoration: none; }
.header nav a:hover { text-decoration: underline; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; }
.brand svg { width: 30px; fill: var(--forest); flex: none; }
.brand path { fill: none; stroke: #fff; stroke-width: 2; }
.demo-label { color: var(--muted); font-size: .8rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: clamp(36px, 8vw, 110px); padding-block: 76px 82px; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
h1 { font-size: clamp(2.55rem, 5.4vw, 4.65rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.45rem); margin-bottom: 20px; }
h3 { font-size: 1.15rem; line-height: 1.3; margin-bottom: 6px; }
.hero-name { margin-top: 18px; color: var(--forest); font-weight: 700; }
.hero-description { margin-top: 12px; max-width: 47ch; color: var(--muted); }
.hero-price { margin-block: 19px 13px; font-variant-numeric: tabular-nums; }
.hero-note { margin-top: 9px; color: var(--muted); font-size: .87rem; max-width: 38ch; }
.button { display: inline-flex; align-items: center; gap: 15px; padding: 10px 16px; min-height: 46px; border: 1px solid var(--forest); border-radius: 5px; background: var(--forest); color: white; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.button:hover { background: #173b2b; }
.portrait { width: 100%; max-width: 355px; justify-self: end; padding: 10px 10px 9px; background: #fff; border: 1px solid #d8dfd2; transform: rotate(2deg); }
.portrait img { display: block; width: 100%; height: auto; }
.portrait figcaption { margin-top: 8px; color: var(--muted); font-size: .8rem; }
.program, .example, .price, .faq { border-top: 1px solid var(--rule); padding-block: 53px; }
.topics { max-width: 810px; }
.topics article { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 18px; padding-block: 15px; border-bottom: 1px solid var(--rule); }
.topics h3 { font: 400 1.35rem/1.2 Georgia, serif; color: var(--forest); }
.topics p, .example p, .price p, .faq p, .contact p { color: var(--muted); }
.example, .price, .faq, .lesson-inner, .contact { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: clamp(24px, 8vw, 90px); }
.diagram { background: var(--note); padding: clamp(16px, 4vw, 30px); }
.diagram figcaption { color: #495e51; font-size: .8rem; margin-bottom: 9px; }
.diagram h3 { font: 400 clamp(1.45rem, 3vw, 2rem)/1.15 Georgia, serif; }
.fraction-row { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 9px; font-variant-numeric: tabular-nums; }
.fraction-row.total { margin-bottom: 13px; font-weight: 700; }
.fraction { height: 20px; border: 1px solid #638170; background-image: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), #638170 calc(100% / 6 - 1px) calc(100% / 6)), linear-gradient(90deg, #c6df87 var(--filled), transparent var(--filled)); }
.lesson { background: #e8eee4; padding-block: 53px; }
.lesson p { color: var(--muted); }
.lesson ol { margin: 0; padding-left: 1.4rem; }
.lesson li { padding: 0 0 14px 7px; }
.lesson li + li { padding-top: 14px; border-top: 1px solid #cbd7c8; }
.lesson li::marker { color: var(--forest); font-weight: 700; }
.price-box { align-self: start; padding-left: 20px; border-left: 1px solid #9bac9d; }
.price-box .amount { font: 400 clamp(2.5rem, 6vw, 4rem)/1 Georgia, serif; color: var(--forest); }
.price-box .button { margin-top: 13px; }
details { border-top: 1px solid var(--rule); }
details:last-child { border-bottom: 1px solid var(--rule); }
summary { padding-block: 12px; font-weight: 650; cursor: pointer; }
details p { padding-bottom: 13px; }
.contact-section { background: var(--note); }
.contact { padding-block: 54px; }
.telegram-contact { align-self: center; }
.telegram-button:disabled { background: var(--forest); color: #fff; opacity: 1; cursor: default; }
.telegram-contact .demo { margin-top: 9px; font-size: .875rem; }
.footer { display: flex; justify-content: space-between; gap: 15px; padding-block: 17px; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 40px); }
  .header { flex-wrap: wrap; gap: 4px 12px; padding-block: 9px; }
  .header nav { order: 3; width: 100%; margin-left: 0; font-size: .875rem; gap: 18px; }
  .header nav a { display: flex; align-items: center; min-height: 44px; }
  .demo-label { margin-left: auto; }
  .hero, .example, .price, .faq, .lesson-inner, .contact, .topics article { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 24px; padding-block: 25px 36px; }
  h1 { font-size: clamp(2rem, 7.8vw, 3.5rem); line-height: 1.12; text-wrap: balance; }
  h1 br { display: none; }
  h2 { font-size: clamp(1.85rem, 6vw, 2.6rem); line-height: 1.13; text-wrap: balance; margin-bottom: 14px; }
  .hero-name { margin-top: 12px; font-size: .95rem; text-wrap: pretty; }
  .hero-description { margin-top: 10px; max-width: 50ch; }
  .hero-price { margin-block: 16px 12px; }
  .hero-note { max-width: 50ch; font-size: .9rem; }
  .portrait { justify-self: start; max-width: 275px; transform: none; }
  .program, .example, .price, .faq, .lesson, .contact { padding-block: 32px; }
  .example, .price, .faq, .lesson-inner, .contact { gap: 17px; }
  .topics article { gap: 4px; }
  .topics h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 0; }
  .diagram h3 { font-size: 1.5rem; line-height: 1.2; }
  .fraction-row { grid-template-columns: 4.8rem minmax(0, 1fr); font-size: .9rem; }
  .faq h2 { margin-bottom: 0; }
}
