@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --background: #090d0f;
  --surface: #11171b;
  --card: #172026;
  --card-2: #1d2830;
  --ink: #f1f5f4;
  --muted: #a4b5ba;
  --accent: #1ca67a;
  --accent-hover: #178f69;
  --mint: #58dbb0;
  --mint-bright: #80f0ca;
  --lime-mint: #b8f794;
  --line: #27363e;
  --set-time: 12s;
  font-family:
    "DM Sans",
    ui-rounded,
    "SF Pro Rounded",
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body,
h1,
h2,
h3,
p,
figure,
fieldset {
  margin: 0;
}
body {
  min-width: 0;
}
a,
summary,
label {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible,
summary:focus-visible,
input:focus-visible + label {
  outline: 3px solid var(--mint-bright);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.device {
  position: relative;
  max-width: 390px;
  min-width: 0;
  margin-inline: auto;
  overflow: clip;
  background: var(--background);
  container-type: inline-size;
}
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
}
.entry .screen {
  display: none;
}
.entry .ready-screen,
.entry .screen:target {
  display: flex;
}
.entry .screen:target ~ .ready-screen {
  display: none;
}
.camera-feed {
  aspect-ratio: 300 / 390;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #23332e;
}
.athlete {
  position: absolute;
  inset: 0;
  background: url("/media/squat-ready.svg") no-repeat 0% 50% / 100% 100%;
}
.camera-feed::before {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(to bottom, #060b0c99 0, transparent 26%, transparent 80%, #060b0c90 100%);
}
.workout-header,
.set-target,
.count-hud,
.scene-bottom {
  position: absolute;
  z-index: 2;
}
.workout-header {
  inset: 14px 12px auto;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 4px;
  z-index: 4;
}
.round-button,
.exercise-pill,
.tracking-status {
  background: rgb(9 14 16 / 0.84);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.round-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}
.round-button .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}
.exercise-pill {
  border-radius: 30px;
  padding: 8px 14px;
  justify-self: center;
  text-align: center;
}
.exercise-pill h1 {
  font-size: clamp(0.92rem, 4cqw, 1.08rem);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.set-menu {
  justify-self: end;
  position: relative;
  z-index: 3;
}
.set-menu summary {
  list-style: none;
}
.set-menu summary::-webkit-details-marker {
  display: none;
}
.set-menu nav {
  position: absolute;
  right: 0;
  top: 48px;
  width: 180px;
  border: 1px solid var(--line);
  background: #131c21;
  border-radius: 13px;
  box-shadow: 0 12px 28px #0009;
  overflow: hidden;
}
.set-menu a {
  display: block;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 560;
}
.set-menu a + a {
  border-top: 1px solid var(--line);
}
.set-menu a:hover {
  background: #1d2a31;
  color: var(--mint-bright);
}
.set-target {
  top: 64px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-shadow:
    0 1px 6px #070b0d,
    0 0 10px #070b0d;
}
.set-target span {
  padding-inline: 3px;
}
.count-hud {
  top: 20%;
  left: 4.4%;
  width: 26%;
  max-width: 100px;
  aspect-ratio: 1;
}
.rep-ring {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  fill: #0b141688;
  overflow: visible;
}
.rep-ring circle {
  stroke-width: 7;
}
.ring-track {
  stroke: #cde6de44;
}
.ring-amount {
  fill: none;
  stroke: var(--mint);
  stroke-dasharray: 3;
  stroke-dashoffset: 3;
  stroke-linecap: butt;
  transform-origin: center;
  transform: rotate(-90deg);
}
.count-inner {
  color: #fff;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  text-shadow: 0 1px 4px #060b0d99;
}
.digit-window {
  font-size: clamp(2rem, 11.75cqw, 3.2rem);
  line-height: 1;
  display: block;
  height: 1em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.digit-window b {
  display: block;
  height: 1em;
  line-height: 1;
  font-weight: 850;
}
.digit-track {
  display: block;
}
.count-inner small {
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.scene-bottom {
  inset: auto 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.tracking-status,
.sample-marker {
  display: inline-flex;
  align-items: center;
  border-radius: 22px;
  gap: 6px;
  padding: 6px 10px;
  font-weight: 650;
  font-size: 0.78rem;
}
.tracking-status .icon {
  width: 15px;
  height: 15px;
  color: var(--mint);
}
.sample-marker {
  color: #eef3f4;
  background: rgb(9 14 16 / 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 560;
}
.control-tray {
  border-top: 1px solid var(--line);
  padding: 14px 16px 8px;
  background: var(--surface);
}
.tray-title,
.control-tray p,
.play-controls,
.secondary-wrap {
  display: grid;
}
.tray-title > span,
.control-tray p > span,
.play-controls > *,
.secondary-wrap > * {
  grid-area: 1/1;
}
.tray-title {
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.tray-title,
.tray-title > span {
  align-items: center;
}
.ready-screen .tray-title,
.tray-title > span {
  display: flex;
  gap: 8px;
}
.tray-title .icon {
  color: var(--mint);
  width: 18px;
  height: 18px;
}
.control-tray p,
.footnote,
.intro,
.routine p {
  color: var(--muted);
  line-height: 1.45;
}
.control-tray p {
  margin: 5px 0 12px;
  font-size: 0.88rem;
}
.primary,
.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.primary {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 10px 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 760;
  cursor: pointer;
}
.primary:hover {
  background: var(--accent-hover);
}
.primary .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.3;
}
.primary .icon-play {
  fill: currentColor;
}
.secondary {
  min-height: 40px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--mint);
}
.secondary:hover,
.demo-footer a:hover,
.sheet-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.demo-footer {
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: #0c1114;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}
.demo-footer a {
  font-weight: 700;
  color: var(--ink);
}

/* Playing animation (used by preview-set.html) */
.playing .athlete {
  background: none;
}
.motion-viewport {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}
.motion-strip {
  transform-box: view-box;
  animation: squat var(--set-time) steps(30, end) both;
}
.live-screen:not(:has(.playback-ready)) .timed,
.live-screen:not(:has(.playback-ready)) .pause-input {
  animation-play-state: paused;
}
@keyframes squat {
  0%,
  25%,
  33.333333%,
  58.333333%,
  66.666667%,
  100% {
    transform: translateX(0%);
  }
  16.666667%,
  50%,
  91.666667% {
    transform: translateX(-3000%);
  }
}
.digit-track {
  animation: count var(--set-time) step-end both;
}
@keyframes count {
  0% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-1em);
  }
  58.333333% {
    transform: translateY(-2em);
  }
  100% {
    transform: translateY(-3em);
  }
}
.playing .ring-amount {
  animation: fill-ring var(--set-time) step-end both;
}
@keyframes fill-ring {
  0% {
    stroke-dashoffset: 3;
  }
  25% {
    stroke-dashoffset: 2;
  }
  58.333333% {
    stroke-dashoffset: 1;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
.during {
  animation: during var(--set-time) step-end both;
}
.after {
  animation: after var(--set-time) step-end both;
}
@keyframes during {
  from {
    visibility: visible;
  }
  to {
    visibility: hidden;
  }
}
@keyframes after {
  from {
    visibility: hidden;
  }
  to {
    visibility: visible;
  }
}
.during,
.after {
  min-width: 0;
}
.stop-flash {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background: rgba(24, 143, 105, 0.92);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: stop-flash 0.95s var(--set-time) ease-out both;
}
.stop-flash strong {
  font-size: clamp(4rem, 25cqw, 6.25rem);
  line-height: 1;
}
.stop-flash b {
  font-size: 1.65rem;
  letter-spacing: 0.035em;
}
@keyframes stop-flash {
  0% {
    opacity: 0;
  }
  12%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
#pause:checked ~ * .timed {
  animation-play-state: paused;
}
#pause:focus-visible ~ .control-tray label[for="pause"] {
  outline: 3px solid var(--mint-bright);
  outline-offset: 3px;
}
.pause-copy,
.resume-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.resume-copy,
#pause:checked ~ .control-tray .pause-copy {
  display: none;
}
#pause:checked ~ .control-tray .resume-copy {
  display: inline-flex;
}
.pause-input {
  animation: during var(--set-time) step-end both;
}
.pause-input:checked {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .motion-strip {
    transform: translateX(-3000%);
    animation: none;
  }
  .stop-flash {
    animation: none;
  }
}

/* Sheets: Recap & AI Coach */
.sheet {
  min-height: 600px;
  background: var(--background);
}
.sheet-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 54px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheet-nav a {
  justify-self: start;
  padding: 8px 0;
  color: var(--mint);
  font-size: 0.9rem;
  font-weight: 600;
}
.sheet-nav h1 {
  grid-column: 2;
  font-size: 1.02rem;
  font-weight: 740;
  letter-spacing: -0.02em;
}
.sheet-content {
  padding: 14px 15px 10px;
}
.group {
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
}
.routine,
.set-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}
.routine-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(88, 219, 176, 0.14);
  color: var(--mint);
  display: grid;
  place-items: center;
  flex: none;
}
.routine h2,
.set-entry h3,
.conversation h3 {
  font-size: 0.98rem;
  line-height: 1.3;
}
.routine p,
.set-meta {
  font-size: 0.82rem;
}
.section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
}
.set-entry {
  justify-content: space-between;
}
.set-meta {
  color: var(--muted);
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 3px;
}
.set-meta .icon {
  width: 15px;
  height: 15px;
  color: var(--mint);
}
.rep-adjust {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.adj-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(28, 166, 122, 0.22);
  color: var(--mint-bright);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.92rem;
}
.tempo {
  overflow: hidden;
  padding: 4px 13px;
}
.tempo table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}
.tempo th,
.tempo td {
  text-align: right;
  padding: 8px 0;
}
.tempo th:first-child {
  text-align: left;
}
.tempo thead th {
  font-weight: 620;
  color: var(--muted);
  font-size: 0.78rem;
}
.tempo tbody tr {
  border-top: 1px solid var(--line);
}
.tempo tbody th {
  font-weight: 650;
}
.last-lower {
  color: var(--mint-bright);
  font-weight: 750;
}
.depth-ok {
  color: var(--mint);
  font-weight: 620;
}
.depth-drift {
  color: var(--lime-mint);
  font-weight: 680;
}
.footnote {
  margin: 10px 2px 0;
  font-size: 0.78rem;
}
.sheet-actions {
  margin-top: auto;
  padding: 10px 15px 6px;
}

