/* Practice Like a Rock Star — clone design system.
   Values taken directly from the site's real theme stylesheet
   (schoolofconcertrock-2023): Montserrat body type, the Selfish-Bold display
   face (extracted from the theme's embedded @font-face), charcoal ink
   #383838, brand red #ab1f3b, gold #CF9333, and the player component styles
   (joined MUTE|SOLO groups, 130px channel cards, red-outline transport
   buttons, lightblue muted lanes). Kid/iPad-first: nothing interactive
   under 44px. */

@font-face {
  font-family: "Selfish-Bold";
  src: url("/fonts/selfish-bold/Selfish-Bold.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --ink: #383838;          /* theme charcoal */
  --ink-soft: rgba(56, 56, 56, 0.6);
  --paper: #ffffff;
  --red: #ab1f3b;          /* brand red: titles, playhead, mute, outlines */
  --gold: #CF9333;         /* gold: active solo, links */
  --green: #2e9e5b;
  --lane-bg: #eeeeee;      /* waveform lane background */
  --lane-border: #7c7c7c;  /* waveform lane border */
  --wave: #808080;         /* waveform peaks */
  --track: rgba(56, 56, 56, 0.2);
  --touch: 44px;

  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Selfish-Bold", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* beat display rules on .screen etc. */

html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; transition: all 0.2s ease-in-out 0s; }

.selfish { font-family: var(--font-display); font-weight: 400; }

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

header.primary {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  padding: max(6px, env(safe-area-inset-top)) 24px 6px;
  background: rgba(255, 255, 255, 0.9);
}

.circle-back {
  grid-column: 1;
  display: inline-block;
  font-size: 26px;
  border-radius: 100px;
  border: 1.5px solid var(--red);
  color: var(--red);
  text-align: center;
  width: 44px;
  height: 44px;
  line-height: 40px;
  transition: transform 0.2s ease-in-out 0s;
}
.circle-back:hover { transform: scale(1.1); }

.logo {
  grid-column: 2;
  justify-self: center;
  display: block;
  margin: 5px auto;
}
.logo img {
  display: block;
  width: min(420px, 100%);
  height: auto;
  margin: 0 auto;
  transition: all 0.2s ease-in-out 0s;
}

footer.primary {
  margin-top: auto;
  padding: 18px;
  text-align: center;
  font-size: 16px;
  line-height: 22px;
  color: var(--ink);
}

body { display: flex; flex-direction: column; min-height: 100dvh; }
.screen { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 30px 40px; }

/* ---------- loading overlay ---------- */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  font-size: 18px;
  font-weight: 600;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 5px solid var(--track);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shared type ---------- */

.section-title {
  font-size: 36px;
  line-height: 43px;
  font-weight: 700;
  color: var(--red);
  text-align: center;
}
.section-subtitle {
  font-size: 18px;
  line-height: 23px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--red);
  text-align: center;
  margin-top: 6px;
}
@media only screen and (max-width: 768px) {
  .section-title { font-size: 30px; line-height: 40px; }
}

/* ---------- instrument select (site's select-instrument rows) ---------- */

.instrument-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 30px;
}

.instrument-card {
  position: relative;
  display: block;
  padding: 10px 0 60px;
  margin-bottom: 30px;
  border-bottom: 1.5px solid var(--ink);
  transition: border-color 0.2s ease-in-out 0s;
}

.instrument-card .sketch {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.instrument-card .sketch svg { width: 100%; height: 100%; display: block; }
.instrument-card .sketch svg path { transition: fill 0.2s ease-in-out 0s; }

.instrument-card .iname {
  display: block;
  position: absolute;
  bottom: -8px;
  left: 20px;
  font-family: var(--font-display);
  font-size: clamp(64px, 8.5vw, 110px);
  line-height: 1;
  text-transform: lowercase;
  color: var(--ink);
  transition: color 0.2s ease-in-out 0s;
  pointer-events: none;
}

.instrument-card .select-song {
  position: absolute;
  right: 0;
  bottom: 14px;
  padding: 12px 22px;
  font-size: 16px;
  line-height: 18px;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  opacity: 0;
  transition: all 0.2s ease-in-out 0s;
}

.instrument-card:hover { border-color: var(--red); }
.instrument-card:hover .iname { color: var(--red); }
.instrument-card:hover .sketch svg path { fill: var(--red) !important; }
.instrument-card:hover .select-song { opacity: 1; }

@media only screen and (max-width: 900px) {
  .instrument-grid { grid-template-columns: repeat(2, 1fr); }
}
@media only screen and (max-width: 768px) {
  .instrument-grid { grid-template-columns: 1fr; }
  .instrument-card .iname { font-size: 100px; bottom: -4px; }
  .instrument-card .select-song { opacity: 1; }
}

/* ---------- song list (site's select-song) ---------- */

#songlist-title {
  font-family: var(--font-display);
  font-size: clamp(80px, 12vw, 140px);
  line-height: 1;
  font-weight: 400;
  text-transform: lowercase;
  text-align: center;
  color: var(--ink);
}

