:root {
  --bg: #070807;
  --card: #141614;
  --card-2: #1b1d1b;
  --ink: #f4f6f3;
  --muted: #8b9188;
  --line: rgba(255, 255, 255, 0.08);
  --lime: #c8f54a;
  --lime-ink: #12150d;
  --ok: #c8f54a;
  --low: #8ec8ff;
  --high: #ff8aa0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(200, 245, 74, 0.16), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.drawer::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

button,
a,
input,
label,
.inst-card,
.string-btn,
.hero-btn,
.chip,
.mic-btn,
.ghost-btn,
.icon-btn {
  touch-action: manipulation;
}

.top {
  width: 100%;
  margin: 0;
  padding: 22px min(5vw, 48px) 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-name {
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}

main,
.metro-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 20px 56px;
}

.hero {
  text-align: center;
  padding: 28px 0 22px;
}

.kicker {
  color: var(--lime);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  letter-spacing: -0.05em;
  font-weight: 800;
}

.lede {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 420px;
  margin: 22px auto 0;
}

.hero-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hero-btn:hover {
  border-color: rgba(200, 245, 74, 0.45);
}

.hero-btn-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-btn-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-btn.has-value .hero-btn-value {
  color: var(--lime);
}

.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 8px 0 10px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 92vw);
  background: #101210;
  border-left: 1px solid var(--line);
  z-index: 50;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  padding: 22px 18px 28px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.35);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer-kicker {
  margin: 0 0 4px;
  color: var(--lime);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.drawer-list {
  gap: 8px;
}

.instrument-grid.drawer-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.instrument-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.inst-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  min-height: 68px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
}

.inst-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.inst-icon img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
}

.inst-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  min-width: 0;
}

.inst-card strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
}

.inst-card small {
  color: var(--muted);
  font-size: 0.68rem;
}

.inst-card.is-selected {
  border-color: var(--lime);
  color: var(--ink);
  background: rgba(200, 245, 74, 0.08);
}

.inst-card.is-selected .inst-icon {
  background: #fff;
}

.inst-card.is-selected strong {
  color: var(--lime);
}

.tuner-card {
  background: linear-gradient(180deg, #171917, #101210);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px 22px 28px;
  text-align: center;
}

.mic-btn:disabled {
  cursor: not-allowed;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6fbf4a;
  display: inline-block;
}

.status.ok {
  color: var(--ok);
}
.status.low {
  color: var(--low);
}
.status.high {
  color: var(--high);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  cursor: pointer;
}

.settings {
  text-align: left;
  margin: 14px 0 8px;
  padding: 12px;
  border-radius: 16px;
  background: #0d0f0d;
}

.a4-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.a4-presets,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.a4-presets button,
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}

.chip.is-selected {
  border-color: var(--lime);
  color: var(--lime);
}

.hz {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  height: 1.6rem;
  line-height: 1.6rem;
  overflow: hidden;
  white-space: nowrap;
  background: #141614;
}

.note-display {
  position: relative;
  margin: 8px 0 4px;
  padding-top: 18px;
  display: grid;
  grid-template-rows: 1.6rem clamp(5.2rem, 16vw, 7.8rem) 1.55rem;
  row-gap: 8px;
}

.note-letter-wrap {
  height: clamp(5.2rem, 16vw, 7.8rem);
  overflow: hidden;
  position: relative;
  background: #141614;
  border-radius: 4px;
}

.note-letter-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.note-solfa {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  height: 1.55rem;
  line-height: 1.55rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: #141614;
}

.tuner-card.is-idle .hz,
.tuner-card.is-idle .note-letter-wrap,
.tuner-card.is-idle .note-solfa {
  visibility: hidden;
}

.prompt {
  color: var(--muted);
  margin: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tuner-card:not(.is-idle) .prompt {
  visibility: hidden;
}

.ruler-wrap {
  margin: 8px auto 22px;
  max-width: 560px;
}

.ruler-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 6px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.mic-btn {
  width: min(320px, 100%);
  margin: 8px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--lime);
  color: var(--lime-ink);
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.string-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 18px 0 16px;
}

.string-row:empty,
.string-row[hidden] {
  display: none;
}

.string-btn {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  padding: 22px 8px 12px;
  cursor: pointer;
  font: inherit;
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.string-btn .num {
  position: absolute;
  top: 8px;
  left: 10px;
  color: var(--muted);
  font-size: 0.68rem;
}

.string-btn .note {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
  min-height: 1.2em;
}

.string-btn .solfa {
  color: var(--muted);
  font-size: 0.78rem;
}

.string-btn.is-selected,
.string-btn.is-detected {
  border-color: var(--lime);
  border-width: 1px;
}

.string-btn.is-detected .note {
  color: var(--lime);
}

.privacy {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 18px 0 0;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metro-card {
  margin-top: 16px;
}

.bpm-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 12px;
}

.bpm-display strong {
  display: block;
  font-size: 4.6rem;
  line-height: 0.9;
}

.bpm-display span {
  color: var(--muted);
  letter-spacing: 0.16em;
  font-size: 0.75rem;
}

.beats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}

.beat {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #2a2e2a;
}

.beat.is-on {
  background: var(--lime);
}

.beat.is-accent.is-on {
  background: #fff;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.back {
  margin-top: 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--lime);
}

@media (max-width: 720px) {
  .string-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-actions {
    max-width: none;
  }
}
