/* MusicMate for Ableton Live: shared styles for the web pages. Matches the plug-in and getmusicmate.com. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-raised: #f4f4f5;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #0a0a0a;
  --muted: #5f5f66;
  --accent: #0080ff;
  --accent-hover: #006fe0;
  --danger: #d92d20;
  --ok: #15803d;
  --radius: 10px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.mono {
  font-family: var(--mono);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.skip-link:focus {
  top: 12px;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 8px;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark svg {
  width: 28px;
  height: 28px;
  flex: none;
}

.wordmark .product {
  color: var(--muted);
  font-weight: 400;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.nav a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--text);
  background: var(--surface-raised);
  text-decoration: none;
}

/* Layout ------------------------------------------------------------------ */

main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}

main.narrow {
  max-width: 520px;
  padding-top: 40px;
}

.stack {
  display: grid;
  gap: 20px;
}

.stack-sm {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.row.spread {
  justify-content: space-between;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-title {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card-title:focus {
  outline: none;
}

.site-footer {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* Buttons and forms ------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: #ececee;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.button.quiet:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.button.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.button.block {
  width: 100%;
}

.button:disabled,
.button[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.button:focus-visible {
  border-radius: 999px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
}

input[type='email'],
input[type='text'] {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input::placeholder {
  color: #9a9aa2;
}

input:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 1px;
  border-radius: var(--radius);
}

input.code {
  font-family: var(--mono);
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  min-height: 60px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  font-size: 0.925rem;
}

.notice.error {
  border-color: rgba(217, 45, 32, 0.4);
  color: #b42318;
}

.notice.success {
  border-color: rgba(21, 128, 61, 0.4);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }

  .button {
    transition: none;
  }
}

/* Product page ------------------------------------------------------------ */

.hero {
  padding: 56px 0 40px;
  display: grid;
  gap: 24px;
  max-width: 720px;
}

.hero .lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 60ch;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 56px;
}

.features .card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0 56px;
}

.price {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plain-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.plain-list li {
  padding-left: 18px;
  position: relative;
}

.plain-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}

.steps {
  margin: 16px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.steps strong {
  color: var(--text);
  font-weight: 500;
}

/* Account ----------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.badge.pro {
  color: var(--text);
  border-color: var(--accent);
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.device-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.device-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.device-list li:last-child {
  padding-bottom: 0;
}

.device-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.connected-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(21, 128, 61, 0.45);
  display: grid;
  place-items: center;
  color: var(--ok);
}

.connected-mark svg {
  width: 22px;
  height: 22px;
}

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

  main {
    padding: 16px 16px 56px;
  }

  main.narrow {
    padding-top: 24px;
  }

  .card {
    padding: 20px;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 400px) {
  .wordmark .product {
    display: none;
  }
}
