    .music-theory-main {
      --hero-enter-ease: cubic-bezier(0.2, 0.74, 0.22, 1);
      width: 100vw;
      max-width: none;
      margin: 0;
      margin-left: calc(50% - 50vw);
      padding-top: 0;
      padding-bottom: 0;
    }
    .lesson-content-wrap {
      position: relative;
      width: 100%;
      margin: 0;
      display: block;
      --section-pad-top: clamp(1.9rem, 4vw, 3.1rem);
      --section-pad-x: clamp(1rem, 5vw, 4rem);
      --section-pad-bottom: clamp(2.1rem, 4.6vw, 3.2rem);
      --amp-gold-gradient: linear-gradient(180deg, #f3d27c 0%, #ddb357 45%, #a97b2f 100%);
      --hero-enter-ease: cubic-bezier(0.2, 0.74, 0.22, 1);
      --section-enter-ease: cubic-bezier(0.18, 0.76, 0.24, 1);
      background: linear-gradient(180deg, #070a10 0%, #090d14 100%);
    }
    .site-footer {
      margin-top: 0;
      gap: 0;
      padding: 0;
      background: transparent !important;
    }
    .site-footer .audio-visualizer--footer {
      margin: 0;
      height: 50px;
      padding-top: 0;
      background: none !important;
    }
    .site-footer .audio-visualizer--footer .vis-bar {
      height: 100%;
    }

    @keyframes hero-rise-fade {
      0% {
        opacity: 0;
        transform: translate3d(0, 18px, 0) scale(0.985);
        filter: blur(2px);
      }
      100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
      }
    }

    @keyframes hero-bg-settle {
      0% {
        transform: scale(1.1);
      }
      100% {
        transform: scale(1.04);
      }
    }

    @keyframes section-rise-fade {
      0% {
        opacity: 0;
        transform: translate3d(0, 28px, 0);
      }
      100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
      }
    }

    @keyframes section-surface-drift {
      0%, 100% { background-position: 50% 0%; }
      50% { background-position: 50% 100%; }
    }

    .lesson-content-wrap::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: clamp(8px, 1.1vw, 12px);
      background: var(--amp-gold-gradient);
      pointer-events: none;
      z-index: 4;
    }
    .lesson-section {
      position: relative;
      width: 100%;
      border: 0;
      overflow: hidden;
      --section-fill: #06080c;
      --section-glow-a: rgba(246, 194, 74, 0.06);
      --section-glow-b: rgba(246, 194, 74, 0.025);
      background: var(--section-fill);
      padding: var(--section-pad-top) var(--section-pad-x) var(--section-pad-bottom);
      isolation: isolate;
    }

    .lesson-section:nth-of-type(even) {
      --section-fill: #11131d;
      --section-glow-a: rgba(246, 194, 74, 0.07);
      --section-glow-b: rgba(95, 146, 220, 0.06);
      background: var(--section-fill);
    }

    #counting-intervals::after,
    #interval-quality::after {
      content: "";
      position: absolute;
      inset: 0;
      background-image: url("../images/backgrounds/paisley2.webp");
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0.14;
      pointer-events: none;
      z-index: 2;
    }

    #interval-foundation::after,
    #interval-number::after,
    #c-chromatic-reference::after {
      content: "";
      position: absolute;
      inset: 0;
      background-image: url("../images/backgrounds/blackhex.webp");
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0.12;
      pointer-events: none;
      z-index: 2;
    }

    .lesson-section:nth-of-type(1) { --section-index: 0; }
    .lesson-section:nth-of-type(2) { --section-index: 1; }
    .lesson-section:nth-of-type(3) { --section-index: 2; }
    .lesson-section:nth-of-type(4) { --section-index: 3; }
    .lesson-section:nth-of-type(5) { --section-index: 4; }
    .lesson-section:nth-of-type(6) { --section-index: 5; }

    .lesson-section + .lesson-section {
      position: relative;
      padding-top: calc(var(--section-pad-top) + clamp(0.9rem, 1.6vw, 1.2rem));
    }

    .lesson-section + .lesson-section::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: clamp(8px, 1.1vw, 12px);
      background: var(--amp-gold-gradient);
      pointer-events: none;
      z-index: 3;
    }

    .lesson-section::after {
      content: none;
    }

    .lesson-section > * {
      position: relative;
      z-index: 5;
      width: min(1240px, 100%);
      margin-left: auto;
      margin-right: auto;
    }

    .lesson-section h2 {
      margin: 0 0 0.9rem;
      color: #f8cf72;
      font-size: clamp(1.22rem, 2.55vw, 2rem);
      line-height: 1.18;
      display: block;
      padding: 0;
      border: 0;
      background: none;
      letter-spacing: 0.01em;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
      text-align: center;
    }

    .lesson-section h2 + h2 {
      margin-top: 1.55rem;
      padding-top: 1.1rem;
      border-top: 1px solid rgba(214, 177, 83, 0.45);
    }

    .lesson-section h3 {
      margin: 0.95rem 0 0.34rem;
      color: #f8cf72;
      font-size: 1.03rem;
      padding-left: 0;
      border-left: 0;
      text-align: center;
    }

    .lesson-section h3::before {
      content: none;
    }
    .lesson-section h2,
    .lesson-section h3 {
      width: 100%;
      max-width: none;
      margin-left: 0;
      margin-right: 0;
    }


    .lesson-section p {
      margin: 0.3rem 0 0;
      color: #e1e6ee;
      line-height: 1.66;
      max-width: min(118ch, 100%);
      margin-left: auto;
      margin-right: auto;
      text-align: center;
      text-wrap: pretty;
    }

    .lesson-section ul {
      margin: 0.48rem auto 0;
      padding-left: 0;
      color: #e1e6ee;
      line-height: 1.64;
      max-width: min(96ch, 100%);
      width: fit-content;
      text-align: center;
      list-style-position: inside;
    }

    .lesson-section li {
      margin: 0.16rem 0;
      text-align: center;
    }

    .lesson-section p + h2,
    .lesson-section ul + h2,
    .lesson-diagram-grid + h2 {
      margin-top: clamp(1.7rem, 2.7vw, 2.45rem);
    }

    .lesson-def-link {
      color: #f6c24a;
      font-weight: 700;
      text-decoration: none;


    }

    .lesson-def-link:hover,
    .lesson-def-link:focus-visible {
      color: #ffe29a;
    }
    .lesson-section strong {
      color: #f8d788;
      font-weight: 600;
    }
    .lesson-bottom-divider {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      margin: 0;
      height: clamp(8px, 1.1vw, 12px);
      background: var(--amp-gold-gradient);
      z-index: 6;
      pointer-events: none;
    }
    body.has-scroll-reveal .lesson-bottom-divider {
      opacity: 1 !important;
      transform: none !important;
      filter: none !important;
    }

    .lesson-diagram-grid {
      margin: 0.9rem auto 0;
      display: grid;
      gap: 0.7rem;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      width: min(1160px, 100%);
    }

    .lesson-diagram-card {
      padding: 0.74rem 0.8rem;
      border-radius: 11px;
      border: 1px solid rgba(246, 194, 74, 0.24);
      background:
        radial-gradient(420px 220px at 12% 8%, rgba(246, 194, 74, 0.14), rgba(246, 194, 74, 0) 72%),
        linear-gradient(165deg, rgba(38, 30, 15, 0.62), rgba(12, 15, 26, 0.84));
      box-shadow: inset 0 1px 0 rgba(255, 239, 197, 0.12), 0 10px 20px rgba(0, 0, 0, 0.24);
    }

    .lesson-diagram-card__title {
      margin: 0;
      color: #ffe9b9;
      font-weight: 700;
      font-size: 0.95rem;
      letter-spacing: 0.01em;
    }

    .lesson-diagram-card__body {
      margin: 0.3rem 0 0;
      color: #dce3ef;
      font-size: 0.92rem;
      line-height: 1.45;
      max-width: none;
    }

    .lesson-pitch-flow {
      margin: 0.45rem 0 0;
      padding: 0.46rem 0.55rem;
      border-radius: 9px;
      border: 0;
      background: rgba(16, 18, 28, 0.72);
      color: #f7d88f;
      font-size: 0.92rem;
      line-height: 1.42;
      letter-spacing: 0.01em;
      max-width: none;
    }
    .lesson-interval-number-highlight {
      color: #f8cf72;
      font-weight: 700;
    }
    .lesson-interval-table {
      margin: 1.2rem auto 0;
      width: min(1040px, 100%);
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid rgba(246, 194, 74, 0.28);
      background: linear-gradient(165deg, rgba(14, 17, 25, 0.86), rgba(9, 12, 18, 0.95));
      box-shadow: inset 0 1px 0 rgba(255, 240, 198, 0.1), 0 12px 20px rgba(0, 0, 0, 0.24);
    }
    .lesson-interval-table + p {
      margin-top: 0.95rem;
    }
    .lesson-interval-table__row {
      display: grid;
      grid-template-columns: 1.1fr 1.9fr 1fr;
      align-items: center;
    }
    .lesson-interval-table__row p {
      margin: 0;
      text-align: left;
      line-height: 1.55;
      max-width: none;
      padding: 0.78rem 0.9rem;
      border-right: 1px solid rgba(246, 194, 74, 0.16);
      border-bottom: 1px solid rgba(246, 194, 74, 0.16);
      background: rgba(26, 30, 42, 0.72);
      font-weight: 500;
    }
    .lesson-interval-table__row p:first-child {
      text-align: left;
      padding-left: 0.95rem;
      color: #f1d28a;
      font-weight: 600;
    }
    .lesson-interval-table__row p:last-child {
      border-right: 0;
    }
    .lesson-interval-table__row:not(.lesson-interval-table__row--head):nth-of-type(even) p {
      background: rgba(21, 25, 36, 0.82);
    }
    .lesson-interval-table__row:not(.lesson-interval-table__row--head):hover p {
      background: rgba(30, 35, 48, 0.9);
    }
    .lesson-interval-table__row--head {
      background: none;
    }
    .lesson-interval-table__row--head p {
      color: #211708;
      font-weight: 700;
      letter-spacing: 0.01em;
      background: linear-gradient(180deg, #f8cf72 0%, #efb83b 100%);
      box-shadow: inset 0 0 0 1px rgba(52, 37, 12, 0.2);
      border-bottom: 1px solid rgba(246, 194, 74, 0.28);
    }
    .lesson-interval-table__row--head p:last-child {
      text-align: center;
    }
    .lesson-interval-table__row:last-child p {
      border-bottom: 0;
    }
    .lesson-interval-count {
      font-weight: 500;
      color: #e4e9f1;
    }
    .lesson-interval-count__letter {
      color: #e8edf5;
      font-weight: 500;
    }
    .lesson-interval-count__arrow {
      margin: 0 0.26rem;
      color: rgba(220, 226, 236, 0.72);
      font-weight: 400;
    }
    .lesson-interval-count__number {
      color: #f8cf72;
      font-weight: 700;
    }
    .lesson-interval-result {
      text-align: center;
      color: #f8cf72;
      font-weight: 700;
      font-size: 1.05rem;
      letter-spacing: 0.01em;
    }
    .lesson-interval-table--accidentals .lesson-interval-table__row {
      grid-template-columns: 1fr;
    }
    .lesson-interval-sentence {
      color: #e7ecf3;
      font-weight: 600;
    }
    .lesson-interval-rule {
      margin: 0.9rem auto 0;
      width: min(980px, 100%);
      border-radius: 11px;
      border: 1px solid rgba(246, 194, 74, 0.22);
      background: linear-gradient(160deg, rgba(23, 25, 34, 0.78), rgba(12, 14, 20, 0.92));
      padding: 0.66rem 0.8rem;
    }
    .lesson-interval-rule p {
      margin: 0;
      max-width: none;
      text-align: left;
      line-height: 1.46;
    }
    .lesson-quality-compare {
      margin: 1.15rem auto 0;
      width: min(980px, 100%);
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.72rem;
    }
    .lesson-quality-compare__item {
      border-radius: 12px;
      border: 1px solid rgba(246, 194, 74, 0.24);
      background: rgba(17, 20, 30, 0.82);
      padding: 0.75rem 0.82rem;
      box-shadow: inset 0 1px 0 rgba(255, 240, 198, 0.1), 0 8px 18px rgba(0, 0, 0, 0.2);
    }
    .lesson-quality-compare__label {
      margin: 0;
      color: #f8cf72;
      font-weight: 700;
      font-size: 0.95rem;
      text-align: left;
      max-width: none;
    }
    .lesson-quality-compare__item p {
      margin: 0.26rem 0 0;
      max-width: none;
      text-align: left;
      line-height: 1.5;
    }
    .lesson-quality-example-card {
      margin: 0.95rem auto 0;
      width: min(980px, 100%);
      border-radius: 12px;
      border: 1px solid rgba(246, 194, 74, 0.26);
      background: linear-gradient(165deg, rgba(18, 20, 30, 0.78), rgba(11, 13, 20, 0.92));
      padding: 0.75rem 0.85rem;
      box-shadow: inset 0 1px 0 rgba(255, 242, 206, 0.1);
    }
    .lesson-quality-example-card p {
      margin: 0;
      max-width: none;
      text-align: left;
    }
    .lesson-quality-example-card p + p {
      margin-top: 0.5rem;
    }
    .lesson-quality-list {
      margin: 0.62rem auto 0;
      display: flex;
      gap: 0.44rem;
      flex-wrap: wrap;
      justify-content: center;
      width: min(980px, 100%);
    }
    .lesson-quality-grid {
      margin: 1.2rem auto 0;
      width: min(980px, 100%);
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.8rem;
    }
    .lesson-quality-card {
      border-radius: 12px;
      border: 1px solid rgba(246, 194, 74, 0.24);
      background: rgba(17, 20, 30, 0.82);
      padding: 0.78rem 0.84rem;
      box-shadow: inset 0 1px 0 rgba(255, 239, 197, 0.09), 0 10px 18px rgba(0, 0, 0, 0.2);
    }
    #interval-quality .lesson-quality-card h3 {
      margin: 0;
      text-align: left;
    }
    .lesson-quality-card p {
      margin: 0.44rem 0 0;
      max-width: none;
      text-align: left;
      line-height: 1.52;
    }
    .lesson-quality-card .lesson-half-step-badges {
      margin: 0.5rem 0 0.24rem;
    }
    .lesson-quality-example-grid {
        margin: 0.62rem 0 0;
        display: grid;
        gap: 0.42rem;
        align-items: stretch;
      }
    .lesson-quality-example-grid--two-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(clamp(4.6rem, 9vw, 6.2rem), 1fr);
        align-items: stretch;
      }
    #interval-quality > .lesson-quality-example-grid--two-col {
      width: min(980px, 100%);
      margin: 1rem auto 0;
      gap: 0.55rem;
    }
    .lesson-quality-example-grid p {
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.35rem;
        border-radius: 10px;
        border: 1px solid rgba(246, 194, 74, 0.2);
        background: rgba(12, 15, 24, 0.74);
        padding: 0.9rem 0.8rem;
        min-height: clamp(4.6rem, 9vw, 6.2rem);
        height: 100%;
      }
    .lesson-quality-note {
      margin-top: 1rem;
    }

    #interval-quality > h3 + p,
    #interval-quality > p + p,
    #interval-quality > p + .lesson-quality-example-grid,
    #interval-quality > .lesson-quality-example-grid + p {
      margin-top: clamp(1rem, 2.4vw, 1.6rem);
    }
    .lesson-chromatic-table-wrap {
      margin: 1.45rem auto 1.25rem;
      width: min(1120px, 100%);
      overflow-x: auto;
      border-radius: 12px;
      border: 1px solid rgba(246, 194, 74, 0.28);
      background: linear-gradient(165deg, rgba(14, 17, 25, 0.86), rgba(9, 12, 18, 0.95));
      box-shadow: inset 0 1px 0 rgba(255, 240, 198, 0.1), 0 12px 20px rgba(0, 0, 0, 0.24);
      scrollbar-width: thin;
    }
    .lesson-chromatic-table {
      width: 100%;
      min-width: 960px;
      border-collapse: separate;
      border-spacing: 0;
      table-layout: fixed;
    }
    .lesson-chromatic-table th,
    .lesson-chromatic-table td {
      padding: 0.62rem 0.45rem;
      border-right: 1px solid rgba(246, 194, 74, 0.16);
      border-bottom: 1px solid rgba(246, 194, 74, 0.16);
      text-align: center;
      font-size: 0.92rem;
      line-height: 1.25;
      white-space: nowrap;
    }
    .lesson-chromatic-table th:first-child {
      width: 116px;
      text-align: left;
      padding-left: 0.7rem;
      color: #f8cf72;
      font-weight: 700;
      background: rgba(21, 18, 11, 0.66);
      letter-spacing: 0.01em;
    }
    .lesson-chromatic-table td:last-child,
    .lesson-chromatic-table th:last-child {
      border-right: 0;
    }
    .lesson-chromatic-table tr:last-child th,
    .lesson-chromatic-table tr:last-child td {
      border-bottom: 0;
    }
    .lesson-chromatic-table__interval td {
      color: #211708;
      font-weight: 700;
      background: linear-gradient(180deg, #f8cf72 0%, #efb83b 100%);
      box-shadow: inset 0 0 0 1px rgba(52, 37, 12, 0.2);
    }
    .lesson-chromatic-table__semitones td {
      color: #dbe3ef;
      font-weight: 700;
      background: rgba(34, 40, 54, 0.76);
    }
    .lesson-chromatic-table__notes td {
      color: #d8f0df;
      font-weight: 700;
      background: linear-gradient(165deg, rgba(30, 61, 44, 0.78), rgba(19, 41, 30, 0.9));
    }
    #c-chromatic-reference p + .lesson-chromatic-table-wrap {
      margin-top: 1.7rem;
    }
    #c-chromatic-reference .lesson-chromatic-table-wrap {
      margin-bottom: 1.55rem;
    }
    #c-chromatic-reference .lesson-chromatic-table-wrap + p {
      margin-top: 1.35rem;
    }
    #c-chromatic-reference .theory-foundations-actions {
      width: min(980px, 100%);
      margin: 1.8rem auto 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.62rem;
      justify-content: center;
    }
    #c-chromatic-reference .theory-foundations-actions .theory-hero__button {
      text-align: center;
      justify-content: center;
    }
    .lesson-section p + .lesson-interval-table,
    .lesson-section ul + .lesson-interval-table,
    .lesson-section p + .lesson-quality-compare,
    .lesson-section p + .lesson-quality-example-card,
    .lesson-section p + .lesson-quality-grid,
    .lesson-section ul + .lesson-quality-grid,
    .lesson-section p + .lesson-image-figure,
    .lesson-section ul + .lesson-image-figure {
      margin-top: 1.45rem;
    }
    .lesson-section .lesson-interval-table + p,
    .lesson-section .lesson-interval-table + ul,
    .lesson-section .lesson-quality-compare + p,
    .lesson-section .lesson-quality-example-card + p,
    .lesson-section .lesson-quality-grid + p,
    .lesson-section .lesson-quality-grid + h3,
    .lesson-section .lesson-image-figure + p,
    .lesson-section .lesson-image-figure + ul {
      margin-top: 1.25rem;
    }
    #interval-number p + .lesson-interval-table,
    #interval-number ul + .lesson-interval-table {
      margin-top: 1.55rem;
    }
    #interval-number .lesson-interval-table {
      margin-bottom: 1.35rem;
    }
    #interval-number .lesson-interval-table + p,
    #interval-number .lesson-interval-table + ul {
      margin-top: 1.3rem;
    }

    .lesson-half-step-badges {
      margin: 0.46rem 0 0;
      display: flex;
      gap: 0.44rem;
      flex-wrap: wrap;
    }

    .lesson-half-step-badges span {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      border: 1px solid rgba(246, 194, 74, 0.48);
      padding: 0.18rem 0.54rem;
      font-size: 0.84rem;
      color: #1a130a;
      background: linear-gradient(180deg, #f8cf72 0%, #f0b93d 100%);
      box-shadow: inset 0 0 0 1px rgba(41, 29, 9, 0.18);
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .lesson-string-map {
      margin: 0.45rem 0 0;
      display: grid;
      gap: 0.33rem;
    }

    .lesson-string-map__row {
      display: grid;
      grid-template-columns: auto auto 1fr;
      gap: 0.55rem;
      align-items: center;
      border: 1px solid rgba(246, 194, 74, 0.2);
      border-radius: 9px;
      padding: 0.36rem 0.45rem;
      background: rgba(14, 16, 26, 0.72);
    }

    .lesson-string-map__row strong {
      color: #ffe1a1;
    }

    .lesson-string-map__row span {
      color: #d4dcea;
      font-size: 0.9rem;
    }

    .lesson-image-figure {
      margin: 0.75rem auto 0;
      width: min(1180px, 100%);
      border-radius: 0;
      border: 0;
      background: transparent;
      padding: 0;
      box-shadow: none;
    }

    .lesson-image {
      display: block;
      width: 100%;
      height: auto;
      border-radius: 0;
    }

    .lesson-pill-row {
      margin: 0.48rem auto 0;
      display: flex;
      gap: 0.42rem;
      width: fit-content;
      max-width: 100%;
      justify-content: center;
      flex-wrap: wrap;
      overflow-x: auto;
      padding: 0.1rem 0.05rem 0.2rem;
      scrollbar-width: thin;
    }

    .lesson-pill-row--chromatic {
      width: min(1160px, 100%);
      justify-content: center;
    }

    .lesson-pill {
      flex: 0 0 auto;
      min-width: clamp(2.15rem, 4.8vw, 3.45rem);
      padding: 0.26rem 0.55rem;
      border-radius: 9px;
      border: 1px solid rgba(246, 194, 74, 0.45);
      background: linear-gradient(180deg, #f8cf72 0%, #f0b93d 100%);
      color: #1a1309;
      text-align: center;
      font-weight: 700;
      font-size: 0.9rem;
      line-height: 1.2;
      white-space: nowrap;
      box-shadow: inset 0 0 0 1px rgba(40, 28, 9, 0.2);
    }

    .lesson-pill-row--chromatic .lesson-pill {
      min-width: clamp(3.1rem, 8vw, 4.6rem);
    }

    .lesson-pill-row--compact .lesson-pill {
      min-width: clamp(2rem, 4.2vw, 3rem);
    }

    .lesson-pill--muted {
      background: rgba(19, 22, 32, 0.8);
      border-color: rgba(246, 194, 74, 0.34);
      color: #ecd9ad;
      box-shadow: none;
    }    .lesson-hero-media {
      position: relative;
      width: 100%;
      min-height: clamp(380px, 47vw, 660px);
      border-radius: 0;
      border-top: 1px solid rgba(246, 194, 74, 0.46);
      border-bottom: 1px solid rgba(246, 194, 74, 0.46);
      border-left: 0;
      border-right: 0;
      overflow: hidden;
      display: flex;
      align-items: stretch;
      margin-top: 0;
      margin-bottom: 0;
      box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
      isolation: isolate;
    }

    .lesson-hero-media__bg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      z-index: 0;
      transform: scale(1.04);
      filter: contrast(1.07) saturate(0.92);
      animation: hero-bg-settle 1700ms ease-out both;
    }

    .lesson-hero-media::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      background:
        radial-gradient(1200px 420px at 50% 46%, rgba(208, 165, 78, 0.22), rgba(8, 10, 15, 0) 62%),
        radial-gradient(900px 380px at 78% 15%, rgba(76, 123, 190, 0.14), rgba(8, 10, 15, 0) 65%),
        linear-gradient(165deg, rgba(4, 7, 12, 0.28), rgba(6, 8, 12, 0.64));
      pointer-events: none;
    }

    .lesson-hero-media::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 2;
      background:
        radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0.64) 92%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.66));
      pointer-events: none;
    }

    .lesson-hero-overlay {
      position: absolute;
      inset: 0;
      z-index: 4;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: clamp(0.95rem, 2.5vw, 1.8rem);
    }

    .lesson-hero-overlay::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      background: linear-gradient(180deg, rgba(8, 10, 14, 0.14), rgba(8, 10, 14, 0.24));
      pointer-events: none;
    }

    .lesson-hero-overlay::after {
      content: none;
    }

    .lesson-hero-overlay__content {
      position: relative;
      z-index: 2;
      width: min(1120px, 100%);
      padding: clamp(0.35rem, 1.5vw, 0.85rem);
    }
