/* Page-specific styles: chords-introduction-to-triads */
.music-theory-main {
      --hero-enter-ease: cubic-bezier(0.2, 0.74, 0.22, 1);
      --section-enter-ease: cubic-bezier(0.18, 0.76, 0.24, 1);
      width: 100vw;
      max-width: none;
      margin: 0;
      margin-left: calc(50% - 50vw);
      padding-top: 0;
      padding-bottom: 0;
      background: #000;
    }
    .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: #ddb357;
      background: #070a10;
    }
    .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);
      --section-surface: var(--section-fill);
      background: var(--section-surface);
      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);
      --section-surface: var(--section-fill);
      background: var(--section-surface);
    }
    .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: "";
      position: absolute;
      inset: 0;
      background: none;
      pointer-events: none;
      z-index: 1;
    }

    #chords-intro-triads-sevenths::after,
    #diminished-augmented-triads::after {
      background-image: url("../images/backgrounds/blackhex.webp");
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0.12;
    }

    #next-section::after,
    #suspended-triads::after {
      background-image: url("../images/backgrounds/paisley2.webp");
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0.2;
    }
    .lesson-section > * {
      position: relative;
      z-index: 5;
      width: min(980px, 100%);
      margin-left: auto;
      margin-right: auto;
    }
    .lesson-section h2 {
      margin: 0 0 1.1rem;
      color: #f8cf72;
      font-size: clamp(1.22rem, 2.55vw, 2rem);
      line-height: 1.18;
      text-align: center;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    .lesson-section h3 {
      margin: 1rem 0 0.4rem;
      color: #f8cf72;
      font-size: 1.03rem;
      text-align: center !important;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    }
    .lesson-section h3.lesson-subsection-title {
      font-size: clamp(1.4rem, 2.4vw, 1.85rem);
      margin-top: 1.15rem;
      margin-bottom: 0.7rem;
    }
    .lesson-section p {
      margin: 0.72rem 0 0;
      color: #e1e6ee;
      line-height: 1.72;
      font-size: clamp(1rem, 1.08vw, 1.12rem);
      max-width: min(84ch, 100%);
      margin-left: auto;
      margin-right: auto;
      text-align: left;
      text-wrap: pretty;
    }
    .lesson-section p + p {
      margin-top: 0.86rem;
    }
    .lesson-content-wrap .lesson-section > h2,
    .lesson-content-wrap .lesson-section > h3 {
      width: 100%;
      max-width: none;
      margin-left: 0;
      margin-right: 0;
      text-align: center !important;
    }
    .lesson-def-link {
      color: #f6c24a;
      font-weight: 700;
      text-decoration: none;
    }
    .lesson-def-link:hover,
    .lesson-def-link:focus-visible {
      color: #ffe29a;
      text-decoration: none;
    }
    .lesson-highlight {
      color: #f6c24a;
      font-weight: 700;
    }
    .lesson-center {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }
    .lesson-tertian-diagram {
      margin: 1.25rem auto 1.15rem;
      width: min(860px, 100%);
      padding: 0.85rem 0.9rem 0.95rem;
      border-radius: 12px;
      border: 1px solid rgba(246, 194, 74, 0.3);
      background: #111520;
      box-shadow: inset 0 1px 0 rgba(255, 242, 206, 0.12), 0 12px 24px rgba(0, 0, 0, 0.24);
    }
    .lesson-tertian-diagram__notes,
    .lesson-tertian-diagram__degrees {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      align-items: end;
      justify-items: center;
      gap: 0.3rem;
    }
    .lesson-tertian-diagram__notes {
      margin: 0;
      color: #bec7d7;
    }
    .lesson-tertian-diagram__note {
      font-size: clamp(1.02rem, 1.8vw, 1.28rem);
      line-height: 1.1;
      font-weight: 600;
      letter-spacing: 0.01em;
      opacity: 0.82;
    }
    .lesson-tertian-diagram__note--active {
      color: #f6c24a;
      font-size: clamp(1.26rem, 2.25vw, 1.62rem);
      font-weight: 700;
      opacity: 1;
      text-shadow: 0 0 12px rgba(246, 194, 74, 0.22);
    }
    .lesson-tertian-diagram__degrees {
      margin: 0.42rem 0 0;
      color: #aeb8c8;
    }
    .lesson-tertian-diagram__degree {
      font-size: 0.92rem;
      line-height: 1;
      opacity: 0.8;
    }
    .lesson-tertian-diagram__degree--active {
      color: #f6c24a;
      font-size: 1.1rem;
      font-weight: 700;
      opacity: 1;
    }
    .lesson-tertian-diagram__intervals {
      margin-top: 0.72rem;
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      row-gap: 0.52rem;
    }
    .lesson-tertian-diagram__interval {
      position: relative;
      height: 2.15rem;
      border-top: 2px solid rgba(246, 194, 74, 0.72);
    }
    .lesson-tertian-diagram__interval::after {
      content: "";
      position: absolute;
      right: -1px;
      top: -6px;
      width: 0;
      height: 0;
      border-top: 5px solid transparent;
      border-bottom: 5px solid transparent;
      border-left: 8px solid rgba(246, 194, 74, 0.86);
    }
    .lesson-tertian-diagram__interval span {
      position: absolute;
      left: 50%;
      top: 0.28rem;
      transform: translateX(-50%);
      white-space: nowrap;
      font-size: 0.82rem;
      color: #f6c24a;
      font-weight: 700;
      letter-spacing: 0.01em;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
      background: rgba(8, 11, 18, 0.75);
      padding: 0 0.34rem;
      border-radius: 4px;
    }
    .lesson-tertian-diagram__interval--one-three {
      grid-column: 1 / 4;
    }
    .lesson-tertian-diagram__interval--three-five {
      grid-column: 3 / 6;
    }
    .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-example-grid,
    .lesson-type-grid {
      margin: 1.25rem auto 1.15rem;
      display: grid;
      gap: 0.7rem;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      width: min(1160px, 100%);
    }
    .lesson-example-card,
    .lesson-type-card {
      padding: 0.74rem 0.8rem;
      border-radius: 11px;
      border: 1px solid rgba(246, 194, 74, 0.24);
      background: 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-example-card h4,
    .lesson-type-card h4 {
      margin: 0;
      color: #f8cf72;
      font-size: 0.98rem;
      font-weight: 700;
      text-align: center;
    }
    .lesson-formula {
      margin: 0.36rem 0 0;
      padding: 0.42rem 0.52rem;
      border-radius: 9px;
      background: rgba(14, 16, 26, 0.72);
      border: 1px solid rgba(246, 194, 74, 0.2);
      color: #f7d88f;
      text-align: center;
      line-height: 1.45;
      letter-spacing: 0.01em;
    }
    .lesson-formula strong {
      color: #ffe1a1;
    }
    .lesson-formula--list {
      margin: 0.9rem auto 1.05rem;
      text-align: left;
      width: min(84ch, 100%);
      padding: 0.62rem 0.78rem 0.7rem;
      background: rgba(12, 15, 24, 0.78);
    }
    .lesson-formula__row {
      margin: 0;
      display: grid;
      grid-template-columns: 168px 1fr;
      column-gap: 0.68rem;
      align-items: baseline;
      line-height: 1.4;
      max-width: none;
    }
    .lesson-formula__row + .lesson-formula__row {
      margin-top: 0.14rem;
    }
    .lesson-formula__row strong {
      justify-self: end;
      white-space: nowrap;
    }
    .lesson-formula__row span {
      justify-self: start;
      letter-spacing: 0.02em;
    }
    .lesson-triad-diagram {
      margin: 0.45rem 0 0;
      padding: 0.62rem 0.65rem 0.66rem;
      border-radius: 10px;
      border: 1px solid rgba(246, 194, 74, 0.24);
      background: rgba(12, 15, 24, 0.78);
    }
    .lesson-triad-diagram__notes,
    .lesson-triad-diagram__degrees {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      justify-items: center;
      align-items: center;
      gap: 0.26rem;
      margin: 0;
    }
    .lesson-triad-diagram__notes {
      color: #f6c24a;
      font-size: clamp(1.1rem, 2.1vw, 1.42rem);
      font-weight: 700;
      line-height: 1.15;
      letter-spacing: 0.01em;
      text-shadow: 0 0 10px rgba(246, 194, 74, 0.18);
    }
    .lesson-triad-diagram__degrees {
      margin-top: 0.3rem;
      color: #f6c24a;
      font-size: 1rem;
      font-weight: 700;
      line-height: 1;
    }
    .lesson-final-actions {
      margin: 1.35rem auto 0;
      width: min(980px, 100%);
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.62rem;
    }
    .lesson-final-actions .theory-hero__button {
      text-align: center;
      justify-content: center;
    }
    .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;
    }
    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-hero-media {
      position: relative;
      width: 100%;
      min-height: clamp(380px, 47vw, 660px);
      border-top: 1px solid rgba(246, 194, 74, 0.46);
      border-bottom: 1px solid rgba(246, 194, 74, 0.46);
      overflow: hidden;
      display: flex;
      align-items: stretch;
      margin: 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: rgba(0, 0, 0, 0.35);
      pointer-events: none;
    }

    .lesson-hero-media::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 2;
      background: rgba(0, 0, 0, 0.45);
      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__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);
      --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);
      --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);
    }

    .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%;
    }

    .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: #f0b93d;
      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 hero-bg-settle {
      0% { transform: scale(1.1); }
      100% { transform: scale(1.04); }
    }

    @keyframes back-to-top-float {
      0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
      50% { transform: translate3d(0, -4px, 0) scale(1); }
    }

    @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 {
        --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 h2 {
        font-size: clamp(1.14rem, 5vw, 1.45rem);
      }
      .lesson-section h3.lesson-subsection-title {
        font-size: clamp(1.26rem, 5.1vw, 1.55rem);
      }
      .lesson-example-grid,
      .lesson-type-grid {
        grid-template-columns: 1fr;
      }
      .lesson-final-actions {
        grid-template-columns: 1fr;
      }

      .back-to-top {
        width: 42px;
        height: 42px;
        right: 0.62rem;
        bottom: 0.72rem;
      }
    }

