:root {
  --bg: #fffaf2;
  --surface: #ffffff;
  --surface-2: #fff3d0;
  --surface-3: #f6efe2;
  --ink: #221814;
  --muted: #6f6258;
  --brand: #c9481c;
  --brand-2: #f2a900;
  --brand-3: #16745d;
  --border: #eadcc7;
  --shadow: 0 18px 60px rgba(83, 43, 21, 0.13);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(242, 169, 0, 0.18), transparent 34rem),
    linear-gradient(180deg, var(--bg), #fff 48rem);
  line-height: 1.6;
}

img, svg { max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

a:hover { color: var(--brand); }

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  padding: .75rem 1rem;
  border-radius: .8rem;
}

.skip-link:focus { top: 1rem; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 242, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(234, 220, 199, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-weight: 900;
  letter-spacing: -.03em;
  font-size: 1.3rem;
  color: var(--ink);
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 28px rgba(201, 72, 28, 0.22);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: .65rem .85rem;
  font-weight: 800;
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.site-nav > a,
.site-nav > .has-dropdown > button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: .65rem .85rem;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
}

.site-nav > a:hover,
.site-nav > .has-dropdown > button:hover,
.site-nav > a.is-active {
  background: #fff1d2;
  color: var(--brand);
}

.nav-cta {
  background: var(--ink) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(34, 24, 20, .12);
}

.has-dropdown {
  position: relative;
}

.dropdown {
  position: absolute;
  top: calc(100% + .55rem);
  left: 0;
  min-width: 235px;
  display: none;
  grid-template-columns: 1fr;
  padding: .55rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.is-open .dropdown {
  display: grid;
}

.dropdown a {
  padding: .7rem .8rem;
  border-radius: 12px;
  font-weight: 700;
  color: var(--ink);
}

.dropdown a:hover {
  background: #fff4d8;
}

.hero {
  padding: clamp(3rem, 6vw, 6rem) 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #7a3a14;
  background: #fff0ca;
  border: 1px solid #f3d78c;
  padding: .38rem .68rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 850;
}

h1, h2, h3 {
  margin: 0 0 .8rem;
  line-height: 1.08;
  letter-spacing: -.04em;
}

h1 {
  font-size: clamp(2.45rem, 6.2vw, 5.5rem);
  max-width: 11ch;
}

.page-title {
  max-width: 16ch;
}

h2 { font-size: clamp(1.8rem, 3.5vw, 3.15rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }

.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  color: var(--muted);
  max-width: 64ch;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .82rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(34, 24, 20, .13);
}

.button:hover { color: #fff; transform: translateY(-1px); }

.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: none;
}

.button-secondary:hover { color: var(--brand); }

.button-brand {
  background: linear-gradient(135deg, var(--brand), #e86b27);
  color: #fff;
}

.hero-card {
  position: relative;
  border-radius: 32px;
  background: linear-gradient(145deg, #2b1812, #6e2515 48%, #dc7b24);
  min-height: 430px;
  padding: clamp(1.4rem, 3vw, 2rem);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -18% -12% auto auto;
  width: 17rem;
  height: 17rem;
  border-radius: 999px;
  background: rgba(242, 169, 0, .38);
  filter: blur(2px);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto auto -22% -14%;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.loop-preview {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-title strong {
  display: block;
  font-size: 1.45rem;
}

.preview-title span { color: rgba(255,255,255,.75); }

.bpm-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  padding: .45rem .7rem;
  border-radius: 999px;
  font-weight: 850;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: .38rem;
  margin: 1.5rem 0;
}

.preview-dot {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.15);
}

.preview-dot.on { background: #ffd45a; box-shadow: 0 0 0 3px rgba(255,212,90,.18); }
.preview-dot.soft { background: rgba(255,255,255,.44); }

.preview-instruments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.preview-instruments span {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 16px;
  padding: .9rem;
  font-weight: 800;
}

.section {
  padding: clamp(2.6rem, 5vw, 5rem) 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 55ch;
}

.ideas {
  background: linear-gradient(180deg, #fff6d7, #fff1bf);
  border-block: 1px solid #efd88b;
  padding: 1.4rem 0;
}

.ideas .section-head { margin-bottom: 1rem; }
.ideas h2 { font-size: clamp(1.35rem, 2.5vw, 2.1rem); }

.idea-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.idea-card {
  display: flex;
  flex-direction: column;
  min-height: 155px;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(210,166,42,.34);
}

.idea-card strong { font-size: 1.02rem; }
.idea-card p { margin: .35rem 0 auto; color: var(--muted); font-size: .93rem; }
.idea-card span { margin-top: .8rem; font-weight: 850; color: var(--brand); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card,
.rhythm-card,
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 2vw, 1.45rem);
  box-shadow: 0 10px 34px rgba(83, 43, 21, 0.06);
}

.rhythm-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.rhythm-card .tag-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .8rem 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .32rem .58rem;
  background: #fff2d1;
  color: #7d3b13;
  font-size: .82rem;
  font-weight: 850;
}

.rhythm-card p,
.card p,
.info-card p { color: var(--muted); }

.rhythm-card .button { margin-top: auto; }

.feature-list {
  display: grid;
  gap: .75rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  background: #fffaf2;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: .85rem;
}

.feature-list li::before {
  content: "✓";
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dcf5e7;
  color: #16745d;
  font-weight: 900;
}

.trainer-shell {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.trainer-panel,
.trainer-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: 0 16px 48px rgba(83, 43, 21, 0.08);
}

.trainer-panel {
  position: sticky;
  top: 92px;
}

.control-group {
  display: grid;
  gap: .8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.control-group:first-child { padding-top: 0; }
.control-group:last-child { border-bottom: 0; padding-bottom: 0; }

.control-group label,
.range-label {
  display: grid;
  gap: .45rem;
  font-weight: 800;
}

.control-group label span,
.range-label span {
  color: var(--brand);
  font-weight: 900;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fffdf9;
  color: var(--ink);
  padding: 0 .8rem;
  font-weight: 750;
}

input[type="range"] {
  accent-color: var(--brand);
}

.toggle-row {
  display: grid;
  gap: .7rem;
}

.toggle-row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fffaf2;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: .75rem .85rem;
  font-weight: 800;
}

.transport-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
}

#play-toggle {
  border: 0;
}

#play-toggle.is-playing {
  background: #5b1f15;
}

.status-box {
  margin: 1rem 0 0;
  padding: .85rem;
  border-radius: 16px;
  background: #fff3d0;
  color: #6d3a12;
  font-weight: 780;
}

.rhythm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .9rem;
}