.song-list {
  margin: 34px auto 0;
  max-width: 720px;
}
.song-list li { border-bottom: 1px solid #eee; }
.song-list a.song-title {
  display: block;
  min-height: var(--touch);
  padding: 14px 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 28px;
}
.song-list a.song-title:hover { color: var(--red); font-weight: 700; }
.song-list .empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
  padding: 30px 10px;
  border: none;
}

/* ---------- player: title bar ---------- */

.player { max-width: 1240px; }

.song-title-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.side-title {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: var(--red);
  text-transform: capitalize;
}
.center-title { text-align: center; }
.center-title .eyebrow {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink);
}
.center-title h1 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: var(--red);
}
.side-actions { justify-self: end; display: flex; gap: 8px; }

.speed-btn {
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  background: var(--paper);
  transition: all 0.2s ease-in-out 0s;
}
.speed-btn:hover { background: var(--ink); color: #fff; }
.speed-btn.is-active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ---------- player: video group ---------- */

.video-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 6px;
}
.video-group .vid { position: relative; }
.video-group .vid .video-container {
  position: relative;
  background: gray;
  overflow: hidden;
  margin: 10px;
  transition: transform 0.2s ease-in-out 0s;
}
.video-group .vid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}
.video-group .vid.full-view { grid-column: 1 / -1; grid-row: 1; }
.video-group .vid.full-view video { aspect-ratio: 16 / 7; }
.video-group .vid.bottom-row { cursor: pointer; }
.video-group .vid.bottom-row:hover .video-container { transform: scale(1.05); }
.video-group .vid .angle-label {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 5px 12px;
  border-radius: 6px;
  background-color: var(--wave);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  transition: background-color 0.2s ease-in-out 0s;
}
.video-group .vid.full-view .angle-label { background-color: #c9213b; }

/* ---------- player: transport bar (site's playlist-top-bar) ---------- */

.playlist-top-bar {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 10px 16px;
}

.round-btn {
  display: block;
  width: 100%;
  min-height: var(--touch);
  text-align: center;
  border: 2px solid var(--red);
  border-radius: 0;
  background: var(--paper);
  color: var(--red);
  font-size: 18px;
  padding: 8px;
  transition: all 0.2s ease-in-out 0s;
}
.round-btn:hover:not(:disabled) { color: #fff; background: var(--red); }
.round-btn:disabled { border-color: #ccc; color: #ccc; cursor: not-allowed; }
.round-btn.play.is-playing { background: var(--red); color: #fff; }

.zoom-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.zoom-control > span {
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--red);
}
#zoom-level-value { min-width: 42px; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); font-size: 12px; }

/* theme range-slider look: 16px red thumb on a 6px gray track */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  height: var(--touch);
}
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--track);
  border: 0;
  border-radius: 2.6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  border: 0;
  height: 16px;
  width: 16px;
  border-radius: 16px;
  background: var(--red);
  cursor: pointer;
  margin-top: -5px;
}
input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--track);
  border: 0;
  border-radius: 2.6px;
}
input[type="range"]::-moz-range-thumb {
  border: 0;
  height: 16px;
  width: 16px;
  border-radius: 16px;
  background: var(--red);
  cursor: pointer;
}

/* ---------- player: waveform multitrack ---------- */

.waveform-container {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  margin: 0 10px;
}

.row-controls { display: flex; flex-direction: column; }

