:root {
  color-scheme: dark;

  --background: #080a0e;
  --surface: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f8fa;
  --muted: #9299a6;
  --cyan: #65d9ee;
  --violet: #a78bfa;
  --coral: #fb7185;
  --lime: #a3e635;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;

  overflow-x: hidden;

  background:
    radial-gradient(
      circle at 12% 15%,
      rgba(101, 217, 238, 0.1),
      transparent 28%
    ),
    radial-gradient(
      circle at 82% 22%,
      rgba(167, 139, 250, 0.11),
      transparent 31%
    ),
    var(--background);
  color: var(--text);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app {
  min-height: 100vh;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  padding: 22px clamp(22px, 4vw, 64px);

  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;

  gap: 10px;

  color: var(--text);

  font-size: 15px;
  font-weight: 700;

  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 12px;
  height: 12px;

  background:
    linear-gradient(135deg, var(--cyan), var(--violet));

  border-radius: 50%;

  box-shadow: 0 0 18px rgba(101, 217, 238, 0.55);
}

.site-header p {
  margin: 0;

  color: var(--muted);

  font-size: 11px;
  font-weight: 650;

  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero {
  min-height: 0;

  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(520px, 1.15fr);
  align-items: center;

  gap: clamp(36px, 6vw, 96px);

  padding: clamp(34px, 5vh, 68px) clamp(22px, 4vw, 64px);
}

.eyebrow {
  margin: 0 0 12px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 750;

  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;

  margin-bottom: 24px;

  font-size: clamp(42px, 5.5vw, 84px);
  font-weight: 590;

  line-height: 0.98;
  letter-spacing: -0.065em;
}

h1 span {
  background:
    linear-gradient(
      90deg,
      var(--cyan),
      var(--violet) 48%,
      var(--coral)
    );

  background-clip: text;
  color: transparent;
}

.intro {
  max-width: 530px;

  margin-bottom: 0;

  color: var(--muted);

  font-size: clamp(14px, 1.25vw, 17px);

  line-height: 1.65;
}

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

  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.tool-card {
  --card-color: var(--cyan);

  min-height: clamp(140px, 17vh, 190px);

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;

  gap: 18px;

  padding: clamp(20px, 2.2vw, 32px);

  background: var(--surface);
  color: var(--text);

  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);

  text-decoration: none;

  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--card-color) 13%, transparent),
      rgba(255, 255, 255, 0.045)
    );
}

.tool-card:focus-visible {
  position: relative;
  z-index: 1;

  outline: 2px solid var(--card-color);
  outline-offset: -2px;
}

.tool-card.notes {
  --card-color: var(--cyan);
}

.tool-card.phrases {
  --card-color: var(--violet);
}

.tool-card.scales {
  --card-color: var(--lime);
}

.tool-card.chords {
  --card-color: var(--coral);
}

.tool-card.fifths {
  --card-color: var(--violet);
}

.tool-card.progression {
  --card-color: var(--lime);
}

