/* ==========================================================
   From the Top website styles

   To change the look, start with the colours and fonts just
   below: they are used everywhere else on the page.
   The same values are listed for Figma in docs/figma-guide.md;
   change both together.
   ========================================================== */

:root {
  /* Colours */
  --bg:      #0a0a0f;                  /* page background */
  --surface: rgba(255,255,255,0.04);   /* cards and panels */
  --border:  rgba(255,255,255,0.09);   /* thin outlines */
  --text:    #f4f2ee;                  /* main text */
  --muted:   #9b99a8;                  /* secondary text */
  --hot:     #ff4f8b;                  /* accent gradient: start */
  --warm:    #ffb03a;                  /* accent gradient: end */
  --live:    #c8ff3d;                  /* "playing now" highlights */
  --gradient: linear-gradient(100deg, var(--hot), var(--warm));

  /* Fonts */
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;

  /* Layout */
  --width: 1160px;
  --gutter: clamp(16px, 5vw, 48px);
  --radius: 20px;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* stage lights: two soft glows behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 50vh at 85% -5%, rgba(255,79,139,0.22), transparent 70%),
    radial-gradient(50vw 45vh at -5% 40%, rgba(255,176,58,0.12), transparent 70%);
  pointer-events: none;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
}
h1 em, h2 em, blockquote em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a { color: inherit; }

main > section {
  max-width: var(--width);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 140px) var(--gutter);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 1.4em;
}

/* ---------- buttons and links ---------- */

.button {
  display: inline-block;
  background: var(--gradient);
  color: #14080c;
  border: 0;
  border-radius: 999px;
  padding: 0.95em 1.8em;
  font: 700 1rem var(--body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 40px -10px rgba(255,79,139,0.6);
  transition: transform .2s, box-shadow .2s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -10px rgba(255,79,139,0.8); }
.button.small { padding: 0.6em 1.2em; font-size: 0.9rem; box-shadow: none; }

.link {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color .2s;
}
.link:hover { border-color: var(--hot); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(var(--gutter), calc((100% - var(--width)) / 2 + var(--gutter)));
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.2rem var(--display);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.topbar nav { display: flex; align-items: center; gap: 28px; font-size: 0.95rem; }
.topbar nav a:not(.button) { text-decoration: none; color: var(--muted); transition: color .2s; }
.topbar nav a:not(.button):hover { color: var(--text); }
@media (max-width: 640px) { .topbar nav a:not(.button) { display: none; } }
@media (max-width: 420px) { .chart { gap: 6px; } .chart li { padding: 14px 4px; } .t-loop { display: none; } }

/* little equaliser in the logo */
.logo-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.logo-bars i {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: var(--gradient);
  transform-origin: bottom;
  animation: eq 1s ease-in-out infinite alternate;
}
.logo-bars i:nth-child(2) { animation-duration: .7s; }
.logo-bars i:nth-child(3) { animation-duration: 1.2s; }
.logo-bars i:nth-child(4) { animation-duration: .85s; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ---------- hero ---------- */

.hero {
  display: grid;
  /* minmax(0, ...) lets the columns shrink on small screens */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 5vw, 72px);
}
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4.4rem); }
.lead { max-width: 30em; font-size: 1.15rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 2.2em; }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 var(--live);
  animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* page-load entrance */
.hero-text > *, .player { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-text > *:nth-child(2) { animation-delay: .08s; }
.hero-text > *:nth-child(3) { animation-delay: .16s; }
.hero-text > *:nth-child(4) { animation-delay: .24s; }
.player { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* ---------- the player picture ---------- */

.player {
  position: relative;
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: 0 40px 120px -30px rgba(255,79,139,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  transform: rotate(1.5deg);
}
.player-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.player-song { font: 600 1.05rem var(--display); margin: 0; }
.player-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.tempo {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font: 600 0.75rem var(--display); color: var(--muted);
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px;
}
/* one flash per beat at 96 BPM */
.beat { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: beat .625s infinite; }
@keyframes beat { 0% { opacity: 1; transform: scale(1.3); } 40%, 100% { opacity: .25; transform: scale(1); } }

/* eight bars of chords; the playing one lights up in turn */
.chart {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.chart li {
  position: relative;
  overflow: hidden;
  padding: 18px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font: 600 clamp(0.9rem, 1.6vw, 1.15rem) var(--display);
  text-align: center;
  animation: bar 10s linear infinite;
  animation-delay: calc((var(--i) - 8) * 1.25s);
}
.chart li::after {
  content: "";
  position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--live);
  animation: playhead 10s linear infinite;
  animation-delay: inherit;
}
@keyframes bar {
  0%, 12.4% { background: rgba(200,255,61,0.12); border-color: rgba(200,255,61,0.5); color: var(--live); }
  12.5%, 100% { background: var(--surface); border-color: var(--border); color: var(--text); }
}
@keyframes playhead { 0% { width: 0; } 12.5% { width: 100%; } 12.51%, 100% { width: 0; } }

.tracks { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.tracks li { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--muted); }
.meter {
  height: 6px; border-radius: 3px;
  background: var(--gradient);
  transform-origin: left;
  animation: level var(--d) ease-in-out infinite alternate;
}
.tracks .you .meter { background: var(--live); }
@keyframes level { from { transform: scaleX(.45); } to { transform: scaleX(1); } }

.transport {
  display: flex; align-items: center; gap: 10px;
  padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted);
}
.t-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); font-size: 0.65rem; color: var(--text);
}
.t-btn.play { width: 42px; height: 42px; background: var(--text); color: var(--bg); border: 0; }
.t-btn.rec::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--hot); }
.t-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.t-loop { color: var(--live); }

