/* ============================================================
   No Excuses Motion Music Mixer — NX Triple M
   Cinematic studio console. Brand: soft-black, chrome silver,
   one crimson accent. Sharp corners, chrome-line signatures,
   fully responsive.
   ============================================================ */

:root {
  --black: #0a0a0a;
  --black-1: #0e0e0f;
  --surface: #141416;
  --surface-2: #1a1a1d;
  --surface-3: #202024;
  --line: #2a2a2f;
  --line-2: #37373d;
  --chrome-1: #f4f5f7;
  --chrome-2: #c7cad0;
  --chrome-3: #8b8f97;
  --red: #c8102e;
  --red-bright: #e8213f;
  --red-deep: #8d1026;
  --white: #ffffff;
  --body: #d9dbe0;
  --muted: #8b8f97;
  --muted-2: #6a6d74;
  --success: #3fb562;

  --chrome-grad: linear-gradient(168deg, #ffffff 0%, #d0d3d9 26%, #7f838b 52%, #e2e4e9 72%, #9a9ea6 100%);
  --chrome-line: linear-gradient(90deg, transparent, rgba(199, 202, 208, 0.55) 20%, rgba(255, 255, 255, 0.8) 50%, rgba(199, 202, 208, 0.55) 80%, transparent);
  --red-line: linear-gradient(90deg, transparent, var(--red) 30%, var(--red-bright) 50%, var(--red) 70%, transparent);

  --font-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-loud: 'Bebas Neue', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --z-base: 1;
  --z-sticky: 100;
  --z-overlay: 500;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* decorative elements may bleed off-canvas; never scroll to them */
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--body);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* cinematic backdrop: black-to-crimson gradient, chrome sheen, glow,
   crisp accent lines, soft vignette, signature. Everything is a static
   vector gradient painted in one layer at full device resolution — no blur
   filters, no animated composited layers, no snapshots. Nothing can blur. */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    /* chrome-silver sheen, top-left */
    radial-gradient(46% 34% at 14% 8%, rgba(184, 190, 200, 0.07), transparent 70%),
    /* deep-crimson pool, bottom-left */
    radial-gradient(52% 42% at 28% 96%, rgba(170, 14, 38, 0.16), rgba(170, 14, 38, 0.05) 55%, transparent 75%),
    /* main crimson bloom, top-right (behind the crest) */
    radial-gradient(50% 40% at 82% 6%, rgba(200, 16, 46, 0.26), rgba(200, 16, 46, 0.09) 48%, transparent 72%),
    /* diagonal black → crimson wash toward the bottom-right */
    linear-gradient(152deg, #0a0a0a 0%, #0c0809 38%, #150609 66%, #22070e 88%, #2a0812 100%);
}

/* razor-thin chrome + crimson beams: crisp structure so the soft light
   reads as intentional design, not out-of-focus */
.bg-fx::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent calc(24% - 1px), rgba(199, 202, 208, 0.09) 24%, transparent calc(24% + 1px)),
    linear-gradient(115deg, transparent calc(27% - 1px), rgba(199, 202, 208, 0.05) 27%, transparent calc(27% + 1px)),
    linear-gradient(115deg, transparent calc(70% - 1px), rgba(232, 33, 63, 0.14) 70%, transparent calc(70% + 1px)),
    linear-gradient(115deg, transparent calc(73% - 1px), rgba(232, 33, 63, 0.07) 73%, transparent calc(73% + 1px));
}

/* soft edge vignette for depth */
.bg-fx::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 130% 105% at 50% 38%, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
}

/* hand-signed flavor: black-ink fancy cursive over the crimson corner */
.bg-sig {
  position: absolute;
  right: clamp(10px, 3.5vw, 64px);
  bottom: clamp(6px, 2.5vw, 38px);
  font-family: 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', cursive;
  font-size: clamp(96px, 14vw, 210px);
  line-height: 1.1;
  color: #060606;
  transform: rotate(-6.5deg);
  text-shadow: 0 1px 0 rgba(232, 33, 63, 0.18), 0 2px 22px rgba(0, 0, 0, 0.55);
  user-select: none;
  white-space: nowrap;
}

main, .site-header, .site-footer { position: relative; z-index: var(--z-base); }

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

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

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding: 18px clamp(18px, 5vw, 60px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 14, 15, 0.85), rgba(10, 10, 10, 0.6));
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

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

