:root {
  --stage: #291747;
  --stage-deep: #211139;
  --stage-rule: #735b95;
  --stage-text: #eee8fa;
  --paper: #faf8f2;
  --lime: #d7fa73;
  --lilac: #e8def9;
  --technical: ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 5px;
  --section-space: clamp(60px, 7vw, 104px);
}

.header { border-bottom-color: #d4cddd; }
.header__inner { min-height: var(--header-h); }
.header__cta-mobile { display: none; }
.nav__link { white-space: nowrap; }
.language-bar { padding-block: 3px; }
.language-bar .languages { gap: 4px; }
.language-bar .languages a { min-height: 40px; }
.header--localized .nav { margin-left: auto; }

.hero--stage { padding-block: clamp(24px, 2.75vw, 46px) clamp(20px, 3vw, 40px); color: var(--stage-text); background: var(--stage); --focus: var(--lime); }
.hero__stage { position: relative; isolation: isolate; display: grid; justify-items: center; text-align: center; gap: 20px; margin-bottom: clamp(22px, 2.35vw, 34px); padding: clamp(12px, 1.65vw, 25px) clamp(12px, 4vw, 62px); }
.hero__stage::before, .hero__stage::after,
.subject-page__intro::after {
  content: ''; position: absolute; width: clamp(28px, 7vw, 110px); aspect-ratio: 1;
  border: solid var(--stage-rule); border-width: 1px 0 0 1px; pointer-events: none;
}
.hero__stage::before { left: 0; top: 0; }
.hero__stage::after, .subject-page__intro::after { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.hero__stage .h1 {
  max-width: 17ch; color: var(--white); font-size: clamp(40px, 6.15vw, 99px);
  line-height: .99; letter-spacing: -.058em; text-wrap: balance;
}
.hero__subtitle { max-width: 50ch; font-size: clamp(16px, 1.38vw, 21px); text-wrap: pretty; }
.hero__actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px 26px; }
.hero__actions .link-underline { color: var(--white); }
.subject-jump {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 164px), 1fr));
  gap: 1px; padding: 1px; background: var(--stage-rule);
}
.subject-jump a {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px;
  align-items: center; min-height: 58px; padding: 9px 12px;
  background: var(--stage-deep); color: var(--white); font-size: 14px; font-weight: 800; text-decoration: none;
  transition: background-color .18s, color .18s;
}
.subject-jump a:hover, .subject-jump a:focus-visible { background: var(--lime); color: var(--ink); }
.subject-jump a:focus-visible { outline-offset: -3px; outline-color: var(--ink); }
.subject-jump .study-graphic { background: transparent; color: var(--lime); }
.subject-jump .study-graphic path { stroke-width: 1.15; vector-effect: non-scaling-stroke; }
.subject-jump a:is(:hover, :focus-visible) .study-graphic { color: var(--ink); }
.study-graphic { display: grid; place-items: center; color: var(--ink); }
.study-graphic svg { display: block; width: 86%; height: auto; max-width: 230px; }
.jump-arrow { font-size: 16px; }
.checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; padding-top: 16px; font-size: 13px; }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks svg { color: var(--lime); }
.checks li:not(:has(svg))::before { content: ''; width: 5px; height: 5px; flex: 0 0 5px; background: var(--lime); }

