/*
 * Pace — pace.products.ripeseed.io
 *
 * The palette and the typeface are the app's own, taken from
 * pace/src/theme/tokens.ts and pace/src/theme/fonts.ts, so the site and the
 * product do not look like two different things. Both themes are here because
 * the app ships both and follows the system setting; this does the same.
 */

/*
 * Light only, on purpose.
 *
 * The app ships both themes and follows the system setting, and this site used
 * to do the same — which meant half of everyone arriving saw a black page with
 * one green accent on it. That is not what Pace looks like. Its own default is
 * the cream and white below, and violet is the colour it already uses for
 * emphasis: the overtime state, and the delta against a target. So the site
 * leads with white and violet, and keeps lime for the brand marks.
 *
 * Every value here is the app's, from pace/src/theme/tokens.ts.
 */
:root {
  --bg: #f4f4ef;
  --surface: #ffffff;
  --raised: #eaeae3;
  --text: #121210;
  --text-dim: #5d5d55;
  --faint: #8e8e83;
  --border: #e2e2da;

  /* Lime: the brand accent. Sparing, so it still reads as an accent. */
  --accent: #c8f25a;
  --on-accent: #121210;

  /* Violet: the app's own emphasis colour, and the interface colour here. */
  --violet: #6b53e6;
  --violet-deep: #5b45d0;
  --violet-soft: #f3f1fa;
  --violet-line: #ddd7f5;

  --measure: 68ch;
  --radius: 18px;
  --radius-lg: 28px;
  --gutter: clamp(20px, 5vw, 48px);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Sofia Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── shell ──────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/*
 * The measure is applied to the children, not to the container.
 *
 * Constraining `.wrap.prose` itself shrinks the wrap, and its auto margins then
 * centre the whole column — so a prose section started 120px further right than
 * the heading of the section above it, which reads as a mistake. This keeps the
 * text at a readable width while its left edge stays on the same line as
 * everything else on the page.
 */
.prose > * {
  max-width: var(--measure);
}

/* ── header ─────────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 26px);
  flex-wrap: wrap;
}

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

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

.nav a[aria-current='page'] {
  color: var(--text);
}

/* ── type ───────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
}

h1 {
  font-family: 'Sofia Sans Extra Condensed', 'Sofia Sans', sans-serif;
  font-weight: 900;
  font-size: clamp(44px, 9vw, 86px);
  text-transform: uppercase;
}

h2 {
  font-weight: 800;
  font-size: clamp(26px, 4vw, 36px);
  margin-top: 1.8em;
}

h3 {
  font-weight: 700;
  font-size: 20px;
  margin-top: 2em;
}

p,
li {
  color: var(--text-dim);
}

.prose p,
.prose li {
  margin-block: 0.85em;
}

.lede {
  font-size: clamp(19px, 2.3vw, 23px);
  color: var(--text-dim);
  max-width: 46ch;
}

a {
  color: var(--violet-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.eyebrow {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 14px;
}

/* ── sections ───────────────────────────────────────────────────────────── */

section {
  padding-block: clamp(48px, 9vw, 96px);
}

.hero {
  padding-block: clamp(56px, 11vw, 120px) clamp(32px, 6vw, 64px);
}

/* ── cards ──────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  margin-top: 36px;
}

/*
 * Four steps, so the widths are chosen to land on 4 or 2 columns and never 3.
 * auto-fit alone gives three across at desktop and leaves the fourth card
 * stranded on its own row, which reads as a mistake rather than a layout.
 */
@media (min-width: 560px) and (max-width: 979px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.card h3 {
  margin-top: 0;
  color: var(--text);
}

.card p:last-child {
  margin-bottom: 0;
}

.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-n {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--violet);
  color: #ffffff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 15px;
}

/* ── device frames ──────────────────────────────────────────────────────── */

/*
 * A phone drawn in CSS around a real screenshot, rather than a screenshot
 * pasted flat on the page.
 *
 * The frame is CSS because a rasterised mockup would need its own retina
 * variants and would still soften on a display it was not cut for; a border,
 * a radius and a shadow stay sharp at any density and cost nothing to ship.
 * The screenshots inside are exported at the width they actually render at,
 * doubled, which is the part that was wrong before.
 */
.device {
  position: relative;
  padding: 11px;
  border-radius: 46px;
  background: linear-gradient(155deg, #43433d 0%, #161614 38%, #2c2c27 72%, #4a4a43 100%);
  box-shadow:
    0 42px 80px -24px rgba(0, 0, 0, 0.6),
    0 6px 18px -8px rgba(0, 0, 0, 0.4);
}

.device::after {
  /* The glass edge. Without it the screen meets the frame too flatly. */
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 36px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 36px;
}

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero-grid {
  display: grid;
  gap: clamp(30px, 5vw, 52px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.04fr 0.96fr;
  }
}

/*
 * The phone is deliberately cut off. It is tilted, scaled past the edge of its
 * box and clipped, so it reads as a photograph of a device rather than a
 * rectangle sitting on a page — and the crop puts the chart, which is the thing
 * worth looking at, in the middle of what survives.
 */
.hero-art {
  position: relative;
  height: clamp(330px, 42vw, 470px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: radial-gradient(
    120% 95% at 32% 8%,
    color-mix(in srgb, var(--violet) 20%, transparent),
    color-mix(in srgb, var(--accent) 12%, transparent) 46%,
    transparent 72%
  );
}

/*
 * Pulled up above its own box so the window lands on the middle of the phone.
 * The chart is roughly half way down the history screen, and anchoring to the
 * top of the device would frame the status bar instead of the thing worth
 * showing.
 */
.hero-art .device {
  position: absolute;
  width: 86%;
  left: 7%;
  top: -13%;
  transform: rotate(-9deg);
}

@media (max-width: 899px) {
  .hero-art .device {
    width: 68%;
    left: 16%;
    top: -8%;
  }
}

/* ── feature rows ───────────────────────────────────────────────────────── */

.feature {
  display: grid;
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
  margin-top: clamp(40px, 7vw, 76px);
}

@media (min-width: 860px) {
  .feature {
    grid-template-columns: 1fr 1fr;
  }
  /* The second row puts the phone on the left, so the page does not read as a
     column of identical blocks. */
  .feature--flip .feature-art {
    order: -1;
  }
}

.feature-art {
  display: flex;
  justify-content: center;
}

.feature-art .device {
  width: min(280px, 78%);
}

.feature h3 {
  margin-top: 0;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text);
}

.feature-note {
  font-size: 14px;
  color: var(--faint);
  margin-top: 18px;
}

/* ── screenshots ────────────────────────────────────────────────────────── */

/* Six screenshots, sized to fall into 3 + 3 or 2 + 2 + 2 rather than 4 + 2. */
.shots {
  display: grid;
  gap: clamp(18px, 4vw, 34px);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 40px;
}

.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.shot figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--faint);
  text-align: center;
}