.lesson-hero-overlay__kicker {
      margin: 0 0 0.35rem;
      color: rgba(255, 255, 255, 0.6);
      -webkit-text-fill-color: transparent;
      -webkit-text-stroke: 1px rgba(255, 255, 255, 0.74);
      font-size: clamp(1rem, 3.1vw, 2.35rem);
      letter-spacing: 0.14em;
      text-transform: uppercase;
      font-weight: 700;
      line-height: 1;
      text-shadow: 0 8px 20px rgba(0, 0, 0, 0.48), 0 0 24px rgba(255, 255, 255, 0.24);
      --hero-reveal-delay: 80ms;
    }

    .lesson-hero-overlay__content h1 {
      margin: 0.25rem 0 0.38rem;
      color: #f8cf72;
      font-size: clamp(1.78rem, 4vw, 3.25rem);
      line-height: 1.08;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.68), 0 0 26px rgba(248, 207, 114, 0.16);
      position: relative;
      z-index: 1;
      --hero-reveal-delay: 180ms;
    }

    .lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker) {
      margin: 0.3rem auto 0;
      color: #ecf1f9;
      line-height: 1.5;
      font-size: clamp(1rem, 1.35vw, 1.22rem);
      max-width: 88ch;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.66);
      position: relative;
      z-index: 1;
      --hero-reveal-delay: 300ms;
    }

    body.has-scroll-reveal .lesson-hero-overlay__kicker,
    body.has-scroll-reveal .lesson-hero-overlay__content h1,
    body.has-scroll-reveal .lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker) {
      opacity: 0;
      transform: translate3d(0, 18px, 0) scale(0.985);
      filter: blur(1.6px);
      transition:
        opacity 760ms var(--hero-enter-ease, cubic-bezier(0.2, 0.74, 0.22, 1)),
        transform 760ms var(--hero-enter-ease, cubic-bezier(0.2, 0.74, 0.22, 1)),
        filter 760ms var(--hero-enter-ease, cubic-bezier(0.2, 0.74, 0.22, 1));
      transition-delay: var(--hero-reveal-delay, 0ms);
      will-change: opacity, transform, filter;
    }

    body.has-scroll-reveal .lesson-hero-overlay__kicker.is-revealed,
    body.has-scroll-reveal .lesson-hero-overlay__content h1.is-revealed,
    body.has-scroll-reveal .lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker).is-revealed {
      opacity: 1;
      transform: none;
      filter: blur(0);
    }

    body.has-scroll-reveal .lesson-section > * {
      opacity: 0;
      transform: translate3d(0, 22px, 0);
      transition:
        opacity 640ms var(--section-enter-ease),
        transform 640ms var(--section-enter-ease);
      transition-delay: calc(24ms + (var(--reveal-index, 0) * 58ms));
      will-change: transform, opacity;
    }

    body.has-scroll-reveal .lesson-section > *.is-revealed {
      opacity: 1;
      transform: none;
    }