.row-control {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 16px;
  line-height: 22px;
  padding: 10px;
  height: 130px;
  width: calc(100% - 5px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.row-control .name {
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}
.row-control .name.lead::after { content: " ★"; color: var(--gold); }

.row-control .mute-solo-buttons { text-align: center; }
.ms-btn {
  font-size: 14px;
  min-width: 56px;
  min-height: 30px;
  padding: 4px 10px;
  line-height: 1;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0 3px 3px 0;
  font-weight: 400;
  transition: all 0.2s ease-in-out 0s;
}
.mute-solo-buttons .ms-btn:first-child { border-right: none; border-radius: 3px 0 0 3px; }
.ms-btn:hover:not(:disabled) { background: var(--ink); color: #fff; }
.ms-btn:disabled { color: #ccc; border-color: #ccc; background: #eee; cursor: not-allowed; }
.ms-btn.solo.active { background: var(--gold); }
.ms-btn.mute.active { background: var(--red); border-color: var(--red); color: #fff; }

.row-control .volume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.row-control .volume svg { width: 14px; height: 14px; flex: none; fill: var(--ink); }
.row-control .volume input { height: 24px; }

/* lanes (rendered by js/ui/waveform.js) */
.lanes { position: relative; background: var(--lane-bg); }
.lanes-scroll { overflow-x: auto; overflow-y: hidden; height: 100%; cursor: pointer; }
.lanes-inner { position: relative; }
.lane {
  position: relative;
  border-bottom: 2px solid var(--lane-border);
  background: var(--lane-bg);
  transition: opacity 0.2s ease-in-out 0s, background-color 0.2s ease-in-out 0s;
}
.lane:last-of-type { border-bottom: 0; }
.lane.muted { opacity: 0.3; background-color: lightblue; }
.lane canvas { display: block; position: absolute; top: 0; left: 0; }
.lane-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}
.lanes-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--red);
  pointer-events: none;
  z-index: 3;
}

/* ---------- player: bottom icon (site: red sketch over red rule) ---------- */

.bottom-instrument-icon {
  text-align: center;
  padding: 30px 0 0 0;
  margin: 26px 10px 30px;
  border-bottom: 1.5px solid var(--red);
}
.bottom-instrument-icon svg {
  width: 250px;
  height: auto;
  margin-bottom: -8px;
}
.bottom-instrument-icon svg path { fill: var(--red); }

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

@media (max-width: 900px) {
  .song-title-bar { grid-template-columns: 1fr; justify-items: center; }
  .side-title { display: none; }
  .side-actions { justify-self: center; }
  .waveform-container { grid-template-columns: 150px minmax(0, 1fr); }
  .playlist-top-bar { grid-template-columns: 1fr 1fr; }
  .zoom-control { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .video-group { grid-template-columns: repeat(2, 1fr); }
  .zoom-control { display: none; }
  .waveform-container { grid-template-columns: 120px minmax(0, 1fr); }
  .row-control { padding: 6px 8px; }
  .logo img { width: min(280px, 100%); }
}

/* ---------- site nav (header, all sections) ---------- */

header.primary { grid-template-rows: auto auto; }
.site-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  padding: 4px 0 8px;
  font-size: 15px;
  font-weight: 600;
}
.site-nav a { min-height: var(--touch); display: inline-flex; align-items: center; }
.site-nav a:hover, .site-nav a.is-active { color: var(--red); }
.site-nav a.donate {
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: 100px;
  padding: 0 18px;
}
.site-nav a.donate:hover { background: var(--red); color: #fff; }

/* ---------- static content pages (welcome / our story / sponsors / video) ---------- */

.content-page { max-width: 860px; text-align: center; }
.content-page .section-title { color: var(--red); margin-bottom: 18px; }
.content-page p { margin-bottom: 18px; }
.content-page a { color: var(--gold); font-weight: 600; }
.content-page a:hover { color: var(--red); }
.content-page .eyebrow {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink);
}

.button-outline {
  display: inline-block;
  border: 1.5px solid var(--red);
  border-radius: 100px;
  padding: 10px 30px;
  min-height: var(--touch);
  color: var(--red) !important;
  font-weight: 700;
}
.button-outline:hover { background: var(--red); color: #fff !important; }

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 10px 0 20px;
}
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.sponsor-level { margin-top: 34px; }
.sponsor-level .amount { color: var(--red); font-weight: 700; }

/* ---------- concert rock performances grid ---------- */

.performance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 22px;
  margin-top: 26px;
}
.performance-card { display: block; text-align: center; }
.performance-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.performance-card .ptitle {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  color: var(--red);
}
.performance-card:hover img { transform: scale(1.03); transition: transform 0.2s ease-in-out 0s; }
.performance-card:hover .ptitle { color: var(--gold); }

@media (max-width: 768px) {
  .performance-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .performance-grid { grid-template-columns: 1fr; }
}
