/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #fafafa;
  --surface:   #f0f0f0;
  --surface2:  #e6e6e6;
  --border:    #d4d4d4;
  --accent:    #8c6d38;        /* warm gold */
  --accent2:   #3d6496;        /* cool steel blue */
  --text:      #1a1a1a;
  --muted:     #888888;
  --danger:    #b84040;
  --success:   #2e7a4a;
  --radius:    8px;
  --font-sans: 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-title h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text);
  line-height: 1.1;
}

.site-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.nav-btn:hover { color: var(--text); background: var(--surface2); }

.nav-btn.active {
  color: var(--accent);
  background: rgba(140,109,56,0.1);
}

/* ─────────────────────────────────────────
   MAIN & TABS
───────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 52px 28px 80px;
}

.tab-section { display: none; }
.tab-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   SECTION HEADER
───────────────────────────────────────── */
.section-header { margin-bottom: 44px; }

.section-header h2,
.tab-section > h2,
.tool-container h2 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 10px;
}

.section-desc {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────
   SHORT FILMS
───────────────────────────────────────── */
.films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
}

.film-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.film-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; }

.film-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.films-grid--single {
  grid-template-columns: minmax(300px, 600px);
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface2) 0%, #d0d0d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon {
  font-size: 2rem;
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
}

.film-card:hover .play-icon {
  color: var(--accent);
  transform: scale(1.15);
}

.film-info { padding: 18px 20px 22px; }

.film-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
  letter-spacing: 0.03em;
}

.film-meta {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.film-desc { font-size: 0.83rem; color: var(--muted); }

/* ─────────────────────────────────────────
   FILM SCORES
───────────────────────────────────────── */
.scores-list { display: flex; flex-direction: column; gap: 16px; }

.score-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: border-color var(--transition);
}

.score-item:hover { border-color: var(--accent2); }

.score-waveform {
  flex-shrink: 0;
  width: 80px;
}

.waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 36px;
}

.waveform-bars span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: var(--accent2);
  opacity: 0.35;
  animation: none;
}

.score-item.playing .waveform-bars span {
  animation: wave 1.2s ease-in-out infinite;
  opacity: 0.7;
}

.waveform-bars span:nth-child(1)  { height: 40%; animation-delay: 0s; }
.waveform-bars span:nth-child(2)  { height: 70%; animation-delay: 0.1s; }
.waveform-bars span:nth-child(3)  { height: 55%; animation-delay: 0.2s; }
.waveform-bars span:nth-child(4)  { height: 90%; animation-delay: 0.15s; }
.waveform-bars span:nth-child(5)  { height: 60%; animation-delay: 0.05s; }
.waveform-bars span:nth-child(6)  { height: 80%; animation-delay: 0.25s; }
.waveform-bars span:nth-child(7)  { height: 45%; animation-delay: 0.3s; }
.waveform-bars span:nth-child(8)  { height: 75%; animation-delay: 0.1s; }
.waveform-bars span:nth-child(9)  { height: 55%; animation-delay: 0.2s; }
.waveform-bars span:nth-child(10) { height: 85%; animation-delay: 0s; }
.waveform-bars span:nth-child(11) { height: 40%; animation-delay: 0.35s; }
.waveform-bars span:nth-child(12) { height: 65%; animation-delay: 0.15s; }
.waveform-bars span:nth-child(13) { height: 50%; animation-delay: 0.05s; }
.waveform-bars span:nth-child(14) { height: 78%; animation-delay: 0.28s; }
.waveform-bars span:nth-child(15) { height: 35%; animation-delay: 0.12s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.4); }
}

.score-info { flex: 1; }
.score-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }

.score-meta {
  font-size: 0.75rem;
  color: var(--accent2);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.score-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-time,
.score-duration {
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.score-duration { text-align: right; }

.score-progress-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.score-progress-bar:hover { background: var(--surface2); }

.score-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent2);
  border-radius: 2px;
  pointer-events: none;
  position: relative;
}

.score-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent2);
  opacity: 0;
  transition: opacity var(--transition);
}

.score-item:hover .score-progress-fill::after,
.score-item.playing .score-progress-fill::after {
  opacity: 1;
}

.score-desc { font-size: 0.83rem; color: var(--muted); }

.play-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.play-btn:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  color: var(--bg);
}

