/* Capitol Hill Jazz Band — audition submission
   Navy ground, brass accent, poster display face. Built to be legible on a
   school iPad in a dim practice room and tappable with a mouthpiece in hand. */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Public+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  --ink: #0e1b33;
  --ink-raised: #16274a;
  --ink-line: #2b3f68;
  --paper: #f2efe6;
  --paper-dim: #a9b6cd;
  --brass: #e0a93b;
  --brass-deep: #a97a1e;
  --rust: #c05a34;

  --tap: 3.5rem;
  --radius: 0.5rem;
  --measure: 36rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  padding: 0 1.25rem calc(var(--tray-h, 8rem) + 2rem);
  background: var(--ink);
  color: var(--paper);
  font: 400 1.0625rem/1.6 'Public Sans', system-ui, -apple-system, sans-serif;
  overflow-wrap: break-word;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
}

h1,
h2,
.brand {
  font-family: 'Archivo Black', 'Public Sans', system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

a {
  color: var(--brass);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
}

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

.masthead {
  padding: 0 0 2rem;
  border-bottom: 2px solid var(--ink-line);
}

.brand {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--brass);
  margin: 0 0 1.25rem;
}

h1 {
  font-size: clamp(2rem, 8vw, 3.25rem);
  margin: 0 0 1rem;
  text-wrap: balance;
}

h1 .yr {
  white-space: nowrap;
}

.deadline {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--paper-dim);
}

.deadline strong {
  color: var(--paper);
  font-weight: 700;
}

.deadline + .deadline {
  margin-top: 0.85rem;
}

.timeline {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9375rem;
  color: var(--paper-dim);
}

.timeline b {
  color: var(--paper);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 0.5rem;
}

/* ------------------------------------------------------------------- steps */

.topbar {
  padding: 1.75rem 0 0;
}

.topbar .brand {
  margin-bottom: 1rem;
}

.steps ol {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  flex: 1 1 0;
  min-width: 0;
}

.steps a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.15rem 0.6rem;
  min-height: var(--tap);
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  border-bottom: 3px solid var(--ink-line);
}

.step-n {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 2px solid var(--ink-line);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.step-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steps a[data-done='true'] .step-n {
  background: var(--brass-deep);
  border-color: var(--brass-deep);
  color: var(--ink);
}

.steps a[data-done='true'] .step-n {
  font-size: 0;
}

.steps a[data-done='true'] .step-n::after {
  content: '✓';
  font-size: 0.9rem;
}

.steps a[aria-current='step'] {
  color: var(--paper);
  font-weight: 700;
  border-bottom-color: var(--brass);
}

.steps a[aria-current='step'] .step-n {
  border-color: var(--brass);
}

.steps a:hover {
  color: var(--paper);
}

.step-count {
  margin: 1.75rem 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
}

/* The etude page is mostly the music, so on a wide screen let it be wide. */
body[data-step='etude'] main#form-view {
  max-width: 60rem;
}

/* ------------------------------------------------------------------ blocks */

.block {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--ink-line);
}

.block:last-of-type {
  border-bottom: 0;
}

h2 {
  font-size: 1.375rem;
  margin: 0 0 1.5rem;
}

.hint {
  color: var(--paper-dim);
  font-size: 0.9375rem;
  margin: 0.4rem 0 0;
}

/* ------------------------------------------------------------------ fields */

.field {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.req {
  color: var(--brass);
  margin-left: 0.15em;
}

input[type='text'],
input[type='email'],
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--paper);
  background: var(--ink-raised);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  appearance: none;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%),
    linear-gradient(135deg, var(--brass) 50%, transparent 50%);
  background-position: calc(100% - 1.35rem) 55%, calc(100% - 1rem) 55%;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
  padding-right: 3rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brass);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.radio-row label {
  flex: 1 1 4.5rem;
  margin: 0;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-raised);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
}

.radio-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-row input:checked + span {
  color: var(--ink);
}

.radio-row label:has(input:checked) {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
  font-weight: 700;
}

