@font-face {
  font-family: "Noto Music";
  src: url("assets/fonts/NotoMusic-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171717;
  --paper: #f7f7f5;
  --white: #ffffff;
  --muted: #66645f;
  --line: #d9d8d4;
  --red: #d13b32;
  --red-dark: #a92c25;
  --gold: #e0ad37;
  --green: #3d8a63;
  --code: #111210;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

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

.hero {
  position: relative;
  min-height: min(720px, 78vh);
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
}

.nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  color: var(--gold);
  font-family: "Noto Music", "Bravura Text", "Apple Symbols", serif;
  font-size: 29px;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: #d8d8d4;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--white);
}

.hero-score {
  position: absolute;
  top: 116px;
  left: 35%;
  z-index: 1;
  width: max-content;
  margin: 0;
  color: var(--white);
  font-family: "Noto Music", "Bravura Text", "Apple Symbols", monospace;
  font-size: 21px;
  line-height: 1.7;
  opacity: 0.13;
  pointer-events: none;
  transform: rotate(-2deg);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 104px 0 112px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--red-dark);
}

.eyebrow.light {
  color: #f2c45d;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 88px;
  font-weight: 500;
  line-height: 0.98;
}

.hero-copy {
  max-width: 630px;
  margin: 30px 0 0;
  color: #d4d4cf;
  font-size: 21px;
  line-height: 1.55;
}

.hero-actions,
.reference-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.button-primary {
  background: var(--red);
  color: var(--white);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--red-dark);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.38);
  color: var(--white);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.facts div {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border-right: 1px solid var(--line);
}

.facts div:last-child {
  border-right: 0;
}

.facts strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
}

.facts span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 96px max(24px, calc((100% - 1180px) / 2));
}

.section-heading {
  max-width: 710px;
  margin-bottom: 54px;
}

.section-heading h2,
.reference-band h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.08;
}

.section-heading > p:last-child {
  max-width: 640px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.language-grid article {
  min-width: 0;
  padding: 34px 40px 12px 0;
  border-right: 1px solid var(--line);
}

.language-grid article + article {
  padding-left: 40px;
}

.language-grid article:last-child {
  border-right: 0;
}

.notation {
  display: block;
  height: 74px;
  color: var(--red);
  font-family: "Noto Music", "Bravura Text", "Apple Symbols", serif;
  font-size: 58px;
  line-height: 1;
}

.language-grid h3 {
  margin: 4px 0 10px;
  font-size: 18px;
}

.language-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.explorer-band {
  background: #242520;
  color: var(--white);
}

.explorer-heading > p:last-child {
  color: #bfc0b9;
}

.explorer-heading .font-note {
  margin-top: 12px;
  color: #aeb0a8;
  font-size: 13px;
}

.font-note a {
  color: #f2c45d;
  font-weight: 750;
}

.example-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.tab {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #53544f;
  border-radius: 4px;
  background: transparent;
  color: #c9cac4;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tab:hover,
.tab:focus-visible {
  border-color: #8c8d86;
  color: var(--white);
}

.tab.is-active {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.explorer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 520px;
  border: 1px solid #4c4d48;
  border-radius: 6px;
  overflow: hidden;
  background: var(--code);
}

.source-pane {
  min-width: 0;
}

.pane-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid #343530;
  color: #d6d7d1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
}

.copy-button {
  padding: 7px 10px;
  border: 1px solid #4c4d48;
  border-radius: 4px;
  background: transparent;
  color: #d6d7d1;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: #85867f;
  color: var(--white);
}

#score-source {
  --score-cell-width: 1.12em;
  min-height: 465px;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  color: #e8e9e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Music", "Apple Symbols", monospace;
  font-size: 15px;
  line-height: 1.55;
  tab-size: 2;
  white-space: normal;
}

.score-sheet {
  display: block;
  width: max-content;
  transform-origin: top left;
}

.score-line {
  position: relative;
  display: flex;
  width: max-content;
  min-height: 1.55em;
}

.score-line.is-staff-row::before {
  position: absolute;
  top: 50%;
  right: var(--score-cell-width);
  left: var(--score-cell-width);
  z-index: 0;
  border-top: 1px solid #aeb0aa;
  content: "";
}

.score-cell {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: var(--score-cell-width);
  flex: 0 0 var(--score-cell-width);
  align-items: center;
  justify-content: center;
  overflow: visible;
  white-space: pre;
}

.score-cell.is-staff-background {
  color: transparent;
}

