/* Training edition: neutral surfaces, clear hierarchy, diagrams before decoration. */
body[data-theme="boxing"] {
  --bg: #f5f4f0;
  --paper: #fff;
  --ink: #172328;
  --muted: #566168;
  --accent: #a93a22;
  --accent-ink: #fff;
  --radius: 5px;
  --heading: Arial, Helvetica, sans-serif;
}
body[data-theme="wrestling"] {
  --bg: #edf1f5;
  --paper: #fff;
  --ink: #182d45;
  --muted: #506176;
  --radius: 4px;
}
body[data-theme="muaythai"] {
  --bg: #f6f2e9;
  --paper: #fffdf8;
  --ink: #332b24;
  --muted: #62564c;
  --radius: 4px;
  --heading: Arial, Helvetica, sans-serif;
}
body[data-theme="bjj"] {
  --bg: #f1f3ef;
  --paper: #fff;
  --ink: #263b32;
  --muted: #506358;
  --radius: 8px;
  --heading: Arial, Helvetica, sans-serif;
}
.site-header {
  height: 80px;
  padding: 0 40px;
  background: var(--paper);
}
.brand {
  letter-spacing: -0.04em;
  font-size: 18px;
}
.brand-mark {
  width: 27px;
  height: 30px;
  font-size: 21px;
}
main {
  max-width: 1440px;
  padding: 0 40px 64px;
}
.page-title {
  padding: 38px 0 28px;
}
.page-title h1 {
  font-size: clamp(30px, 4vw, 49px);
  letter-spacing: -0.055em;
  max-width: 1000px;
}
.page-title > p:last-child:not(:first-child) {
  max-width: 700px;
  font-size: 15px;
}
.hero.training-hero {
  grid-template-columns: 1fr 1.12fr;
  gap: 64px;
  padding: 55px 0 45px;
}
.training-hero .hero-copy h1 {
  font:
    750 clamp(44px, 5.4vw, 76px) / 1.01 Arial,
    Helvetica,
    sans-serif;
  text-transform: none;
  letter-spacing: -0.065em;
  margin: 22px 0;
}
.training-hero .intro {
  font-size: 16px;
  line-height: 1.7;
  max-width: 430px;
}
.hero-proof {
  font-size: 11px;
  letter-spacing: 0;
  margin-top: 26px;
}
.training-feature {
  background: #172328;
  border-radius: var(--radius);
  overflow: hidden;
}
.training-feature svg {
  display: block;
  width: 100%;
  height: auto;
}
.training-feature > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--paper);
  font-weight: 700;
  border: 1px solid var(--line);
}
.training-feature > a span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.training-hero .hero-actions {
  gap: 20px;
  flex-wrap: wrap;
}
.training-intro {
  display: grid;
  grid-template-columns: 210px 1fr 1fr;
  gap: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  align-items: center;
}
.training-intro .hero-photo {
  height: 130px;
  transform: none;
  border-radius: 4px;
}
.training-intro .hero-photo:after {
  display: none;
}
.training-intro h2 {
  font:
    700 19px/1.3 Arial,
    Helvetica,
    sans-serif;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}
.training-intro p {
  font-size: 13px;
  line-height: 1.7;
}
.program-card {
  background: var(--paper) !important;
  border: 1px solid var(--line) !important;
  padding: 24px;
}
.program-card h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 27px;
  font-weight: 650 !important;
}
.program-card p {
  font-size: 14px;
}
.program-grid {
  gap: 18px;
}
.filterbar {
  background: var(--paper);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  gap: 24px;
}
.filterbar input,
.filterbar select {
  background: var(--bg);
}
.chips {
  padding: 20px 0;
  gap: 9px;
}
.chip {
  border-radius: 4px;
  min-height: 40px;
}
.drill-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.drill-card {
  display: grid;
  grid-template-columns: 42% 58%;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}
