
/* ---------- Colors ----------
   One color per service. Tracks in the player pick up the color
   of the service they belong to. */
:root {
  --ground: #D9DBDD;
  --panel:  #E8EAEB;
  --ink:    #17191B;
  --muted:  #4A4F55;
  --line:   #B4B9BE;
  --score:  #2F62A8;
  --beat:   #B86A10;
  --mix:    #23785E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #1F2225;
    --panel:  #2A2E32;
    --ink:    #ECEEEF;
    --muted:  #A7ADB3;
    --line:   #41474D;
    --score:  #7CA6E8;
    --beat:   #EDA23A;
    --mix:    #58C2A0;
  }
}
:root[data-theme="dark"] {
  --ground: #1F2225;
  --panel:  #2A2E32;
  --ink:    #ECEEEF;
  --muted:  #A7ADB3;
  --line:   #41474D;
  --score:  #7CA6E8;
  --beat:   #EDA23A;
  --mix:    #58C2A0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }
h1, h2, h3, .brand { font-stretch: 125%; font-weight: 750; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); line-height: 1.1; }
h3 { font-size: 1.25rem; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

/* ---------- Header ---------- */
.site-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 28px; }
.brand { font-size: 1.125rem; text-decoration: none; }
.site-nav { display: flex; gap: 24px; }
.site-nav a { text-decoration: none; padding: 10px 0; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Intro ---------- */
.intro { padding-top: clamp(32px, 7vw, 88px); }
.intro h1 { font-size: clamp(2.5rem, 6.4vw, 4.75rem); line-height: 0.96; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; }
.intro p { max-width: 54ch; margin-top: 24px; font-size: 1.1875rem; color: var(--muted); }

.intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: end; gap: 32px clamp(24px, 5vw, 56px); }
.intro-video { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; background: var(--panel); }
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; } }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 32px; }
.listen-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.listen-head p { color: var(--muted); max-width: 52ch; margin-top: 12px; }
.license .cost.ask { font-size: 1.125rem; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; align-items: center; gap: 32px clamp(24px, 6vw, 80px); }
.about-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; background: var(--panel); }
.about-copy p { color: var(--muted); max-width: 58ch; margin-top: 16px; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: clamp(32px, 5vw, 56px); }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; background: var(--panel); }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Volume ---------- */
.volume { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: clamp(24px, 4vw, 44px); }
.mute { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.mute svg { width: 28px; height: 28px; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mute .i-off { display: none; }
.mute[aria-pressed="true"] .i-on { display: none; }
.mute[aria-pressed="true"] .i-off { display: block; }
.volume input[type="range"] { width: 170px; height: 44px; margin: 0; cursor: pointer; accent-color: var(--ink); }
@media (max-width: 640px) { .volume input[type="range"] { flex: 1; width: auto; } }

/* ---------- Tracks ---------- */
.tracks { list-style: none; margin: 8px 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.track { --c: var(--score); display: grid; grid-template-columns: 56px minmax(120px, 170px) 1fr auto; align-items: center; gap: 12px 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.track[data-kind="beat"] { --c: var(--beat); }
.track[data-kind="mix"]  { --c: var(--mix); }

.play { width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; background: var(--ink); color: var(--ground); display: grid; place-items: center; cursor: pointer; }
.play:hover { background: var(--c); }
.play svg { width: 22px; height: 22px; fill: currentColor; }
.play .i-pause { display: none; }
.track.is-playing .play .i-play { display: none; }
.track.is-playing .play .i-pause { display: block; }

.track-buy { grid-column: 4; }
.track-title { font-weight: 700; font-stretch: 112%; font-size: 1.1875rem; line-height: 1.2; }
.track-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.kind { display: inline-flex; align-items: center; gap: 7px; }
.kind::before, .chip { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--c); flex: none; }

/* The waveform sits in a tinted block, like a clip on a DAW timeline,
   with a stereo level meter at the end of the lane. */
.lane { display: flex; align-items: stretch; gap: 10px; min-width: 0; height: 76px; }
.clip { position: relative; flex: 1; min-width: 0; border-radius: 4px; overflow: hidden; background: var(--panel); background: color-mix(in srgb, var(--c) 20%, var(--panel)); }
.clip svg { position: absolute; inset: 8px 0; width: 100%; height: calc(100% - 16px); display: block; }
.clip .rest   { fill: var(--line); fill: color-mix(in srgb, var(--c) 50%, var(--panel)); }
.clip .played { fill: var(--c); fill: color-mix(in srgb, var(--c) 82%, var(--ink)); }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--ink); opacity: 0; pointer-events: none; }
.track.has-started .playhead { opacity: 1; }
.clip input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.clip:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.meter { display: flex; gap: 3px; width: 17px; flex: none; }
.meter span { position: relative; flex: 1; border-radius: 2px; overflow: hidden; background: var(--panel); background: color-mix(in srgb, var(--c) 20%, var(--panel)); }
.meter .fill { position: absolute; inset: 0; background: var(--c); background: color-mix(in srgb, var(--c) 82%, var(--ink)); transform: scaleY(0); transform-origin: bottom; }
.meter .hold { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); opacity: 0; }
.track-error { grid-column: 2 / -1; color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 640px) {
  .track { grid-template-columns: 56px 1fr; }
  .track-buy { grid-column: 1 / -1; }
  .track-buy .btn { width: 100%; }
  .lane { grid-column: 1 / -1; height: 64px; }
  .track-error { grid-column: 1 / -1; }
}

/* ---------- License panel ----------
   Opens under a track when someone clicks Buy. */