/* ---------- scrolling strip ---------- */

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding: 22px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: scroll 40s linear infinite; }
.ticker span {
  font: 600 clamp(1.1rem, 2.4vw, 1.6rem) var(--display);
  letter-spacing: -0.02em;
  color: var(--muted);
  padding: 0 28px;
  white-space: nowrap;
}
.ticker span::after { content: "✦"; margin-left: 56px; color: var(--hot); font-size: 0.7em; vertical-align: middle; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- modes ---------- */

.modes h2, .cta h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
  margin-top: 48px;
}
.grid article {
  position: relative;
  padding: 32px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .3s, border-color .3s, background .3s;
}
.grid article:hover {
  transform: translateY(-6px);
  border-color: rgba(255,79,139,0.5);
  background: linear-gradient(160deg, rgba(255,79,139,0.10), rgba(255,176,58,0.03));
}
.grid svg {
  width: 40px; height: 40px; padding: 8px; margin-bottom: 28px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  fill: none; stroke: var(--warm); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.grid h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.grid p { color: var(--muted); margin: 0; font-size: 0.97rem; }

/* ---------- why ---------- */

.why {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
@media (max-width: 860px) { .why { grid-template-columns: minmax(0, 1fr); } }
.why blockquote {
  margin: 0;
  font: 600 clamp(1.6rem, 3.4vw, 2.5rem)/1.2 var(--display);
  letter-spacing: -0.03em;
}
.stats { display: grid; gap: 14px; }
.stats div {
  display: grid; gap: 4px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.stats strong { font: 800 1.5rem var(--display); letter-spacing: -0.03em; }
.stats span { color: var(--muted); font-size: 0.95rem; }

/* ---------- game: name the note ---------- */

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
@media (max-width: 860px) { .play { grid-template-columns: minmax(0, 1fr); } }
.play h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
.play-text > p:not(.eyebrow) { color: var(--muted); max-width: 26em; }

.game-stats { display: flex; gap: 12px; margin: 2em 0 0; }
.game-stats div {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.game-stats dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.game-stats dd { margin: 2px 0 0; font: 800 1.3rem var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.note-game {
  padding: clamp(16px, 2.6vw, 28px);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: 0 40px 120px -30px rgba(255,176,58,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}

.clef-choice {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}
.clef-choice button {
  border: 0;
  border-radius: 999px;
  padding: 0.45em 1.1em;
  background: transparent;
  color: var(--muted);
  font: 700 0.85rem var(--body);
  cursor: pointer;
}
.clef-choice button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.staff { display: block; width: 100%; height: auto; margin: 12px 0; }
.staff-line { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.clef { fill: var(--text); font-family: "Noto Music", serif; }
.clef-treble { font-size: 42px; }
.clef-bass { font-size: 40px; }
.note { fill: var(--text); stroke: var(--text); stroke-width: 1.4; transition: fill .15s, stroke .15s; }
.note.right { fill: var(--live); stroke: var(--live); }
.note.wrong { fill: var(--hot); stroke: var(--hot); }
.note ellipse { stroke: none; }

.letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.letters button {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: 600 clamp(1rem, 2.4vw, 1.4rem) var(--display);
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.letters button:hover { transform: translateY(-3px); border-color: rgba(255,79,139,0.6); }
.letters button.right { background: rgba(200,255,61,0.15); border-color: var(--live); color: var(--live); }
.letters button.wrong { background: rgba(255,79,139,0.15); border-color: var(--hot); color: var(--hot); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.game-message { min-height: 1.6em; margin: 14px 0 0; text-align: center; font-weight: 700; }

/* ---------- call to action ---------- */

main > section.cta {
  position: relative;
  overflow: hidden;
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--width) - 2 * var(--gutter));
  margin-bottom: 64px;
  border-radius: 32px;
  text-align: center;
  background:
    radial-gradient(80% 120% at 50% 120%, rgba(255,79,139,0.45), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
}
.cta p { color: var(--muted); max-width: 32em; margin-inline: auto; }
.signup { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 2em; }
.signup input {
  flex: 1 1 240px;
  max-width: 340px;
  padding: 0.95em 1.4em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  font: 1rem var(--body);
  outline: none;
  transition: border-color .2s;
}
.signup input:focus { border-color: var(--hot); }
.signup button:disabled { opacity: 0.6; cursor: wait; }
.signup-status { min-height: 1.6em; margin: 1em auto 0; color: var(--text) !important; }

/* ---------- footer ---------- */

.footer {
  max-width: var(--width);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- less motion for people who ask for it ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