/* ─────────────────────────────────────────
   ABOUT
───────────────────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

.about-photo {
  position: sticky;
  top: 100px;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface2) 0%, #d8d0c8 100%);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.about-text h2 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
}

.about-text p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 18px;
  max-width: 600px;
}

.contact-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-block;
  padding: 9px 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.contact-btn:hover {
  border-color: var(--accent);
  background: rgba(140,109,56,0.08);
  color: var(--accent);
}

/* ─────────────────────────────────────────
   TOOL CONTAINER (shared for metro + tuner)
───────────────────────────────────────── */
.tool-container {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.tool-container h2 {
  margin-bottom: 36px;
}

.tool-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 30px;
  letter-spacing: 0.04em;
}

.tool-btn {
  margin-top: 32px;
  padding: 13px 44px;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 24px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tool-btn:hover,
.tool-btn.running {
  background: var(--accent);
  color: var(--bg);
}

/* ─────────────────────────────────────────
   METRONOME
───────────────────────────────────────── */
.bpm-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.bpm-value-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

#bpm-value {
  font-size: 4.5rem;
  font-weight: 200;
  letter-spacing: -0.02em;
  color: var(--text);
  min-width: 120px;
  text-align: center;
}

.bpm-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.bpm-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bpm-arrow:hover {
  border-color: var(--accent);
  background: rgba(140,109,56,0.08);
  color: var(--accent);
}

#bpm-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  margin-bottom: 32px;
  cursor: pointer;
}

#bpm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#bpm-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.beat-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.beat-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: background 0.08s, transform 0.08s;
}

.beat-dot.active-beat {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.35);
  box-shadow: 0 0 10px rgba(140,109,56,0.35);
}

.beat-dot.downbeat {
  background: var(--accent);
}

.time-sig-row,
.subdivision-row {
  margin-bottom: 18px;
}

.ts-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.ts-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ts-btn, .sub-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.ts-btn:hover, .sub-btn:hover { border-color: var(--accent); color: var(--text); }

.ts-btn.active, .sub-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(140,109,56,0.1);
}

.tap-row { margin-top: 20px; }

.tap-btn {
  padding: 10px 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color var(--transition), color var(--transition), transform 0.08s;
}

.tap-btn:active {
  transform: scale(0.96);
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ─────────────────────────────────────────
   TUNER
───────────────────────────────────────── */
.tuner-display {
  margin: 20px 0 28px;
}

.note-name {
  font-size: 5rem;
  font-weight: 200;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.octave-label {
  font-size: 1.2rem;
  color: var(--muted);
  margin-top: 4px;
  min-height: 1.4em;
}

.cents-display {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--muted);
}

#tuner-cents {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text);
}

.cents-unit {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-left: 4px;
}

.needle-wrap {
  margin: 0 auto 20px;
  width: 100%;
  max-width: 380px;
}

.needle-track {
  position: relative;
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.needle-center-mark {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(140,109,56,0.3);
  transform: translateX(-50%);
}

.needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 72px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  transition: transform 0.1s ease-out;
  box-shadow: 0 0 8px rgba(140,109,56,0.3);
}

.needle-labels {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.tuner-status {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  min-height: 1.4em;
  margin-bottom: 4px;
}

.tuner-status.in-tune  { color: var(--success); }
.tuner-status.sharp    { color: var(--danger); }
.tuner-status.flat     { color: var(--accent2); }

.ref-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
}

#ref-pitch {
  width: 72px;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}

#ref-pitch:focus { border-color: var(--accent); }

/* ─────────────────────────────────────────
   PLACEHOLDER HELPER
───────────────────────────────────────── */
.placeholder-card { opacity: 0.9; }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 28px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────
   DRUM SEQUENCER
───────────────────────────────────────── */
#sequencer { max-width: 960px; }

.seq-header { margin-bottom: 28px; }

.seq-header h2 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.seq-top-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Machine selector pill group */
.machine-select {
  display: flex;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3px;
}

.machine-btn {
  padding: 5px 18px;
  border: none;
  border-radius: 20px;
  background: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.machine-btn:hover:not(.active) { color: var(--text); }

.machine-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

/* Sequencer BPM */
.seq-bpm-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seq-bpm-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}

.seq-bpm-btn:hover { border-color: var(--accent); color: var(--accent); }

.seq-bpm-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

#seq-bpm-value {
  font-size: 1.6rem;
  font-weight: 200;
  color: var(--text);
  width: 56px;
  text-align: center;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  -moz-appearance: textfield;
  cursor: text;
}