/* 2026 editorial Foundations redesign */
.music-theory-main {
  --triad-gold: #d6a441;
  --triad-gold-bright: #efc75e;
  --triad-text: #f5f5f2;
  --triad-muted: #c8c8c3;
  --triad-line: rgba(214, 164, 65, .34);
  background: #050505;
}

.lesson-hero-media {
  min-height: clamp(440px, 52vw, 720px);
  border-top-color: var(--triad-line);
  border-bottom-color: var(--triad-line);
  box-shadow: none;
}

.lesson-hero-media__bg {
  transform: none;
  filter: grayscale(.08) contrast(1.08) brightness(.72);
  animation: none;
}

.lesson-hero-media::before {
  background: linear-gradient(90deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .6) 48%, rgba(0, 0, 0, .38) 100%);
}

.lesson-hero-media::after {
  background: linear-gradient(0deg, #050505 0%, transparent 30%, rgba(0, 0, 0, .12) 100%);
}

.lesson-hero-overlay {
  justify-content: flex-start;
  text-align: left;
  padding: clamp(2rem, 7vw, 7.5rem);
}

.lesson-hero-overlay__content {
  width: min(850px, 100%);
  padding: 0;
}

.lesson-hero-overlay__kicker {
  margin: 0 0 1rem;
  color: var(--triad-gold-bright);
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
  font-size: clamp(.78rem, 1vw, .92rem);
  letter-spacing: .2em;
  text-shadow: none;
}

.lesson-hero-overlay__content h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--triad-gold-bright);
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: .94;
  letter-spacing: -.035em;
  text-wrap: balance;
  text-shadow: none;
}

