:root {
  --ink: #111827;
  --muted: #526077;
  --faint: #6b7280;
  --line: #dbe2ea;
  --surface: #ffffff;
  --soft: #f1f5f9;
  --canvas: #f8fafc;
  --brand: #2557d6;
  --brand-dark: #153c9e;
  --teal: #087f78;
  --warn: #92570a;
  --warn-bg: #fff7e6;
  --radius: 8px;
  --max: 1120px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
}
a { color: inherit; }
button { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #9db7f4;
  outline-offset: 2px;
}
p { margin: 0 0 1rem; }
h1, h2, h3 { letter-spacing: 0; line-height: 1.18; margin: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  color: var(--brand);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.5rem;
}
.logo span { color: var(--ink); }
.logo.small { font-size: 1.25rem; display: inline-block; margin-bottom: 8px; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 600;
  color: var(--muted);
  font-size: .95rem;
}
.site-nav a, .footer-links a { text-decoration: none; }
.site-nav a:hover, .footer-links a:hover { color: var(--brand); }

.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 58px 22px 52px;
  display: grid;
  grid-template-columns: minmax(460px, 1fr) 356px;
  gap: 56px;
  align-items: center;
}
.hero-copy h1 {
  max-width: 680px;
  font-size: clamp(2.5rem, 5vw, 3.55rem);
  margin-bottom: 18px;
}
.kicker {
  margin: 0 0 14px;
  color: var(--brand);
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 750;
}
.hero-lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.13rem;
  line-height: 1.68;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 20px;
}
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .96rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--surface);
  cursor: pointer;
}
.btn.primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.secondary:hover { color: var(--brand); border-color: #9db7f4; }
.rights-note { color: var(--faint); font-size: .9rem; }

.signal-panel {
  background: #0f172a;
  border-radius: var(--radius);
  color: #e2e8f0;
  padding: 10px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .14);
}
.signal-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 700;
  padding: 0 10px;
}
.status-dot {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background: #22c55e;
}
.signal-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  margin-bottom: 7px;
  border: 1px solid #293449;
  border-radius: 6px;
  text-decoration: none;
  background: #141e31;
}
.signal-row:hover { border-color: #4a75de; }
.signal-row strong {
  color: #8eb1ff;
  font-size: .74rem;
}

.band { padding: 58px 22px; }
.band-soft { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-inner { max-width: var(--max); margin: 0 auto; }
.section-heading {
  max-width: 700px;
  margin: 0 0 32px;
}
.section-heading h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.35rem);
  margin-bottom: 12px;
}
.section-heading > p:not(.kicker) { color: var(--muted); }
.heading-row {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.text-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  margin-bottom: 12px;
}