.radio-row label:has(input:focus-visible) {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
}

.consent {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--ink-raised);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.consent input {
  width: 1.6rem;
  height: 1.6rem;
  margin: 0.1rem 0 0;
  flex: none;
  accent-color: var(--brass);
}

.consent label {
  margin: 0;
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------- set list */

.piece {
  padding: 0 0 1rem;
}


.piece-head h2 {
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  margin: 0 0 0.75rem;
}

.piece-head > p {
  margin: 0 0 1.25rem;
  color: var(--paper-dim);
  font-size: 1rem;
}

/* Jack's own words on how the take should go. The thing students most needed
   and could not find, so it sits right under the title, in the brass. */
.instructions {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--ink-raised);
  border-left: 4px solid var(--brass);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.instructions-label {
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
}

.instructions-text {
  margin: 0;
  font-size: 1.0625rem;
  white-space: pre-line;
}

.materials:empty {
  display: none;
}

.sheet-link {
  margin: -0.5rem 0 1rem;
  font-size: 0.9375rem;
}

.optional {
  font-family: 'Public Sans', sans-serif;
  color: var(--brass);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0;
  margin-left: 0.6rem;
  vertical-align: middle;
}

/* The take controls stick to the bottom of the screen, just above the tray,
   so the record button is always in reach while the music above it scrolls.
   On a page with nothing to read they simply sit where they are. */
.piece-body {
  position: -webkit-sticky;
  position: sticky;
  bottom: var(--tray-h, 0px);
  z-index: 5;
  background: var(--ink);
  padding: 0.75rem 0;
}

.piece[data-dock] .piece-body {
  border-top: 2px solid var(--ink-line);
  box-shadow: 0 -1.25rem 1.25rem -0.75rem var(--ink);
  max-height: calc(100vh - var(--tray-h, 0px) - 3rem);
  max-height: calc(100dvh - var(--tray-h, 0px) - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.etude-sheet {
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0 0 1rem;
  display: block;
}

.etude-empty {
  background: var(--ink-raised);
  border: 2px dashed var(--ink-line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1rem;
  color: var(--paper-dim);
  font-size: 0.9375rem;
}

audio {
  width: 100%;
  margin: 0 0 1rem;
}

.tracks {
  margin: 0 0 1rem;
}

.track-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.9375rem;
}

.track audio {
  margin: 0 0 0.75rem;
}

/* ------------------------------------------------------------------ upload */

.drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 4.5rem;
  padding: 1rem;
  background: var(--ink-raised);
  border: 2px dashed var(--ink-line);
  border-radius: var(--radius);
  color: var(--paper);
  font-weight: 700;
  font-size: 1.0625rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop:hover,
.drop:focus-within {
  border-color: var(--brass);
}

.drop input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pick {
  display: grid;
  gap: 0.6rem;
}

.record-btn {
  min-height: 4.5rem;
  font: 700 1.0625rem 'Public Sans', sans-serif;
  background: var(--brass);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

/* The picker is the quieter of the two: plenty of students already have the
   take on their phone, but recording here is the shorter road. */
.pick .drop {
  min-height: 3.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.piece[data-state='uploading'] .pick,
.piece[data-state='done'] .pick,
.piece[data-state='review'] .pick,
.piece[data-state='recorder'] .pick {
  display: none;
}

/* Inside the dock the controls go compact: a thumbnail self-view next to the
   buttons instead of a full-width camera picture, so the music keeps most of
   the screen while the student plays from it. */
.piece[data-dock] .pick {
  grid-template-columns: 3fr 2fr;
}

.piece[data-dock] .record-btn,
.piece[data-dock] .pick .drop {
  min-height: 3.5rem;
}

.piece[data-dock] .recorder {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  grid-template-areas:
    'preview level'
    'preview msg'
    'preview actions';
  align-items: center;
  gap: 0 0.9rem;
  padding: 0.75rem;
}

.piece[data-dock] .recorder:has(.preview[hidden]) {
  grid-template-columns: 1fr;
  grid-template-areas: 'level' 'msg' 'actions';
}

.piece[data-dock] .recorder .preview {
  grid-area: preview;
  align-self: start;
  width: 4.5rem;
}

.piece[data-dock] .level {
  grid-area: level;
  margin-top: 0;
}

.piece[data-dock] .rec-msg {
  grid-area: msg;
  margin-top: 0.4rem;
}

.piece[data-dock] .rec-actions {
  grid-area: actions;
  margin-top: 0.4rem;
}

.piece[data-dock] .playback-media video {
  max-height: 35vh;
  max-height: 35dvh;
}

/* ---------------------------------------------------------------- playback */

.playback {
  margin: 0 0 1rem;
}

.playback-media video,
.playback-media audio {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.playback-media video {
  max-height: 60vh;
}

.playback-warning {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--rust);
  font-weight: 700;
}

.playback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  margin-top: 0.85rem;
}

.take-hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--paper-dim);
}

/* The choice only exists while a take is waiting on the student. Once it is
   sent the player stays, so they can check it again before submitting. */
.piece:not([data-state='review']) .playback-actions {
  display: none;
}

/* ---------------------------------------------------------------- recorder */

.recorder {
  background: var(--ink-raised);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 1rem;
}

.recorder .preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #000;
  border-radius: var(--radius);
  display: block;
}

/* A self-view reads as a mirror; the rear camera must not, or the student sees
   their own sheet music backwards. */
.recorder .preview.mirrored {
  transform: scaleX(-1);
}

.level {
  height: 0.4rem;
  background: var(--ink);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.level span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  border-radius: 999px;
  transition: width 0.08s linear;
}

.rec-msg {
  margin: 0.85rem 0 0;
  font-size: 0.9375rem;
  color: var(--paper-dim);
  font-variant-numeric: tabular-nums;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  margin-top: 0.85rem;
}

.rec-actions .primary {
  min-height: 3rem;
  font-size: 1rem;
}

.rec-stop {
  background: var(--rust);
  color: var(--paper);
}

.status {
  display: none;
  background: var(--ink-raised);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 1rem;
}

.piece[data-state='uploading'] .status,
.piece[data-state='done'] .status,
.piece[data-state='error'] .status,
.piece[data-state='resume'] .status {
  display: block;
}

.piece[data-state='done'] .status {
  border-color: var(--brass);
}

.piece[data-state='error'] .status {
  border-color: var(--rust);
}

.status-name {
  font-weight: 700;
  font-size: 0.9375rem;
  margin: 0 0 0.5rem;
  word-break: break-all;
}

.status-msg {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--paper-dim);
}