.drill-art {
  height: 100%;
  min-height: 210px;
  background: #172328;
  border-radius: 0;
  overflow: hidden;
}
.drill-art svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.drill-art svg text {
  display: none;
}
.drill-body {
  padding: 21px;
}
.drill-body h2 {
  font:
    700 22px/1.18 Arial,
    Helvetica,
    sans-serif;
  letter-spacing: -0.03em;
  margin: 13px 0 10px;
}
.drill-body p {
  font-size: 13px;
  min-height: 0;
  line-height: 1.6;
}
.drill-body .eyebrow {
  font-size: 10px;
}
.drill-body .program-meta {
  font-size: 10px;
  margin-top: 15px;
  gap: 9px;
  flex-wrap: wrap;
}
.art-arrow {
  background: #fff;
  color: #172328;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
}
.favorite {
  font-size: 24px;
  min-width: 36px;
  min-height: 36px;
}
.drill-card:hover {
  border-color: var(--ink);
}
.technique-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr);
  gap: 32px;
  align-items: start;
}
.technique-layout .study-canvas {
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.study-label {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.study-label .eyebrow,
.study-label .pill {
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.technique-layout .motion-stage {
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: 640/440;
}
.technique-figure {
  display: block;
  width: 100%;
  height: auto;
}
.phase-readout {
  display: flex;
  gap: 17px;
  align-items: start;
  padding: 20px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  min-height: 102px;
}
.phase-readout > span {
  font:
    500 30px/1.2 ui-monospace,
    monospace;
  color: var(--muted);
}
.phase-readout strong {
  font-size: 17px;
  letter-spacing: -0.025em;
}
.phase-readout p {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 4px;
  color: var(--ink);
}
.transport {
  display: flex;
  align-items: end;
  gap: 18px;
  padding: 20px 22px 14px;
}
.transport > label {
  font-size: 11px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}
.transport .scrub-label {
  flex: 1;
  min-width: 60px;
}
.transport input[type="range"] {
  width: 100%;
  padding: 0;
  min-height: 42px;
  accent-color: var(--ink);
  border: 0;
  cursor: ew-resize;
}
.transport select {
  min-height: 45px;
  padding: 10px;
}
.transport .button {
  white-space: nowrap;
}
.phase-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0 22px;
}
.phase-tabs button {
  min-height: 65px;
  border-top: 3px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 4px;
  padding: 10px 7px;
  font-size: 11px;
  text-align: left;
}
.phase-tabs button span {
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
}
.phase-tabs button b {
  font-weight: 600;
}
.phase-tabs button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--bg);
}
.view-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.view-options label {
  display: flex;
  gap: 7px;
  align-items: center;
}
.view-options input {
  min-height: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
}
.view-options > span {
  color: var(--muted);
  margin-left: auto;
}
.sequence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 22px 0;
  font-size: 12px;
}
.study-progress {
  padding: 12px 22px 20px;
  gap: 8px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}
