:root {
  --bg: #0a0a0a;
  --panel: #151513;
  --panel-soft: #20201c;
  --text: #f5f0e0;
  --muted: #c4b9ad;
  --dim: #786f66;
  --charcoal: #2c2c2c;
  --red-deep: #8e1116;
  --red: #c01a1a;
  --red-hot: #f42a24;
  --orange: #e55a31;
  --purple: #f3c9ff;
  --line: rgba(255, 255, 255, 0.1);
  --line-red: rgba(192, 26, 26, 0.42);
  --line-purple: rgba(243, 201, 255, 0.24);
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 30%),
    radial-gradient(circle at 16% 86%, rgba(192, 26, 26, 0.18), transparent 28%),
    radial-gradient(circle at 86% 82%, rgba(243, 201, 255, 0.12), transparent 30%),
    linear-gradient(145deg, #0b0b0b 0%, #1f1f1b 56%, #0b0b0b 100%);
  isolation: isolate;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
}

.glow {
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(62px);
  opacity: 0.16;
}

.glow-red {
  left: -190px;
  bottom: 18%;
  background: var(--red);
}

.glow-amber {
  right: -220px;
  top: 8%;
  background: var(--orange);
}

.deck {
  position: relative;
  width: 100vw;
  height: 100svh;
}

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 76px 18px 116px;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition:
    opacity 240ms var(--ease),
    transform 240ms var(--ease);
}

.screen.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.screen.is-active .stage {
  animation: stageReveal 280ms var(--ease) both;
}

.screen.is-exiting-left {
  transform: translateX(-24px);
}

.stage {
  position: relative;
  z-index: 2;
  width: min(100%, 720px);
  min-width: 0;
  display: grid;
  gap: 20px;
}

.stage.with-card {
  width: min(100%, 980px);
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
  align-items: center;
  gap: 32px;
}

.center-stage,
.cover {
  text-align: center;
}

.stage.cover {
  width: min(100%, 960px);
}

.center-stage p,
.cover p {
  margin-left: auto;
  margin-right: auto;
}

.copy {
  display: grid;
  gap: 16px;
}

.photo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.42), rgba(10, 10, 10, 0.96) 78%, #0a0a0a),
    linear-gradient(90deg, rgba(10, 10, 10, 0.75), rgba(10, 10, 10, 0.58)),
    url("./assets/runner-hero.png") center / cover no-repeat;
  filter: saturate(0.72) contrast(1.12);
}

.kicker {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  font-family: "Barlow Condensed", "Arial Narrow", Inter, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.3rem, 9vw, 6.8rem);
  line-height: 0.86;
}

h2 {
  max-width: 760px;
  font-size: clamp(2.65rem, 6.4vw, 5.25rem);
  line-height: 0.9;
}

.cover h1 span {
  display: block;
}

.mobile-break {
  display: none;
}

.red {
  color: var(--red);
}

p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 2vw, 1.14rem);
  line-height: 1.62;
  overflow-wrap: break-word;
}

.macro-card,
.number-card,
.formula-card,
.meal-card,
.three-card,
.final-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(12, 12, 12, 0.78);
  box-shadow: var(--shadow);
}

.macro-card::before,
.number-card::before,
.formula-card::before,
.meal-card::before,
.three-card::before,
.final-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(243, 201, 255, 0.42), transparent);
  opacity: 0.7;
}

.screen.is-active .macro-card,
.screen.is-active .number-card,
.screen.is-active .formula-card,
.screen.is-active .meal-card,
.screen.is-active .three-card,
.screen.is-active .final-card {
  animation: cardSettle 320ms var(--ease) 80ms both;
}

.final-card {
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(243, 201, 255, 0.05),
    0 20px 80px rgba(243, 201, 255, 0.08);
}

.macro-card,
.number-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 240px;
  padding: 24px;
  border-color: var(--line-red);
  text-align: center;
}

.macro-card span,
.number-card small,
.formula-result small,
.meal-card span,
.three-card span {
  color: var(--dim);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.macro-card strong,
.number-card strong,
.formula-result strong {
  color: var(--red);
  font-family: "Barlow Condensed", "Arial Narrow", Inter, sans-serif;
  font-style: italic;
  font-weight: 800;
  line-height: 0.85;
  text-transform: uppercase;
}

.macro-card strong {
  font-size: clamp(6rem, 15vw, 9rem);
}

.number-card strong {
  font-size: clamp(4.2rem, 9vw, 6.2rem);
}

.macro-card small {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.formula-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-color: var(--line-red);
}

.formula-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: center;
}

