/* ДоУма — public pages and shared control styles. */
body { color: var(--ink); background: var(--paper); font: 16px/1.6 var(--font); }
button, input, select, textarea { font-family: var(--font); }
h1, h2, h3, .btn { font-family: var(--display); }
h1, h2, h3 { letter-spacing: -.035em; text-wrap: balance; }
h1[tabindex="-1"]:focus { outline: none; }
a { text-underline-offset: 5px; text-decoration-thickness: 1px; }
::selection { color: var(--ink); background: var(--peach); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
input, select, textarea { caret-color: var(--action); }
input[type=checkbox], input[type=radio] { accent-color: var(--action); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: #a89c8e; border-color: var(--paper); }
.btn { min-height: 52px; padding: 13px 22px; border-radius: var(--control-radius); border-color: var(--orange); background: var(--orange); color: var(--navy); font-size: 16px; font-weight: 800; transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.btn:hover:not(:disabled) { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.small { min-height: 44px; }
.btn.secondary { color: var(--ink); background: var(--white); border-color: var(--control-line); }
.btn.secondary:hover:not(:disabled) { background: var(--soft); border-color: var(--action); }
.btn.danger { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.danger:hover:not(:disabled) { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.danger-quiet { color: var(--red); background: transparent; border-color: #bd8787; }
.btn.danger-quiet:hover:not(:disabled) { background: #fff3f3; border-color: var(--red); }
.btn:disabled { transform: none; cursor: not-allowed; opacity: .57; }
.text-link { color: var(--action); }
.skip-link { border-radius: var(--control-radius); }

.brand, .footer-wordmark, .child-wordmark { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); font-size: 30px; line-height: 1; text-decoration: none; text-transform: none; }
.brand > .brand-mark, .footer-wordmark > .brand-mark, .child-wordmark > .brand-mark { background: none; }
.public-header, .account-header, .trial-header, .tutor-hero, .auth-intro, .home-close { --focus: var(--focus-on-dark); }
.public-header .brand, .account-header .brand { color: var(--cream); }
.public-header .brand-mark { display: block; }
:is(.public-header, .account-header, .trial-header) .brand-accent { color: var(--orange); }
.public-header { width: 100%; max-width: none; margin: 0; min-height: var(--public-header-height); padding: 12px max(var(--page-gutter), calc((100% - var(--page-width))/2)); gap: 24px; color: var(--cream); background: var(--navy); border-bottom: 1px solid #354464; }
.public-header nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }
.public-header nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.public-header nav a:hover { color: var(--gold); }
.public-header .nav-login { min-width: 94px; justify-content: center; padding: 8px 16px; border: 1px solid #8090ad; border-radius: var(--control-radius); }
.public-header .nav-login:hover { border-color: var(--gold); }
.footer { max-width: none; margin: 0; padding: 24px max(var(--page-gutter), calc((100% - var(--page-width))/2)); display: flex; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); background: var(--paper); }
.footer-wordmark { font-size: 23px; }
.footer-wordmark .brand-mark { width: 30px; height: 30px; }
.footer p { margin-top: 4px; font-size: 13px; }
.footer nav { display: flex; align-items: center; gap: 24px; }
.footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
.footer nav a:hover { color: var(--action); }

/* The mascot and one real, explicitly scripted interaction form the opening scene. */
.tutor-home { margin: 0; }
.tutor-hero { padding: clamp(46px, 6.2vw, 96px) var(--page-gutter) clamp(48px, 6vw, 88px); background: var(--navy); color: var(--cream); }
.hero-layout { max-width: var(--page-width); min-height: 490px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); align-items: center; gap: clamp(20px, 5vw, 74px); }
.hero-invitation { align-self: start; min-width: 0; padding-block-start: clamp(4px, 2.3vw, 36px); }
.hero-invitation h1 { font-size: clamp(44px, 6.45vw, 94px); line-height: .99; font-weight: 800; text-wrap: initial; letter-spacing: -.04em; }
.hero-invitation h1 span, .hero-invitation h1 em { display: block; }
.hero-invitation h1 em { color: var(--orange); font-style: normal; }
.hero-description { margin-top: 26px; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.62; max-width: 44ch; color: var(--on-dark-muted); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 28px; }
.hero-action { min-height: 54px; }
.hero-example-link, .home-text-link { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.hero-example-link { color: var(--cream); }
.hero-example-link:hover { color: var(--gold); }
.hero-example-link .icon { width: 17px; height: 17px; transform: rotate(90deg); }
.hero-fineprint { color: var(--on-dark-muted); font-size: 12px; line-height: 1.6; margin-top: 18px; }
.hero-scene { position: relative; isolation: isolate; display: grid; align-items: start; min-width: 0; }
.hero-scene > * { grid-area: 1 / 1; }
.hero-orbit { position: absolute; z-index: -1; inset: 9% 0 auto 13%; width: 85%; aspect-ratio: 1; border: 1px solid #354464; border-radius: 50%; background: var(--academic); }
.hero-orbit::before { content: ''; position: absolute; inset: 7%; border-radius: inherit; border: 1px solid #4a5a7b; }
.hero-orbit::after, .hero-orbit span { content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.hero-orbit::after { top: 15%; left: 12%; }
.hero-orbit span { top: 65%; right: 2%; width: 6px; height: 6px; background: #a5b3cf; }
.hero-owl { justify-self: end; display: block; width: min(74%, 370px); height: auto; margin-right: 3%; filter: drop-shadow(0 23px 18px #080e2466); }
.conversation-preview { --focus: #a04a06; position: relative; z-index: 1; align-self: end; justify-self: start; width: min(67%, 324px); min-width: 250px; margin-top: clamp(190px, 24vw, 321px); color: var(--ink); background: var(--cream); border: 1px solid var(--line); border-radius: 17px; padding: 16px; box-shadow: 0 16px 34px #080e245c; overflow-wrap: anywhere; }
.preview-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.preview-heading h2 { font-size: 18px; line-height: 1.25; text-wrap: initial; }
.preview-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; background: var(--peach); color: var(--ink); border-radius: 10px; }
.preview-icon .icon { width: 19px; height: 19px; }
.preview-disclosure { color: var(--muted); margin-top: 4px; font-size: 11px; line-height: 1.4; }
.preview-turn { padding: 8px 12px; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.preview-turn > span { color: var(--action); font-size: 11px; font-weight: 700; }
.preview-turn p { margin: 2px 0 0; font-size: 14px; line-height: 1.42; }
.pupil-turn { margin-left: 17px; background: var(--sand); }
.pupil-turn > span { color: var(--muted); }
.preview-continuation { margin-top: 10px; border-top: 1px solid var(--line); }
.preview-continuation > summary { list-style: none; display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 3px 3px; font-size: 13px; cursor: pointer; color: var(--action); font-weight: 700; }
.preview-continuation > summary::-webkit-details-marker { display: none; }
.preview-continuation > summary:hover { text-decoration: underline; }
.preview-continuation > summary .icon { width: 16px; height: 16px; transition: transform .22s var(--ease); }
.preview-continuation[open] > summary .icon { transform: rotate(90deg); }
.preview-continuation { overflow: clip; }
.preview-continuation :focus-visible { outline-offset: -3px; }
.preview-next { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; color: var(--action); font-size: 13px; font-weight: 700; }
.preview-next .icon { width: 16px; height: 16px; }

.home-section-content { max-width: 1160px; width: 100%; margin: auto; }
.home-format, .home-parents, .home-reports, .home-questions { padding: clamp(48px, 7vw, 112px) var(--page-gutter); border-bottom: 1px solid var(--line); }
.home-split { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); align-items: start; gap: clamp(32px, 8vw, 116px); }
.home-section-content h2 { font-size: clamp(32px, 3.65vw, 55px); line-height: 1.08; font-weight: 800; text-wrap: initial; }
.home-section-content h2 + p { font-size: clamp(16px, 1.4vw, 19px); margin-top: 20px; max-width: 48ch; color: var(--muted); }
.home-text-link { color: var(--action); margin-top: 14px; }
.home-text-link .icon { width: 19px; height: 19px; }
.home-format { background: var(--paper); }
.lesson-sequence { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lesson-sequence li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; padding-block: 19px; border-bottom: 1px solid var(--line); }
.lesson-sequence li > span { padding-top: 1px; color: var(--action); font-variant-numeric: tabular-nums; font-weight: 700; }
.lesson-sequence h3, .subject-list h3 { font-size: clamp(20px, 2.1vw, 31px); text-wrap: initial; }
.lesson-sequence p, .subject-list p { margin-top: 6px; color: var(--muted); }
.home-parents { background: var(--sand); }
.courses-heading { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: end; gap: 36px; }
.courses-heading h2 + p { margin-top: 0; }
.subject-list { margin-top: 36px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-block: 1px solid #c9b9a5; }
.subject-list article { display: flex; gap: 20px; align-items: flex-start; padding: 28px 26px 28px 0; }
.subject-list article + article { border-left: 1px solid #c9b9a5; padding-inline: 32px 0; }
.subject-list .icon { width: 34px; height: 34px; padding: 5px; color: var(--action); }
.home-reports { background: var(--paper); }
.report-sample { padding: clamp(18px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 14px 28px #101a350a; }
.report-sample-header { display: flex; gap: 12px; align-items: center; font: 800 18px/1.4 var(--display); }
.report-sample-header .icon { color: var(--action); }
.report-sample dl { margin: 15px 0; }
.report-sample dl div { padding-block: 12px; border-top: 1px solid var(--line); }
.report-sample dt { font-size: 15px; font-weight: 700; }
.report-sample dd { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.report-sample > p { color: var(--muted); background: var(--soft); padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.home-questions { background: var(--white); }
.home-faq { border-top: 1px solid var(--line); }
.home-faq details { border-bottom: 1px solid var(--line); }
.home-faq summary { cursor: pointer; min-height: 56px; padding: 16px 4px; font-family: var(--display); font-size: 17px; font-weight: 800; }
.home-faq summary:hover { color: var(--action); }
.home-faq p { padding: 0 4px 20px; font-size: 15px; max-width: 65ch; color: var(--muted); }
.home-close { background: var(--navy); color: var(--cream); padding: clamp(40px, 6vw, 84px) var(--page-gutter); }
.home-close .home-section-content { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.home-close .home-section-content p { color: var(--on-dark-muted); }
.home-close .btn { flex: none; }

/* Forms and text pages keep the same typography and controls on a quieter canvas. */
.auth-layout { max-width: 1280px; padding: clamp(28px, 4vw, 56px) var(--page-gutter) 56px; gap: clamp(24px, 4vw, 56px); align-items: stretch; min-height: calc(100svh - 190px); }
.auth-intro { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: clamp(24px, 4vw, 52px); background: var(--academic); color: var(--cream); border-radius: 20px; }
.auth-intro h2 { font-size: clamp(30px, 3.3vw, 50px); line-height: 1.06; font-weight: 800; }
.auth-intro > p { color: var(--on-dark-muted); font-size: 16px; max-width: 44ch; }
.auth-study-note { display: flex; align-items: center; gap: 10px; margin-top: 20px; margin-bottom: 24px; font-size: 13px; font-weight: 700; }
.auth-study-note .icon { color: var(--gold); width: 18px; height: 18px; }
.auth-intro .local-note { flex: 1; display: flex; align-items: end; margin: 38px 0 0; color: var(--on-dark-muted); font-size: 12px; max-width: calc(100% - 128px); }
.auth-owl { position: absolute; z-index: -1; bottom: -14px; right: 17px; width: min(29%,138px); height: auto; }
.auth-form-panel { padding: clamp(22px, 3.2vw, 42px); border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 16px 34px #101a350a; }
.auth-form-panel h1 { font-size: clamp(24px, 2.6vw, 36px); font-weight: 800; }
.auth-form-panel > .muted { margin-top: 8px; font-size: 14px; line-height: 1.6; }
form label:not(.answer-choice) { font-size: 14px; }
input:not([type=checkbox],[type=radio]), select, textarea { min-height: 48px; border: 1px solid var(--control-line); border-radius: var(--control-radius); color: var(--ink); background: var(--white); font-size: 16px; }
form .checkbox-label { font-size: 13px !important; }
.field-note#password-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-switch { font-size: 14px; }
.subtle-link { min-height: 44px; display: grid; align-items: center; font-size: 13px; }
.notice { color: var(--ink); background: var(--soft); border-color: #cfb18b; border-radius: var(--control-radius); }
.form-error { color: #8b2929; background: #fff3f3; border-color: #d8aaaa; }
.reading-page { max-width: 1040px; margin: 40px auto 56px; padding: 40px 48px 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.reading-page h1 { font-size: clamp(30px, 3.8vw, 48px); }
.reading-page > .lead { font-size: 19px; color: var(--muted); margin-top: 24px; }
.reading-page h2 { margin: 40px 0 16px; font-size: 27px; }
.reading-page > p { font-size: 16px; max-width: 74ch; }
.feature-table { margin-top: 32px; border-top: 1px solid var(--line); }
.feature-table > div { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 24px; padding: 24px 0; border-color: var(--line); background: transparent; }
.feature-table > div:first-child { background: var(--soft); padding: 16px; margin-bottom: 0; }
.feature-table strong, .feature-table p { color: var(--ink); font-size: 16px; }
.source-list { padding-left: 20px; font-size: 14px; overflow-wrap: anywhere; }
.source-list li { margin-bottom: 12px; }
.boot, .loading-state { color: var(--ink); }

@media (max-width: 1088px) { .reading-page { margin-inline: var(--page-gutter); } }
@media (max-width: 880px) {
  .hero-layout { min-height: 0; }
  .hero-invitation h1 { font-size: clamp(42px, 7vw, 63px); }
  .hero-scene { align-self: center; }
  .hero-owl { width: min(84%, 319px); }
  .conversation-preview { margin-top: clamp(190px, 30vw, 254px); }
  .auth-layout { gap: 22px; }
  .auth-intro .local-note { max-width: calc(100% - 68px); }
}
@media (max-width: 700px) {
  .public-header { gap: 12px; }
  .public-header .brand { font-size: 26px; gap: 7px; }
  .public-header .brand-mark { display: block; width: 32px; height: 32px; }
  .public-header .public-how { display: none; }
  .public-header nav { gap: 14px; }
  .public-header nav a { font-size: 13px; }
  .public-header .nav-login { min-width: 0; padding-inline: 12px; }
  .tutor-hero { padding-top: 34px; padding-bottom: 38px; }
  .hero-layout { grid-template-columns: 1fr; max-width: 500px; gap: 28px; }
  .hero-description { margin-top: 19px; }
  .hero-actions { margin-top: 18px; }
  .hero-actions .hero-action { width: auto; min-height: 48px; padding-inline: 13px; font-size: 14px; gap: 8px; }
  .hero-actions .hero-action .icon { width: 17px; height: 17px; }
  .hero-example-link { font-size: 13px; }
  .hero-fineprint { margin-top: 10px; }
  .hero-orbit { inset: 4% 0 auto auto; width: min(85%, 340px); }
  .hero-owl { width: min(64%, 300px); margin-right: 0; }
  .conversation-preview { margin-top: clamp(157px, 47vw, 245px); width: min(73%, 310px); min-width: 0; }
  .home-split, .courses-heading { grid-template-columns: 1fr; gap: 24px; }
  .subject-list { grid-template-columns: 1fr; margin-top: 24px; }
  .subject-list article { padding: 18px 0; gap: 12px; }
  .subject-list article + article { border: 0; border-top: 1px solid #c9b9a5; padding-inline: 0; }
  .home-close .home-section-content { flex-direction: column; align-items: flex-start; }
  .auth-layout { grid-template-columns: 1fr; max-width: 590px; }
  .auth-intro h2 { font-size: clamp(28px, 6vw, 42px); }
  .auth-intro > h2 + p { display: none; }
  .auth-study-note { margin-block: 12px 0; }
  .auth-intro .local-note { margin-top: 14px; max-width: calc(100% - 74px); }
  .auth-owl { right: 10px; width: min(24%,100px); }
  .reading-page { padding: 24px var(--page-gutter); }
  .reading-page > .lead { font-size: 17px; }
  .feature-table > div { grid-template-columns: 1fr; gap: 8px; }
  .feature-table > div:first-child { display: none; }
}
@media (max-width: 400px) {
  .hero-actions { align-items: center; gap: 0 12px; }
  .hero-owl { width: 64%; }
  .auth-owl { display: none; }
  .auth-intro .local-note { max-width: 100%; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer nav { flex-wrap: wrap; gap: 0 18px; }
}
@media (max-width: 360px) {
  .public-header .public-courses { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .preview-continuation > summary .icon { transition: none; }
  .preview-continuation[open] > .preview-turn { animation: none; }
}