.piece[data-state='done'] .status-msg {
  color: var(--brass);
  font-weight: 700;
}

.piece[data-state='error'] .status-msg {
  color: var(--rust);
}

.bar {
  height: 0.6rem;
  background: var(--ink);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  border-radius: 999px;
  transition: width 0.25s ease-out;
}

.piece[data-state='done'] .bar {
  display: none;
}

.linkish {
  background: none;
  border: 0;
  color: var(--brass);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  padding: 0.5rem 0 0;
  cursor: pointer;
  min-height: 2.75rem;
}

/* -------------------------------------------------------------- submit bar */

.tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ink-raised);
  border-top: 2px solid var(--ink-line);
  padding: 0.9rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom));
  z-index: 10;
}

.tray-inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.tray-status {
  flex: 1 1 12rem;
  font-size: 0.875rem;
  color: var(--paper-dim);
  margin: 0;
}

.tray-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

@media (max-width: 30rem) {
  .tray-nav .primary {
    flex: 1 1 auto;
  }
}

/* Nothing to navigate to mid-take, and the music needs the room. */
body:has(.step:not([hidden]) .piece[data-state='recorder']) .tray {
  display: none;
}

body:has(.step:not([hidden]) .piece[data-state='recorder']) .piece-body {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

button.secondary {
  font: 700 1rem 'Public Sans', sans-serif;
  min-height: var(--tap);
  padding: 0 1.25rem;
  background: transparent;
  color: var(--paper);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  cursor: pointer;
}

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

button.primary {
  font: 700 1.0625rem 'Public Sans', sans-serif;
  min-height: var(--tap);
  padding: 0 1.75rem;
  background: var(--brass);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

button.primary:disabled {
  background: var(--ink-line);
  color: var(--paper-dim);
  cursor: not-allowed;
}

.notice {
  margin: 1.5rem 0 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--rust);
  background: var(--ink-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem;
}

.notice.good {
  border-left-color: var(--brass);
}

.notice:empty {
  display: none;
}

#turnstile {
  margin: 1.5rem 0 0;
}

/* ----------------------------------------------------------------- summary */

.summary {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.summary a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--tap);
  padding: 0.75rem 1rem;
  background: var(--ink-raised);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  color: var(--paper);
  text-decoration: none;
}