.brand-crest {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(200, 16, 46, 0.35));
  flex: none;
}
.brand-crest.sm { width: 34px; height: 34px; }

.wordmark { display: flex; flex-direction: column; line-height: 1; gap: 3px; }

.wm-no {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  background: var(--chrome-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wm-mixer {
  font-family: var(--font-loud);
  font-size: 13px;
  letter-spacing: 0.26em;
  color: var(--chrome-3);
  padding-left: 2px;
}

.wordmark.small .wm-no { font-size: 17px; }
.wordmark.small .wm-mixer { font-size: 11px; letter-spacing: 0.2em; }

.header-tag { color: var(--muted); font-size: 14px; }

/* ---------- layout ---------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 90px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(36px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr;
}

.hero-crest {
  position: absolute;
  right: -3%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(240px, 34vw, 420px);
  height: auto;
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
  /* radial fade removes the square image edge and blends it into the glow */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 74%);
}

.hero-copy { max-width: 680px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chrome-3);
  margin: 0 0 16px;
}

h1 {
  font-family: var(--font-loud);
  font-size: clamp(46px, 9vw, 92px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--white);
  margin: 0 0 22px;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}
h1 .red { text-shadow: 0 0 34px rgba(200, 16, 46, 0.5); }

.hero-sub {
  font-size: clamp(16px, 1.5vw, 19px);
  max-width: 60ch;
  margin: 0 0 26px;
  color: var(--body);
}

.hero-points { list-style: none; padding: 0; margin: 0; max-width: 62ch; display: grid; gap: 10px; }
.hero-points li { padding-left: 28px; position: relative; }
.hero-points li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 9px;
  height: 9px;
  background: var(--red);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(200, 16, 46, 0.6);
}
.hero-points strong { color: var(--white); font-weight: 700; }

/* ---------- panels ---------- */

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--black-1));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3.5vw, 40px);
  margin: 22px 0;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 96px; /* clear the sticky header on auto-scroll */
}
/* chrome-line signature across the top of every panel */
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--chrome-line);
  opacity: 0.7;
}

.panel-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel-head .eyebrow { margin: 0 0 4px; }

.step-num {
  font-family: var(--font-loud);
  font-size: 20px;
  color: var(--white);
  background: linear-gradient(160deg, var(--red-bright), var(--red-deep));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 3px;
  flex: none;
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
  color: var(--white);
  margin: 0;
  line-height: 1.05;
}

.panel-sub { color: var(--muted); font-size: 15px; margin: 0 0 20px; max-width: 74ch; }
.panel-sub strong { color: var(--body); }
.panel-sub em { color: var(--chrome-2); font-style: normal; font-weight: 600; }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), color 0.16s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: linear-gradient(160deg, var(--red-bright), var(--red)); color: var(--white); box-shadow: 0 4px 18px rgba(200, 16, 46, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(200, 16, 46, 0.45); }

.btn-secondary { background: var(--surface-3); color: var(--body); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--chrome-3); color: var(--white); }

.btn-ghost { background: transparent; color: var(--body); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--red); color: var(--white); }

.btn-cta {
  font-family: var(--font-loud);
  font-size: 21px;
  letter-spacing: 0.05em;
  padding: 15px 36px 12px;
  background: linear-gradient(160deg, var(--red-bright), var(--red));
  color: var(--white);
  box-shadow: 0 6px 22px rgba(200, 16, 46, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(200, 16, 46, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

.link-btn {
  background: none;
  border: none;
  color: var(--red);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--red-bright); }

/* ---------- dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 52px) 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease);
  background: radial-gradient(120% 120% at 50% 0%, rgba(200, 16, 46, 0.04), transparent 70%);
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag {
  border-color: var(--red);
  background: radial-gradient(120% 120% at 50% 0%, rgba(200, 16, 46, 0.1), transparent 70%);
  outline: none;
}
.dropzone.drag { transform: scale(1.006); }
.dz-icon { color: var(--chrome-2); display: flex; justify-content: center; }
.dz-main { font-size: clamp(17px, 2vw, 20px); font-weight: 600; color: var(--white); margin-top: 10px; }
.dz-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- tool cards (split / master) ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease);
}
.tool-card[role='button'] { cursor: pointer; }
.tool-card[role='button']:hover, .tool-card[role='button']:focus-visible { border-color: var(--red); transform: translateY(-2px); outline: none; }
.tool-body h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--white); margin: 0 0 8px; }
.tool-body p { color: var(--muted); font-size: 14px; margin: 0; }
.tool-body strong { color: var(--chrome-2); }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- track list ---------- */

#track-list { display: grid; gap: 10px; }

.track-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: border-color 0.16s var(--ease);
}
.track-row:hover { border-color: var(--line-2); }
.track-row.error { border-color: var(--red-deep); }

.track-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 260px; }
.track-wave { flex: none; background: #0b0b0c; border-radius: 4px; border: 1px solid var(--line); }
.track-meta { min-width: 0; }
.track-name { color: var(--white); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub { color: var(--muted); font-size: 12.5px; }

.track-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* form controls */
select {
  background: var(--black-1);
  color: var(--body);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease);
}
select:hover { border-color: var(--chrome-3); }
select:focus-visible { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.25); }