.tool-card.writer {
  --card-color: var(--accent, #f5b971);
}

.tool-card.metronome-card {
  --card-color: var(--cyan);
}

.games-section {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(520px, 1.15fr);
  align-items: center;

  gap: clamp(36px, 6vw, 96px);

  padding: clamp(46px, 6vh, 76px) clamp(22px, 4vw, 64px);

  border-top: 1px solid var(--line);
}

.games-section .section-heading {
  display: block;

  margin-bottom: 0;
}

.games-section .section-heading h2 {
  margin-bottom: 18px;

  font-size: clamp(42px, 5.5vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.games-section .section-heading > p {
  max-width: 530px;

  margin-bottom: 0;

  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.65;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;

  gap: 24px;

  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;

  font-size: clamp(28px, 3vw, 42px);
  font-weight: 590;

  letter-spacing: -0.045em;
}

.section-heading > p {
  margin-bottom: 4px;

  color: var(--muted);

  font-size: 12px;
}

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

  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.game-card {
  min-height: 155px;
}

.game-card.fret-trainer {
  --card-color: var(--violet);
}

.game-card.chord-guesser {
  --card-color: var(--coral);
}

.game-card.guitar-parts {
  --card-color: var(--cyan);
}

.game-card.coming-soon {
  --card-color: var(--lime);
}

.tool-number {
  color: var(--card-color);

  font-size: 10px;
  font-weight: 750;

  letter-spacing: 0.12em;
}

.tool-card h2 {
  margin-bottom: 8px;

  font-size: clamp(23px, 2vw, 31px);
  font-weight: 620;

  letter-spacing: -0.045em;
}

.tool-card p {
  max-width: 250px;

  margin-bottom: 0;

  color: var(--muted);

  font-size: 12px;

  line-height: 1.5;
}

.tool-arrow {
  color: var(--card-color);

  font-size: 20px;

  transition: transform 0.18s ease;
}

.tool-card:hover .tool-arrow {
  transform: translate(3px, -3px);
}

.keyboard-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(480px, 1.4fr);
  align-items: end;

  gap: clamp(28px, 5vw, 80px);

  padding: 20px clamp(22px, 4vw, 64px) 0;

  background: rgba(0, 0, 0, 0.24);

  border-top: 1px solid var(--line);
}

.keyboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;

  gap: 24px;

  padding-bottom: 24px;
}

.keyboard-heading h2 {
  margin-bottom: 0;

  font-size: clamp(18px, 2vw, 28px);
  font-weight: 580;

  letter-spacing: -0.035em;
}

.keyboard-heading > p {
  margin-bottom: 2px;

  color: var(--muted);

  font-size: 10px;

  white-space: nowrap;
}

.keyboard {
  position: relative;

  width: min(100%, 720px);
  height: 158px;

  justify-self: end;

  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.piano-key {
  position: relative;

  padding: 0;

  border: 0;

  cursor: pointer;

  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.piano-key.white {
  height: 158px;

  display: flex;
  align-items: end;
  justify-content: center;

  padding-bottom: 14px;

  background: #f1f2f4;
  color: #5d6470;

  border-right: 1px solid #b6bac2;
  border-radius: 0 0 7px 7px;

  font-size: 10px;
  font-weight: 700;
}

.piano-key.white:first-child {
  border-left: 1px solid #b6bac2;
}

.piano-key.black {
  position: absolute;
  z-index: 2;
  top: 0;

  width: 8%;
  height: 96px;

  display: flex;
  align-items: end;
  justify-content: center;

  padding-bottom: 11px;

  background:
    linear-gradient(180deg, #242832, #0c0e12);
  color: #868e9b;

  border: 1px solid #050608;
  border-radius: 0 0 6px 6px;

  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.45);

  font-size: 9px;
  font-weight: 700;

  transform: translateX(-50%);
}

.piano-key.black[data-position="1"] { left: 12.5%; }
.piano-key.black[data-position="2"] { left: 25%; }
.piano-key.black[data-position="3"] { left: 50%; }
.piano-key.black[data-position="4"] { left: 62.5%; }
.piano-key.black[data-position="5"] { left: 75%; }

.piano-key.white.active {
  background: var(--cyan);
  color: #0a2025;
}

.piano-key.black.active {
  background:
    linear-gradient(180deg, var(--violet), #5b3bb6);
  color: white;
}

.piano-key:focus-visible {
  z-index: 3;

  outline: 3px solid var(--coral);
  outline-offset: -3px;
}

@media (max-width: 1050px) {
  .app {
    display: block;
  }

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

  .games-section {
    grid-template-columns: 1fr;
  }

  .keyboard-section {
    grid-template-columns: 1fr;

    padding-top: 24px;
  }

  .keyboard {
    width: min(100%, 760px);

    justify-self: center;
  }
}

@media (max-width: 650px) {
  .site-header {
    padding: 18px;
  }

  .site-header p {
    display: none;
  }

  .hero {
    padding: 38px 18px;
  }

  .games-section {
    padding: 38px 18px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;

    gap: 7px;
  }

  .tool-grid,
  .games-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 130px;
  }

  .keyboard-section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .keyboard-heading > p {
    display: none;
  }

  .keyboard {
    height: 132px;
  }

  .piano-key.white {
    height: 132px;
  }

  .piano-key.black {
    height: 80px;
  }
}