/* ── callout ────────────────────────────────────────────────────────────── */

.callout {
  background: var(--violet-soft);
  border: 1px solid var(--violet-line);
  border-left: 3px solid var(--violet);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-block: 28px;
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ── plans ──────────────────────────────────────────────────────────────── */

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 32px;
}

/* Four tiers: 4 across at desktop, 2 + 2 at tablet, never 3 + 1. */
@media (min-width: 520px) and (max-width: 919px) {
  .plans {
    grid-template-columns: repeat(2, 1fr);
  }
}

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Free is a real tier, not an absence of one, so it gets a card beside the
   others — distinguished by a dashed edge rather than by being left out. */
.plan--free {
  background: var(--violet-soft);
  border-color: var(--violet-line);
  border-style: dashed;
}

.plan--free .plan-price {
  color: var(--violet-deep);
}

.plan.is-featured {
  background: var(--accent);
  border-color: transparent;
}

.plan.is-featured .plan-name,
.plan.is-featured .plan-price {
  color: var(--on-accent);
}

.plan.is-featured .plan-note {
  color: #3b4714;
}

.plan-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.plan-price {
  font-family: 'Sofia Sans Extra Condensed', 'Sofia Sans', sans-serif;
  font-weight: 900;
  font-size: 46px;
  line-height: 1.1;
  margin-block: 6px;
  color: var(--text);
}

.plan-note {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}

/* ── tables ─────────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  margin-block: 26px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-dim);
}

th {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

/* ── faq ────────────────────────────────────────────────────────────────── */

details {
  border-bottom: 1px solid var(--border);
  padding-block: 6px;
}

summary {
  cursor: pointer;
  padding-block: 16px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

summary::after {
  content: '+';
  color: var(--faint);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
}

details[open] summary::after {
  content: '–';
}

details > :not(summary) {
  margin-top: 0;
  padding-bottom: 14px;
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--border);
  padding-block: 40px 56px;
  margin-top: clamp(48px, 8vw, 96px);
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  justify-content: space-between;
  align-items: baseline;
}

.site-foot p,
.site-foot a {
  font-size: 14px;
  margin: 0;
}

.foot-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.site-foot a {
  color: var(--text-dim);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--text);
}

/* ── utility ────────────────────────────────────────────────────────────── */

.updated {
  color: var(--faint);
  font-size: 14px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  background: var(--violet);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}
