/* Shared customer-facing presentation. Course interaction styles live in their own sheets. */
body {
  --navy: #11263b;
  --ink: #1b3041;
  --muted: #435b66;
  --blue: #075e55;
  --blue-dark: #084e47;
  --teal: #007a69;
  --sky: #e8f3ee;
  --cream: #f8f6ed;
  --background: #f8f8f2;
  --line: #cddbd5;
  --radius: 16px;
  --shadow: 0 3px 8px rgb(17 38 59 / 5%);
  background: var(--background);
}

.wrap { width: min(1184px, calc(100% - clamp(2rem, 8vw, 8rem))); }
main.wrap { padding-block: clamp(2.25rem, 5vw, 4.5rem); }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { font-weight: 770; letter-spacing: -.048em; line-height: 1.08; }
h2 { font-size: clamp(1.28rem, 1.8vw, 1.65rem); font-weight: 750; letter-spacing: -.025em; }
h3 { letter-spacing: -.018em; }
p { text-wrap: pretty; }
a { text-underline-offset: .2em; }
.study-home [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { z-index: 50; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid var(--blue);
  border-radius: 9px;
  padding: .67rem 1.05rem;
  transition: background-color .15s ease, border-color .15s ease;
}
.button.secondary { background: var(--paper); border-color: #8da7a0; }
.button.secondary:hover { background: var(--sky); border-color: var(--blue); }
.button:disabled { cursor: not-allowed; opacity: .66; }
[aria-busy="true"] .button:disabled { cursor: wait; }
.card { border-color: var(--line); }
.card p:last-child { margin-bottom: 0; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; }
.lead { color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.22rem); }

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid #2d4658;
  background: var(--navy);
}
.site-header .header-inner { min-height: 74px; gap: .8rem 1.5rem; padding-block: .35rem; }
.site-header .brand { padding: 0; }
.site-header .brand-logo {
  width: clamp(140px, 17vw, 178px);
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.site-header nav { align-items: center; gap: .2rem clamp(.5rem, 1.4vw, 1.3rem); }
.site-header nav a, .site-menu summary {
  color: #f0f5f6;
  font-size: .92rem;
  font-weight: 650;
}
.site-header nav a:hover, .site-menu summary:hover { color: #a7ead6; }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px #8fdac6; }
.site-header .account-learning-bar { background: #17374b; }
.site-header .account-learning-nav { justify-content: flex-start; }
.site-header :is(a, summary):focus-visible { outline: 2px solid #a7ead6; outline-offset: 3px; box-shadow: none; }
.public-header .header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.public-header .public-nav { display: flex; justify-content: center; }
.public-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.public-header-actions .nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid #73939c;
  border-radius: 8px;
  padding: .4rem .8rem;
  color: white;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
}
.public-header-actions .nav-cta:hover { background: #234357; }
.site-menu { position: relative; margin: 0; }
.site-menu summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .35rem .4rem;
  border-radius: 6px;
  list-style: none;
  cursor: pointer;
}
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary::after {
  content: "";
  width: .38rem;
  height: .38rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}
.site-menu[open] summary::after { transform: rotate(225deg) translate(-1px,-1px); }
.site-menu[open] .site-menu-links {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  z-index: 3;
  display: grid;
  width: min(15rem, calc(100vw - 2rem));
  max-height: 75vh;
  overflow: auto;
  gap: .1rem;
  padding: .5rem;
  border: 1px solid #38596b;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: 0 12px 34px rgb(12 33 51 / 20%);
}
.site-menu-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem .65rem;
  border-radius: 6px;
  color: #f0f5f6;
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}
.site-menu-links a:hover { background: #234357; }
.mobile-public-menu { display: none; }

.site-footer {
  display: block;
  border-top: 1px solid var(--line);
  background: #edf3ed;
  padding-block: clamp(2.25rem, 5vw, 3.75rem) 1.5rem;
  font-size: .9rem;
}
.site-footer > .footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(0, 1fr));
  gap: 1.25rem clamp(1rem, 5vw, 5rem);
}
.footer-brand img { display: block; width: 162px; height: auto; }
.footer-brand p { max-width: 26ch; }
.site-footer .footer-nav { display: grid; justify-content: start; gap: .1rem; }
.footer-nav a { padding: 0; }
.footer-nav a:hover { text-decoration: underline; }
.footer-company { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 0; padding-top: 1.2rem; font-size: .8rem; }

.public-info-main { max-width: 970px; }
.public-info-hero { margin-bottom: clamp(1.65rem, 4vw, 3rem); }
.public-info-hero h1 { font-size: clamp(2.5rem, 5vw, 4.1rem); }
.public-info-hero > p:not(.eyebrow), .page-heading > p { max-width: 66ch; color: var(--muted); }
.public-info-main > .card { padding: clamp(1.15rem, 3vw, 2rem); }
.public-info-main > .card:not(.legal-document, .seo-guide) { box-shadow: none; }
.public-info-grid > .card { border-top: 3px solid #c6e1d5; }
.public-info-main .public-info-callout { border-left-color: var(--teal); border-radius: 0 10px 10px 0; }
.legal-document, .seo-guide { line-height: 1.75; }
.legal-document h2, .seo-guide h2 { border-top: 1px solid var(--line); padding-top: 1rem; }
.support-shortcuts { justify-content: flex-start; margin-top: 1.25rem; gap: .4rem; }
.support-shortcuts a { border: 1px solid #a7bdb4; background: var(--sky); color: var(--blue-dark); padding-inline: .7rem; font-size: .875rem; }
.support-shortcuts a:hover { text-decoration: underline; }
.legal-document .legal-contents { background: var(--sky); border-radius: 10px; padding: .5rem .75rem; align-items: center; }
.seo-guide details, .account-page .form-card details { border-top: 1px solid var(--line); }
.seo-guide summary, .account-page summary { cursor: pointer; }

.course-main {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 2.15fr) minmax(15rem, 1fr);
  gap: 1.25rem clamp(1.25rem, 4vw, 3.25rem);
  max-width: 1100px;
}
.course-main:not(:has(.course-offer)) { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.course-access-jump { display: none; }
.course-breadcrumb { grid-column: 1 / -1; align-items: center; justify-content: start; gap: .2rem .75rem; margin: 0; font-size: .88rem; }
.course-breadcrumb [aria-current] { font-weight: 650; }
.course-content { min-width: 0; }
.course-content .narrow { max-width: none; }
.course-content :is(.page-heading, .public-info-hero) { margin: 0 0 clamp(1.5rem, 3.2vw, 2.5rem); }
.course-content h1 { max-width: 19ch; font-size: clamp(2.4rem, 4.4vw, 3.9rem); }
.course-content > .card + .card { margin-top: 1rem; }
.course-content :is(.card > h2:not(:first-child)) { margin-top: 1.5rem; }
.course-content .card li + li { margin-top: .35rem; }
.course-offer { position: sticky; top: 1.2rem; background: #eaf3e9; border-color: #b7d3c3; }
.course-offer h2 { font-size: 1.36rem; }
.course-offer .actions { display: grid; gap: .55rem; margin-top: 1rem; }
.course-offer .button { width: 100%; }

.pricing-hero { margin-inline: auto; text-align: center; }
.pricing-hero p { margin-inline: auto; }
.pricing-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan-card { display: flex; flex-direction: column; border-top: 4px solid var(--teal); }
.plan-card h2, .plan-card p { margin-bottom: .6rem; }
.plan-card .plan-price { margin: .45rem 0 0; color: var(--muted); }
.plan-price strong { display: inline-block; color: var(--navy); font-size: clamp(1.8rem, 3.3vw, 2.8rem); letter-spacing: -.06em; line-height: 1.1; }
.plan-card .button { margin-top: auto; }
.plan-card p + .button { margin-top: 1rem; }
.pricing-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(1.5rem, 4vw, 3rem); }
.pricing-details .wide { grid-column: 1 / -1; }

.account-page .form-card { max-width: 44rem; padding: clamp(1.1rem, 4vw, 2.4rem); margin-block: 0 1.5rem; }
.account-entry .form-card { max-width: 38rem; }
.account-entry .form-card > form { display: grid; gap: .45rem; }
.account-entry .form-card > form > label:not(:first-of-type) { margin-top: .5rem; }
.account-page :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="hidden"]) {
  min-height: 46px;
  border: 1px solid #718b86;
  border-radius: 9px;
}
.account-page input:is([type="radio"], [type="checkbox"]) { accent-color: var(--blue); }
.account-page :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--danger); }
.account-page .form-card .error {
  border: 1px solid #e0b1ad;
  border-radius: 8px;
  padding: .65rem .85rem;
  background: #fff1ef;
}
.account-page summary { min-height: 44px; padding-block: .55rem; font-weight: 700; }
.account-page .subject-card { border-top-width: 3px; }
.account-page .subject-card details { min-width: 0; }
.account-page .subject-card .actions { margin-top: .3rem; }
.account-page .account-links {
  padding: .55rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sky);
}
.account-page .explore-subjects { margin-top: 1.25rem; }
.account-page .explore-subjects li { padding-block: .22rem; }