.rhythm-meta span {
  background: #f7ead7;
  border: 1px solid #ecdbc2;
  border-radius: 999px;
  padding: .28rem .58rem;
  font-size: .82rem;
  font-weight: 850;
  color: #6b5444;
}

.tip-box {
  background: #effbf6;
  border: 1px solid #cbeedd;
  border-radius: 18px;
  padding: .95rem;
  color: #155a48;
  font-weight: 750;
  margin: 1rem 0;
}

.mixer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin: 1rem 0 1.4rem;
}

.mixer-card {
  background: #fffaf2;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
}

.mixer-card.is-muted { opacity: .55; }
.mixer-card.is-soloed { border-color: var(--brand-3); box-shadow: inset 0 0 0 2px rgba(22,116,93,.12); }

.mixer-card__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: start;
  margin-bottom: .85rem;
}

.mixer-card strong { display: block; line-height: 1.2; }
.mixer-card small { display: block; color: var(--muted); margin-top: .25rem; line-height: 1.35; }

.mixer-actions {
  display: flex;
  gap: .35rem;
}

.chip-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .38rem .58rem;
  font-weight: 850;
  font-size: .82rem;
  cursor: pointer;
}

.chip-button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.beat-grid-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fffdf9;
}

.beat-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) repeat(var(--steps, 16), minmax(36px, 1fr));
  gap: 1px;
  min-width: 760px;
  background: var(--border);
}

.grid-label,
.grid-step,
.beat-cell {
  min-height: 42px;
  display: grid;
  place-items: center;
  background: #fff;
  font-weight: 800;
}

.grid-label {
  justify-content: start;
  padding: 0 .75rem;
  color: #5f4c3f;
}

.grid-label--corner,
.grid-step {
  background: #fff3d0;
  color: #7b3a13;
}

