html {
  scroll-behavior: smooth;
}

.journey-carousel {
  width: min(1120px, calc(100% - 2rem));
  margin: -1.4rem auto 2rem;
  position: relative;
  z-index: 2;
}

.journey-carousel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .85rem;
  color: rgba(255, 255, 255, .74);
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.journey-carousel__hint {
  color: rgba(255, 255, 255, .42);
  letter-spacing: .08em;
}

.journey-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(225px, 28%);
  gap: .85rem;
  overflow-x: auto;
  padding: .2rem .15rem 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(110, 236, 210, .65) rgba(255, 255, 255, .08);
}

.journey-card {
  min-height: 138px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scroll-snap-align: start;
  border: 1px solid rgba(180, 255, 238, .24);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(48, 89, 98, .72), rgba(12, 21, 29, .8));
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 16px 34px rgba(0, 0, 0, .22);
  color: #f5fffd;
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.journey-card:hover,
.journey-card:focus-visible {
  transform: translateY(-5px);
  border-color: #75f3d7;
  background: linear-gradient(145deg, rgba(55, 121, 126, .9), rgba(14, 36, 42, .94));
  outline: none;
}

.journey-card--active {
  border-color: rgba(117, 243, 215, .72);
  background: linear-gradient(145deg, rgba(38, 131, 123, .88), rgba(10, 49, 52, .94));
}

.journey-card__number {
  color: #75f3d7;
  font: 700 .72rem/1 monospace;
  letter-spacing: .12em;
}

.journey-card strong {
  font-size: 1.08rem;
}

.journey-card small {
  color: rgba(255, 255, 255, .63);
  font-size: .82rem;
}

.theory-section {
  position: relative;
  overflow: hidden;
  padding: 8rem 0 6rem;
  color: #eaf7f4;
  background:
    radial-gradient(circle at 88% 8%, rgba(72, 229, 255, .12), transparent 28rem),
    radial-gradient(circle at 8% 44%, rgba(196, 255, 47, .07), transparent 26rem),
    linear-gradient(180deg, #081419 0%, #0b1f25 48%, #071317 100%);
}

.theory-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

.theory-section > * {
  position: relative;
}

.theory-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
}

.theory-intro h2 {
  margin: .45rem 0 1.4rem;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: .89;
  letter-spacing: -.065em;
}

.theory-intro h2 em {
  color: #75f3d7;
  font-weight: 400;
}

.theory-lead {
  max-width: 760px;
  color: rgba(234, 247, 244, .72);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.65;
}

.chapter-note {
  padding: 1.45rem;
  border: 1px solid rgba(117, 243, 215, .27);
  border-radius: 1.35rem;
  background: rgba(6, 24, 28, .72);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 28px 70px rgba(0, 0, 0, .23);
}

.chapter-note span,
.material-data__heading span {
  display: block;
  margin-bottom: .75rem;
  color: #75f3d7;
  font: 700 .7rem/1 monospace;
  letter-spacing: .16em;
}

.chapter-note strong {
  display: block;
  margin-bottom: .75rem;
  font-size: 1.35rem;
}

.chapter-note p {
  margin: 0;
  color: rgba(234, 247, 244, .6);
  line-height: 1.55;
}