.formula-row span,
.formula-row b {
  min-width: 0;
  min-height: 94px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(243, 201, 255, 0.05);
  font-family: "Barlow Condensed", "Arial Narrow", Inter, sans-serif;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.formula-row b {
  min-height: auto;
  border: 0;
  color: var(--red);
  background: transparent;
  box-shadow: none;
}

.formula-result {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(243, 201, 255, 0.05);
  text-align: center;
}

.formula-result strong {
  font-size: clamp(2.7rem, 8vw, 4.8rem);
}

.formula-result.danger strong,
.shock .formula-result strong {
  color: var(--red);
}

.formula-line {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: "Barlow Condensed", "Arial Narrow", Inter, sans-serif;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-style: italic;
  font-weight: 800;
}

.shock .formula-result strong {
  font-size: clamp(6rem, 17vw, 10rem);
}

.meal-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.meal-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 0 rgba(243, 201, 255, 0.05);
}

.meal-card strong {
  color: var(--text);
  font-family: "Barlow Condensed", "Arial Narrow", Inter, sans-serif;
  font-size: 2.2rem;
  font-style: italic;
}

.danger-screen {
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 42, 36, 0.16), transparent 34%),
    transparent;
}

.three-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-color: var(--line-red);
}

.three-card div {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 0 rgba(243, 201, 255, 0.05);
}

.three-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(135deg, var(--red), var(--orange));
}

.three-card strong {
  font-family: "Barlow Condensed", "Arial Narrow", Inter, sans-serif;
  font-size: 2.4rem;
  font-style: italic;
  line-height: 0.9;
  text-transform: uppercase;
}

.final-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-color: var(--line-red);
}

.final-screen .stage.with-card {
  grid-template-columns: 1fr;
  width: min(calc(100vw - 44px), 560px);
  max-width: min(calc(100vw - 44px), 560px);
  justify-self: center;
}

.final-screen .copy,
.final-screen .final-card {
  min-width: 0;
}

.final-screen p {
  max-width: 100%;
}

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

.tags span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-size: 0.82rem;
  font-weight: 900;
}

.tags span:nth-child(2),
.tags span:nth-child(4) {
  border-color: rgba(243, 201, 255, 0.22);
  color: var(--text);
}

.sales-button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 8px;
  color: var(--text);
  background: linear-gradient(100deg, var(--red), var(--orange) 72%, var(--purple));
  box-shadow:
    0 18px 42px rgba(192, 26, 26, 0.28),
    0 0 42px rgba(243, 201, 255, 0.1);
  font-size: 0.94rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition: transform 170ms var(--ease), background 170ms var(--ease);
}

.sales-button:hover {
  background: linear-gradient(100deg, var(--red-hot), var(--orange) 68%, var(--purple));
  transform: translateY(-2px);
}

.progress-track {
  position: fixed;
  z-index: 24;
  left: 50%;
  bottom: 92px;
  width: min(calc(100vw - 32px), 980px);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-50%);
}

.progress-track span {
  display: block;
  width: 5.26%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--red-deep) 0%,
    var(--red) 36%,
    var(--orange) 72%,
    var(--purple) 100%
  );
  background-size: 160% 100%;
  animation: progressGlow 4s ease-in-out infinite;
  transition: width 240ms var(--ease);
}

.controls {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: 20px;
  width: min(calc(100vw - 32px), 980px);
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  transform: translateX(-50%);
  transition:
    top 180ms var(--ease),
    bottom 180ms var(--ease),
    width 180ms var(--ease),
    transform 180ms var(--ease);
}

.nav-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 160ms var(--ease),
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    opacity 160ms var(--ease);
}

.nav-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.nav-button.primary {
  background: linear-gradient(100deg, var(--red), var(--red-hot) 58%, var(--orange));
  box-shadow: 0 18px 42px rgba(192, 26, 26, 0.24);
}

.nav-button.secondary {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.nav-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.nav-button:active:not(:disabled),
.sales-button:active {
  transform: translateY(0) scale(0.985);
}

.nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.nav-button:focus-visible,
.sales-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
}

.final-top-actions,
.whatsapp-button {
  display: none;
}

body.is-final-screen .final-top-actions {
  position: fixed;
  z-index: 35;
  top: 16px;
  left: max(12px, env(safe-area-inset-left));
  right: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  pointer-events: none;
}

.mini-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgba(10, 10, 10, 0.66);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 900;
  pointer-events: auto;
  transition:
    transform 160ms var(--ease),
    border-color 160ms var(--ease),
    background 160ms var(--ease);
}

.mini-button:hover {
  border-color: var(--line-purple);
  background: rgba(24, 24, 22, 0.78);
  transform: translateY(-1px);
}

.mini-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

body.is-final-screen .progress-track {
  bottom: 92px;
}

body.is-final-screen .controls {
  grid-template-columns: 1fr;
}

body.is-final-screen #nextButton {
  display: none;
}

body.is-final-screen .whatsapp-button {
  display: inline-flex;
}

body.is-final-screen #prevButton {
  display: none;
}

body.is-final-screen .whatsapp-button {
  min-height: 60px;
  font-size: 0.98rem;
  background: linear-gradient(100deg, var(--red), var(--orange) 68%, var(--purple));
  box-shadow:
    0 18px 42px rgba(192, 26, 26, 0.26),
    0 0 48px rgba(243, 201, 255, 0.12);
  animation: ctaBreath 3.4s ease-in-out infinite;
}