.lesson-nav-list a {
      color: #f1d68e;
      text-decoration: none;
    }

    .lesson-nav-list a:hover {
      text-decoration: none;
    }
  

    .lesson-sticky-nav {
      position: sticky;
      top: 0.45rem;
      z-index: 7;
      margin: 0 0 0.75rem;
      border-radius: 0;
      border: 1px solid rgba(204, 174, 90, 0.28);
      background: linear-gradient(145deg, rgba(22, 24, 31, 0.95), rgba(10, 11, 14, 0.98));
      padding: 0.6rem;
      display: grid;
      gap: 0.55rem;
      box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
    }

    .lesson-sticky-nav__links {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
    }

    .lesson-sticky-nav__links a {
      padding: 0.35rem 0.58rem;
      border-radius: 999px;
      border: 1px solid rgba(204, 174, 90, 0.24);
      color: #d9dfeb;
      text-decoration: none;
      font-size: 0.86rem;
      line-height: 1.2;
    }

    .lesson-sticky-nav__links a:hover {
      border-color: rgba(246, 209, 121, 0.7);
      color: #fff4d3;
    }

    .lesson-sticky-nav__links a.is-active {
      background: linear-gradient(180deg, #f8cf72 0%, #f0b93d 100%);
      border-color: rgba(246, 194, 74, 0.95);
      color: #17120a;
      font-weight: 700;
    }

    .lesson-sticky-nav__search {
      display: grid;
      grid-template-columns: auto minmax(140px, 1fr) auto;
      gap: 0.45rem;
      align-items: center;
    }

    .lesson-sticky-nav__search label {
      color: #d3d9e5;
      font-size: 0.86rem;
      margin: 0;
    }

    .lesson-sticky-nav__search input {
      border-radius: 0;
      border: 1px solid rgba(204, 174, 90, 0.3);
      background: rgba(12, 14, 18, 0.95);
      color: #f0f3f8;
      padding: 0.42rem 0.52rem;
      min-height: 36px;
    }

    .lesson-sticky-nav__search button {
      border-radius: 0;
      border: 1px solid rgba(204, 174, 90, 0.35);
      background: rgba(24, 20, 12, 0.8);
      color: #f1d68e;
      min-height: 36px;
      padding: 0.38rem 0.6rem;
      font-size: 0.82rem;
    }

    .lesson-sticky-nav__hint {
      margin: 0;
      color: #bec5d2;
      font-size: 0.82rem;
      grid-column: 1 / -1;
    }

    .lesson-section h3.is-search-match {
      color: #ffdf94;
      text-shadow: 0 0 10px rgba(246, 194, 74, 0.28);
    }

    .lesson-section.is-filter-empty {
      opacity: 0.68;
    }

    .back-to-top {
      position: fixed;
      right: clamp(0.7rem, 1.8vw, 1.25rem);
      bottom: clamp(0.75rem, 1.8vw, 1.25rem);
      width: 46px;
      height: 46px;
      border-radius: 999px;
      border: 1px solid rgba(246, 194, 74, 0.78);
      background: linear-gradient(180deg, #f8cf72 0%, #f0b93d 100%);
      color: #151008;
      font-size: 1.35rem;
      font-weight: 700;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 246, 219, 0.55);
      cursor: pointer;
      z-index: 50;
      opacity: 0;
      transform: translate3d(0, 14px, 0) scale(0.96);
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
      animation: back-to-top-float 2.2s ease-in-out infinite;
    }

    .back-to-top.is-visible {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
      pointer-events: auto;
    }

    .back-to-top:hover {
      filter: brightness(1.06);
      transform: translate3d(0, -2px, 0) scale(1.03);
    }

    .back-to-top:focus-visible {
      outline: 2px solid #fff6dd;
      outline-offset: 2px;
    }
    @keyframes back-to-top-float {
      0%,
      100% { transform: translate3d(0, 0, 0) scale(1); }
      50% { transform: translate3d(0, -4px, 0) scale(1); }
    }

    @media (prefers-reduced-motion: reduce) {
      .lesson-hero-media__bg,
      .lesson-hero-overlay__kicker,
      .lesson-hero-overlay__content h1,
      .lesson-hero-overlay__content p,
      .lesson-section > *,
      .lesson-section::after,
      .back-to-top {
        animation: none !important;
        transition: none !important;
      }

      .lesson-hero-overlay__kicker,
      .lesson-hero-overlay__content h1,
      .lesson-hero-overlay__content p,
      .lesson-section > * {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
      }
    }

        @media (max-width: 900px) {
      .lesson-hero-media {
        min-height: clamp(320px, 62vw, 520px);
      }

      .lesson-hero-overlay__content {
        width: min(980px, 100%);
        padding: clamp(0.3rem, 1.9vw, 0.6rem);
      }
      .lesson-hero-overlay__kicker {
        margin-bottom: 0.22rem;
        font-size: clamp(0.92rem, 4.1vw, 1.35rem);
        letter-spacing: 0.09em;
      }

.lesson-hero-overlay__content h1 {
        font-size: clamp(1.45rem, 5.1vw, 2.1rem);
      }

      .lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker) {
        font-size: clamp(0.94rem, 3.1vw, 1.05rem);
        max-width: 60ch;
      }

      .lesson-content-wrap {
      position: relative;
        --section-pad-top: clamp(1.45rem, 5vw, 2rem);
        --section-pad-x: clamp(0.88rem, 4vw, 1.35rem);
        --section-pad-bottom: clamp(1.55rem, 5.2vw, 2.15rem);
      }

      .lesson-section + .lesson-section {
      position: relative;
      padding-top: calc(var(--section-pad-top) + clamp(0.9rem, 1.6vw, 1.2rem));
    }

      .lesson-section + .lesson-section::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: clamp(8px, 1.1vw, 12px);
      background: var(--amp-gold-gradient);
      pointer-events: none;
      z-index: 3;
    }

      .lesson-section h2 {
        font-size: clamp(1.14rem, 5vw, 1.45rem);
      }

      .lesson-diagram-grid {
        grid-template-columns: 1fr;
      }
      .lesson-quality-compare,
      .lesson-quality-grid {
        grid-template-columns: 1fr;
      }
      .lesson-quality-example-grid--two-col {
        grid-template-columns: 1fr;
      }
      #c-chromatic-reference .theory-foundations-actions {
        grid-template-columns: 1fr;
      }
      .lesson-chromatic-table th,
      .lesson-chromatic-table td {
        font-size: 0.86rem;
      }
      .lesson-interval-table__row {
        grid-template-columns: 1fr;
        gap: 0.28rem;
      }
      .lesson-interval-table__row p,
      .lesson-interval-rule p {
        text-align: center;
      }

      .lesson-pill-row {
        gap: 0.34rem;
      }

      .lesson-pill {
        font-size: 0.84rem;
        padding: 0.22rem 0.48rem;
      }

      .lesson-sticky-nav {
        top: 0.25rem;
      }

      .lesson-sticky-nav__search {
        grid-template-columns: 1fr;
      }

      .lesson-sticky-nav__search button {
        width: max-content;
      }

      .back-to-top {
        width: 42px;
        height: 42px;
        right: 0.62rem;
        bottom: 0.72rem;
      }
    }