.study-progress .beat {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 12px;
  min-height: 42px;
  font-size: 12px;
  flex: none;
}
.study-progress .beat.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.study-progress .beat span {
  font-size: 10px;
  opacity: 0.75;
  display: inline;
}
.study-notes h2 {
  font:
    700 30px/1.12 Arial,
    Helvetica,
    sans-serif;
  letter-spacing: -0.04em;
  margin: 10px 0 20px;
}
.technical-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}
.technical-steps li {
  display: flex;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 15px 12px 15px 0;
  transition: background 0.15s;
}
.technical-steps li.current {
  background: var(--paper);
}
.technical-steps li > span {
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted);
  padding-top: 4px;
  min-width: 22px;
}
.technical-steps h3 {
  font:
    650 15px/1.4 Arial,
    Helvetica,
    sans-serif;
  letter-spacing: 0;
  margin-bottom: 3px;
}
.technical-steps p {
  font-size: 13px;
  line-height: 1.7;
}
.error-note {
  border-left: 3px solid var(--accent);
  background: var(--paper);
  padding: 14px 16px;
  margin: 17px 0;
}
.error-note strong {
  font-size: 12px;
}
.error-note p {
  font-size: 12px;
  line-height: 1.65;
  margin-top: 5px;
}
.source-note {
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
/* A disclosure control is a control. Wave four sweep measured this one at 32 px
   high on a phone, which is under the touch minimum the rest of the app keeps. */
.source-note summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 6px 0;
  box-sizing: border-box;
  font-weight: 600;
}
.source-note summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.source-note p {
  margin-top: 12px;
  line-height: 1.7;
}
.source-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.drill-purpose {
  margin: 23px 0;
}
.drill-purpose h3 {
  font:
    650 17px/1.4 Arial,
    Helvetica,
    sans-serif;
  letter-spacing: -0.01em;
  margin: 5px 0;
}
.drill-purpose > p:last-child {
  font-size: 13px;
  line-height: 1.6;
}
.study-notes > .button {
  margin-top: 7px;
}
.composer-canvas {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0 0 20px;
  overflow: hidden;
}
.composer-canvas .study-controls,
.composer-canvas .fine,
.sequence-track {
  margin: 15px 20px;
}
.composer-canvas .fine {
  color: var(--muted) !important;
}
.player-visual {
  padding: 0 0 20px;
  overflow: hidden;
  background: #172328;
  color: #e3e7e3;
}
.player-visual p {
  padding: 0 20px;
  color: #c7d0d2 !important;
}
.player-visual .motion-stage {
  max-width: none;
}
.technique-layout .fine {
  padding: 0 22px 16px;
  color: var(--muted) !important;
}
.button {
  transition: background 0.15s;
}
.button:hover {
  transform: none;
  filter: brightness(0.95);
}
@media (min-width: 1100px) {
  .technique-layout .study-canvas {
    position: sticky;
    top: 20px;
  }
}
@media (max-width: 1000px) {
  .site-header {
    padding: 0 24px;
  }
  .site-header nav {
    gap: 15px;
  }
  main {
    padding: 0 24px 50px;
  }
  .hero.training-hero {
    gap: 30px;
  }
  .technique-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(265px, 1fr);
    gap: 22px;
  }
  .drill-card {
    grid-template-columns: 1fr;
  }
  .drill-art {
    height: 200px;
    min-height: 0;
  }
  .drill-art svg {
    height: 100%;
    width: 100%;
  }
  .drill-body {
    padding: 20px;
  }
  .transport {
    gap: 10px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .phase-tabs {
    padding: 0 15px;
  }
  .training-intro {
    grid-template-columns: 150px 1fr 1fr;
    gap: 20px;
  }
}
@media (max-width: 760px) {
  .site-header {
    height: auto;
    padding: 18px 20px;
    gap: 17px;
    flex-wrap: wrap;
  }
  .site-header nav {
    order: 3;
    width: 100%;
    overflow: auto;
    gap: 22px;
  }
  .header-cta {
    margin-left: auto;
  }
  .hero.training-hero {
    grid-template-columns: 1fr;
    padding: 35px 0;
    gap: 28px;
  }
  .training-hero .hero-copy h1 {
    font-size: 52px;
    max-width: 450px;
  }
  .training-feature {
    max-width: 620px;
    width: 100%;
  }
  .training-intro {
    grid-template-columns: 1fr 1fr;
  }
  .training-intro .hero-photo {
    display: none;
  }
  .technique-layout {
    grid-template-columns: 1fr;
  }
  .study-notes {
    padding-top: 10px;
  }
  .drill-grid {
    gap: 13px;
  }
  .drill-body h2 {
    font-size: 21px;
  }
  .drill-body .program-meta span {
    flex-basis: auto;
  }
  .page-title {
    padding: 29px 0 22px;
  }
  .filterbar {
    padding: 16px;
  }
  .phase-readout {
    min-height: 98px;
  }
  .transport .button {
    font-size: 12px;
    padding: 12px 15px;
  }
  .view-options > span {
    margin-left: 0;
  }
  .training-hero .hero-proof {
    margin-top: 22px;
  }
}
@media (max-width: 440px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .site-header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .site-header nav {
    font-size: 12px;
    gap: 20px;
  }
  .header-cta {
    font-size: 10px;
    padding: 10px;
    gap: 8px;
  }
  .brand {
    font-size: 15px;
    gap: 7px;
  }
  .brand-mark {
    width: 22px;
    height: 25px;
    font-size: 18px;
  }
  .drill-grid {
    grid-template-columns: 1fr;
  }
  .drill-card {
    grid-template-columns: 39% 61%;
  }
  .drill-art {
    height: 100%;
    min-height: 185px;
  }
  .drill-body {
    padding: 15px;
  }
  .drill-body h2 {
    font-size: 19px;
  }
  .drill-body p {
    font-size: 12px;
  }
  .drill-body .program-meta {
    font-size: 9px;
  }
  .drill-body .eyebrow {
    font-size: 9px;
  }
  .training-hero .hero-copy h1 {
    font-size: 43px;
  }
  .training-hero .intro {
    font-size: 14px;
  }
  .training-intro {
    grid-template-columns: 1fr;
  }
  .training-feature > a {
    padding: 17px;
    font-size: 14px;
  }
  .training-feature > a span {
    font-size: 10px;
  }
  .transport {
    flex-wrap: wrap;
    align-items: center;
    gap: 11px;
  }
  .transport .scrub-label {
    order: 3;
    flex-basis: 100%;
    gap: 0;
  }
  .transport > label:last-child {
    margin-left: auto;
    display: flex;
    align-items: center;
  }
  .phase-tabs {
    padding: 0 10px;
  }
  .phase-tabs button {
    font-size: 10px;
    padding: 10px 5px;
    min-height: 75px;
  }
  .phase-readout {
    padding: 17px 16px;
    gap: 13px;
    min-height: 115px;
  }
  .study-label {
    padding: 14px 15px;
  }
  .phase-readout p {
    font-size: 12px;
  }
  .phase-readout strong {
    font-size: 16px;
  }
  .study-progress {
    padding: 10px 15px 18px;
  }
  .sequence-heading {
    padding: 10px 15px 0;
  }
  .view-options {
    padding: 15px;
    gap: 12px;
  }
  .view-options > span {
    display: none;
  }
  .study-notes h2 {
    font-size: 27px;
  }
  .technical-steps p {
    font-size: 13px;
  }
  .page-title h1 {
    font-size: 32px;
  }
  .filterbar {
    gap: 16px;
  }
  .favorite {
    min-width: 32px;
  }
  .hero-proof {
    gap: 9px;
  }
  .hero-proof span + span:before {
    margin-right: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .technical-steps li {
    transition: none;
  }
}
@media print {
  .transport,
  .phase-tabs,
  .view-options,
  .study-progress,
  .sequence-heading {
    display: none;
  }
  .technique-layout {
    display: block;
  }
  .technical-steps li {
    break-inside: avoid;
  }
  .study-canvas {
    position: static !important;
  }
  .motion-stage {
    max-width: 450px !important;
    margin: auto !important;
  }
}
body[data-theme="boxing"] .composer-canvas .secondary {
  color: var(--ink);
  border-color: var(--ink);
}
.program-card:first-child {
  --line: #d1d6d3;
}
.drill-art .technique-figure {
  transform: scale(1.55);
  transform-origin: 50% 55%;
}
.reference-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 12px;
}
.sequence-limit {
  padding-top: 15px !important;
  padding-bottom: 0 !important;
}

