:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #1c2523;
  background: #f5f7f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 4rem);
  border-bottom: 1px solid #dce2dd;
  background: #ffffff;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}

.site-header__nav a,
.link-button {
  padding: 0;
  border: 0;
  color: #3b4e49;
  background: none;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.site-header__brand {
  font-weight: 750;
  text-decoration: none;
}

.site-main {
  width: min(64rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 7rem) 0;
}

.hero {
  max-width: 48rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #3b695f;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2.7rem, 8vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero__summary {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: #52605d;
  font-size: 1.2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__actions form {
  margin: 0;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
  border: 1px solid #263b36;
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  color: #ffffff;
  background: #263b36;
}

.button--secondary {
  color: #263b36;
  background: transparent;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.flash--notice {
  color: #235342;
  background: #e1f2ea;
}

.flash--alert {
  color: #7b2929;
  background: #f8e4e4;
}

.library,
.chart-preview {
  display: grid;
  gap: 2rem;
}

.library__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.library__header h1,
.chart-preview__header h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.library__summary,
.chart-preview__artist {
  max-width: 45rem;
  margin-bottom: 0;
  color: #52605d;
}

.library__count {
  flex: 0 0 auto;
  color: #52605d;
}

.library-filters {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 14rem) auto;
  gap: 0.75rem;
}

.library-filters input,
.library-filters select {
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #bbc7c1;
  border-radius: 0.5rem;
  background: #ffffff;
  font: inherit;
}

.chart-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.chart-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px solid #d5ded9;
  border-radius: 0.75rem;
  background: #ffffff;
  text-decoration: none;
}

.chart-card:hover {
  border-color: #78968d;
  box-shadow: 0 0.5rem 1.5rem rgb(30 56 48 / 8%);
}

.chart-card__title {
  font-size: 1.05rem;
  font-weight: 750;
}

.chart-card__artist,
.chart-card__meta {
  color: #60706c;
  font-size: 0.88rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag {
  padding: 0.2rem 0.5rem;
  border-radius: 99rem;
  color: #30564d;
  background: #e8f0ed;
  font-size: 0.75rem;
}

.back-link {
  color: #3b695f;
  text-decoration: none;
}

.chart-details {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 1.5rem 0 0;
}

.chart-details div {
  display: grid;
  gap: 0.2rem;
}

.chart-details dt {
  color: #60706c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chart-details dd {
  margin: 0;
}

.chart-source {
  overflow-x: auto;
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d5ded9;
  border-radius: 0.75rem;
  color: #17211f;
  background: #ffffff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  line-height: 1.45;
  white-space: pre;
}

.chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #d5ded9;
  border-radius: 0.75rem;
  background: #ffffff;
}

.chart-controls__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.key-option {
  min-width: 2.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #bbc7c1;
  border-radius: 0.4rem;
  color: #3b4e49;
  background: #ffffff;
  font-size: 0.8rem;
  text-align: center;
  text-decoration: none;
}

.key-option--selected {
  border-color: #263b36;
  color: #ffffff;
  background: #263b36;
}

.chart-controls form {
  flex: 0 0 auto;
  margin: 0;
}

.chart-sheet {
  overflow-x: auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d5ded9;
  border-radius: 0.75rem;
  color: #17211f;
  background: #ffffff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.88rem, 2vw, 1rem);
  line-height: 1.45;
}

.chart-line {
  min-width: max-content;
}

.chart-line--section {
  margin: 1.5rem 0 0.4rem;
  color: #3b695f;
  font: 750 0.85rem/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-line--section:first-child {
  margin-top: 0;
}

.chart-line--pair {
  margin-bottom: 0.55rem;
}

.chart-line--blank {
  min-height: 1.45em;
}

.chart-line--text {
  white-space: pre;
}

.chart-row {
  display: flex;
  white-space: pre;
}

.chart-cell {
  display: inline-block;
  flex: 0 0 calc(var(--chart-columns) * 1ch);
  min-width: max-content;
  white-space: pre;
}

.chart-cell--chord,
.chart-row--chords {
  color: #9c3f1f;
  font-weight: 750;
}

.chart-annotation {
  color: #60706c;
  font-weight: 500;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed #aebdb7;
  border-radius: 0.75rem;
  color: #52605d;
  background: #fafbf9;
}

.auth-panel {
  display: grid;
  max-width: 28rem;
  gap: 1.5rem;
  margin: 0 auto;
}

.auth-panel h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.auth-panel header > :last-child {
  margin-bottom: 0;
  color: #52605d;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form__field {
  display: grid;
  gap: 0.35rem;
}

.auth-form__field label,
.auth-form__remember label {
  font-weight: 700;
}

.auth-form__field input {
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #bbc7c1;
  border-radius: 0.5rem;
  background: #ffffff;
  font: inherit;
}

.auth-form__remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-form__remember input {
  width: 1rem;
  height: 1rem;
}

.auth-form .button {
  justify-content: center;
}

.auth-links {
  color: #3b695f;
}

.auth-links p {
  margin: 0.35rem 0;
}

@media (max-width: 42rem) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .library__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .library-filters {
    grid-template-columns: 1fr;
  }

  .chart-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-controls form,
  .chart-controls .button {
    width: 100%;
  }

  .chart-controls .button {
    justify-content: center;
  }
}