.lesson-hero-overlay__content > p:not(.lesson-hero-overlay__kicker) {
  max-width: 62ch;
  margin: 1.5rem 0 0;
  color: var(--triad-text);
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.62;
  text-shadow: none;
}

.lesson-content-wrap {
  --section-pad-x: clamp(1.2rem, 7vw, 7.5rem);
  background:
    linear-gradient(rgba(5, 5, 5, .945), rgba(5, 5, 5, .945)),
    url("../images/backgrounds/blackhex.webp") center / cover no-repeat;
}

.lesson-content-wrap::before,
.lesson-section + .lesson-section::before,
.lesson-bottom-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--triad-gold), transparent);
}

/* No divider between the final lesson section and its visualiser. */
.lesson-bottom-divider {
  display: none !important;
}

.lesson-section,
.lesson-section:nth-of-type(even) {
  --section-fill: #050505;
  padding: clamp(4.5rem, 8vw, 8rem) var(--section-pad-x);
  overflow: hidden;
  background: #050505;
}

.lesson-section + .lesson-section {
  padding-top: clamp(4.5rem, 8vw, 8rem);
}

.lesson-section::after,
#chords-intro-triads-sevenths::after,
#next-section::after,
#diminished-augmented-triads::after,
#suspended-triads::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  background: url("../images/backgrounds/blackhex.webp") center / cover no-repeat;
  opacity: .055;
  pointer-events: none;
}