/* Micro-interactions. Nothing in this app answered a press, so every control
   felt like a picture of a control. A 1 px displacement is enough; anything
   larger reads as a bug on a touch screen. Reduced motion keeps the change in
   colour and drops the movement. */
button:not(:disabled):active,
.drill-card:active,
a.button:active { transform: translateY(1px); }
.human-toolbar button:not(:disabled):active { background: #46595e; }
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active,
  .drill-card:active,
  a.button:active { transform: none; }
}

/* The viewer is a blank rectangle until the 9 MB model arrives. A quiet pulse
   says the frame is loading rather than broken, and it stops the moment the
   first pose is drawn. */
.human-study[data-ready="loading"] { background: linear-gradient(100deg, #242e31 30%, #2e3b3f 50%, #242e31 70%); background-size: 300% 100%; animation: human-skeleton 1.6s linear infinite; }
@keyframes human-skeleton { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .human-study[data-ready="loading"] { animation: none; } }

/* The first-visit guide to the player. It sits above the model rather than on
   top of it, because a coach mark that covers the thing it is describing is
   worse than no coach mark. Dismissed once, never shown again; the flag lives
   in its own browser key and never enters a backup file. */
.tour {
  border: 1px solid var(--ink);
  border-left: 6px solid var(--bell);
  background: var(--paper);
  padding: 14px 16px 16px;
  margin: 0 0 14px;
}
.tour .tour-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour h2 { margin: 6px 0 6px; font-size: 20px; }
.tour p { margin: 0 0 14px; max-width: 62ch; }
.tour .tour-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
/* Wave four sweep: on a phone the full-size guide filled the screen on its own,
   so the first thing a visitor saw of a movement study was a page of text and
   no movement. Tightened until the top of the model is in the same view. */
@media (max-width: 700px) {
  .tour { padding: 10px 12px 12px; margin-bottom: 10px; }
  .tour h2 { font-size: 17px; margin: 2px 0 4px; }
  .tour p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
  .tour .tour-foot { gap: 10px; }
}

/* The round clock gets a shape as well as a number: the ring empties over the
   round that is running, so a glance from across the room is enough. */
.clock-ring { position: relative; display: grid; place-items: center; width: min(340px, 84vw); aspect-ratio: 1; margin: 4px 0 10px; }
.clock-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.clock-ring circle { fill: none; stroke-width: 6; }
.clock-ring .ring-track { stroke: var(--corner-line, #34322e); }
.clock-ring .ring-run { stroke: var(--bell); stroke-linecap: butt; transition: stroke-dashoffset .3s linear; }
.clock-ring .ring-run[data-kind="rest"] { stroke: var(--corner-muted, #9d9a92); }
.clock-ring .player-clock { position: relative; margin: 0; font-size: clamp(56px, 13vw, 112px); }
@media (prefers-reduced-motion: reduce) { .clock-ring .ring-run { transition: none; } }

.next-cue { margin: 2px 0 0; font: 600 13px/1.4 var(--sans, Arial, sans-serif); letter-spacing: .02em; }

/* What the session actually was, counted from the plan that ran, shown once on
   the journal with the entry it describes already written. */
.round-summary { border: 1px solid var(--ink); border-top: 6px solid var(--bell); background: var(--paper); padding: 16px; margin: 0 0 20px; }
/* Ink, not the bell colour: chartreuse on paper is a 1.6:1 contrast ratio and
   the bell is reserved for a marker and one active state, not for reading. */
.round-summary h2, .round-summary .summary-figures b { color: var(--ink); }
.round-summary h2 { margin: 6px 0 12px; }
.round-summary .summary-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-bottom: 10px; }
.round-summary .summary-figures b { display: block; font: 700 30px/1 var(--heading, sans-serif); }
.round-summary .summary-figures span { font-size: 12px; color: var(--muted); }
.round-summary p { margin: 0 0 14px; color: var(--muted); }
