/*
 * Palette. Every colour on the page, including the 3D figure's glow, comes
 * from these variables (main.js reads them), so a colour change is one edit.
 */
:root {
  --bg: #0c0b0a;
  --surface: #1b1917;
  --hi: #2a2724;
  --rule: #3a3633;
  --text: #f5f1ea;
  --text-2: rgba(245, 241, 234, 0.62);
  --text-3: rgba(245, 241, 234, 0.32);
  --accent: #e4572e;
  --secondary: #ead8b8;
  --shell: #8f8a84;
  --chalk: #5c5853;
}

:root {
  --display: 'Archivo', system-ui, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  /* Scroll progress 0..1 of the pinned stage, set by main.js. */
  --p: 0;
  --focus: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-variation-settings: 'wdth' 100;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

h2,
h3 {
  font-weight: 800;
  font-variation-settings: 'wdth' 105;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

h2 {
  font-size: clamp(34px, 4.6vw, 64px);
}

.small {
  font-size: 14px;
  color: var(--text-2);
}

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--gutter);
  mix-blend-mode: difference;
}

.wordmark {
  font-weight: 900;
  font-variation-settings: 'wdth' 125;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.nav-link {
  font-size: 15px;
  font-weight: 600;
}

/* Stage: hero and exercise demo share one pinned canvas */
.stage-track {
  height: 680vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero-word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-variation-settings: 'wdth' 125;
  font-size: clamp(120px, 33vw, 520px);
  line-height: 0.8;
  letter-spacing: calc(-0.04em + var(--p) * 0.4em);
  opacity: calc(1 - var(--p) * 3.2);
  user-select: none;
  pointer-events: none;
}

.hero-word span {
  display: inline-block;
  animation: rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-word span:nth-child(2) {
  animation-delay: 0.06s;
}
.hero-word span:nth-child(3) {
  animation-delay: 0.12s;
}
.hero-word span:nth-child(4) {
  animation-delay: 0.18s;
}

@keyframes rise {
  from {
    transform: translateY(40%);
    opacity: 0;
  }
}

.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-copy {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(56px, 9vh, 96px);
  right: var(--gutter);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 46px);
  line-height: 1;
  letter-spacing: -0.03em;
  opacity: calc(1 - var(--focus) * 2);
  pointer-events: none;
}

.hero-line {
  position: absolute;
  inset: auto 0 0;
  transition:
    opacity 0.5s,
    transform 0.5s;
}

.hero-line[data-line='1'] {
  color: var(--accent);
}

.hero-line.off {
  opacity: 0;
  transform: translateY(12px);
}

/* The exercise demo overlay */
.lift {
  position: absolute;
  inset: 0;
  padding: 88px var(--gutter) 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  align-content: space-between;
  opacity: var(--focus);
  pointer-events: none;
}

.lift > * {
  transform: translateY(calc((1 - var(--focus)) * 24px));
}

.lift-name {
  font-size: clamp(28px, 3.6vw, 48px);
}

.lift-rep {
  grid-column: 2;
  justify-self: end;
  font-size: 18px;
  color: var(--text-2);
}

.lift-rep strong {
  display: inline-block;
  min-width: 1.1ch;
  color: var(--text);
  font-weight: 900;
  font-variation-settings: 'wdth' 110;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  vertical-align: -0.1em;
  margin: 0 6px;
}

.lift-muscles {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
  align-self: end;
  list-style: none;
  padding: 0;
  width: min(300px, 100%);
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.lift-muscles li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  cursor: default;
  /* Set by main.js: how hard this muscle is working right now. */
  --w: 0;
}

.lift-muscles b {
  font-weight: 600;
  font-size: 16px;
}

.lift-muscles i {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: var(--hi);
  position: relative;
  overflow: hidden;
}

.lift-muscles i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--w));
  box-shadow: 0 0 10px var(--accent);
}

.lift-muscles li:hover b {
  color: var(--accent);
}

.lift-copy {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  color: var(--text-2);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.45;
  max-width: 34ch;
}

/* Statement: the type widens as it takes the screen, like a lift under load */
.statement {
  padding: clamp(100px, 20vh, 220px) var(--gutter);
}

.statement p {
  max-width: 1100px;
  margin: 0 auto;
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.statement .w {
  display: inline-block;
  white-space: nowrap;
  text-align: center;
  font-variation-settings: 'wdth' calc(70 + var(--x) * 50);
  color: color-mix(in srgb, var(--text) calc(35% + var(--x) * 65%), transparent);
}

/* Next set adjusts: a ledger of sets and a barbell that loses plates */
.adjust {
  height: 300vh;
  /* How far the dropped plates have slid off, 0..1, set by main.js. */
  --drop: 0;
}

.adjust-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 88px var(--gutter) 48px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 32px;
}