#seq-bpm-value::-webkit-outer-spin-button,
#seq-bpm-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

#seq-bpm-value:focus {
  border-bottom: 1px solid var(--border);
}

.seq-bpm-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Swing control */
.swing-block {
  display: flex;
  align-items: center;
  gap: 9px;
}

.swing-label {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

#seq-swing {
  -webkit-appearance: none;
  appearance: none;
  width: 88px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

#seq-swing::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent2);
  cursor: pointer;
}

#seq-swing::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent2);
  border: none;
  cursor: pointer;
}

#seq-swing-val {
  font-size: 0.7rem;
  color: var(--muted);
  min-width: 32px;
}

/* Sample load status */
.seq-status {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  min-height: 1.3em;
  margin: 12px 0 8px;
}

.seq-status.loading { color: var(--accent2); }
.seq-status.error   { color: var(--danger);  }
.seq-status.ready   { color: var(--success); }

/* Play button override — sits inline */
.seq-play-btn {
  margin-top: 0 !important;
  padding: 8px 28px;
  font-size: 0.78rem;
}

/* ── Ruler ── */
.seq-ruler {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  padding-left: calc(80px + 16px); /* align with track steps */
}

.ruler-group {
  display: flex;
  gap: 4px;
  flex: 1;
}

.ruler-num {
  flex: 1;
  text-align: center;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0;
}

.ruler-num.beat { color: var(--accent); font-weight: 600; }

/* ── Grid ── */
.seq-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 20px;
}

.seq-track {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Per-track accent colour */
.seq-track[data-track="kick"]  { --tc: #c8a96e; }
.seq-track[data-track="snare"] { --tc: #8fa6c8; }
.seq-track[data-track="hihat"] { --tc: #6ec88a; }
.seq-track[data-track="tom"]   { --tc: #c88ab4; }

.track-left {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.track-name {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tc);
  font-weight: 700;
}

.track-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.track-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tc);
  cursor: pointer;
}

.track-vol::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tc);
  border: none;
  cursor: pointer;
}

.track-steps {
  display: flex;
  gap: 8px;
  flex: 1;
  position: relative;
}

.step-group {
  display: flex;
  gap: 4px;
  flex: 1;
}

.step-btn {
  flex: 1;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  min-width: 0;
  transition: background 0.08s, border-color 0.08s;
}

.step-btn:hover { border-color: var(--tc); background: rgba(0,0,0,0.04); }

.step-btn.on {
  background: var(--tc);
  border-color: var(--tc);
  box-shadow: 0 0 7px var(--tc);
}

/* Out-of-range steps (beyond track length) */
.step-btn.out-of-range {
  opacity: 0.15;
  pointer-events: none;
}

/* Per-track length drag handle */
.track-length-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  cursor: col-resize;
  transform: translateX(-50%);
  z-index: 5;
}

.track-length-handle::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--accent2);
  border-radius: 2px;
  opacity: 0.6;
  transition: opacity 0.12s, background 0.12s;
}

.track-length-handle:hover::before,
.track-length-handle.dragging::before {
  opacity: 1;
  background: var(--accent);
}

/* Playhead: dark ring */
.step-btn.current {
  border-color: #1a1a1a !important;
  border-width: 2px;
}

.step-btn.on.current {
  filter: brightness(0.82);
  border-color: #1a1a1a !important;
}

/* ── Footer buttons ── */
.seq-footer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.seq-clear-btn,
.seq-rand-btn {
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.seq-clear-btn:hover { border-color: var(--danger); color: var(--danger); }
.seq-rand-btn:hover  { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  nav { gap: 4px; }
  .nav-btn { font-size: 0.72rem; padding: 6px 10px; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-photo { position: static; }

  .photo-placeholder { width: 140px; aspect-ratio: 1; }

  .score-item { flex-direction: column; align-items: flex-start; }
  .score-waveform { width: 100%; }

  main { padding: 36px 20px 60px; }

  /* Sequencer responsive */
  .seq-top-controls { gap: 12px; }
  .seq-ruler { padding-left: calc(64px + 12px); gap: 8px; }
  .seq-ruler .ruler-group { gap: 2px; }
  .seq-track { gap: 8px; }
  .track-left { width: 64px; }
  .track-steps { gap: 5px; }
  .step-group { gap: 2px; }
}