/* Editorial Foundations redesign */
:root {
  --ib-gold: #d6a441;
  --ib-gold-bright: #efc65f;
  --ib-ink: #080808;
  --ib-text: #f5f5f5;
  --ib-line: rgba(214, 164, 65, .3);
}

.music-theory-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--ib-ink);
}

.lesson-hero-media {
  position: relative;
  display: flex;
  min-height: clamp(520px, 68vh, 760px);
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(214, 164, 65, .68);
  box-shadow: none;
  isolation: isolate;
}

.lesson-hero-media__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  filter: grayscale(.12) contrast(1.12) brightness(.68);
  transform: scale(1.02);
  animation: none;
}

.lesson-hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .97), rgba(0, 0, 0, .84) 42%, rgba(0, 0, 0, .3) 76%, rgba(0, 0, 0, .16)),
    linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .72));
}

.lesson-hero-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 34%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
}

.lesson-hero-overlay {
  position: relative;
  inset: auto;
  z-index: 3;
  display: flex;
  width: min(1440px, 100%);
  margin: 0 auto;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(3rem, 8vw, 7rem);
  text-align: left;
}

.lesson-hero-overlay::before,
.lesson-hero-overlay::after {
  content: none;
}

.lesson-hero-overlay__content {
  width: min(780px, 68vw);
  padding: 0;
}