.theory-toc {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.theory-toc a {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1.15rem .9rem;
  border-right: 1px solid rgba(255, 255, 255, .08);
  color: rgba(234, 247, 244, .72);
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.theory-toc a:last-child {
  border-right: 0;
}

.theory-toc a:hover,
.theory-toc a:focus-visible {
  color: #fff;
  background: rgba(117, 243, 215, .07);
  outline: none;
}

.theory-toc span,
.module-index {
  color: #75f3d7;
  font: 700 .7rem/1 monospace;
  letter-spacing: .15em;
}

.theory-block {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
  padding-top: 8rem;
  scroll-margin-top: 5.5rem;
}

.theory-block--reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
}

.theory-block--reverse > :first-child {
  order: 2;
}

.theory-block--wide {
  display: block;
}

.theory-copy h3,
.theory-finish h3 {
  margin: .75rem 0 1.3rem;
  font-size: clamp(2.15rem, 4vw, 4.25rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.theory-copy p,
.theory-finish p {
  color: rgba(234, 247, 244, .69);
  line-height: 1.72;
}

.theory-copy--header {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 1.5rem 5rem;
  align-items: end;
  margin-bottom: 2.4rem;
}

.theory-copy--header .module-index {
  grid-column: 1 / -1;
}

.theory-copy--header h3,
.theory-copy--header p {
  margin-top: 0;
}

.formula-stack,
.inline-formulas {
  display: grid;
  gap: .7rem;
  margin: 1.8rem 0;
}

.formula-stack {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.formula-card {
  padding: 1rem;
  border: 1px solid rgba(117, 243, 215, .2);
  border-radius: 1rem;
  background: rgba(117, 243, 215, .055);
}

.formula-card span {
  display: block;
  margin-bottom: .55rem;
  color: rgba(234, 247, 244, .5);
  font: 700 .62rem/1.2 monospace;
  letter-spacing: .12em;
}

.formula-card strong {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  font-weight: 500;
  white-space: nowrap;
}

.formula-card small {
  display: block;
  margin-top: .7rem;
  color: rgba(234, 247, 244, .55);
}

.formula-card--hero {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-color: rgba(117, 243, 215, .36);
  background: linear-gradient(135deg, rgba(117, 243, 215, .11), rgba(72, 229, 255, .05));
}

.concept-note {
  padding-left: 1rem;
  border-left: 2px solid #75f3d7;
  font-size: .92rem;
}

.concept-note strong {
  color: #dffff7;
}

.theory-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1.25rem;
  background: #f7f9f8;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .25);
}

.theory-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.theory-figure figcaption {
  padding: 1rem 1.1rem;
  color: #31474c;
  font-size: .83rem;
  line-height: 1.5;
}

.theory-figure figcaption span {
  display: block;
  margin-bottom: .3rem;
  color: #0b7169;
  font: 800 .66rem/1.2 monospace;
  letter-spacing: .12em;
}

.wave-figure-grid,
.advanced-waves__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.advanced-waves {
  margin-top: 1.15rem;
  border: 1px solid rgba(117, 243, 215, .18);
  border-radius: 1.2rem;
  background: rgba(4, 18, 22, .56);
}

.advanced-waves summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.35rem;
  color: #dffff7;
  cursor: pointer;
  list-style: none;
}

.advanced-waves summary::-webkit-details-marker {
  display: none;
}

.advanced-waves summary span {
  color: #75f3d7;
  font-size: 1.35rem;
  transition: transform .2s ease;
}

.advanced-waves[open] summary span {
  transform: rotate(45deg);
}

.advanced-waves__grid {
  padding: 0 1.15rem 1.15rem;
}

.material-data {
  padding: 1.5rem;
  border: 1px solid rgba(72, 229, 255, .2);
  border-radius: 1.35rem;
  background: rgba(7, 28, 35, .74);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .22);
}

.material-data__heading strong {
  font-size: 1.35rem;
}

.material-table-wrap {
  overflow-x: auto;
  margin-top: 1.2rem;
}

.material-data table {
  width: 100%;
  border-collapse: collapse;
  min-width: 430px;
}

.material-data th,
.material-data td {
  padding: .85rem .7rem;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  text-align: right;
}

.material-data th {
  color: rgba(234, 247, 244, .48);
  font: 700 .66rem/1.2 monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.material-data th:first-child,
.material-data td:first-child {
  text-align: left;
}

.material-data td {
  color: rgba(234, 247, 244, .84);
}

.material-data > p {
  margin: 1rem 0 0;
  color: rgba(234, 247, 244, .48);
  font-size: .78rem;
  line-height: 1.5;
}

.example-split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem;
  margin: 1.3rem 0;
}

.example-split div {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .055);
}

.example-split strong,
.example-split span {
  display: block;
}

.example-split strong {
  color: #75f3d7;
  font-size: 2rem;
}

.example-split span {
  margin-top: .25rem;
  color: rgba(234, 247, 244, .58);
  font-size: .78rem;
}

.wave-figure-grid--attenuation {
  align-items: start;
}

.refraction-figures {
  display: grid;
  gap: 1rem;
}

.theory-finish {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
  margin-top: 8rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(117, 243, 215, .2);
}

.theory-finish h3 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.theory-finish p {
  max-width: 660px;
}

.theory-source {
  margin-top: 3.5rem;
  color: rgba(234, 247, 244, .4);
  font-size: .78rem;
  line-height: 1.6;
}

.return-button {
  display: inline-flex;
  padding: .72rem 1rem;
  border: 1px solid rgba(117, 243, 215, .58);
  border-radius: 999px;
  color: #dffff7;
  text-decoration: none;
}

@media (max-width: 980px) {
  .theory-toc {
    grid-template-columns: repeat(3, 1fr);
  }

  .theory-toc a:nth-child(3) {
    border-right: 0;
  }

  .theory-toc a:nth-child(-n+3) {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .theory-block,
  .theory-block--reverse {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .theory-block--reverse > :first-child {
    order: initial;
  }

  .theory-copy--header {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .theory-finish {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .journey-carousel__track {
    grid-auto-columns: minmax(230px, 82%);
  }

  .journey-carousel__hint {
    display: none;
  }

  .theory-section {
    padding: 5.5rem 0 4.5rem;
  }

  .theory-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .theory-toc {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 2.5rem;
  }

  .theory-toc a,
  .theory-toc a:nth-child(3) {
    border-right: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .theory-toc a:nth-child(even) {
    border-right: 0;
  }

  .theory-block {
    padding-top: 5.5rem;
  }

  .formula-stack,
  .inline-formulas,
  .wave-figure-grid,
  .advanced-waves__grid {
    grid-template-columns: 1fr;
  }

  .formula-card strong {
    white-space: normal;
  }

  .theory-figure figcaption {
    font-size: .78rem;
  }
}

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

  .journey-card,
  .advanced-waves summary span {
    transition: none;
  }
}