.pan-pref { display: inline-flex; gap: 3px; background: var(--black-1); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 3px; }
.pan-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 4px;
  min-width: 36px;
  padding: 7px 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.pan-btn:hover { color: var(--white); }
.pan-btn.active { color: var(--white); background: var(--red); box-shadow: 0 1px 6px rgba(200, 16, 46, 0.4); }

.remove-btn {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--muted);
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.remove-btn:hover { color: var(--white); border-color: var(--red); }

.clean-btn {
  background: var(--black-1);
  color: var(--body);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.clean-btn:hover:not(:disabled) { border-color: var(--red); color: var(--white); }
.clean-btn.done { border-color: var(--success); color: var(--success); }
.clean-btn:disabled { opacity: 0.6; cursor: wait; }
.clean-btn.tune { border-color: #43343a; }

.clean-report {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
  display: grid;
  gap: 3px;
}
.undo-clean { background: none; border: none; color: var(--red); font-family: inherit; font-size: 13px; cursor: pointer; padding: 4px 0 0; text-decoration: underline; text-underline-offset: 2px; justify-self: start; }
.undo-clean:hover { color: var(--red-bright); }

.tune-panel {
  flex-basis: 100%;
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.tune-panel label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.offset-wrap { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.offset-input {
  width: 62px;
  background: var(--black-1);
  color: var(--body);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 8px 6px;
  font-family: inherit;
  font-size: 14px;
}
.offset-input:focus-visible { outline: none; border-color: var(--red); }

/* ---------- sound-effects shelf ---------- */

.shelf-head { margin: 30px 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
.shelf-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--white); margin: 0; }
.shelf-sub { font-size: 13px; color: var(--muted); }

.sfx-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.sfx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px 8px 13px;
  transition: border-color 0.14s var(--ease);
}
.sfx-item:hover { border-color: var(--line-2); }
.sfx-name { flex: 1; font-size: 14px; color: var(--body); }
.sfx-btn {
  background: var(--black-1);
  color: var(--body);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.sfx-btn:hover { border-color: var(--chrome-3); color: var(--white); }
.sfx-btn.add:hover { border-color: var(--red); color: var(--white); }

/* ---------- mix options ---------- */

.mix-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-bottom: 26px; }
.opt { min-width: 0; }
.opt > label {
  display: block;
  font-family: var(--font-loud);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--chrome-2);
  margin-bottom: 8px;
}
.opt select, .opt .btn { width: 100%; }
.opt-desc { color: var(--muted); font-size: 13px; margin-top: 8px; }

.status {
  margin-top: 18px;
  color: var(--chrome-2);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 8px var(--red); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 0.3; } to { opacity: 1; } }

/* ---------- transport ---------- */

.transport { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--chrome-3);
  background: radial-gradient(circle at 50% 35%, var(--surface-3), var(--black));
  color: var(--white);
  cursor: pointer;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.play-btn:hover { border-color: var(--red); box-shadow: 0 0 20px rgba(200, 16, 46, 0.35); }
.play-btn svg { margin-left: 2px; }

.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 42px; }

#seek { flex: 1; min-width: 140px; }

input[type='range'] {
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--chrome-grad);
  border: 1px solid #5a5d63;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cfd2d8;
  border: 1px solid #5a5d63;
  cursor: pointer;
}
input[type='range']:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.3); }