/* AI Coach Panel */
.coach-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.chat-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(88, 219, 176, 0.14);
  border: 1px solid rgba(88, 219, 176, 0.3);
  color: var(--mint-bright);
  font-weight: 680;
  font-size: 0.78rem;
  border-radius: 30px;
}
.chat-mode .icon {
  width: 14px;
  height: 14px;
}
.mcp-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 20px;
}
.coach-content > h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 12px 0 3px;
  line-height: 1.18;
}
.intro {
  font-size: 0.86rem;
}
.questions {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.questions legend {
  font-weight: 650;
  padding: 0;
  margin-bottom: 7px;
  font-size: 0.82rem;
  color: var(--muted);
}
.question-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  gap: 3px;
}
.question-tabs label {
  display: grid;
  place-items: center;
  min-height: 36px;
  text-align: center;
  padding: 4px 4px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  color: var(--muted);
}
.question-radio:checked + label {
  background: var(--accent);
  color: #ffffff;
}
.conversation {
  padding: 13px 14px;
  margin-top: 10px;
}
.conversation-title {
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 650;
}
.sample-pill {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--mint-bright);
  background: rgba(88, 219, 176, 0.14);
  padding: 2px 7px;
  border-radius: 99px;
}
.conversation h3 {
  margin: 8px 0 10px;
  font-size: 0.98rem;
}
.conversation p {
  font-size: 0.84rem;
  line-height: 1.48;
  color: #d6e0e3;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: 10px;
}
.conversation strong {
  color: var(--ink);
}
.reply {
  display: none;
}
.questions:has(#q-fatigue:checked) .reply-fatigue,
.questions:has(#q-progress:checked) .reply-progress,
.questions:has(#q-snapshots:checked) .reply-snapshots {
  display: block;
}

/* Mini telemetry bars */
.mini-bars {
  display: grid;
  gap: 7px;
}
.bar-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}
.bar-row span {
  color: var(--muted);
  font-weight: 600;
}
.bar-track {
  height: 7px;
  border-radius: 99px;
  background: #23323a;
  overflow: hidden;
}
.bar-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.bar-track .fill-2 {
  width: 66%;
  background: var(--mint);
}
.bar-track .fill-3 {
  width: 100%;
  background: var(--lime-mint);
}
.bar-row b {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink);
}
.bar-row b.hi {
  color: var(--lime-mint);
}

/* Progression trend mini boxes */
.trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.trend-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}
.trend-box small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.trend-box strong {
  display: block;
  font-size: 1.12rem;
  color: var(--mint-bright);
  margin: 2px 0;
}
.trend-box span {
  display: block;
  font-size: 0.75rem;
  color: #cdd8dc;
}

/* Peak-phase keyframe cards */
.kf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.kf-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
}
.kf-card svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.kf-card span {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
}

.paired {
  display: flex;
  justify-content: space-around;
  gap: 8px;
}
@media (min-width: 520px) {
  body {
    min-height: 100svh;
    padding: 20px 14px;
    background: radial-gradient(ellipse at top, #132520, #090d0f 70%);
  }
  .device {
    border: 4px solid #26343b;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  }
}
@media (max-width: 310px) {
  .workout-header {
    inset-inline: 7px;
  }
  .trend-grid {
    grid-template-columns: 1fr;
  }
}