.summary-state {
  color: var(--paper-dim);
  font-size: 0.9375rem;
  text-align: right;
}

.summary li[data-state='done'] a {
  border-color: var(--brass);
}

.summary li[data-state='done'] .summary-state {
  color: var(--brass);
  font-weight: 700;
}

.summary li[data-state='error'] a {
  border-color: var(--rust);
}

/* ------------------------------------------------------------------ thanks */

.done-screen {
  padding: 4rem 0;
  text-align: left;
}

.done-screen h1 {
  color: var(--brass);
}

/* ------------------------------------------------------------------ review */

.review-head {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 2px solid var(--ink-line);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.filters button {
  font: 500 0.875rem 'Public Sans', sans-serif;
  min-height: 2.75rem;
  padding: 0 1rem;
  background: var(--ink-raised);
  color: var(--paper);
  border: 2px solid var(--ink-line);
  border-radius: 999px;
  cursor: pointer;
}

.filters button[aria-pressed='true'] {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
  font-weight: 700;
}

.card {
  padding: 2rem 0;
  border-bottom: 1px solid var(--ink-line);
}

.card h3 {
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  font-size: 1.375rem;
  margin: 0 0 0.35rem;
}

.card .meta {
  color: var(--paper-dim);
  font-size: 0.9375rem;
  margin: 0 0 1.25rem;
}

.take {
  margin: 0 0 1.25rem;
}

.take h4 {
  font-size: 0.875rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.take video,
.take audio {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.verdict {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.verdict button {
  flex: 1;
  min-height: var(--tap);
  font: 700 0.9375rem 'Public Sans', sans-serif;
  background: var(--ink-raised);
  color: var(--paper);
  border: 2px solid var(--ink-line);
  border-radius: var(--radius);
  cursor: pointer;
}

.verdict button[aria-pressed='true'] {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------------------------------------------------------- review: tabs */

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tabs button {
  font: 700 0.9375rem 'Public Sans', sans-serif;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  background: transparent;
  color: var(--paper-dim);
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tabs button[aria-pressed='true'] {
  color: var(--paper);
  border-bottom-color: var(--brass);
}

/* -------------------------------------------------- review: audition music */

.music-row .music-preview:empty {
  display: none;
}

.music-row .music-preview {
  margin: 0 0 1rem;
}

.music-row .music-preview .etude-sheet {
  max-height: 22rem;
  object-fit: contain;
  object-position: top;
}

.music-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.music-actions button.primary {
  min-height: 2.75rem;
  font-size: 0.9375rem;
  padding: 0 1.25rem;
}

.music-actions .linkish {
  padding: 0;
}

.tracks-head {
  margin: 2.5rem 0 0.5rem;
}

.step-count + .block {
  padding-top: 0.25rem;
}

/* ------------------------------------------------- review: take instructions */

.music-head {
  margin: 2rem 0 0.5rem;
}

.card.instruction-row {
  padding: 1.25rem 0;
}

.instruction-row h3 {
  margin-bottom: 0.75rem;
}

.instruction-row textarea {
  min-height: 7rem;
}

.instruction-row .meta {
  margin: 0.5rem 0 0;
  min-height: 1.5em;
}