.adjust-ledger {
  display: grid;
  gap: 28px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.adjust-ledger h2 {
  max-width: 16ch;
}

.sets {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 600;
}

.sets th,
.sets td {
  text-align: left;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.sets th {
  font-weight: 400;
}

.sets th:nth-child(2),
.sets th:nth-child(3) {
  width: 12%;
}

.sets td:last-child em {
  font-style: normal;
  font-weight: 500;
  font-size: 0.75em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.adjust.is-short .set-1 em,
.adjust.is-dropped .set-2 em {
  opacity: 1;
}

.adjust.is-short .set-1 td:nth-child(3) {
  color: var(--accent);
}

.set-2 {
  opacity: calc(var(--drop) * 2);
}

.set-2 td:nth-child(2) {
  color: var(--accent);
}

.bar {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(900px, 100%);
  height: 160px;
  display: flex;
  align-items: center;
}

.shaft {
  flex: 1;
  height: 10px;
  background: linear-gradient(var(--rule), var(--surface));
}

.bar-end {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 190px;
  flex: none;
}

.bar-end.left {
  justify-content: flex-end;
}

.plate {
  display: block;
  width: 24px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--hi), var(--surface));
  box-shadow: inset 0 0 0 1px var(--rule);
}

.p20 {
  height: 150px;
}

.p5 {
  height: 96px;
  width: 18px;
}

.collar {
  display: block;
  width: 12px;
  height: 34px;
  border-radius: 3px;
  background: var(--text-2);
}

.drop {
  background: var(--accent);
  box-shadow: none;
  opacity: calc(1 - var(--drop));
}

.left .drop {
  transform: translateX(calc(var(--drop) * -180px));
}

.right .drop {
  transform: translateX(calc(var(--drop) * 180px));
}

.bar-weight {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -140%);
  font-weight: 800;
  font-variation-settings: 'wdth' 110;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.02em;
}

/* Finish time: the running order fills in and the clock rolls forward */
.finish {
  height: 260vh;
}

.finish-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 88px var(--gutter) 48px;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 32px clamp(32px, 6vw, 96px);
}

.finish-copy {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.finish-copy h2 {
  max-width: 14ch;
}

.finish-copy p,
.cta-sub {
  color: var(--text-2);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.45;
  max-width: 44ch;
}

.order {
  list-style: none;
  padding: 0;
  align-self: end;
  display: grid;
}

.order li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px 0;
  font-weight: 600;
  font-size: clamp(16px, 1.6vw, 22px);
  /* 0..1 of this exercise done, set by main.js. */
  --f: 0;
}

.order li span {
  color: var(--text-2);
}

.order li i {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: var(--hi);
  position: relative;
}

.order li i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  transform-origin: left;
  transform: scaleX(var(--f));
}

