:root {
  color-scheme: dark;
  --ink: #f4f7f7;
  --muted: #aab5b5;
  --line: #313941;
  --accent: #38f0c0;
  --accent-2: #f6cf4f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 22% 10%, rgba(56, 240, 192, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 16%, rgba(246, 207, 79, 0.12), transparent 24rem),
    linear-gradient(145deg, #101214 0%, #15191d 48%, #0d0f11 100%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.hero-panel,
.control-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 27, 31, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-panel {
  min-height: calc(100vh - 64px);
  padding: 28px;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  text-align: left;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(13, 15, 17, 0.8);
  border: 1px solid var(--line);
  object-fit: contain;
  padding: 5px;
}

.eyebrow {
  width: 100%;
  margin: 0 0 2px 4px;
  padding: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1;
}

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

h1 {
  margin-bottom: 0;
  padding: 0;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.tempo-cluster {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  gap: 12px;
  align-items: center;
}

.icon-button,
.ghost-button,
.tap-button,
.preset-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #20262c;
  border-radius: 8px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button {
  width: 58px;
  height: 58px;
  font-size: 1.8rem;
  font-weight: 700;
}

.icon-button:hover,
.ghost-button:hover,
.tap-button:hover,
.preset-button:hover,
.beat-button:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 240, 192, 0.7);
}

.bpm-readout {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0f11;
  display: grid;
  place-items: center;
  padding: 18px 14px;
}

.bpm-readout span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
}

.bpm-readout input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  text-align: center;
  font-size: clamp(4rem, 12vw, 7.5rem);
  font-weight: 850;
  line-height: 0.9;
  letter-spacing: 0;
}

.tempo-slider,
.slider-stack input {
  width: 100%;
  accent-color: var(--accent);
}

.transport-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
}

.play-button,
.tap-button {
  min-height: 62px;
  border-radius: 8px;
  font-weight: 800;
}

.play-button {
  border: 0;
  color: #08110f;
  background: linear-gradient(135deg, var(--accent), #8fffe4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(56, 240, 192, 0.16);
}

.play-button span:first-child {
  min-width: 38px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(8, 17, 15, 0.12);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.tap-button {
  border: 1px solid rgba(246, 207, 79, 0.46);
  color: var(--accent-2);
  background: rgba(246, 207, 79, 0.08);
}

.tap-button.tapped {
  color: #08110f;
  background: var(--accent-2);
}

.pulse-stage {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
}

.pulse-ring {
  width: min(58vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    conic-gradient(from 0deg, rgba(56, 240, 192, 0.5), rgba(246, 207, 79, 0.32), rgba(255, 111, 145, 0.22), rgba(56, 240, 192, 0.5)),
    #111518;
  transition: transform 90ms ease, filter 90ms ease;
}

.pulse-ring.active {
  transform: scale(1.035);
  filter: brightness(1.2);
}

.pulse-core {
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #111518;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 850;
}

.measure-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.measure-status span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 15, 17, 0.5);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-content: start;
}

.control-panel {
  padding: 22px;
  border-radius: 8px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel-heading,
.mini-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
}

.signature-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 84px;
  gap: 12px;
  align-items: end;
}

.signature-row label,
.slider-stack label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #101417;
  padding: 0 12px;
}

.signature-display {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #09110f;
  background: var(--accent);
  font-size: 1.28rem;
  font-weight: 900;
}

.beat-editor {
  margin-top: 22px;
}

.mini-heading {
  color: var(--muted);
  font-size: 0.78rem;
}

.beat-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
}

.beat-button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #101417;
  display: grid;
  place-items: center;
  gap: 3px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.beat-button strong {
  font-size: 1.1rem;
}

.beat-button span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.beat-button.accent {
  color: #07100d;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.beat-button.accent span {
  color: rgba(7, 16, 13, 0.72);
}

.beat-button.mute {
  color: rgba(244, 247, 247, 0.45);
  background: #111417;
}

.beat-button.current {
  outline: 3px solid rgba(56, 240, 192, 0.36);
}

.sound-options {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.sound-card {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 20px 1fr;
  column-gap: 10px;
  background: #101417;
  cursor: pointer;
}

.sound-card input {
  grid-row: span 2;
  align-self: center;
  accent-color: var(--accent);
}

.sound-card span {
  font-weight: 850;
}

.sound-card small {
  color: var(--muted);
}

.sound-card:has(input:checked) {
  border-color: rgba(56, 240, 192, 0.72);
  background: rgba(56, 240, 192, 0.08);
}

.slider-stack {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

.slider-stack strong {
  color: var(--ink);
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.preset-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.preset-button {
  min-height: 58px;
  padding: 8px 9px;
  font-weight: 800;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 2px;
}

.preset-button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.preset-button small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.25;
}

.site-footer {
  padding: 18px 16px 20px;
  color: #ffffff;
  background: #000000;
  text-align: center;
}

.footer-links {
  margin-bottom: 7px;
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 0.68rem;
  font-style: italic;
}

.footer-links a,
.developer-link {
  text-decoration: none;
}

.footer-links a:hover,
.developer-link:hover {
  text-decoration: underline;
}

.developer-link {
  font-size: 0.75rem;
  font-weight: 700;
}

.legal-shell {
  width: min(860px, calc(100% - 32px));
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 36px 0;
}

.legal-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(23, 27, 31, 0.92);
  box-shadow: var(--shadow);
  padding: 28px;
}

.legal-panel h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.legal-panel h2 {
  margin-top: 26px;
  margin-bottom: 8px;
}

.legal-panel p,
.legal-panel li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-panel ul {
  padding-left: 1.2rem;
}

.legal-note {
  color: var(--ink);
  font-size: 0.86rem;
}

.back-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .hero-panel,
  .control-panel {
    padding: 16px;
  }

  .control-grid,
  .preset-row {
    grid-template-columns: 1fr;
  }

  .tempo-cluster {
    grid-template-columns: 46px 1fr 46px;
  }

  .icon-button {
    width: 46px;
    height: 52px;
  }

  .transport-row,
  .signature-row {
    grid-template-columns: 1fr;
  }

  .signature-display {
    min-height: 42px;
  }
}