.grid-step.is-accent { background: #ffe19a; }

.beat-cell {
  color: transparent;
  position: relative;
}

.beat-cell::before {
  content: "";
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: transparent;
}

.beat-cell--soft::before { background: #f0b449; opacity: .62; }
.beat-cell--strong::before { background: var(--brand); width: .72rem; height: .72rem; }
.beat-cell.is-active { background: #fff1bf; }
.beat-cell.is-active::after {
  content: "";
  position: absolute;
  inset: .35rem;
  border: 2px solid rgba(201,72,28,.28);
  border-radius: 10px;
}

.current-step-box {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: #2b1812;
  color: #fff;
  border-radius: 999px;
  padding: .5rem .8rem;
  font-weight: 850;
  margin-top: .8rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: start;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(1.1rem, 3vw, 2rem);
}

.article-body p,
.article-body li { color: var(--muted); }
.article-body h2 { margin-top: 2rem; }
.article-body h2:first-child { margin-top: 0; }

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 1rem;
}

.sidebar-card {
  background: #fffaf2;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.1rem;
}

.sidebar-card ul { padding-left: 1.2rem; color: var(--muted); }

.practice-callout {
  background: linear-gradient(135deg, #fff1bf, #fff7df);
  border: 1px solid #efd88b;
  border-radius: 24px;
  padding: clamp(1.2rem, 3vw, 2rem);
  margin: 1.5rem 0;
}

.faq-list {
  display: grid;
  gap: .8rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.faq-item button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 1rem;
  font-weight: 850;
  color: var(--ink);
  cursor: pointer;
}

.faq-answer {
  display: none;
  padding: 0 1rem 1rem;
  color: var(--muted);
}

.faq-item.is-open .faq-answer { display: block; }

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  padding: .75rem;
  border: 1px dashed #dfc997;
  border-radius: 18px;
  background: rgba(255, 246, 215, .5);
  color: #8a6c32;
  font-size: .88rem;
  text-align: center;
}

.site-footer {
  margin-top: 3rem;
  background: #211612;
  color: #f8eadc;
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 1.4rem;
}

.footer-grid h3 { font-size: 1rem; letter-spacing: 0; }
.footer-grid p, .footer-grid a { color: #d7c8b9; }
.footer-grid a { display: block; margin: .35rem 0; }
.footer-grid a:hover { color: #fff3d0; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 2rem;
  padding-top: 1rem;
  color: #bfae9d;
  font-size: .9rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  color: var(--muted);
  font-size: .94rem;
  margin-bottom: 1.2rem;
}

.breadcrumbs a { font-weight: 800; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #fff;
}

th, td {
  padding: .9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th { background: #fff3d0; color: #713711; }
tr:last-child td { border-bottom: 0; }

.notice {
  background: #effbf6;
  border: 1px solid #cbeedd;
  color: #155a48;
  border-radius: 18px;
  padding: 1rem;
}

@media (max-width: 980px) {
  .hero-grid,
  .trainer-shell,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .trainer-panel,
  .sidebar {
    position: static;
  }

  .idea-grid,
  .card-grid.four,
  .card-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container { width: min(100% - 1.1rem, var(--max)); }

  .header-inner { min-height: 66px; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 66px;
    left: .55rem;
    right: .55rem;
    display: none;
    align-items: stretch;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: .65rem;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open { display: flex; }

  .site-nav > a,
  .site-nav > .has-dropdown > button {
    width: 100%;
    text-align: left;
    border-radius: 14px;
  }

  .dropdown {
    position: static;
    display: none;
    min-width: auto;
    box-shadow: none;
    border-radius: 14px;
    margin: .25rem 0 .5rem;
    background: #fffaf2;
  }

  .has-dropdown:hover .dropdown { display: none; }
  .has-dropdown.is-open .dropdown,
  .has-dropdown:focus-within .dropdown { display: grid; }

  h1 { max-width: 12ch; }
  .hero { padding-top: 2.4rem; }
  .hero-card { min-height: auto; }
  .preview-instruments { grid-template-columns: 1fr; }
  .preview-grid { gap: .25rem; }

  .section-head {
    display: grid;
    align-items: start;
  }

  .idea-grid,
  .card-grid,
  .card-grid.two,
  .card-grid.four,
  .mixer-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .mixer-card__head {
    grid-template-columns: 1fr;
  }

  .mixer-actions { justify-content: start; }

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

  .footer-grid { gap: .8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .idea-card,
  .rhythm-card,
  .card {
    transition: transform .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
  }

  .idea-card:hover,
  .rhythm-card:hover,
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 50px rgba(83, 43, 21, 0.1);
  }
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-inline: .25rem;
  padding: .22rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
}

.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: .34rem .55rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  color: var(--ink);
}

.language-switch a.is-active,
.language-switch a:hover {
  background: var(--ink);
  color: #fff;
}

.quick-rhythm-strip {
  margin-top: -1rem;
  padding: .8rem 0 1.2rem;
}

.quick-rhythm-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  background: #fff7df;
  border: 1px solid #efd88b;
  border-radius: 20px;
  padding: .75rem;
}

.quick-rhythm-inner strong {
  margin-inline: .35rem .15rem;
}

.quick-rhythm-inner a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .42rem .72rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(210,166,42,.45);
  color: var(--ink);
  font-weight: 850;
}

.quick-rhythm-inner a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

@media (max-width: 760px) {
  .language-switch {
    width: 100%;
    justify-content: center;
    margin: .2rem 0;
    border-radius: 14px;
  }

  .language-switch a {
    flex: 1;
  }

  .quick-rhythm-inner {
    align-items: stretch;
  }

  .quick-rhythm-inner strong,
  .quick-rhythm-inner a {
    width: 100%;
    justify-content: center;
  }
}