.ab-btn {
  font-family: var(--font-loud);
  letter-spacing: 0.08em;
  font-size: 16px;
  background: var(--black-1);
  color: var(--white);
  border: 1px solid var(--chrome-3);
  border-radius: var(--radius);
  padding: 12px 18px 9px;
  cursor: pointer;
  min-width: 166px;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.ab-btn:hover { border-color: var(--chrome-2); }
.ab-btn.raw { border-color: var(--red); color: var(--red); }

#meter { width: 100%; height: 18px; margin: 16px 0 4px; display: block; border-radius: 3px; }

.chain-toolbar { margin-bottom: 16px; }

/* ---------- console strips ---------- */

.console { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 14px; }

.strip {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--black-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.14s var(--ease);
}
.strip:hover { border-color: var(--line-2); }
.strip-name {
  font-family: var(--font-loud);
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--white);
  padding-bottom: 8px;
  margin-bottom: 12px;
  position: relative;
}
.strip-name::after { content: ''; position: absolute; left: 0; bottom: 0; width: 42px; height: 2px; background: var(--red); box-shadow: 0 0 8px rgba(200, 16, 46, 0.5); }

.chain-row { display: flex; gap: 6px; margin-bottom: 12px; }
.chain-select { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13.5px; }
.chain-export { width: 38px; flex: none; background: var(--black-1); border: 1px solid var(--line-2); color: var(--chrome-2); border-radius: var(--radius); font-size: 15px; cursor: pointer; transition: border-color 0.14s var(--ease); }
.chain-export:hover { border-color: var(--chrome-2); }

.fader { margin-bottom: 11px; }
.fader label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; }
.fader-controls { display: flex; align-items: center; gap: 8px; }
.fader-controls input[type='range'] { flex: 1; min-width: 0; }
.fader-val { font-size: 12px; color: var(--chrome-2); text-align: right; font-variant-numeric: tabular-nums; margin-top: 1px; }

.nudge {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 5px;
  background: var(--black-1);
  border: 1px solid var(--line-2);
  color: var(--body);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease);
}
.nudge:hover { border-color: var(--chrome-3); }

.fx-row select { flex: 1; min-width: 0; padding: 8px; font-size: 13px; }
.fx-row input[type='range'] { max-width: 76px; }

.reset-strip {
  width: 100%;
  margin-top: 4px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--muted);
  border-radius: 5px;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.reset-strip:hover { color: var(--white); border-color: var(--chrome-3); }

/* ---------- export ---------- */

.export-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.export-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.export-note { color: var(--muted); font-size: 13.5px; max-width: 42ch; }
.export-note strong { color: var(--chrome-2); }

/* ---------- mix report ---------- */

#report-body { display: grid; gap: 14px; }
.report-block {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.report-block h3 { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--white); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-block ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.report-block li { font-size: 14.5px; }
.report-block li::marker { color: var(--red); }
.report-block.warnings { border-color: var(--red-deep); background: linear-gradient(180deg, rgba(141, 16, 38, 0.12), var(--surface-2)); }
.report-block.warnings h3 { color: var(--red); }

.chip {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--chrome-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 11px;
}

.stats-row { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--white); line-height: 1; }
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 5px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px clamp(18px, 5vw, 60px) 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-line { color: var(--muted-2); font-size: 13px; }

/* ---------- header right / marketplace ---------- */

.header-right { display: flex; align-items: center; gap: 20px; }
.header-link {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--body);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.header-link:hover { border-color: var(--red); color: var(--white); }

/* ---------- marketplace modal ---------- */

.mkt-modal { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center; padding: clamp(10px, 3vw, 40px); }
.mkt-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px); animation: mkt-fade 0.2s var(--ease); }
.mkt-dialog {
  position: relative;
  width: min(940px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--black-1));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: mkt-rise 0.24s var(--ease);
}
.mkt-dialog::before { content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: var(--chrome-line); }
@keyframes mkt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mkt-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.mkt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px clamp(18px, 3vw, 30px) 14px; }
.mkt-head h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3vw, 30px); color: var(--white); margin: 4px 0 0; }
.mkt-x { background: transparent; border: 1px solid var(--line-2); color: var(--muted); width: 38px; height: 38px; border-radius: var(--radius); cursor: pointer; font-size: 14px; flex: none; }
.mkt-x:hover { border-color: var(--red); color: var(--white); }

