:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5d6975;
  --paper: #fffaf3;
  --panel: #ffffff;
  --line: #d9e1e8;
  --orange: #f05a28;
  --orange-dark: #b73b1e;
  --blue: #1664a7;
  --green: #16835d;
  --gold: #be7d00;
  --charcoal: #24313e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

img,
audio {
  display: block;
  width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.workout-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 24px;
  align-items: end;
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

h3 {
  margin-bottom: 7px;
  font-size: 1rem;
}

.summary {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.landing-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.landing-shell {
  width: min(420px, 100%);
}

.landing-form {
  display: grid;
  gap: 16px;
}

.landing-form h1 {
  margin-bottom: 4px;
  font-size: clamp(2.3rem, 12vw, 4.5rem);
  text-align: center;
}

.landing-form label {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

.landing-form button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--blue);
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.generation-shell {
  width: min(620px, 100%);
}

.generation-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 5vw, 36px);
  background: var(--panel);
}

.generation-panel h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 9vw, 4.4rem);
  text-align: left;
}

.generation-summary,
.generation-status {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.generation-progress {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #dce7f1;
}

.generation-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadBar 1.35s ease-in-out infinite;
}

.generation-link {
  justify-self: start;
  border-radius: 6px;
  padding: 11px 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

@keyframes loadBar {
  0% {
    transform: translateX(-115%);
  }

  55% {
    transform: translateX(70%);
  }

  100% {
    transform: translateX(240%);
  }
}

.audio-panel,
.stats-strip article,
.intel-block,
.movement-card,
.speed-personalizer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.audio-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.audio-label {
  margin-bottom: 4px;
  font-weight: 900;
}

.audio-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.audio-track {
  display: grid;
  gap: 6px;
}

.audio-track span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

audio {
  width: 100%;
  min-height: 44px;
}

.speed-personalizer {
  margin: 18px 0 30px;
  padding: 18px;
}

.personalizer-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.speed-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px 12px;
  align-items: center;
}

.speed-form label {
  display: grid;
  gap: 3px;
  font-weight: 900;
}

.speed-form label span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.speed-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.speed-input input {
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.speed-input span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.speed-form button,
.script-panel button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--blue);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.speed-form button {
  grid-column: 1 / -1;
}

.script-panel {
  display: grid;
  gap: 10px;
}

.script-panel-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.script-panel textarea {
  width: 100%;
  min-height: 244px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  background: #fbfdff;
  font: 0.95rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 30px;
}

.stats-strip article {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.stats-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-strip strong {
  font-size: 1rem;
}

.section-heading {
  margin-bottom: 14px;
}

.block-list {
  display: grid;
  gap: 12px;
}

.intel-block {
  padding: 16px;
  border-left: 7px solid var(--orange);
}

.intel-block.tread {
  border-left-color: var(--blue);
}

.intel-block.floor {
  border-left-color: var(--green);
}

.intel-block.recovery {
  border-left-color: var(--gold);
}

.block-kicker {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.block-kicker span {
  border-radius: 6px;
  padding: 8px 10px;
  color: #ffffff;
  background: var(--charcoal);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.block-kicker strong {
  font-size: 1.08rem;
}

.goal {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.intel-block ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.intel-block li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--ink);
  line-height: 1.35;
}

.intel-block li span {
  border-radius: 5px;
  padding: 3px 5px;
  color: var(--orange-dark);
  background: #fff0e9;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.movement-guide {
  margin-top: 34px;
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.movement-card {
  overflow: hidden;
}

.movement-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #eef2f6;
}

.movement-card div {
  padding: 14px;
}

.movement-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 860px) {
  .workout-header,
  .stats-strip,
  .movement-grid,
  .personalizer-layout {
    grid-template-columns: 1fr;
  }

  .workout-header {
    align-items: start;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .intel-block ul,
  .block-kicker,
  .speed-form {
    grid-template-columns: 1fr;
  }

  .block-kicker span {
    width: fit-content;
  }
}