@keyframes progressGlow {
  0%,
  100% {
    background-position: 0% 50%;
    filter: saturate(1);
  }

  50% {
    background-position: 100% 50%;
    filter: saturate(1.22);
  }
}

@keyframes stageReveal {
  from {
    opacity: 0.82;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardSettle {
  from {
    opacity: 0.82;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ctaBreath {
  0%,
  100% {
    box-shadow:
      0 18px 42px rgba(192, 26, 26, 0.26),
      0 0 42px rgba(243, 201, 255, 0.1);
  }

  50% {
    box-shadow:
      0 20px 48px rgba(229, 90, 49, 0.28),
      0 0 58px rgba(243, 201, 255, 0.18);
  }
}

@media (max-width: 840px) {
  .screen {
    place-items: center;
    padding: 64px 16px 116px;
  }

  .stage,
  .stage.with-card {
    width: calc(100vw - 64px) !important;
    max-width: 360px !important;
    justify-self: center;
    grid-template-columns: 1fr;
    gap: 22px;
    text-align: left;
  }

  .cover,
  .center-stage {
    text-align: center;
  }

  .photo-bg {
    background:
      linear-gradient(180deg, rgba(10, 10, 10, 0.48), rgba(10, 10, 10, 0.96) 75%, #0a0a0a),
      url("./assets/runner-hero.png") 56% center / cover no-repeat;
  }

  h1 {
    font-size: clamp(2.72rem, 10.8vw, 3.35rem);
  }

  h2 {
    font-size: clamp(1.95rem, 7.3vw, 2.35rem);
    line-height: 0.94;
  }

  p {
    max-width: 34ch;
    font-size: 1.02rem;
    line-height: 1.58;
  }

  .cover p,
  .center-stage p {
    max-width: 31ch;
  }

  .cover h1 {
    max-width: 340px;
    margin-inline: auto;
    font-size: clamp(2.22rem, 9.2vw, 2.86rem);
  }

  .mobile-break {
    display: initial;
  }

  .cover p {
    max-width: 29ch;
  }

  .macro-card,
  .number-card {
    min-height: 190px;
  }

  .formula-row span {
    min-height: auto;
    border: 0;
    background: transparent;
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .formula-row b {
    min-height: auto;
    padding: 0;
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .shock .formula-result strong {
    font-size: 6.3rem;
  }

  .tags {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-track {
    left: 12px;
    right: 12px;
    bottom: 86px;
    width: auto;
    transform: none;
  }

  .controls {
    left: 12px;
    right: 12px;
    bottom: 16px;
    width: auto;
    grid-template-columns: 104px minmax(0, 1fr);
    transform: none;
  }

  body.is-final-screen .controls {
    bottom: 16px;
  }

  body.is-final-screen .progress-track {
    bottom: 86px;
  }

  body.is-final-screen .final-top-actions {
    top: 12px;
    left: max(12px, env(safe-area-inset-left));
    right: auto;
  }

  .final-screen .stage.with-card {
    width: calc(100vw - 72px) !important;
    max-width: 328px !important;
  }

  .final-screen p {
    max-width: 29ch;
  }
}

@media (max-width: 420px) {
  .screen {
    padding-inline: 14px;
  }

  h1 {
    font-size: 2.64rem;
  }

  .cover h1 {
    font-size: 2.22rem;
  }

  h2 {
    font-size: 2.34rem;
  }

  .kicker {
    font-size: 0.72rem;
  }

  .macro-card,
  .number-card,
  .formula-card,
  .meal-card,
  .three-card,
  .final-card {
    padding: 16px;
  }

  .macro-card strong {
    font-size: 5.6rem;
  }

  .number-card strong {
    font-size: 3.9rem;
  }

  .formula-result strong {
    font-size: 2.52rem;
  }

  .controls {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  body:not(.is-final-screen) .nav-button.secondary svg {
    display: none;
  }

  body.is-final-screen .whatsapp-button {
    min-height: 58px;
    padding-inline: 14px;
    font-size: 0.9rem;
  }
}

@media (max-height: 720px) {
  .screen {
    padding-top: 54px;
    padding-bottom: 104px;
  }

  .stage,
  .stage.with-card {
    gap: 14px;
  }

  h1 {
    font-size: 2.72rem;
  }

  h2 {
    font-size: 2.08rem;
  }

  p {
    line-height: 1.45;
  }

  .macro-card,
  .number-card {
    min-height: 156px;
  }

  .formula-row span {
    min-height: 58px;
  }

  .progress-track {
    bottom: 76px;
  }

  .controls {
    bottom: 10px;
  }

  .nav-button {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .progress-track span,
  body.is-final-screen .whatsapp-button {
    animation: none;
  }
}