.licenses { grid-column: 1 / -1; display: none; gap: 16px; padding: 4px 0 14px; }
.track.is-open .licenses { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.license { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.license h4 { margin: 0; font-stretch: 112%; font-weight: 750; font-size: 1.0625rem; }
.license .cost { font-size: 1.5rem; font-weight: 750; font-stretch: 112%; line-height: 1; }
.license ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.9375rem; }
.license li { margin-bottom: 3px; }
.license .btn { margin-top: auto; }
.license-note { grid-column: 1 / -1; color: var(--muted); font-size: 0.9375rem; margin: 0; }

/* ---------- Services ---------- */
.section { padding-top: clamp(64px, 10vw, 120px); }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px clamp(24px, 4vw, 48px); margin-top: 36px; }
.service { --c: var(--score); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.service[data-kind="beat"] { --c: var(--beat); }
.service[data-kind="mix"]  { --c: var(--mix); }
.service h3 { display: flex; align-items: center; gap: 10px; }
.service .chip { width: 14px; height: 14px; }
.service p { color: var(--muted); }
.service .price { color: var(--ink); font-weight: 650; }
.service .btn { margin-top: 8px; }
@media (max-width: 760px) { .services { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 4px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--ground); }
.btn-solid { background: var(--ink); color: var(--ground); }
.btn-solid:hover { background: transparent; color: var(--ink); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 5fr 7fr; gap: 40px clamp(24px, 6vw, 80px); }
.contact-copy p { margin-top: 16px; color: var(--muted); max-width: 40ch; }
.contact-copy a { color: var(--ink); font-weight: 650; }
form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
label { font-weight: 650; font-size: 0.9375rem; }
input[type="text"], input[type="email"], select, textarea { width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
textarea { min-height: 150px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.hint { color: var(--muted); font-size: 0.9375rem; }
.hidden { position: absolute; left: -9999px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-status { font-weight: 650; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(64px, 10vw, 120px); border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: 0.9375rem; }

/* ---------- Nav: current page ---------- */
.site-nav { flex-wrap: wrap; column-gap: 24px; row-gap: 0; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- Page heading (Scoring, Mixing, Beats, Contact) ---------- */
.page-head { --c: var(--ink); padding-top: clamp(32px, 7vw, 88px); }
.page-head[data-kind="score"] { --c: var(--score); }
.page-head[data-kind="mix"]   { --c: var(--mix); }
.page-head[data-kind="beat"]  { --c: var(--beat); }
.page-head h1 { font-size: clamp(2.25rem, 5.6vw, 4rem); line-height: 0.98; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; max-width: 16ch; }
.page-head h1::before { content: ""; display: block; width: 56px; height: 8px; border-radius: 2px; background: var(--c); margin-bottom: 24px; }
.page-head p { max-width: 54ch; margin-top: 20px; font-size: 1.1875rem; color: var(--muted); }
.section-lede { color: var(--muted); max-width: 56ch; margin-top: 12px; }

/* ---------- Home: the three doors ---------- */
.doors { list-style: none; margin: 32px 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.door { --c: var(--score); border-top: 1px solid var(--line); }
.door[data-kind="mix"]  { --c: var(--mix); }
.door[data-kind="beat"] { --c: var(--beat); }
.door a { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px clamp(20px, 4vw, 40px); padding: clamp(22px, 4vw, 36px) 0; text-decoration: none; }
.door .bar { align-self: stretch; border-radius: 2px; background: var(--c); }
.door h3 { font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.05; letter-spacing: -0.02em; }
.door p { color: var(--muted); margin-top: 8px; max-width: 48ch; }
.door .go { font-weight: 650; white-space: nowrap; }
.door a:hover h3, .door a:hover .go { text-decoration: underline; text-underline-offset: 0.14em; }
@media (max-width: 640px) {
  .door a { grid-template-columns: 8px minmax(0, 1fr); }
  .door .go { grid-column: 2; }
}

/* ---------- Closing call to action ---------- */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding: clamp(28px, 5vw, 48px); border-radius: 4px; background: var(--panel); }
.cta p { color: var(--muted); margin-top: 8px; max-width: 48ch; }

/* ---------- Steps (a real sequence, so numbered) ---------- */
.steps { list-style: none; counter-reset: step; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px clamp(24px, 4vw, 48px); }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 16px; }
.steps li::before { content: counter(step); display: block; font-stretch: 125%; font-weight: 800; font-size: 2.25rem; line-height: 1; color: var(--c, var(--ink)); margin-bottom: 12px; }
.steps p { color: var(--muted); margin-top: 8px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Plain checklists ---------- */
.checklist { margin: 20px 0 0; padding-left: 20px; color: var(--muted); max-width: 60ch; }
.checklist li { margin-bottom: 6px; }

/* ---------- Empty states (shown until you add tracks or the store) ---------- */
.empty { margin-top: 24px; padding: clamp(24px, 4vw, 36px); border: 1px dashed var(--line); border-radius: 4px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.empty p { color: var(--muted); max-width: 52ch; }
.empty strong { display: block; color: var(--ink); font-size: 1.125rem; margin-bottom: 4px; }
[hidden] { display: none !important; }

/* ---------- Before / After switch on mix rows ---------- */
.ab-switch { display: inline-flex; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.ab-switch button { min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.ab-switch button + button { border-left: 2px solid var(--ink); }
.ab-switch button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.track.is-ab .meter { display: none; }
@media (max-width: 640px) {
  .track-ab { grid-column: 1 / -1; }
  .ab-switch { width: 100%; }
  .ab-switch button { flex: 1; }
}

/* ---------- Beat store embed ---------- */
.store { margin-top: 24px; }
.store iframe { display: block; width: 100%; min-height: 520px; border: 0; border-radius: 4px; }

/* ---------- Marketplace links ---------- */
.elsewhere { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 24px; }

/* ---------- Footer nav ---------- */
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