.mkt-tabs { display: flex; gap: 6px; padding: 0 clamp(18px, 3vw, 30px); border-bottom: 1px solid var(--line); }
.mkt-tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-family: inherit; font-size: 15px; font-weight: 600; padding: 12px 8px; cursor: pointer; margin-bottom: -1px; }
.mkt-tab:hover { color: var(--body); }
.mkt-tab.active { color: var(--white); border-bottom-color: var(--red); }

.mkt-pane { padding: 20px clamp(18px, 3vw, 30px) 28px; overflow-y: auto; }

.mkt-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
#mkt-search { flex: 1; min-width: 200px; background: var(--black-1); border: 1px solid var(--line-2); color: var(--body); border-radius: var(--radius); padding: 11px 14px; font-family: inherit; font-size: 14px; }
#mkt-search:focus-visible { outline: none; border-color: var(--red); }
.mkt-sort { display: inline-flex; gap: 3px; background: var(--black-1); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 3px; }
.mkt-sortbtn { background: transparent; border: none; color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.mkt-sortbtn.active { background: var(--surface-3); color: var(--white); }

.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mkt-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color 0.14s var(--ease); }
.mkt-card:hover { border-color: var(--line-2); }
.mkt-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mkt-card-top h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--white); margin: 0; }
.mkt-price { font-size: 13px; font-weight: 700; white-space: nowrap; padding-top: 3px; }
.mkt-price.free { color: var(--success); }
.mkt-price.paid { color: var(--chrome-2); }
.mkt-by { color: var(--muted); font-size: 13px; margin: 0; }
.mkt-genre { color: var(--chrome-3); }
.mkt-desc { color: var(--body); font-size: 13.5px; margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.mkt-dl { color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.mkt-install.done { background: var(--success); border-color: var(--success); color: var(--white); }

.mkt-msg { color: var(--muted); font-size: 14px; margin-top: 14px; }
.mkt-lead { color: var(--body); font-size: 15px; margin: 0 0 18px; max-width: 60ch; }
.mkt-lead strong { color: var(--white); }
.mkt-fine { color: var(--muted-2); font-size: 12.5px; margin: 10px 0 0; }

.mkt-form { display: grid; gap: 14px; max-width: 460px; }
.mkt-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.mkt-form input, .mkt-form select { background: var(--black-1); border: 1px solid var(--line-2); color: var(--body); border-radius: var(--radius); padding: 11px 13px; font-family: inherit; font-size: 14px; text-transform: none; letter-spacing: normal; font-weight: 400; }
.mkt-form input:focus-visible, .mkt-form select:focus-visible { outline: none; border-color: var(--red); }
.mkt-form .btn-cta { justify-self: start; margin-top: 4px; }

@media (max-width: 560px) {
  .mkt-grid { grid-template-columns: 1fr; }
  .mkt-dialog { max-height: 96vh; }
}

/* ---------- a11y ---------- */

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .site-header { padding: 14px 18px; }
  .header-tag { display: none; }
  .hero { padding-top: 40px; }
  .hero-crest { opacity: 0.1; right: -12%; }
  .panel-head { gap: 12px; }
  .step-num { width: 36px; height: 36px; font-size: 17px; }
  .transport { gap: 10px; }
  .ab-btn { min-width: 0; flex: 1 1 100%; order: 5; }
  .export-row { gap: 16px; }
  .export-btns { width: 100%; }
  .export-btns .btn { flex: 1 1 auto; }
  .track-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 460px) {
  body { font-size: 15px; }
  .brand-crest { width: 40px; height: 40px; }
  .wm-no { font-size: 19px; }
  .console { grid-template-columns: 1fr; }
  .sfx-shelf { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .btn-cta { width: 100%; }
  .stat-num { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

@media (prefers-contrast: more) {
  :root { --muted: #a9adb4; --body: #eceef1; }
}

/* ---------- Tag Studio & Vocal Booth ---------- */

.ts-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.ts-tab {
  font-family: var(--font-loud);
  font-size: 17px;
  letter-spacing: 0.07em;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 11px 20px 8px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.ts-tab:hover { color: var(--white); }
.ts-tab.active { color: var(--white); border-color: var(--red); background: rgba(200, 16, 46, 0.1); }
.ts-tab:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.ts-source-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.ts-voice-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.ts-mic-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ts-mic-row select { background: var(--black-1); border: 1px solid var(--line-2); color: var(--body); border-radius: var(--radius); padding: 9px 12px; font-family: inherit; font-size: 14px; text-transform: none; letter-spacing: normal; font-weight: 400; max-width: 100%; }
.acct-dialog { max-width: 480px; }
.clb-take-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.clb-take-name { flex: 1; color: var(--body); font-size: 14px; }
.ts-voice-hints { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.mix-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
#fire-mix-btn { background: linear-gradient(160deg, #ff5a2e, var(--red)); }
.ts-meter { width: 100%; max-width: 600px; height: 16px; display: block; margin: 8px 0; border-radius: 3px; }
.ts-source-status { color: var(--chrome-2); font-size: 14px; min-height: 20px; margin: 6px 0; }

.ts-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ts-style-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease);
}
.ts-style-card:hover { border-color: var(--line-2); }
.ts-style-card.active { border-color: var(--red); background: rgba(200, 16, 46, 0.08); box-shadow: 0 0 14px rgba(200, 16, 46, 0.18); }
.ts-style-card:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.ts-style-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--white); }
.ts-style-sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.ts-knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin: 22px 0 8px; max-width: 640px; }
.ts-knobs label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ts-knob-val { color: var(--chrome-2); font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: normal; }

.ts-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 18px; }
.ts-name-wrap { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ts-name-wrap input {
  background: var(--black-1);
  border: 1px solid var(--line-2);
  color: var(--body);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  min-width: 200px;
}
.ts-name-wrap input:focus-visible { outline: none; border-color: var(--red); }

.ts-ai-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; margin-top: 14px; }
.ts-vision-form { max-width: 520px; }
.ts-idea-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ts-idea-chip {
  background: var(--black-1);
  border: 1px solid var(--line-2);
  color: var(--body);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.ts-idea-chip:hover { border-color: var(--red); color: var(--white); }

@media (max-width: 560px) {
  .ts-style-grid { grid-template-columns: 1fr; }
  .ts-actions .btn { flex: 1 1 auto; }
}

/* ---------- skip link (keyboard / screen-reader fast lane) ---------- */

.skip-link {
  position: fixed;
  left: 14px;
  top: -80px;
  z-index: 2000;
  background: var(--red);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 20px;
  border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6);
  transition: top 0.15s var(--ease);
}
.skip-link:focus-visible { top: 14px; outline: 2px solid var(--white); outline-offset: 2px; }

/* ---------- button icons ---------- */

.btn svg { flex: none; }

/* ---------- installed app (PWA) + notched phones ---------- */

.site-header {
  padding-left: max(clamp(18px, 5vw, 60px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(18px, 5vw, 60px), env(safe-area-inset-right, 0px));
}
.site-footer { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

@media (display-mode: standalone) {
  /* running as an installed app: keep the header clear of the status bar */
  .site-header { padding-top: max(18px, env(safe-area-inset-top, 0px)); }
}

/* ---------- touch ergonomics (fingers, not cursors) ---------- */

@media (pointer: coarse) {
  .btn { min-height: 46px; }
  .header-link { min-height: 44px; }
  .sfx-btn, .remove-btn, .nudge, .mkt-x, .chain-export { min-width: 44px; min-height: 44px; }
  .pan-btn, .clean-btn, .ab-btn, .mkt-tab, .mkt-sortbtn, .mkt-install, .ts-tab, .ts-idea-chip { min-height: 44px; }
  .offset-input { min-height: 44px; width: 74px; }
  .play-btn { width: 64px; height: 64px; }
  .link-btn, .undo-clean { padding-top: 10px; padding-bottom: 10px; }
  input[type='range'] { height: 8px; }
  input[type='range']::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type='range']::-moz-range-thumb { width: 26px; height: 26px; }
}

/* iOS zooms the page when a focused input is under 16px — don't let it */
@media (max-width: 760px) {
  .offset-input, .opt select, .chain-select, .fx-row select,
  .mkt-form input, .mkt-form select, #mkt-search { font-size: 16px; }
}
