@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap');

:root {
  color-scheme: light;
  --ink: #17202f;
  --muted: #687284;
  --paper: #ffffff;
  --canvas: #f4f7fa;
  --line: #dce3e9;
  --navy: #112a46;
  --blue: #176b87;
  --blue-soft: #e9f4f6;
  --gold: #c7922f;
  --gold-soft: #fff7e5;
  --shadow: 0 16px 42px rgba(25, 45, 66, 0.08);
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

a {
  color: var(--blue);
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 84px 24px 70px;
  color: #f8fbff;
  background:
    radial-gradient(circle at 88% 14%, rgba(48, 164, 174, 0.34), transparent 31%),
    radial-gradient(circle at 8% 92%, rgba(199, 146, 47, 0.18), transparent 26%),
    linear-gradient(132deg, #0b1c31, #123d59 70%, #145c70);
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255, 255, 255, 0.025), 0 0 0 108px rgba(255, 255, 255, 0.018);
}

.hero__inner,
main,
footer p {
  width: min(100%, 1440px);
  margin-inline: auto;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-number,
.figure-label {
  margin: 0 0 10px;
  color: #80d2d7;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
}

.hero__summary {
  max-width: 850px;
  margin: 24px 0 0;
  color: #d9e7ef;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 920px;
  margin: 42px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.19);
}

.facts div {
  padding: 18px 20px 0 0;
}

.facts dt {
  color: #93b1c1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts dd {
  margin: 3px 0 0;
  color: #fff;
  font-weight: 600;
}

main {
  padding: 54px 24px 80px;
}

.intro {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 52px;
  align-items: end;
  margin-bottom: 28px;
  padding: 0 4px;
}

.section-number,
.figure-label {
  color: var(--blue);
}

.intro h2,
.example h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}

.intro > p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
}

.example {
  margin-top: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.example__heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 26px;
}

.example__heading code {
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #5c6677;
  background: #f7f9fb;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.stage-card {
  position: relative;
  min-width: 0;
  padding: 22px 16px 20px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.stage-card + .stage-card {
  border-left: 1px solid var(--line);
}

.stage-card__index {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin: 0 0 24px;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.stage-card h3 {
  margin: 0;
  font-size: 1rem;
}

.stage-card > p:not(.stage-card__index) {
  min-height: 1.5em;
  margin: 2px 0 17px;
  color: var(--muted);
  font-size: 0.8rem;
}

.stage-card--reference {
  background: linear-gradient(150deg, var(--gold-soft), #fffdf8);
}

.stage-card--reference .stage-card__index {
  color: #815a10;
  background: #f6dfad;
}

audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 38px;
}

.spectrogram {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
}

.spectrogram summary {
  padding: 15px 18px;
  cursor: pointer;
  color: #324158;
  font-size: 0.9rem;
  font-weight: 600;
}

.spectrogram summary:hover {
  color: var(--blue);
}

.spectrogram__frame {
  height: min(72vh, 700px);
  margin: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.spectrogram object {
  width: 100%;
  height: 100%;
}

.spectrogram__link {
  display: inline-block;
  margin: 13px 18px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.spectrogram__link:hover {
  text-decoration: underline;
}

footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #edf1f4;
  font-size: 0.78rem;
}

footer p {
  margin-block: 0;
}

@media (max-width: 1080px) {
  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 0;
    background: var(--line);
  }

  .stage-card,
  .stage-card + .stage-card {
    border: 0;
  }

  .stage-card--reference {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 62px 20px 54px;
  }

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

  main {
    padding: 38px 14px 58px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .example {
    padding: 20px 14px;
    border-radius: 13px;
  }

  .example__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .stage-grid {
    grid-template-columns: 1fr;
  }

  .stage-card--reference {
    grid-column: auto;
  }

  .stage-card__index {
    margin-bottom: 14px;
  }

  .spectrogram__frame {
    height: 420px;
    margin-inline: 10px;
  }
}

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