/* Home page. Same tokens as page.css and the app's design system. */
:root {
  --color-surface: #141210;
  --color-surface-200: #211e19;
  --color-surface-300: #2e2a23;
  --color-ink: #fdf0dc;
  --color-ink-muted: #b8ac9a;
  --color-line: #fdf0dc;
  --color-yellow: #f7d55a;
  --color-pink: #f09ab8;
  --color-blue: #a9d8f5;
  --color-green: #b9eebb;
  --color-orange: #ffa94d;
  --color-on-accent: #141210;

  --font-display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --font-sans: "Space Grotesk", system-ui, sans-serif;

  --border-thick: 3px;
  --border-thin: 2px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 2px 2px 0 0 var(--color-line);
  --shadow-md: 4px 4px 0 0 var(--color-line);
  --shadow-lg: 6px 6px 0 0 var(--color-line);

  --text-hero: clamp(2.75rem, 1.6rem + 5.2vw, 5.5rem);
  --text-section: clamp(1.75rem, 1.2rem + 2.4vw, 3rem);
  --space-section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --page-max: 72rem;

  --duration-fast: 150ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  /* A faint grain so the dark ground has some texture. */
  background-image: radial-gradient(rgba(253, 240, 220, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: var(--border-thick) solid var(--color-pink);
  outline-offset: 4px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .wrap {
    padding: 0 32px;
  }
}

/* ---------- Top bar ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: 16px;
}

.top .home {
  line-height: 0;
}

.top .home svg {
  width: 104px;
  height: auto;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top nav a {
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.top nav a.quiet {
  display: none;
  color: var(--color-ink-muted);
}

@media (min-width: 640px) {
  .top nav a.quiet {
    display: inline;
  }
}

.top nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-yellow);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-md);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: var(--color-ink);
}

.btn.small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.btn.small:hover {
  box-shadow: var(--shadow-md);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.fine {
  margin: 14px 0 0;
  color: var(--color-ink-muted);
  font-size: 14px;
}

/* ---------- Shared type ---------- */

.label {
  display: inline-block;
  padding: 4px 10px;
  border: var(--border-thin) solid var(--color-line);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section {
  padding-top: var(--space-section);
}

.section-title {
  margin: 16px 0 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: var(--text-section);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-lede {
  margin: 20px 0 0;
  max-width: 40rem;
  color: var(--color-ink-muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.5;
}

.section-lede strong {
  color: var(--color-ink);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: 56px;
  align-items: center;
  padding-top: clamp(2rem, 1rem + 4vw, 5rem);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.15fr 1fr;
    gap: 48px;
  }
}

.hero .label {
  color: var(--color-green);
  border-color: var(--color-green);
}

.hero h1 {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: var(--text-hero);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero h1 .tilt {
  display: inline-block;
  margin-top: 6px;
  padding: 0 0.18em 0.04em;
  border-radius: 10px;
  background: var(--color-pink);
  color: var(--color-on-accent);
  transform: rotate(-2.5deg);
}

.hero .sub {
  margin: 28px 0 32px;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.45;
  color: var(--color-ink-muted);
}

.hero .sub strong {
  color: var(--color-ink);
}

/* ---------- Phone mock ---------- */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px 0 24px;
}

.phone {
  position: relative;
  width: min(340px, 82vw);
  padding: 14px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: 44px;
  background: var(--color-surface);
  box-shadow: 10px 10px 0 0 var(--color-pink);
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 14px 16px;
  border-radius: 32px;
  background: var(--color-surface-200);
}

.screen-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.progress {
  height: 8px;
  border: var(--border-thin) solid var(--color-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 58%;
  height: 100%;
  background: var(--color-green);
}

.ex-name {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
}

.ex-meta {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.sets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 9px;
  border: var(--border-thin) solid var(--color-line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  background: var(--color-surface-300);
}

.chip.done {
  background: var(--color-green);
  color: var(--color-on-accent);
}

.chip.now {
  background: var(--color-yellow);
  color: var(--color-on-accent);
}

.note {
  position: relative;
  padding: 14px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-blue);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  line-height: 1.4;
}

.note-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-head .dot {
  width: 10px;
  height: 10px;
  border: var(--border-thin) solid var(--color-on-accent);
  border-radius: 50%;
  background: var(--color-pink);
}

.note p {
  margin: 0;
}

.next {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.target {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface-300);
}

.target b {
  font-family: var(--font-display);
  font-size: clamp(24px, 7vw, 30px);
  font-weight: 400;
  line-height: 1;
}

.target small {
  color: var(--color-ink-muted);
  font-size: 12px;
}

.log-btn {
  padding: 14px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-yellow);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rest {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border: var(--border-thin) solid var(--color-line);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-pink) 62%, #a76d81 62%);
  color: var(--color-on-accent);
  font-size: 13px;
  font-weight: 700;
}

/* Floating stickers around the phone. */
.sticker {
  position: absolute;
  padding: 8px 12px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-md);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.sticker.pr {
  top: 11%;
  right: max(-4px, calc(50% - 230px));
  background: var(--color-yellow);
  transform: rotate(6deg);
}

.sticker.streak {
  bottom: 9%;
  left: max(-4px, calc(50% - 232px));
  background: var(--color-green);
  transform: rotate(-5deg);
}

@media (prefers-reduced-motion: no-preference) {
  .note {
    animation: pin 900ms var(--ease-out) 300ms both;
  }

  @keyframes pin {
    from {
      opacity: 0;
      transform: translateY(-14px) rotate(-3deg);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ---------- How it works ---------- */

.loop {
  display: grid;
  gap: 20px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .loop {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .loop {
    grid-template-columns: repeat(4, 1fr);
  }

  /* A staircase, so the eye follows the loop down to the gym. */
  .loop li:nth-child(2) { margin-top: 32px; }
  .loop li:nth-child(3) { margin-top: 64px; }
  .loop li:nth-child(4) { margin-top: 96px; }
}

.loop li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-md);
}

.loop li:nth-child(1) { --card: var(--color-blue); }
.loop li:nth-child(2) { --card: var(--color-green); }
.loop li:nth-child(3) { --card: var(--color-yellow); }
.loop li:nth-child(4) { --card: var(--color-pink); }

.loop .n {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
}

.loop h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.loop p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Already pay ---------- */

.pay {
  display: grid;
  gap: 40px;
}

@media (min-width: 960px) {
  .pay {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.points {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.points li {
  padding: 22px 24px;
}

.points li + li {
  border-top: var(--border-thick) solid var(--color-line);
}

.points h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-yellow);
}

.points p {
  margin: 0;
  color: var(--color-ink-muted);
  line-height: 1.5;
}

/* ---------- Bento ---------- */

.bento {
  display: grid;
  gap: 16px;
  margin-top: 48px;
}

@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
  }

  .tile.wide { grid-column: span 4; }
  .tile.mid { grid-column: span 3; }
  .tile.slim { grid-column: span 2; }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface-200);
}

.tile.fill {
  background: var(--card);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-md);
}

.tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
}

.tile p {
  margin: 0;
  line-height: 1.5;
  color: var(--color-ink-muted);
}

.tile.fill p {
  color: var(--color-on-accent);
}

.tile .big {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  line-height: 1;
}

.prefill {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.prefill .chip {
  font-size: 14px;
  padding: 8px 12px;
  background: var(--color-surface);
  color: var(--color-ink);
}

.prefill .chip.done {
  background: var(--color-surface);
  color: var(--color-green);
  border-color: var(--color-green);
}

.body-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.body-map span {
  height: 28px;
  border: var(--border-thin) solid var(--color-line);
  border-radius: 6px;
  background: var(--heat, var(--color-surface-300));
}

.week {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.week span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--border-thick) solid var(--color-on-accent);
  border-radius: 50%;
  background: var(--color-ink);
  font-weight: 700;
}

.week span.hit {
  background: var(--color-on-accent);
  color: var(--color-pink);
}

.week b {
  align-self: center;
  margin-left: 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
}

/* ---------- Setup ---------- */

.setup {
  display: grid;
  gap: 20px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 900px) {
  .setup {
    grid-template-columns: repeat(3, 1fr);
  }
}

.setup li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  counter-increment: step;
}

.setup li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-on-accent);
  font-family: var(--font-display);
  font-size: 20px;
}