.lesson-hero-overlay__kicker {
  display: inline-flex;
  margin: 0 0 1.25rem !important;
  padding: .42rem .75rem;
  border: 1px solid rgba(214, 164, 65, .58);
  border-radius: 999px;
  color: var(--ib-gold);
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.2;
  text-shadow: none;
  text-transform: uppercase;
}

.lesson-hero-overlay__content h1 {
  max-width: 10ch;
  margin: 0;
  color: var(--ib-text);
  font-family: "Cal Sans", sans-serif;
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .9;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .74);
}

.lesson-hero-overlay__content h1::after {
  content: "";
  display: block;
  width: 82px;
  height: 3px;
  margin: 1.35rem 0 1.2rem;
  background: var(--ib-gold);
}

.lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker) {
  max-width: 62ch;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.65;
  text-align: left;
  text-shadow: none;
}

.lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker) + p {
  margin-top: .7rem;
}

.lesson-content-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: clamp(4rem, 7vw, 6.5rem) 1rem 0;
  background:
    linear-gradient(rgba(8, 8, 8, .92), rgba(8, 8, 8, .97)),
    url("../images/backgrounds/blackhex.webp") center top / 1500px auto repeat-y;
}

.lesson-content-wrap::before {
  content: "Foundations lesson";
  position: static;
  display: block;
  width: min(920px, 100%);
  height: auto;
  margin: 0 auto 1rem;
  color: var(--ib-gold);
  background: none;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.lesson-section,
.lesson-section:nth-of-type(even) {
  position: relative;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 0 0 clamp(4.5rem, 7vw, 6rem);
  border: 0;
  background: transparent;
  overflow: visible;
  isolation: auto;
}

.lesson-section + .lesson-section {
  padding-top: clamp(3.5rem, 6vw, 5rem);
  border-top: 1px solid var(--ib-line);
}

.lesson-section::before,
.lesson-section::after,
.lesson-section + .lesson-section::before {
  content: none;
}

#interval-foundation::after,
#counting-intervals::after,
#interval-number::after,
#interval-quality::after,
#c-chromatic-reference::after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
}

