@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-cyrillic-wght-normal.70800b98b5e7.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-wght-normal.b2c9031d9fd6.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexSansCondensed-SemiBold.7291775918ac.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/IBMPlexSansCondensed-Bold.92c35fd31638.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --theme-color: #e47400;
  --white-lightness: 0.9573969320543095;
  --black-lightness: 0.2701124128533074;
  --target-background-lightness: var(--white-lightness);
  --target-foreground-lightness: var(--black-lightness);
  --page-bg: oklch(from var(--theme-color) var(--target-background-lightness) 0.005 calc(h + 30));
  --text: oklch(from var(--theme-color) var(--target-foreground-lightness) 0.005 calc(h + 30));
  --heading: oklch(
    from var(--theme-color)
    calc((var(--target-background-lightness) + var(--target-foreground-lightness) * 2) / 3) 0.15 h
  );
  --subheading: oklch(
    from var(--theme-color)
    calc((var(--target-background-lightness) + var(--target-foreground-lightness) * 3) / 4) 0.1
      calc(h + 30)
  );
  --accent: var(--heading);
  --accent-hover: var(--heading);
  --accent-text: var(--page-bg);
  --muted: oklch(from var(--text) l c h / 60%);
  --subtle: var(--muted);
  --surface: color-mix(in oklch, var(--page-bg), var(--text) 4%);
  --surface-strong: var(--surface);
  --line: color-mix(in oklch, var(--page-bg), var(--text) 10%);
  --line-strong: var(--line);
  --focus: var(--text);
  --success-bg: var(--surface);
  --success-text: var(--heading);
  --danger-bg: var(--surface);
  --danger-text: var(--subheading);
  --planned-bg: var(--surface);
  --planned-text: var(--text);
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-condensed: "IBM Plex Sans Condensed", "Arial Narrow", var(--font-sans);
  --unit: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --target-background-lightness: var(--black-lightness);
    --target-foreground-lightness: var(--white-lightness);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --target-background-lightness: var(--white-lightness);
  --target-foreground-lightness: var(--black-lightness);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --target-background-lightness: var(--black-lightness);
  --target-foreground-lightness: var(--white-lightness);
}

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

  html {
    min-width: 320px;
    background: var(--page-bg);
    color: var(--text);
    scroll-behavior: smooth;
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.012em;
    text-rendering: optimizeLegibility;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
  }

  button,
  summary {
    -webkit-tap-highlight-color: transparent;
  }

  a {
    color: inherit;
    text-decoration-color: color-mix(in oklch, var(--page-bg), var(--text) 50%);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
  }

  ::selection {
    background: var(--heading);
    color: var(--page-bg);
  }

  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
  }

  [hidden] {
    display: none !important;
  }
}