/* Homepage */
.landing-page { background: var(--background); }
main.study-home {
  width: min(1184px, calc(100% - clamp(2rem, 8vw, 8rem)));
  overflow: visible;
  padding-block: 0 clamp(2.75rem, 6vw, 5rem);
}
.study-home > section { width: 100%; }
.study-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding-block: clamp(2.6rem, 5.8vw, 5.65rem);
}
.study-hero h1 { margin: 0 0 1.25rem; font-size: clamp(3rem, 5.25vw, 5.4rem); }
.study-hero h1 > span, .study-hero h1 em { display: block; }
.study-hero h1 em {
  color: var(--blue);
  font: italic 500 1.02em / 1.07 Georgia, serif;
  letter-spacing: -.055em;
}
.study-hero .lead { max-width: 45ch; margin: 0; }
.study-hero .actions { margin-top: 1.5rem; }
.study-price { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.worked-example {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 330px;
  isolation: isolate;
  padding: clamp(1.2rem, 4vw, 3.2rem);
  border-radius: 22px;
  background: #d4ebe0;
  background-image: linear-gradient(135deg, rgb(255 255 255 / 50%), transparent),
    linear-gradient(rgb(22 97 81 / 12%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(22 97 81 / 12%) 1px, transparent 1px);
  background-size: auto, 23px 23px, 23px 23px;
}
.example-sheet {
  border: 1px solid #b2d1c2;
  border-radius: 13px;
  border-top: 4px solid var(--teal);
  background: #fffefa;
  padding: clamp(1.1rem, 3vw, 1.85rem);
  box-shadow: 8px 12px 0 rgb(18 73 63 / 9%);
}
.example-sheet .eyebrow { margin: 0 0 .6rem; }
.example-sheet h2 { margin: 0 0 .6rem; }
.example-sheet > p:not(.eyebrow) { margin: .6rem 0 .95rem; font-size: 1.04rem; }
.example-sheet details { border-top: 1px solid var(--line); }
.example-sheet summary { min-height: 44px; padding-block: .62rem; color: var(--blue-dark); font-weight: 720; cursor: pointer; }
.example-sheet details p { margin: 0 0 .5rem; padding: .7rem .85rem; border-radius: 8px; background: var(--sky); }
.study-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 700; }

.study-catalogue {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1.1rem, 3.3vw, 2.7rem);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.catalogue-heading { display: flex; justify-content: space-between; align-items: end; gap: .65rem 1.25rem; }
.study-home :is(.catalogue-heading, .study-process, .study-prelims) h2 {
  margin: 0 0 .5rem;
  font-size: clamp(1.8rem, 3.1vw, 2.85rem);
  letter-spacing: -.045em;
}
#courses-heading { scroll-margin-top: 1.25rem; }
.catalogue-heading p { margin: 0; color: var(--muted); }
.catalogue-heading .catalogue-total { color: var(--blue-dark); font-weight: 700; font-size: .88rem; }
.catalogue-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: .5rem 1rem;
  padding: 1rem 0 .6rem;
}
.catalogue-search label, .catalogue-levels legend { display: block; margin: 0 0 .35rem; font-size: .88rem; font-weight: 750; }
.catalogue-search input {
  height: 48px;
  border: 1px solid #718b86;
  border-radius: 8px;
  background: #fafcf9;
  padding-inline: .85rem;
}
.catalogue-search input::placeholder { color: #536963; }
.catalogue-levels { min-width: 0; margin: 0; padding: 0; border: 0; }
.catalogue-levels > div { display: flex; gap: 3px; padding: 2px; border: 1px solid #a7bdb4; border-radius: 9px; background: #edf4ef; }
.catalogue-levels label { position: relative; flex: 1 1 auto; }
.catalogue-levels input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.catalogue-levels span {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding-inline: clamp(.5rem, 1.2vw, 1rem);
  border-radius: 6px;
  color: var(--navy);
  white-space: nowrap;
  font-size: .88rem;
  cursor: pointer;
}
.catalogue-levels input:checked + span { background: var(--navy); color: white; }
.catalogue-levels input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.catalogue-count { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .875rem; }
.catalogue-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  margin: .6rem 0 0;
  padding: 0;
}
.catalogue-list li { min-width: 0; border-top: 1px solid var(--line); }
.catalogue-list article {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: .2rem .75rem;
  padding-block: .35rem;
}
.catalogue-list h3 { margin: 0; font-size: .99rem; font-weight: 720; }
.catalogue-course-links { flex: 0 0 auto; display: flex; gap: .35rem; }
.catalogue-course-links a {
  display: inline-flex;
  gap: .3rem;
  align-items: center;
  min-height: 44px;
  padding-inline: .52rem;
  border-radius: 6px;
  color: var(--blue-dark);
  font-size: .83rem;
  font-weight: 720;
  text-decoration: none;
}
.catalogue-course-links a:hover { background: var(--sky); text-decoration: underline; }
.catalogue-empty { padding: 1rem; border-radius: 10px; background: var(--sky); }
.catalogue-empty p { margin-top: 0; }

.study-process { padding-block: clamp(2.5rem, 6vw, 5rem); }
.study-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 1.45rem 0 0; }
.study-steps li { border-top: 2px solid #a3c9bb; padding: 1rem .3rem 0 0; }
.study-steps h3 { margin: 0; font-size: 1.1rem; }
.study-steps p { margin: .4rem 0 0; color: var(--muted); }
.study-prelims {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(12rem, 1fr);
  align-items: center;
  gap: .8rem 2rem;
  border-radius: 18px;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--navy);
  color: #e4edf0;
}
.study-prelims h2 { color: white; }
.study-prelims p { margin: .65rem 0 0; }
.study-prelims-links { display: grid; justify-items: start; justify-self: end; }
.study-prelims .study-link { color: #a7ead6; }
.study-prelims .study-link:focus-visible { outline-color: #a7ead6; box-shadow: none; }
.study-founder { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.study-founder h2, .study-founder p { margin: .2rem 0; }

@media (max-width: 890px) {
  .public-header .header-inner { grid-template-columns: auto minmax(0, 1fr); }
  .public-header .public-nav { display: none; }
  .mobile-public-menu { display: block; margin-left: 0; }
  .mobile-public-menu summary { padding-inline: .65rem; border: 1px solid #73939c; border-radius: 8px; }
  .study-hero { gap: 1.6rem; }
  .catalogue-list article { display: block; padding-block: .7rem .25rem; }
  .catalogue-course-links a:first-child { margin-left: -.52rem; }
}

@media (max-width: 700px) {
  .study-hero { grid-template-columns: 1fr; padding-block: 2rem 1.5rem; gap: 1.55rem; }
  .study-hero h1 { font-size: clamp(2.5rem, 8.9vw, 4rem); }
  .worked-example { min-height: 0; }
  .study-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-prelims { grid-template-columns: 1fr; }
  .study-prelims-links { justify-self: start; }
  .study-founder { display: block; }
  .catalogue-heading { display: block; }
  .catalogue-heading .catalogue-total { margin-top: .5rem; }
  .catalogue-controls { grid-template-columns: 1fr; gap: .7rem; }
  .course-main { grid-template-columns: minmax(0, 1fr); }
  .course-offer { position: static; scroll-margin-top: 1rem; }
  .course-access-jump {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    justify-self: start;
    min-height: 44px;
    margin-block: -.6rem -.3rem;
    padding-inline: .7rem;
    border: 1px solid #a7bdb4;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 700;
  }
  .pricing-plans, .pricing-details { grid-template-columns: minmax(0, 1fr); }
  .pricing-hero { text-align: left; }
}

@media (max-width: 480px) {
  .site-header .header-inner { gap: .45rem; }
  .site-header .brand-logo { width: clamp(114px, 36vw, 160px); }
  .public-header-actions { gap: .35rem; }
  .public-header-actions .nav-cta, .mobile-public-menu summary { font-size: .8rem; padding-inline: .5rem; }
  .catalogue-list { grid-template-columns: 1fr; }
  .catalogue-list article { display: flex; padding-block: .35rem; }
  .catalogue-course-links a:first-child { margin-left: 0; }
  .catalogue-course-links a { padding-inline: .3rem; }
  .catalogue-course-links a > span[aria-hidden] { display: none; }
  .catalogue-list h3 { font-size: .9rem; }
  .study-hero .actions { gap: .45rem; }
  .study-hero .actions .button { width: auto; flex: 1 1 auto; font-size: .87rem; padding-inline: .58rem; }
  .site-footer > .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:active { transform: none; }
}