.lesson-section > * {
  position: relative;
  z-index: 1;
  width: auto;
  margin-left: 0;
  margin-right: 0;
}

.lesson-section > h2:first-child {
  max-width: 16ch;
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  color: var(--ib-gold-bright);
  font-family: "Cal Sans", sans-serif;
  font-size: clamp(2.6rem, 5vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .96;
  text-align: left;
  text-shadow: none;
}

.lesson-section > h2:first-child::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-top: 1rem;
  background: var(--ib-gold);
}

.lesson-section > h2:not(:first-child) {
  max-width: 24ch;
  margin: clamp(3rem, 6vw, 5rem) 0 1rem;
  padding: 0;
  border: 0;
  color: var(--ib-gold-bright);
  font-family: "Cal Sans", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-align: left;
  text-shadow: none;
}

.lesson-section h3,
#interval-quality .lesson-quality-card h3 {
  width: auto;
  margin: 2.25rem 0 .65rem;
  color: var(--ib-gold-bright);
  font-family: "Cal Sans", sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -.01em;
  text-align: left;
}

.lesson-section p,
.lesson-section ul {
  max-width: 76ch;
  margin-left: 0;
  margin-right: 0;
  color: var(--ib-text);
  font-size: clamp(.98rem, 1.1vw, 1.06rem);
  line-height: 1.75;
  text-align: left;
}