.catalog-heading { margin-bottom: 30px; }
.subject-index { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: var(--grid-space); align-items: start; }
.subject-index__rows { border-top: 1px solid var(--line); }
.subject-row {
  display: grid; grid-template-columns: 65px minmax(0, 1fr) auto; gap: clamp(10px, 1.5vw, 25px);
  align-items: start; padding: 17px 9px 17px 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: 12px; transition: background-color .18s;
}
.subject-row:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.subject-row .study-graphic { align-self: start; width: 100%; aspect-ratio: 1; background: var(--lilac); }
.subject-row[data-subject="math"] .study-graphic { background: var(--lime); }
.subject-row__text { display: grid; gap: 6px; }
.subject-row__text p { max-width: 61ch; }
.subject-row > .more { min-width: max-content; padding-inline: 3px; font-size: 14px; }
.subject-index__panel {
  position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 12px; min-width: 0;
  background: var(--lilac); padding: clamp(18px, 2.3vw, 34px);
}
.subject-index__label { font-size: 13px; font-weight: 800; color: var(--violet); }
.subject-index__sample { display: none; grid-template-rows: 1fr auto; gap: 12px; text-decoration: none; font-size: clamp(17px, 1.8vw, 27px); font-weight: 800; line-height: 1.2; }
.subject-index__sample > span:last-child { display: flex; justify-content: space-between; gap: 10px; }
.subject-index__sample .study-graphic {
  background: var(--lime); aspect-ratio: 1.28; border: 1px solid var(--violet);
  position: relative; transition: background-color .2s;
}
.subject-index__sample .study-graphic::after { content:''; position:absolute; inset:9px; border:1px solid #8b9f4d; pointer-events:none; }
.subject-index__sample:hover .study-graphic { background: #edffa8; }
.subject-index__sample[data-active-sample], .subject-index__panel:not(:has([data-active-sample])) [data-default-sample] { display: grid; }
.dir-other { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) auto; gap: 15px 20px; align-items: center; margin-top: 28px; padding: 22px; background: var(--lilac); }
.dir-other .h3 { margin-bottom: 5px; }
.dir-other .btn { justify-self: start; }

#how { background: var(--stage); color: var(--stage-text); --focus: var(--lime); }
#how :is(.h2, .h4) { color: var(--white); }
#how .steps { grid-template-columns: minmax(0,1fr); border-color: var(--stage-rule); }
#how .step { grid-template-columns: clamp(52px, 7vw, 116px) minmax(130px, 1fr) minmax(0,2fr); padding: 18px 2px; gap: 12px 16px; align-items: center; border: 0; border-bottom: 1px solid var(--stage-rule); }
#how .step__top { display: none; }
#how .step__num { color: var(--lime); grid-column: 1; }
#how .step :is(.h4,p) { grid-column: auto; grid-row: 1; }
.localized-plan ol { display: grid; padding-top: 30px; counter-reset: stages; }
.localized-plan ol li { counter-increment: stages; display: flex; gap: 18px; padding: 15px 0; border-top: 1px solid var(--stage-rule); }
.localized-plan ol li::before { content: '0' counter(stages); color: var(--lime); font: 700 1rem/1.65 var(--technical); }

.chess-example { padding-block: clamp(34px, 6vw, 88px); background: var(--stage-deep); color: var(--stage-text); }
.chess-example__inner { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: var(--grid-space); align-items: center; }
.chess-example__photo { aspect-ratio: 1.32; overflow: hidden; background: var(--lilac); }
.chess-example__photo picture, .subject-page__image picture { display:block; width:100%; height:100%; }
.chess-example__photo img, .subject-page__image img { width: 100%; height: 100%; object-fit: cover; }
.chess-example__photo img { object-position: 50% 65%; }
.chess-example__text { display: grid; justify-items: start; gap: 14px; }
.chess-example__text .h2 { color: var(--white); font-size: clamp(30px, 3.8vw, 56px); }
.chess-example__text .study-graphic { width: 55px; aspect-ratio: 1; background: var(--lime); }
.chess-example__text .bar { width: min(100%,440px); }

#why .features { grid-template-columns: repeat(3,minmax(0,1fr)); }
#teachers { background: #eee8f8; }
.teachers { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 23px; }
.teacher { display: grid; grid-template-columns: minmax(125px,.78fr) minmax(0,1.22fr); gap: 12px; align-items: start; padding: 16px 0; border-top: 1px solid #b7a7ca; }
.teacher__photo { aspect-ratio: 4/5; }
.teacher:nth-child(1) .teacher__photo img { object-position: 53% 38%; }
.teacher:nth-child(2) .teacher__photo img { object-position: 50% 33%; }
.teacher:nth-child(3) .teacher__photo img { object-position: 52% 34%; }
.teacher:nth-child(4) .teacher__photo img { object-position: 48% 39%; }
.teacher__body { padding-block: 0; border-bottom: 0; }
.teacher__illustration { font-size: 10px; }
#progress { background: var(--stage); }
#formats .format--featured { background: #edf6cc; }
#reviews { background: #f1edf9; }
#reviews .reviews { grid-template-columns: 1.20fr 1fr .92fr; gap: clamp(12px, 3vw, 40px); }
#reviews .review:first-child blockquote { font-size: clamp(20px, 2.05vw, 30px); }
#faq .faq__icon { border-radius: 50%; }
#faq .faq__item summary { min-height: 57px; }
#lead { border-top: 0; background: var(--lilac); color: var(--text); --focus: #6243a2; }
#lead :is(.h1,.h2) { color: var(--ink); }
#lead .lead-grid__contacts a { color: var(--ink); }
#lead .form-card { background: var(--white); border: 1px solid #b6aac8; box-shadow: 9px 9px 0 #d0bfe9; }
#lead .form .btn--lime { background: var(--stage); color: var(--white); }
#lead .form .btn--lime:hover { background: var(--violet); }
#lead .form-success__icon { color: var(--ink); }
#contacts { scroll-margin-top: 10px; }
.footer { background: var(--stage-deep); }

.subject-page__mast { padding-block: clamp(35px, 5vw, 76px); background: var(--stage); color: var(--stage-text); --focus: var(--lime); }
.subject-page__intro { position: relative; display: grid; gap: 14px; justify-items: start; }
.subject-page__intro::after { right: var(--gutter); border-color: var(--stage-rule); }
.subject-page__intro .h1 { color: var(--white); font-size: clamp(42px, 7.4vw, 111px); width: min(100%, 19ch); text-wrap: pretty; }
.subject-page__intro .more { color: var(--stage-text); }
.subject-page__intro .more::before { content: '←'; }
.subject-page__intro .tags li { color: var(--stage-text); }
.subject-page__intro .btn { margin-top: 5px; }
.subject-page__body { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); align-items: start; gap: var(--grid-space); padding-block: clamp(22px,4vw,60px) var(--section-space); }
.subject-page__media { display: grid; grid-template-columns: 1fr clamp(50px, 8vw, 140px); align-items: stretch; }
.subject-page__media .study-graphic { background: var(--lime); grid-column: 2; grid-row: 1; }
.subject-page__image { grid-column: 1; grid-row: 1; overflow: hidden; aspect-ratio: 1.49; background: var(--lilac); }
.subject-page__details { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 15px; }

@media (max-width: 1170px) {
  .nav__link { white-space: normal; }
}
@media (max-width: 1060px) {
  .header__inner { gap: 10px; justify-content: start; }
  .header__cta-mobile { display: inline-flex; min-height: 44px; margin-left: auto; padding: 8px 12px; font-size: 13px; }
  .js .burger { flex: 0 0 44px; }
  html:not(.js) .header { position: relative; }
  .header--localized .nav { margin-left: 0; }
}
@media (max-width: 860px) {
  .subject-index { grid-template-columns: minmax(0,1fr); }
  .subject-index__panel { display: none; }
  .dir-other { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  #why .features { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .teacher { grid-template-columns: minmax(0,1fr); }
  .teacher__photo { aspect-ratio: 1.04; }
  .subject-page__body { grid-template-columns: minmax(0,1fr); }
  .subject-page__image { aspect-ratio: 1.62; }
}
@media (max-width: 570px) {
  .hero--stage { padding-top: 24px; }
  .hero__stage { justify-items: start; text-align: left; padding: 14px 0 7px; gap: 14px; margin-bottom: 21px; }
  .hero__stage::before { top: 0; right: 0; left: auto; border-width: 1px 1px 0 0; }
  .hero__stage::after { display: none; }
  .hero__stage .h1 { font-size: clamp(36px, 9.5vw, 52px); letter-spacing: -.058em; text-wrap: pretty; }
  .hero__actions { justify-content: start; gap: 0 12px; }
  .hero__actions .btn { min-height: 48px; padding-inline: 12px; }
  .subject-jump { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .subject-jump a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .subject-jump a { min-height: 49px; grid-template-columns: 21px minmax(0,1fr); gap: 5px; padding: 6px; font-size: 13px; }
  .jump-arrow { display: none; }
  .checks { justify-content: start; gap: 6px 16px; }
  .subject-row { grid-template-columns: 43px minmax(0,1fr); gap: 8px 12px; }
  .subject-row > .more { grid-column: 2; min-height: 44px; justify-self: start; padding-inline: 0; }
  .dir-other, #why .features, #reviews .reviews, .chess-example__inner { grid-template-columns: minmax(0,1fr); }
  #how .step { grid-template-columns: 36px minmax(0,1fr); }
  #how .step .h4 { grid-column: 2; }
  #how .step p { grid-column: 2; grid-row: 2; }
  .teachers { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .teacher { grid-template-columns: minmax(102px, .45fr) minmax(0, 1fr); gap: 12px; padding-block: 14px 20px; }
  .teacher__photo { aspect-ratio: 4/5; }
  .teacher__illustration { left: 4px; bottom: 4px; padding-inline: 4px; font-size: 9px; }
  .teacher__body .more { min-height: 44px; }
  .subject-page__intro .h1 { font-size: clamp(36px, 11vw, 65px); }
  .subject-page__intro::after { bottom: auto; top: 0; border-width: 1px 1px 0 0; }
  #lead .form-card { box-shadow: 5px 5px 0 #d0bfe9; }
}
@media (max-width: 370px) {
  .header__cta-mobile { padding-inline: 7px; font-size: 12px; }
  .header__inner { gap: 7px; }
  .hero__stage .h1 { font-size: 35px; }
}

.header { background: var(--stage-deep); color: var(--stage-text); border-bottom-color: var(--stage-rule); --focus: var(--lime); }
.header .logo, .header .nav__link { color: var(--white); }
.header .logo__accent { color: var(--lime); }
.header .logo__tagline { color: var(--stage-text); }
.header__cta { background: var(--lime); color: var(--ink); }
.header__cta:hover { background: var(--lime-hover); color: var(--ink); }
.language-bar { background: var(--stage-deep); max-width: none; padding-inline: max(var(--gutter), calc((100% - var(--max-content)) / 2)); color: var(--stage-text); --focus: var(--lime); }
.language-bar .languages a { color: var(--stage-text); }
.language-bar .languages a[aria-current="page"] { color: var(--ink); background: var(--lime); box-shadow: none; }
.hero__stage::before, .hero__stage::after, .subject-page__intro::after {
  background: linear-gradient(var(--lime),var(--lime)) 9px 9px / 18px 4px no-repeat,
    linear-gradient(var(--lime),var(--lime)) 9px 9px / 4px 18px no-repeat;
}
.hero__stage::after, .subject-page__intro::after {
  background-position: calc(100% - 9px) calc(100% - 9px);
}
@media (max-width: 1060px) {
  .js .header .burger { border-color: var(--stage-rule); }
  .header .burger span { background: var(--stage-text); }
  .js .header .nav { background: var(--stage-deep); border-bottom-color: var(--stage-rule); }
  .header .nav__link { border-bottom-color: var(--stage-rule); }
}
@media (max-width: 570px) {
  .hero__stage::before, .subject-page__intro::after {
    background-position: calc(100% - 6px) 6px;
    background-size: 12px 3px, 3px 12px;
  }
}

.hero-notes summary { display: none; }
.review-link { margin-bottom: 26px; }
.review-form { width: min(100%, 580px); }
@media (max-width: 700px) {
  .header__cta-mobile { display: none; }
  .header__inner, .header--localized .header__inner { justify-content: space-between; }
  .language-bar { padding-block: 0; }
  .language-bar .languages a { min-height: 36px; }
  .hero--stage { padding-top: 18px; }
  .hero__stage { margin-bottom: 12px; }
  .subject-jump { display: none; }
  .hero-notes { border-top: 1px solid var(--stage-rule); }
  .hero-notes summary { display: list-item; cursor: pointer; padding-block: 10px; font-size: 14px; }
  .hero-notes .checks { padding-top: 2px; }
  #directions { padding-top: 38px; }
  #directions .section__head { margin-bottom: 22px; }
  .step-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 0 14px; }
  .step-picker button { min-width: 44px; min-height: 44px; border: 1px solid var(--stage-rule); border-radius: 2px; background: transparent; color: var(--stage-text); font-weight: 800; }
  .step-picker button[aria-pressed="true"] { border-color: var(--lime); background: var(--lime); color: var(--ink); }
  #how .step { display: block; padding: 16px 14px; background: var(--stage-deep); }
  #how .step .step__num { display: none; }
  #how .step p { margin-top: 8px; max-width: 56ch; }
  .subject-page__intro { gap: 12px; }
  .subject-page__mast { padding-block: 25px 32px; }
}