.lesson-section > * {
  width: min(1120px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.lesson-content-wrap .lesson-section > h2,
.lesson-content-wrap .lesson-section > h3,
.lesson-section h2,
.lesson-section h3 {
  width: min(1120px, 100%);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  color: var(--triad-gold-bright);
  text-align: left !important;
  text-shadow: none;
}

.lesson-section h2 {
  margin-top: 0;
  margin-bottom: 1.8rem;
  font-size: clamp(2.4rem, 5.5vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lesson-section h3,
.lesson-section h3.lesson-subsection-title {
  margin-top: clamp(3rem, 6vw, 5.5rem);
  margin-bottom: 1rem;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.08;
}

.lesson-section p,
.lesson-section ul {
  max-width: 76ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--triad-text);
  font-size: clamp(1rem, 1.2vw, 1.13rem);
  line-height: 1.78;
  text-align: left;
}

.lesson-section p { margin-top: .7rem; }
.lesson-section p + p { margin-top: 1rem; }
.lesson-def-link,
.lesson-highlight { color: var(--triad-gold-bright); }

/* Match the foundations lessons: headings and reading copy share one left edge. */
.lesson-content-wrap .lesson-section > h2,
.lesson-content-wrap .lesson-section > h3,
.lesson-section h2,
.lesson-section h3,
.lesson-section > p,
.lesson-section > ul {
  margin-left: max(0px, calc((100% - 920px) / 2));
  margin-right: 0;
}

.lesson-content-wrap .lesson-section > h2,
.lesson-content-wrap .lesson-section > h3,
.lesson-section h2,
.lesson-section h3 {
  width: min(920px, 100%);
  max-width: 920px;
}

.lesson-tertian-diagram {
  width: min(920px, 100%);
  margin: 2.4rem auto;
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid var(--triad-line);
  border-radius: 0;
  background: rgba(9, 9, 9, .82);
  box-shadow: none;
}

.lesson-tertian-diagram__interval span {
  color: var(--triad-gold-bright);
  background: #090909;
}

.lesson-example-grid,
.lesson-type-grid {
  width: min(980px, 100%);
  margin: 2.3rem auto;
  gap: 1px;
  border: 1px solid var(--triad-line);
  background: var(--triad-line);
}

.lesson-example-card,
.lesson-type-card {
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border: 0;
  border-radius: 0;
  background: #0a0a0a;
  box-shadow: none;
}

.lesson-example-card h4,
.lesson-type-card h4 {
  color: var(--triad-gold-bright);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.lesson-sus-resolution-grid {
  width: min(1320px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lesson-sus-resolution-grid img {
  display: block;
  width: 100%;
  height: auto;
}

.lesson-triad-diagram {
  margin-top: 1.2rem;
  padding: 1.2rem 0 0;
  border: 0;
  border-top: 1px solid rgba(214, 164, 65, .24);
  border-radius: 0;
  background: transparent;
}

.lesson-triad-diagram__notes,
.lesson-triad-diagram__degrees {
  color: var(--triad-gold-bright);
}

.lesson-formula {
  max-width: 76ch;
  padding: 1rem 1.2rem;
  border: 1px solid var(--triad-line);
  border-radius: 0;
  color: var(--triad-gold-bright);
  background: #0a0a0a;
}

.lesson-formula--list {
  width: min(640px, 100%);
  margin-top: 1.5rem;
  margin-bottom: 1.8rem;
}

.lesson-center { text-align: left; }

.lesson-final-actions {
  width: min(680px, 100%);
  margin: 3rem auto 0;
  gap: .8rem;
}

.lesson-final-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-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}

.lesson-final-actions .theory-hero__button--primary {
  color: #171109;
  border-color: #efd58c;
  background: var(--triad-gold);
}

.lesson-final-actions .theory-hero__button:hover,
.lesson-final-actions .theory-hero__button:focus-visible {
  color: #171109;
  border-color: #f5dda0;
  background: #e0b65d;
  outline: none;
  transform: translateY(-3px);
}

.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;
}


@media (max-width: 900px) {
  .lesson-hero-media { min-height: clamp(420px, 95vw, 620px); }
  .lesson-hero-overlay { align-items: flex-end; padding: 2rem 1.2rem 3.5rem; }
  .lesson-hero-overlay__content h1 { font-size: clamp(2.7rem, 13vw, 4.8rem); }
  .lesson-section,
  .lesson-section + .lesson-section { padding-top: 4rem; padding-bottom: 4rem; }
  .lesson-section h2 { font-size: clamp(2.35rem, 11vw, 3.6rem); }
  .lesson-example-grid,
  .lesson-type-grid { grid-template-columns: 1fr; }
  .lesson-formula__row { grid-template-columns: minmax(105px, 38%) 1fr; }
}

.lesson-section ul {
  width: min(76ch, 100%);
  padding-left: 1.35rem;
  list-style-position: outside;
  text-align: left;
}

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

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

.lesson-quick-test {
  width: min(900px, 100%);
  margin: clamp(4rem, 8vw, 7rem) auto 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--triad-line);
}

.lesson-quick-test > h3 {
  margin: 0 0 .7rem;
}

.lesson-quick-test > p {
  margin-left: 0;
}

.lesson-quick-test__questions {
  margin-top: 1.6rem;
  border-top: 1px solid rgba(214, 164, 65, .28);
}

.lesson-quick-test details {
  border-bottom: 1px solid rgba(214, 164, 65, .28);
}

.lesson-quick-test summary {
  position: relative;
  padding: 1.15rem 3rem 1.15rem 0;
  color: var(--triad-text);
  font-weight: 700;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}

.lesson-quick-test summary::-webkit-details-marker { display: none; }

.lesson-quick-test summary::after {
  content: "+";
  position: absolute;
  right: .25rem;
  top: 50%;
  color: var(--triad-gold-bright);
  font-size: 1.45rem;
  font-weight: 400;
  transform: translateY(-50%);
}

.lesson-quick-test details[open] summary::after { content: "−"; }

.lesson-quick-test details > p {
  max-width: 72ch;
  margin: 0;
  padding: 0 3rem 1.25rem 0;
  color: var(--triad-muted);
}

.lesson-quick-test summary:hover,
.lesson-quick-test summary:focus-visible {
  color: var(--triad-gold-bright);
  outline: none;
}

.lesson-triad-reference-wrap { width:min(900px,100%); margin:2rem auto; overflow:hidden; border:1px solid var(--triad-line); }
.lesson-triad-reference { width:100%; border-collapse:collapse; table-layout:fixed; }
.lesson-triad-reference th,.lesson-triad-reference td { padding:.9rem 1rem; border-right:1px solid rgba(214,164,65,.2); border-bottom:1px solid rgba(214,164,65,.2); text-align:left; }
.lesson-triad-reference thead th { color:#171109; background:var(--triad-gold); }
.lesson-triad-reference tbody th { color:var(--triad-gold-bright); }
.lesson-triad-reference tbody td { color:var(--triad-text); }
.lesson-triad-reference tr:last-child > * { border-bottom:0; }
.lesson-triad-reference tr > *:last-child { border-right:0; }
@media (max-width:560px) { .lesson-triad-reference th,.lesson-triad-reference td { padding:.7rem .4rem; font-size:.78rem; } }