.lesson-section p {
  margin-top: .5rem;
}

.lesson-section p + p {
  margin-top: .8rem;
}

.lesson-section ul {
  width: auto;
  margin-top: .8rem;
  padding-left: 1.25rem;
  list-style-position: outside;
}

.lesson-section li {
  margin: .3rem 0;
  text-align: left;
}

.lesson-section li::marker {
  color: var(--ib-gold);
}

.lesson-section strong,
.lesson-interval-number-highlight,
.lesson-interval-count__number,
.lesson-interval-result {
  color: var(--ib-gold-bright);
}

.lesson-interval-table,
.lesson-interval-rule,
.lesson-quality-compare__item,
.lesson-quality-example-card,
.lesson-quality-card,
.lesson-quality-example-grid p,
.lesson-chromatic-table-wrap {
  border: 1px solid var(--ib-line);
  border-radius: 8px;
  background: #0e0e0e;
  box-shadow: none;
}

.lesson-interval-table,
.lesson-interval-rule,
.lesson-quality-compare,
.lesson-quality-example-card,
.lesson-quality-grid,
#interval-quality > .lesson-quality-example-grid--two-col,
.lesson-chromatic-table-wrap,
#c-chromatic-reference .theory-foundations-actions {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.lesson-interval-table__row p,
.lesson-interval-table__row:not(.lesson-interval-table__row--head):nth-of-type(even) p,
.lesson-interval-table__row:not(.lesson-interval-table__row--head):hover p {
  color: var(--ib-text);
  background: transparent;
  border-color: rgba(214, 164, 65, .18);
}

.lesson-interval-table__row--head p,
.lesson-chromatic-table__interval td {
  color: #171109;
  background: var(--ib-gold);
  box-shadow: none;
}

.lesson-chromatic-table__semitones td,
.lesson-chromatic-table__notes td,
.lesson-chromatic-table__names td,
.lesson-chromatic-table th:first-child {
  color: var(--ib-text);
  background: #121212;
}

.lesson-chromatic-table__names td {
  color: var(--ib-gold-bright);
  white-space: normal;
}

.lesson-half-step-badges span {
  border-radius: 5px;
  color: #171109;
  background: var(--ib-gold);
  box-shadow: none;
}

#c-chromatic-reference .theory-foundations-actions {
  gap: .8rem;
  margin-top: 3rem;
}

/* The tool CTA is a single action; let it occupy the same full row as the navigation below. */
#c-chromatic-reference .theory-foundations-actions[aria-label="Interactive interval tools"] {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1.65rem;
}

#c-chromatic-reference .lesson-inline-link {
  color: var(--ib-gold-bright);
  font-weight: 700;
  text-decoration-color: rgba(214, 164, 65, .5);
  text-underline-offset: .18em;
}

#c-chromatic-reference .lesson-inline-link:hover,
#c-chromatic-reference .lesson-inline-link:focus-visible {
  color: #fff0b8;
  outline: none;
}

#c-chromatic-reference .theory-foundations-actions .theory-hero__button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.25rem;
  border: 1px solid #9f792e;
  border-radius: 8px;
  color: #f7f3ea;
  background: rgba(5, 5, 5, .74);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-decoration: none;
  text-transform: uppercase;
}

#c-chromatic-reference .theory-foundations-actions .theory-hero__button--primary {
  color: #171109;
  border-color: #efd58c;
  background: var(--ib-gold);
}

#c-chromatic-reference .lesson-faq-disclosure {
  width: 100%;
  margin: clamp(3rem, 6vw, 5rem) 0 0;
  border-top: 1px solid var(--ib-line);
  border-bottom: 1px solid var(--ib-line);
}

#c-chromatic-reference .lesson-faq-disclosure > summary {
  position: relative;
  display: flex;
  min-height: 92px;
  align-items: center;
  padding: 1.25rem 4rem 1.25rem 0;
  color: var(--ib-gold-bright);
  font-family: "Cal Sans", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.05;
  list-style: none;
  cursor: pointer;
}

#c-chromatic-reference .lesson-faq-disclosure > summary::-webkit-details-marker { display: none; }
#c-chromatic-reference .lesson-faq-disclosure > summary::after { content: "+"; position: absolute; top: 50%; right: .5rem; color: var(--ib-gold); font-family: sans-serif; font-size: 2rem; font-weight: 300; line-height: 1; transform: translateY(-50%); }
#c-chromatic-reference .lesson-faq-disclosure[open] > summary::after { content: "−"; }
#c-chromatic-reference .lesson-faq-disclosure > summary:hover,
#c-chromatic-reference .lesson-faq-disclosure > summary:focus-visible { color: #fff0b8; outline: none; }
#c-chromatic-reference .lesson-faq-disclosure > .faq-accordion { margin-top: 0; margin-bottom: 2rem; }

.lesson-bottom-divider {
  display: none;
}