.copy-note {
  margin: 12px 0 0;
  color: #92948d;
  font-size: 12px;
}

.copy-note strong {
  color: #cfd0ca;
}

.advanced-example {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  align-items: center;
  gap: 72px;
  border-bottom: 1px solid var(--line);
  background: #ecefea;
}

.advanced-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.08;
}

.advanced-copy > p:not(.eyebrow) {
  max-width: 600px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.advanced-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 34px;
  border-top: 1px solid #c6cbc4;
}

.advanced-metrics div {
  padding: 18px 16px 16px 0;
  border-bottom: 1px solid #c6cbc4;
}

.advanced-metrics div:nth-child(odd) {
  border-right: 1px solid #c6cbc4;
}

.advanced-metrics div:nth-child(even) {
  padding-left: 18px;
}

.advanced-metrics strong,
.advanced-metrics span {
  display: block;
}

.advanced-metrics strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
}

.advanced-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.advanced-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
}

.button-dark {
  background: var(--ink);
  color: var(--white);
}

.button-dark:hover,
.button-dark:focus-visible {
  background: #393a35;
}

.dark-link {
  color: #4d4f49;
}

.dark-link:hover,
.dark-link:focus-visible {
  color: var(--ink);
}

.song-output {
  min-width: 0;
  border: 1px solid #393a35;
  border-radius: 6px;
  overflow: hidden;
  background: var(--code);
  color: #e8e9e3;
}

.song-output-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid #343530;
  color: #b8bab3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.song-output pre {
  margin: 0;
  overflow-x: auto;
  padding: 24px;
  color: #e8e9e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.output-pane {
  padding: 30px;
  border-left: 1px solid #343530;
  background: #191a17;
}

.output-label {
  margin: 0 0 18px;
  color: #9b9c96;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

#score-output {
  display: block;
  min-height: 70px;
  overflow-wrap: anywhere;
  color: #f2c45d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 31px;
}

#example-note {
  margin: 26px 0 0;
  color: #b6b7b1;
  font-size: 14px;
}

.state-section {
  background: var(--white);
}

.state-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.state-flow div {
  min-width: 0;
  border-top: 3px solid var(--red);
  padding-top: 18px;
}

.state-flow strong,
.state-flow span {
  display: block;
}

.state-flow strong {
  min-height: 42px;
  font-family: "Noto Music", "Bravura Text", "Apple Symbols", Georgia, serif;
  font-size: 27px;
}

.state-flow div span {
  color: var(--muted);
  font-size: 14px;
}

.flow-arrow {
  color: #aaa8a1;
  font-size: 22px;
}

.reference-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 60px;
  padding: 84px max(24px, calc((100% - 1180px) / 2));
  background: var(--ink);
  color: var(--white);
}

.reference-band > div:first-child {
  max-width: 720px;
}

.reference-band p:last-child {
  margin: 20px 0 0;
  color: #c7c7c1;
  font-size: 17px;
}

.reference-actions {
  align-items: flex-start;
  flex-direction: column;
  margin: 0;
}

.text-link {
  color: #deded8;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--white);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px max(24px, calc((100% - 1180px) / 2));
  border-top: 1px solid #343530;
  background: var(--ink);
  color: #8e8f89;
  font-size: 12px;
}

@media (max-width: 860px) {
  .hero {
    min-height: 680px;
  }

  .hero-score {
    top: 220px;
    left: 10%;
    font-size: 17px;
  }

  .hero-content {
    padding-top: 90px;
  }

  h1 {
    font-size: 64px;
  }

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

  .facts div:nth-child(2) {
    border-right: 0;
  }

  .facts div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .language-grid article,
  .language-grid article + article {
    padding: 28px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .output-pane {
    border-top: 1px solid #343530;
    border-left: 0;
  }

  .state-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
    justify-self: start;
  }

  .reference-band {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .advanced-example {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .nav {
    width: min(100% - 32px, 1180px);
  }

  .nav-links a:not(:last-child) {
    display: none;
  }

  .hero-content {
    width: min(100% - 32px, 1180px);
    padding-top: 72px;
  }

  h1 {
    font-size: 52px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .section-heading h2,
  .reference-band h2 {
    font-size: 38px;
  }

  .facts div {
    min-height: 96px;
    flex-direction: column;
    gap: 0;
  }

  .facts strong {
    font-size: 28px;
  }

  #score-source {
    min-height: 390px;
    padding: 18px;
    font-size: 13px;
  }

  footer {
    flex-direction: column;
  }
}

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