.setup h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.setup p {
  margin: 0;
  color: var(--color-ink-muted);
  line-height: 1.5;
}

.prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 10px 10px 10px 16px;
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface-200);
  font-weight: 700;
}

.copy {
  min-height: 40px;
  padding: 0 14px;
  border: var(--border-thin) solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-pink);
  color: var(--color-on-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.copy:active {
  transform: translate(2px, 2px);
}

/* ---------- Founder ---------- */

.founder {
  position: relative;
  max-width: 46rem;
  padding: clamp(24px, 4vw, 44px);
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-ink);
  color: var(--color-on-accent);
  box-shadow: 8px 8px 0 0 var(--color-blue);
  transform: rotate(-0.8deg);
}

.founder p {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.55;
}

.founder .sign {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.founder a {
  color: var(--color-on-accent);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 12px;
  margin-top: 40px;
  max-width: 48rem;
}

.faq details {
  border: var(--border-thick) solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.faq details[open] {
  box-shadow: var(--shadow-md);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  color: var(--color-yellow);
}

.faq details[open] summary::after {
  content: "–";
}

.faq .a {
  padding: 0 20px 20px;
  color: var(--color-ink-muted);
  line-height: 1.6;
}

.faq .a p {
  margin: 0 0 10px;
}

.faq .a p:last-child {
  margin: 0;
}

.faq a {
  color: var(--color-blue);
}

/* ---------- Closing ---------- */

.closing {
  display: grid;
  justify-items: center;
  gap: 24px;
  padding: var(--space-section) 0;
  text-align: center;
}

.closing .section-title {
  max-width: 16ch;
  margin: 0 auto;
}

/* ---------- Footer ---------- */

footer {
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: var(--border-thick) solid var(--color-surface-300);
  text-align: center;
  font-size: 12px;
  color: var(--color-ink-muted);
}

footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 8px;
}

footer a {
  display: inline-block;
  padding: 8px 4px;
  color: var(--color-ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }
}