.theory-lesson-page .lesson-content-wrap > .lesson-content-visualizer {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  width: 100vw;
  max-width: none;
  height: 62px;
  margin: 0 0 0 calc(50% - 50vw) !important;
  padding: 0 clamp(.7rem, 2.2vw, 2.2rem) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

.theory-lesson-page .lesson-content-wrap > .lesson-content-visualizer::before,
.theory-lesson-page .lesson-content-wrap > .lesson-content-visualizer::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

.site-footer {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: var(--ib-ink) !important;
}

@media (max-width: 760px) {
  .lesson-hero-media {
    min-height: 620px;
  }

  .lesson-hero-media__bg {
    object-position: 70% center;
  }

  .lesson-hero-media::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .95) 68%);
  }

  .lesson-hero-overlay {
    align-items: flex-end;
    padding: 2rem 1.15rem 3.5rem;
  }

  .lesson-hero-overlay__content {
    width: 100%;
  }

  .lesson-hero-overlay__content h1 {
    font-size: clamp(3.1rem, 15vw, 4.8rem);
  }

  .lesson-content-wrap {
    padding-top: 3.25rem;
  }

  .lesson-section {
    padding-bottom: 3.75rem;
  }

  .lesson-section + .lesson-section {
    padding-top: 3.25rem;
  }

  .lesson-section > h2:first-child {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }

  .lesson-quality-compare,
  .lesson-quality-example-grid--two-col,
  #c-chromatic-reference .theory-foundations-actions {
    grid-template-columns: 1fr;
  }
}

/* Compact vertical chromatic reference: all values remain visible without horizontal scrolling. */
.lesson-chromatic-table-wrap { overflow: visible; }

.lesson-chromatic-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.lesson-chromatic-table thead th {
  padding: .8rem .7rem;
  color: #171109;
  background: var(--ib-gold);
  border-right: 1px solid rgba(23, 17, 9, .18);
  border-bottom: 1px solid var(--ib-line);
  text-align: left;
  font-weight: 800;
  white-space: normal;
}

.lesson-chromatic-table thead th:nth-child(1) { width: 14%; }
.lesson-chromatic-table thead th:nth-child(2) { width: 16%; }
.lesson-chromatic-table thead th:nth-child(3) { width: 45%; }
.lesson-chromatic-table thead th:nth-child(4) { width: 25%; }

.lesson-chromatic-table tbody th,
.lesson-chromatic-table tbody td {
  padding: .72rem .7rem;
  border-right: 1px solid rgba(214, 164, 65, .16);
  border-bottom: 1px solid rgba(214, 164, 65, .16);
  color: var(--ib-text);
  background: #0e0e0e;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.lesson-chromatic-table tbody th {
  color: var(--ib-gold-bright);
  font-weight: 800;
}

.lesson-chromatic-table tbody tr:nth-child(even) th,
.lesson-chromatic-table tbody tr:nth-child(even) td { background: #121212; }

.lesson-chromatic-table__octave th,
.lesson-chromatic-table__octave td {
  color: var(--ib-gold-bright);
  border-top: 1px solid rgba(214, 164, 65, .5);
}

.lesson-chromatic-table tr:last-child th,
.lesson-chromatic-table tr:last-child td { border-bottom: 0; }

.lesson-chromatic-table th:last-child,
.lesson-chromatic-table td:last-child { border-right: 0; }

.lesson-interval-count__separator {
  display: inline-block;
  margin-right: .45rem;
  color: var(--ib-text);
}

/* Keep every interval-example row on one shared column grid. */
.lesson-interval-table:not(.lesson-interval-table--accidentals) .lesson-interval-table__row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr) minmax(0, 1fr);
}

.lesson-interval-table:not(.lesson-interval-table--accidentals) .lesson-interval-table__row > p {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.lesson-interval-table:not(.lesson-interval-table--accidentals) .lesson-interval-table__row > p:nth-child(3) {
  text-align: center;
}

@media (max-width: 720px) {
  .lesson-interval-table:not(.lesson-interval-table--accidentals) .lesson-interval-table__row {
    grid-template-columns: 1fr;
  }
}

/* Editorial cleanup: reserve boxes for genuine reference tables. */
.lesson-quality-compare {
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: 2rem;
}

.lesson-quality-compare__item {
  padding: 0 0 0 1.25rem;
  border: 0;
  border-left: 2px solid var(--ib-gold);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lesson-quality-example-card {
  padding: 1.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--ib-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lesson-quality-grid {
  gap: clamp(3rem, 7vw, 7rem);
  margin-top: 3rem;
}

.lesson-quality-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#interval-quality .lesson-quality-card h3 {
  margin-top: 0;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--ib-line);
}

.lesson-quality-example-grid {
  gap: 0;
  border-top: 1px solid rgba(214, 164, 65, .2);
}

.lesson-quality-example-grid p,
.lesson-quality-example-grid--two-col p {
  min-height: 0;
  padding: .9rem 0;
  border: 0;
  border-bottom: 1px solid rgba(214, 164, 65, .2);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  align-items: flex-start;
  text-align: left;
}

.lesson-quality-example-grid--two-col p:nth-child(odd) {
  padding-right: 1.25rem;
}

.lesson-quality-example-grid--two-col p:nth-child(even) {
  padding-left: 1.25rem;
  border-left: 1px solid rgba(214, 164, 65, .2);
}

.lesson-interval-rule {
  padding: .2rem 0 .2rem 1.25rem;
  border: 0;
  border-left: 2px solid var(--ib-gold);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lesson-interval-table--accidentals {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lesson-interval-table--accidentals .lesson-interval-table__row p {
  padding: .85rem 0;
  border-right: 0;
  border-bottom: 1px solid rgba(214, 164, 65, .2);
  background: transparent;
}

.lesson-image-figure {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 720px) {
  .lesson-quality-example-grid--two-col p:nth-child(odd),
  .lesson-quality-example-grid--two-col p:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .lesson-chromatic-table thead th,
  .lesson-chromatic-table tbody th,
  .lesson-chromatic-table tbody td {
    padding: .58rem .38rem;
    font-size: clamp(.68rem, 2.8vw, .82rem);
  }

  .lesson-chromatic-table thead th:nth-child(1) { width: 16%; }
  .lesson-chromatic-table thead th:nth-child(2) { width: 17%; }
  .lesson-chromatic-table thead th:nth-child(3) { width: 42%; }
  .lesson-chromatic-table thead th:nth-child(4) { width: 25%; }
}