.done {
  align-self: end;
  justify-self: end;
  text-align: right;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.odo {
  display: flex;
  justify-content: flex-end;
  font-weight: 900;
  font-variation-settings: 'wdth' 110;
  font-size: clamp(88px, 14vw, 200px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.odo-digit {
  display: block;
  height: 1em;
  overflow: hidden;
}

.odo-digit i {
  display: block;
  font-style: normal;
  white-space: pre;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.done-note {
  color: var(--text-2);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.45;
  max-width: 30ch;
}

/* Coming next: the figure acts out each unbuilt feature while its copy steps through */
.next {
  height: 420vh;
}

.next-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding: 88px var(--gutter) 48px;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.next-figure {
  height: 100%;
  min-height: 0;
}

.next-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.next-copy {
  display: grid;
  gap: 14px;
}

.next-copy h2 {
  font-size: clamp(40px, 5.2vw, 80px);
}

.next-none {
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(16px, 1.3vw, 19px);
}

.steps {
  display: grid;
  margin-top: 18px;
}

.step {
  grid-area: 1 / 1;
  display: grid;
  align-content: start;
  gap: 14px;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.45s,
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.step.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.step h3 {
  font-size: clamp(26px, 2.8vw, 40px);
}

.step p {
  color: var(--text-2);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.45;
  max-width: 46ch;
}

/* The week's sets per muscle, each bar filling against the 10 to 20 band */
.volume {
  list-style: none;
  padding: 0;
  margin-top: 6px;
  display: grid;
  gap: 10px;
  max-width: 46ch;
  /* Bar scale: 26 sets across the full width. */
  --scale: 26;
}

.volume li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  font-weight: 600;
  font-size: 15px;
  /* 0..1 of this muscle's bar drawn, and the sets it reaches, set by main.js. */
  --f: 0;
  --sets: 0;
}

.volume li span {
  color: var(--text-2);
  font-weight: 500;
}

.volume li strong {
  color: var(--text);
  font-weight: 700;
}

.volume li i {
  grid-column: 1 / -1;
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--hi);
  overflow: hidden;
}

/* The research-backed band, 10 to 20 of the 26-set scale. */
.volume li i::before {
  content: '';
  position: absolute;
  inset: 0 calc(100% * (1 - 20 / var(--scale))) 0 calc(100% * 10 / var(--scale));
  background: var(--rule);
}

.volume li i::after {
  content: '';
  position: absolute;
  inset: 0;
  width: calc(100% * var(--sets) / var(--scale));
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--f));
  box-shadow: 0 0 10px var(--accent);
}

.volume li.is-off i::after {
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
}

.volume li em {
  grid-column: 1 / -1;
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  color: var(--secondary);
  opacity: 0;
  transition: opacity 0.3s;
}

.volume li.is-off.is-full em {
  opacity: 1;
}

/* Waitlist: the figure at the top of the lift, beside the sign-up */
.cta {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 12vh var(--gutter);
  max-width: 1280px;
  margin: 0 auto;
}

.cta-copy {
  display: grid;
  gap: 22px;
}

.cta h2 {
  font-size: clamp(56px, 7.5vw, 120px);
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.cta-canvas {
  width: 100%;
  height: min(76vh, 760px);
}

.waitlist {
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
  margin-top: 8px;
}

.waitlist label {
  font-weight: 600;
  font-size: 16px;
}

.field {
  display: flex;
  gap: 10px;
}

.waitlist input[type='email'] {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  outline: none;
  transition: border-color 0.15s;
}

.waitlist input[type='email']:focus {
  border-color: var(--text);
}

.waitlist button {
  height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s;
}

.waitlist button:hover {
  opacity: 0.85;
}

.botcheck {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.status {
  min-height: 1.5em;
  font-size: 16px;
  line-height: 1.5;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--gutter) 36px;
  color: var(--text-2);
  font-size: 15px;
}

@media (max-width: 900px) {
  .finish-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 24px;
  }
  .done {
    justify-self: start;
    justify-items: start;
    text-align: left;
  }
  .odo {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .lift {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    padding-top: 80px;
    padding-bottom: 28px;
  }
  .lift-rep {
    grid-column: 1;
    justify-self: start;
  }
  .lift-muscles {
    grid-column: 1;
    grid-row: 4;
    justify-self: stretch;
    width: 100%;
  }
  .lift-copy {
    grid-row: 5;
    font-size: 15px;
  }
  .adjust-stage {
    padding-top: 76px;
    gap: 16px;
  }
  .sets {
    font-size: 16px;
  }
  .sets th,
  .sets td:last-child em {
    font-size: 12px;
  }
  .bar {
    height: 110px;
  }
  .bar-end {
    width: 84px;
  }
  .p20 {
    height: 100px;
    width: 16px;
  }
  .p5 {
    height: 64px;
    width: 12px;
  }
  .collar {
    width: 8px;
    height: 24px;
  }
  .left .drop {
    transform: translateX(calc(var(--drop) * -90px));
  }
  .right .drop {
    transform: translateX(calc(var(--drop) * 90px));
  }
  .next-stage {
    grid-template-columns: 1fr;
    /* The figure takes whatever height the tallest step leaves. */
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding-top: 72px;
    padding-bottom: 16px;
  }
  .next-copy {
    gap: 8px;
  }
  .next-copy h2 {
    font-size: 34px;
  }
  .steps {
    margin-top: 8px;
  }
  .step {
    gap: 8px;
  }
  .step h3 {
    font-size: 22px;
  }
  .step p {
    font-size: 14px;
    line-height: 1.4;
  }
  .volume {
    gap: 6px;
  }
  .volume li {
    font-size: 14px;
  }
  .volume li i {
    height: 4px;
  }
  .volume li em {
    font-size: 13px;
  }
  .cta {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 0;
  }
  .cta-canvas {
    order: -1;
    height: 52vh;
  }
  .field {
    flex-direction: column;
  }
  .waitlist input[type='email'] {
    flex: none;
  }
  .footer {
    flex-wrap: wrap;
  }
}

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