.tool-grid, .workflow-grid, .article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tool-card, .article-card {
  position: relative;
  display: block;
  min-height: 214px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.tool-card:hover, .article-card:hover { border-color: #a9c1f8; box-shadow: 0 10px 20px rgba(20, 34, 59, .06); }
.tool-card.featured { border-color: #aac3fd; }
.tool-card h3, .article-card h3 { font-size: 1.2rem; margin: 14px 0 9px; }
.tool-card p, .article-card p:not(.meta) { color: var(--muted); font-size: .94rem; }
.tag {
  display: inline-block;
  color: var(--brand);
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid #c3d4fd;
  background: #eef4ff;
  border-radius: 4px;
}
.tag.local { color: var(--teal); background: #e9f8f5; border-color: #b6e4dd; }
.card-link { color: var(--brand); font-size: .9rem; font-weight: 700; }
.workflow-grid { grid-template-columns: repeat(3, 1fr); }
.workflow {
  min-height: 176px;
  padding: 22px 0;
  border-top: 2px solid var(--ink);
}
.workflow h3 { font-size: 1.22rem; margin-bottom: 10px; }
.workflow p { color: var(--muted); }
.workflow a { color: var(--brand); font-weight: 650; text-decoration: none; }
.article-grid { grid-template-columns: repeat(3, 1fr); }
.article-card { min-height: 184px; }
.article-card .meta { color: var(--brand); text-transform: uppercase; font-size: .76rem; font-weight: 700; margin: 0; }
.trust-band { background: #111827; color: #f8fafc; }
.trust-copy { max-width: 820px; }
.trust-copy h2 { font-size: 1.8rem; margin-bottom: 14px; }
.trust-copy p { color: #cbd5e1; line-height: 1.7; }
.trust-links { display: flex; gap: 22px; flex-wrap: wrap; }
.trust-links a { color: #a9c7ff; text-decoration: none; font-weight: 650; }

.site-footer {
  padding: 36px 22px 25px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 26px;
  justify-content: space-between;
}
.footer-inner p { color: var(--muted); font-size: .9rem; }
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-content: start;
  color: var(--muted);
  font-size: .9rem;
}
.copyright {
  max-width: var(--max);
  margin: 18px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: .86rem;
}

/* Tool and guide pages */
.page-hero {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 42px 22px 38px;
}
.page-hero-inner, .content-shell {
  max-width: 920px;
  margin: 0 auto;
}
.breadcrumbs {
  color: var(--faint);
  font-size: .88rem;
  margin-bottom: 20px;
}
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.page-hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin-bottom: 14px; }
.page-hero .lead { font-size: 1.08rem; max-width: 760px; color: var(--muted); }
.content-shell { padding: 36px 22px 62px; }
.embedded-tool {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 42px;
}
.tool-alert {
  padding: 13px 16px;
  border-bottom: 1px solid #f3d895;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: .92rem;
}
.embedded-tool iframe { width: 100%; height: 850px; display: block; border: 0; }
.content-section { margin: 40px 0; }
.content-section h2 { font-size: 1.6rem; margin-bottom: 14px; }
.content-section h3 { font-size: 1.2rem; margin: 26px 0 10px; }
.content-section p, .content-section li { color: var(--muted); }
.content-section ul, .content-section ol { padding-left: 22px; }
.steps { display: grid; gap: 12px; counter-reset: step; }
.step {
  display: flex;
  gap: 16px;
  background: var(--surface);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  flex: none;
  height: 30px;
  width: 30px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: .9rem;
  font-weight: 700;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}
.related-card h3 { font-size: 1.02rem; margin-bottom: 7px; }
.related-card p { color: var(--muted); font-size: .9rem; margin: 0; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin: 10px 0 0; }

.utility-box {
  padding: 24px;
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 650; margin-bottom: 8px; }
.field input[type="file"] {
  display: block;
  width: 100%;
  border: 1px dashed #a8b5c6;
  padding: 20px;
  border-radius: var(--radius);
  background: #fbfdff;
}
.time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.field input[type="number"] {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 1rem;
}
.field input[type="text"], .field input[type="date"], .field textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.field textarea {
  resize: vertical;
  line-height: 1.55;
}
.field input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}
.field select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--surface);
  font-size: 1rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.field-output {
  color: var(--brand);
  font-size: .94rem;
  font-weight: 700;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .94rem;
  margin-top: 14px;
}
.check-row input { accent-color: var(--brand); height: 18px; width: 18px; }
.utility-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.status {
  min-height: 24px;
  color: var(--muted);
  font-size: .94rem;
  margin-top: 16px;
}
.start-panel h2 { font-size: 1.55rem; margin-bottom: 12px; }
.start-panel > p:not(.kicker) { color: var(--muted); }
.prompt-results { margin-top: 22px; }
.prompt-results .btn { min-height: 42px; }
.hidden { display: none !important; }
.bpm-screen {
  min-height: 144px;
  display: grid;
  place-items: center;
  text-align: center;
  background: #111827;
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.bpm-number { font-size: clamp(3rem, 12vw, 5rem); font-weight: 750; line-height: 1; }
.bpm-label { color: #a7b5cc; font-size: .84rem; font-weight: 650; text-transform: uppercase; }
.tap-button {
  width: 100%;
  height: 76px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 1.24rem;
  font-weight: 750;
  cursor: pointer;
}
.tap-button:active { background: var(--brand-dark); }
.display-panel {
  min-height: 122px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  margin-bottom: 20px;
  color: #fff;
  background: #111827;
  border-radius: var(--radius);
}
.display-value {
  color: #fff;
  font-size: clamp(2.1rem, 8vw, 3.5rem);
  font-weight: 750;
  line-height: 1.1;
}
.display-sub {
  color: #a7b5cc;
  font-size: .88rem;
  margin: 9px 0 0;
}
.transport {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.transport audio { width: 100%; margin-bottom: 16px; }
.metro-beats {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}
.metro-beat {
  height: 13px;
  width: 13px;
  border: 1px solid #74849c;
  border-radius: 50%;
}
.metro-beat.active { background: #8eb1ff; border-color: #8eb1ff; }
.metro-beat.accent { background: #38cbbd; border-color: #38cbbd; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.result-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.result-card strong { display: block; font-size: 1.25rem; }
.result-card span { color: var(--faint); font-size: .84rem; }
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0 8px;
}
.choice-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}
.choice-button:hover { border-color: #9db7f4; color: var(--brand); }
.canvas-result {
  margin-top: 24px;
}
.canvas-result canvas {
  display: block;
  width: min(100%, 500px);
  height: auto;
  margin: 0 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.chroma-list { display: grid; gap: 7px; margin-top: 18px; }
.chroma-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; font-size: .85rem; color: var(--muted); }
.chroma-track { height: 9px; background: var(--soft); border-radius: 8px; overflow: hidden; }
.chroma-fill { height: 100%; background: var(--brand); border-radius: 8px; }
.article-body { max-width: 760px; }
.article-body h2 { font-size: 1.55rem; margin: 35px 0 12px; }
.article-body h3 { font-size: 1.18rem; margin: 28px 0 10px; }
.article-body p, .article-body li { color: var(--muted); }
.article-body a { color: var(--brand); font-weight: 600; }
.article-byline {
  padding-bottom: 17px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
  color: var(--faint) !important;
  font-size: .9rem;
}
.article-note {
  margin: 30px 0;
  padding: 18px;
  background: #eef4ff;
  border: 1px solid #c5d8ff;
  border-radius: var(--radius);
}
.audio-comparison {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 26px;
}
.sample-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.sample-card h3 { font-size: 1rem; margin: 0 0 10px; }
.sample-card p { color: var(--muted); font-size: .88rem; margin: 0 0 10px; }
.sample-card audio { width: 100%; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 26px;
  font-size: .94rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  color: var(--muted);
  font-weight: 650;
  background: var(--soft);
}
.guide-index-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* Legal pages */
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 22px 72px;
}
.legal-page h1 { font-size: 2.4rem; margin: 16px 0 22px; }
.legal-page h2 { font-size: 1.35rem; margin: 30px 0 10px; }
.legal-page p, .legal-page li { color: var(--muted); }
.legal-page a { color: var(--brand); }
.back-link { text-decoration: none; font-weight: 750; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; padding-top: 45px; }
  .signal-panel { max-width: 430px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .site-header { height: auto; }
  .header-inner { min-height: 66px; align-items: flex-start; padding-top: 17px; padding-bottom: 15px; flex-direction: column; }
  .site-nav { width: 100%; gap: 18px; overflow-x: auto; }
  .hero-inner { padding: 38px 18px; }
  .band { padding: 42px 18px; }
  .tool-grid, .workflow-grid, .article-grid, .related-grid, .guide-index-grid, .time-grid, .result-grid, .audio-comparison, .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .heading-row, .footer-inner { display: block; }
  .footer-links { margin-top: 16px; }
  .embedded-tool iframe { height: 1040px; }
  .content-shell, .page-hero { padding-left: 18px; padding-right: 18px; }
}