@layer components {
  .site-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
  }

  .site-main {
    flex: 1;
  }

  .content-container,
  .content-container--reading,
  .content-container--wide {
    width: calc(100% - 48px);
    margin-inline: auto;
  }

  .content-container {
    max-width: 984px;
  }

  .content-container--reading {
    max-width: 792px;
  }

  .content-container--wide {
    max-width: 1296px;
  }

  .page-section {
    padding-block: 72px;
  }

  .page-section--compact {
    padding-block: 48px 72px;
  }

  .eyebrow {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
  }

  .display-title,
  .page-title,
  .section-title,
  .brand {
    font-family: var(--font-condensed);
    font-weight: 700;
    letter-spacing: -0.018em;
  }

  .display-title {
    max-width: 760px;
    color: var(--heading);
    font-size: clamp(3.25rem, 7vw, 6.5rem);
    line-height: 0.94;
    text-wrap: balance;
  }

  .page-title {
    margin-top: 8px;
    color: var(--heading);
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1;
    text-wrap: balance;
  }

  .section-title {
    color: var(--heading);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.08;
  }

  .lede {
    max-width: 680px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.65;
  }

  .muted {
    color: var(--muted);
  }

  .subtle {
    color: var(--subtle);
  }

  .surface {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .divider-top {
    border-top: 1px solid var(--line);
  }

  :where(.site-main, .site-footer)
    a:not(.button):not(.icon-button):not(.calendar-session):not(.lesson-list__link):hover {
    text-decoration-line: underline;
  }

  .button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
  }

  .button--primary {
    background: var(--accent);
    color: var(--accent-text);
  }

  .button--primary:hover {
    background: var(--accent-hover);
  }

  .button--secondary {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--text);
  }

  .button--secondary:hover {
    border-color: var(--text);
    background: var(--surface);
  }

  .button--ghost {
    min-height: 36px;
    padding: 7px 10px;
    color: var(--muted);
  }

  .button--ghost:hover {
    background: var(--surface);
    color: var(--text);
  }

  .button--block {
    width: 100%;
  }

  .icon-button {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }

  .icon-button:hover {
    background: var(--surface-strong);
  }

  .icon-button svg {
    width: 20px;
    height: 20px;
  }

  .phi-glyph {
    position: relative;
    display: block;
    top: -0.19em;
    color: var(--accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--phi-size);
    font-weight: 400;
    line-height: 0.8;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: var(--page-bg);
  }

  .site-header__inner {
    display: flex;
    width: calc(100% - 48px);
    max-width: 1416px;
    height: 71px;
    margin-inline: auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
  }

  .brand-mark {
    --phi-size: 1.55rem;

    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
  }

  .header-branding,
  .header-actions,
  .header-page-links,
  .desktop-nav {
    display: flex;
    align-items: center;
  }

  .header-branding {
    gap: 24px;
  }

  .header-actions {
    gap: 12px;
  }

  .header-page-links,
  .desktop-nav {
    gap: 4px;
  }

  .header-link {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
  }

  .header-link:hover {
    background: var(--surface);
    color: var(--text);
  }

  .header-logout {
    margin: 0;
  }

  .theme-toggle {
    width: 40px;
    padding: 0;
  }

  .mobile-menu {
    position: relative;
    display: none;
  }

  .mobile-menu > summary {
    list-style: none;
  }

  .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu__panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    display: grid;
    width: min(260px, calc(100vw - 32px));
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    background: var(--page-bg);
  }

  .mobile-menu__panel .header-link,
  .mobile-menu__panel .button {
    width: 100%;
    justify-content: flex-start;
  }

  .mobile-menu__section {
    display: grid;
    gap: 4px;
  }

  .mobile-menu__divider {
    width: 100%;
    margin: 4px 0;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .site-footer {
    border-top: 1px solid var(--line);
  }

  .site-footer__inner {
    display: grid;
    width: calc(100% - 48px);
    max-width: 1416px;
    min-height: 96px;
    margin-inline: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    padding-block: 20px;
  }

  .footer-quote {
    max-width: 720px;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.55;
  }

  .copyright {
    color: var(--subtle);
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .home-hero {
    display: grid;
    min-height: min(720px, calc(100vh - 72px));
    min-height: min(720px, calc(100dvh - 72px));
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    align-items: center;
    gap: 72px;
    padding-block: 72px;
  }

  .home-hero__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .home-hero .display-title {
    margin-top: 20px;
  }

  .home-hero .lede {
    margin-top: 32px;
  }

  .home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
  }

  .home-hero__mark {
    position: relative;
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 0;
    background: transparent;
  }

  .home-hero__mark::after {
    position: absolute;
    inset: 12%;
    border: 1px solid var(--line);
    border-radius: 50%;
    content: "";
  }

  .home-hero__phi {
    --phi-size: clamp(9rem, 20vw, 17rem);

    z-index: 1;
  }

  .home-section {
    padding-block: 72px;
    border-top: 1px solid var(--line);
  }

  .section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
  }

  .feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 36px;
  }

  .feature-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    padding: 24px;
  }

  .feature-card__number {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
  }

  .feature-card h3 {
    margin-top: auto;
    color: var(--heading);
    font-family: var(--font-condensed);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
  }

  .feature-card p {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.6;
  }

  .quote-layout {
    display: grid;
    grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
    gap: 72px;
    align-items: start;
  }

  .editorial-quote {
    margin: 0;
  }

  .editorial-quote blockquote {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .editorial-quote blockquote p {
    color: var(--text);
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    line-height: 1.55;
    letter-spacing: -0.01em;
  }

  .editorial-quote figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
  }

  .editorial-quote cite {
    font-style: normal;
  }

  .page-header {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
  }

  .page-header__row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
  }

  .page-header__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .about-sections {
    display: grid;
    gap: 24px;
    margin-top: 32px;
  }

  .about-section {
    padding: 32px;
  }

  .about-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
    padding-left: 1.25rem;
    list-style-type: disc;
    line-height: 1.65;
  }

  .about-list li::marker {
    color: var(--accent);
  }

  .about-list__link {
    color: var(--accent);
    text-decoration-line: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
  }

  .about-list__contact,
  .contact-links {
    display: flex;
    align-items: center;
  }

  .about-list__contact-item {
    border-radius: 8px;
    scroll-margin-top: 95px;
  }

  .about-list__contact-item--highlighted {
    animation: about-contact-highlight 1.6s ease-out;
  }

  @keyframes about-contact-highlight {
    0%,
    65% {
      outline: 1px solid var(--accent);
      outline-offset: 8px;
    }

    100% {
      outline: 1px solid transparent;
      outline-offset: 8px;
    }
  }

  .about-list__contact {
    flex-wrap: wrap;
    gap: 8px;
  }

  .contact-links {
    gap: 6px;
  }

  .contact-link {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--muted);
    text-decoration: none;
  }

  .contact-link:hover {
    border-color: var(--text);
    background: var(--surface);
    color: var(--text);
  }

  .contact-link svg {
    width: 18px;
    height: 18px;
  }

  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
  }

  .back-link:hover {
    color: var(--text);
    text-decoration: underline;
  }

  .auth-shell {
    display: grid;
    width: calc(100% - 32px);
    max-width: 488px;
    min-height: calc(100vh - 168px);
    min-height: calc(100dvh - 168px);
    margin-inline: auto;
    place-items: center;
    padding-block: 48px;
  }

  .form-panel {
    width: 100%;
    padding: 32px;
  }

  .form-panel__intro {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .form-stack {
    display: grid;
    gap: 20px;
    margin-top: 32px;
  }

  .field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
  }

  .required-mark {
    color: var(--danger-text);
  }

  .form-control {
    display: block;
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    background: var(--page-bg);
    color: var(--text);
  }

  .form-control:hover {
    border-color: var(--text);
  }

  .form-control:focus {
    border-color: var(--focus);
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  .field-help {
    margin-top: 7px;
    color: var(--subtle);
    font-size: 0.75rem;
    line-height: 1.5;
  }

  .field-error {
    margin-top: 7px;
    color: var(--danger-text);
    font-size: 0.8125rem;
  }

  .alert {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .alert ul {
    margin: 0;
  }

  .alert--danger {
    border-color: var(--danger-text);
    background: var(--danger-bg);
    color: var(--danger-text);
  }

  .alert--success {
    border-color: var(--success-text);
    background: var(--success-bg);
    color: var(--success-text);
  }

  .auth-switch {
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
  }

  .auth-switch a {
    color: var(--text);
    font-weight: 600;
  }

  .empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: 40px 24px;
    color: var(--muted);
    text-align: center;
  }

  .course-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
  }

  .course-card-grid > .empty-state {
    grid-column: 1 / -1;
  }

  .course-card {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    padding: 24px;
  }

  .course-card h2,
  .course-card h3 {
    color: var(--heading);
    font-family: var(--font-condensed);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
  }

  .course-card h2 a:hover,
  .course-card h3 a:hover {
    text-decoration-color: var(--accent);
  }

  .course-card--catalog {
    min-height: 260px;
  }

  .course-card__description {
    margin-block: 20px 24px;
  }

  .course-card__action {
    align-self: flex-start;
    margin-top: auto;
  }

  .course-card__group {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.875rem;
  }

  .meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    padding-bottom: 24px;
    border-top: 1px solid var(--line);
  }

  .meta-grid dt,
  .stat-card dt {
    color: var(--subtle);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .meta-grid dd,
  .stat-card dd {
    margin-top: 6px;
    font-weight: 600;
  }

  .progress-block {
    margin-top: auto;
    padding-top: 24px;
  }

  .progress-block__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    font-size: 0.8125rem;
  }

  .progress-block__heading h4 {
    font-weight: 600;
  }

  .progress-block__heading p {
    color: var(--muted);
  }

  .progress-segments {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 14px;
  }

  .progress-segment {
    width: 22px;
    height: 5px;
    border-radius: 999px;
    background: var(--line-strong);
  }

  .progress-segment.is-complete {
    background: var(--success-text);
  }

  .module-stack {
    display: grid;
    gap: 24px;
    margin-top: 32px;
  }

  .module-card {
    padding: 24px;
  }

  .module-card--curriculum {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "number title homework"
      ". annotation annotation"
      "lessons lessons lessons";
    column-gap: 20px;
    align-items: center;
  }

  .module-card--curriculum .module-number {
    grid-area: number;
    align-self: start;
  }

  .module-card__title {
    grid-area: title;
  }

  .module-card__annotation {
    grid-area: annotation;
  }

  .module-card--curriculum .lesson-list {
    grid-area: lessons;
  }

  .module-card__homework {
    grid-area: homework;
  }

  .module-number {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    font-family: var(--font-condensed);
    font-size: 1.25rem;
    font-weight: 700;
  }

  .module-card h3 {
    color: var(--heading);
    font-family: var(--font-condensed);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
  }

  .lesson-list {
    margin-top: 24px;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
  }

  .lesson-list li + li {
    border-top: 1px solid var(--line);
  }

  .lesson-list a {
    display: grid;
    min-height: 56px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding-block: 12px;
    text-decoration: none;
  }

  .lesson-list a:hover .lesson-list__name {
    color: var(--heading);
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }

  .lesson-list__number,
  .lesson-list__arrow {
    color: var(--subtle);
    font-size: 0.8125rem;
  }

  .lesson-list__name {
    font-weight: 600;
  }

  .lesson-article .page-header {
    margin-top: 24px;
  }

  .lesson-article .page-header:not(:has(.lede)) {
    padding-bottom: 20px;
  }

  .lesson-session-links {
    display: grid;
    gap: 12px;
  }

  .lesson-body {
    margin-top: 40px;
  }

  .attachments {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
  }

  .lesson-article:not(:has(.lesson-body)) .page-header {
    border-bottom: 0;
  }

  .lesson-article:not(:has(.lesson-body)) .attachments {
    margin-top: 0;
  }

  .attachment-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
  }

  .attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
  }

  .attachment-card h3 {
    font-weight: 600;
  }

  .attachment-card .button {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .lesson-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
  }

  .lesson-pagination a {
    color: var(--text);
    text-decoration: none;
  }

  .lesson-pagination__next {
    grid-column: 2;
    text-align: right;
  }

  .lesson-pagination__label {
    display: block;
    color: var(--subtle);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .lesson-pagination__name {
    display: block;
    margin-top: 6px;
    font-weight: 600;
  }

  .lesson-pagination a:hover .lesson-pagination__name {
    color: var(--heading);
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }

  .session-panel {
    margin-top: 24px;
    padding: 32px;
  }

  .session-panel .page-title a:hover {
    text-decoration-color: var(--accent);
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 32px;
  }

  .stat-card {
    min-width: 0;
    padding: 18px;
    border-radius: 8px;
    background: var(--surface-strong);
  }

  .session-note {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
  }

  .calendar-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
  }

  .calendar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .calendar-picker {
    position: relative;
  }

  .calendar-picker > summary {
    min-width: 184px;
    list-style: none;
  }

  .calendar-picker > summary::-webkit-details-marker {
    display: none;
  }

  .calendar-picker__chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

  .calendar-picker[open] .calendar-picker__chevron {
    transform: rotate(180deg);
  }

  .calendar-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 10px);
    right: 0;
    display: flex;
    min-width: 390px;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: var(--page-bg);
  }

  .calendar-popover .form-control {
    min-width: 120px;
  }

  .calendar-frame {
    margin-top: 32px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .calendar-table {
    width: 100%;
    min-width: 1000px;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .calendar-table th {
    height: 48px;
    padding: 10px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--subtle);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
  }

  .calendar-table td {
    height: 150px;
    padding: 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }

  .calendar-table tr > :last-child {
    border-right: 0;
  }

  .calendar-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .calendar-day {
    font-size: 0.8125rem;
    font-weight: 600;
  }

  .calendar-day.is-outside {
    color: var(--subtle);
    opacity: 0.5;
  }

  .calendar-events {
    display: grid;
    gap: 7px;
    margin-top: 8px;
  }

  .calendar-session {
    display: block;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 8px;
    font-size: 0.7rem;
    line-height: 1.35;
    text-decoration: none;
  }

  .calendar-session:hover {
    text-decoration: underline;
  }

  .calendar-session--planned {
    border-color: var(--line);
    background: var(--planned-bg);
    color: var(--planned-text);
  }

  .calendar-session--held {
    border-color: var(--success-text);
    background: var(--success-bg);
    color: var(--success-text);
  }

  .calendar-session--cancelled {
    border-color: var(--danger-text);
    background: var(--danger-bg);
    color: var(--danger-text);
  }

  .calendar-session__title {
    font-weight: 600;
  }

  .calendar-session__detail,
  .calendar-session__status {
    margin-top: 4px;
  }

  .calendar-session__status {
    color: var(--muted);
  }

  .wysiwyg {
    color: var(--text);
  }

  .wysiwyg--muted {
    color: var(--muted);
  }

  .wysiwyg > :first-child {
    margin-top: 0;
  }

  .wysiwyg > :last-child {
    margin-bottom: 0;
  }

  .wysiwyg p,
  .wysiwyg ul,
  .wysiwyg ol,
  .wysiwyg blockquote,
  .wysiwyg pre,
  .wysiwyg table {
    margin-block: 1.25em;
  }

  .wysiwyg h2 {
    margin: 2.2em 0 0.7em;
    color: var(--heading);
    font-family: var(--font-condensed);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
  }

  .wysiwyg h3 {
    margin: 1.8em 0 0.6em;
    color: var(--heading);
    font-family: var(--font-condensed);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .wysiwyg ul,
  .wysiwyg ol {
    padding-left: 1.4em;
  }

  .wysiwyg ul {
    list-style-type: disc;
  }

  .wysiwyg ul li::marker {
    color: var(--accent);
  }

  .wysiwyg ol {
    list-style-type: decimal;
  }

  .wysiwyg li + li {
    margin-top: 0.45em;
  }

  .wysiwyg blockquote {
    padding-left: 20px;
    border-left: 2px solid var(--accent);
    color: var(--muted);
    font-size: 1.05em;
  }

  .wysiwyg a {
    color: var(--heading);
    text-decoration: underline;
  }

  .wysiwyg code {
    border-radius: 4px;
    padding: 0.1em 0.32em;
    background: var(--surface-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
  }

  .wysiwyg pre {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: var(--surface);
  }

  .wysiwyg pre code {
    padding: 0;
    background: transparent;
  }

  .wysiwyg img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }

  .wysiwyg table {
    width: 100%;
    border-collapse: collapse;
  }

  .wysiwyg th,
  .wysiwyg td {
    padding: 10px 12px;
    border: 1px solid var(--line);
    text-align: left;
  }

  .wysiwyg th {
    background: var(--surface);
    font-weight: 600;
  }
}

@media (max-width: 900px) {
  .header-page-links,
  .desktop-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .home-hero__mark {
    width: min(440px, 100%);
    justify-self: center;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card:last-child {
    grid-column: 1 / -1;
    min-height: 220px;
  }

  .quote-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 700px) {
  .content-container,
  .content-container--reading,
  .content-container--wide,
  .site-header__inner,
  .site-footer__inner {
    width: calc(100% - 32px);
  }

  .page-section {
    padding-block: 48px;
  }

  .page-section--compact {
    padding-block: 32px 48px;
  }

  .about-section {
    padding: 24px;
  }

  .brand-label {
    display: none;
  }

  .site-header__inner {
    gap: 12px;
  }

  .header-actions {
    gap: 4px;
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-block: 24px;
  }

  .copyright {
    white-space: normal;
  }

  .home-hero {
    padding-block: 48px;
  }

  .home-hero .lede {
    margin-top: 24px;
  }

  .home-section {
    padding-block: 48px;
  }

  .feature-grid,
  .course-card-grid,
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card:last-child {
    grid-column: auto;
  }

  .feature-card {
    min-height: 220px;
  }

  .page-header__row,
  .calendar-heading,
  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header__row,
  .calendar-heading {
    display: flex;
  }

  .calendar-controls {
    position: relative;
    width: 100%;
  }

  .calendar-picker {
    position: static;
    flex: 1;
  }

  .calendar-picker > summary {
    width: 100%;
    min-width: 0;
  }

  .calendar-popover {
    right: 0;
    left: 0;
    width: auto;
    min-width: 0;
    flex-direction: column;
  }

  .course-card {
    min-height: 280px;
  }

  .attachment-card {
    align-items: stretch;
    flex-direction: column;
  }

  .attachment-card .button {
    width: 100%;
  }

  .session-panel,
  .form-panel {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .module-card--curriculum {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "number title"
      ". annotation"
      "homework homework"
      "lessons lessons";
  }

  .module-card__homework {
    width: 100%;
    margin-top: 24px;
  }
}

@media (max-width: 520px) {
  .display-title {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .page-title {
    font-size: clamp(2rem, 11vw, 3.1rem);
  }

  .home-hero__actions,
  .home-hero__actions .button {
    width: 100%;
  }

  .meta-grid,
  .lesson-pagination {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-pagination__next {
    grid-column: 1;
    text-align: left;
  }

  .module-card--curriculum {
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 14px;
  }

  .module-number {
    width: 40px;
    height: 40px;
  }

  .calendar-controls .icon-button {
    width: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Static helpers retain the original spacing and type scale. */
@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
  }

  .mt-2 {
    margin-top: 0.5rem;
  }

  .mt-3 {
    margin-top: 0.75rem;
  }

  .mt-4 {
    margin-top: 1rem;
  }

  .mt-5 {
    margin-top: 1.25rem;
  }

  .mt-6 {
    margin-top: 1.5rem;
  }

  .mt-10 {
    margin-top: 2.5rem;
  }

  .py-4 {
    padding-block: 1rem;
  }

  .text-lg {
    font-size: 1.125rem;
    line-height: calc(1.75 / 1.125);
  }

  .text-sm {
    font-size: 0.875rem;
    line-height: calc(1.25 / 0.875);
  }

  .leading-8 {
    line-height: 2rem;
  }
}
