/* GramRep homepage. The app's own language (PaletteValues.swift): Apple's system type, graphite and white for
   the accent, the Health macro colours, flat surfaces, 16 px radius, hairlines and a dark capsule button.
   Light and dark follow prefers-color-scheme; motion follows prefers-reduced-motion. */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --bg-tint: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #515156;
  --text-3: #636366;
  --hairline: #d1d1d6;
  --fill: #e8e8ed;
  --accent: #2c2c2e;
  --on-accent: #ffffff;
  --protein: #c43a63;
  --carbs: #0071e3;
  --fat: #9c4fb0;
  --success: #007b83;
  --error: #be3433;
  --bezel: #1d1d1f;
  --radius: 16px;
  --radius-small: 12px;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --space: clamp(72px, 11vw, 144px);
  --font:
    system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-display:
    system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-rounded:
    ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-tint: #0d0d0e;
    --surface: #1c1c1e;
    --surface-raised: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #aeaeb2;
    --text-3: #98989d;
    --hairline: #38383a;
    --fill: #2c2c2e;
    --accent: #ffffff;
    --on-accent: #000000;
    --protein: #ff7a9c;
    --carbs: #2997ff;
    --fat: #edb7ff;
    --success: #43d5dc;
    --error: #ff5e4d;
    --bezel: #3a3a3c;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--carbs);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.wrap--narrow {
  --wrap: 760px;
}

/* Type */

.caps {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
}

.caps--protein {
  color: var(--protein);
}

.display {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7.4vw, 5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.display__quiet {
  color: var(--text-3);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2.125rem, 5.6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 20px;
}

.lead {
  font-size: clamp(1.1875rem, 2.2vw, 1.4375rem);
  line-height: 1.4;
  color: var(--text-2);
  max-width: 34em;
  text-wrap: pretty;
}

.num {
  font-family: var(--font-rounded);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 6px;
}

.fineprint {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 20px;
}

/* Buttons and fields */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1.0625rem/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.button:hover {
  opacity: 0.88;
}

.button:active {
  transform: scale(0.97);
}

.button[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.button--small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.9375rem;
}

.button--quiet {
  background: var(--fill);
  color: var(--text);
  min-height: 40px;
  font-size: 0.9375rem;
}

.field {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 400 1.0625rem/1 var(--font);
}

.field::placeholder {
  color: var(--text-3);
}

.field[aria-invalid='true'] {
  border-color: var(--error);
}

/* Nav */

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}

.skip:focus {
  top: 12px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}

.brand img,
.footer__brand img,
.cta img {
  box-shadow: 0 0 0 1px var(--hairline);
}

.brand img {
  border-radius: 7px;
}

.nav__links {
  display: flex;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.nav__links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav__links a:hover {
  color: var(--text);
  background: var(--fill);
}

@media (max-width: 719px) {
  .nav__links {
    display: none;
  }
}

/* Hero */

.hero {
  padding-block: clamp(48px, 8vw, 112px) clamp(56px, 9vw, 128px);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(48px, 7vw, 72px);
  align-items: center;
}

.hero__copy .lead {
  margin-top: 24px;
}

.hero__phones {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 0;
}

.hero__phones .phone {
  width: min(56vw, 300px);
}

.phone--back {
  transform: translateX(18%) rotate(4deg) translateY(4%);
  opacity: 0.98;
}

.phone--front {
  margin-left: -26%;
  transform: translateX(-12%) rotate(-3deg);
  z-index: 1;
}

@media (min-width: 960px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
}

/* The phone frame: a bezel around the store screenshot, the island drawn on top. */

.phone {
  position: relative;
  width: min(100%, 300px);
  margin-inline: auto;
  padding: 2.6%;
  border-radius: 15% / 6.9%;
  background: var(--bezel);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hairline) 60%, transparent),
    0 30px 60px -30px rgb(0 0 0 / 0.35);
}

.phone img {
  width: 100%;
  border-radius: 13% / 6%;
  background: var(--surface);
}

.phone::after {
  content: '';
  position: absolute;
  top: 3.9%;
  left: 50%;
  width: 29%;
  height: 3.4%;
  translate: -50% 0;
  border-radius: 999px;
  background: #000;
}

/* Waitlist form */

.waitlist {
  margin-top: 32px;
  max-width: 520px;
}

.cta .waitlist {
  margin-inline: auto;
}

.waitlist__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.waitlist__row .button {
  flex: 0 0 auto;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 0.9375rem;
  color: var(--text-2);
  text-align: left;
}

.consent input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.waitlist__status {
  min-height: 1.5em;
  margin-top: 12px;
  font-weight: 600;
  text-align: left;
}

.waitlist__status[data-tone='ok'] {
  color: var(--success);
}

.waitlist__status[data-tone='error'] {
  color: var(--error);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The numbers band under the hero: every figure is a fact (site/content/facts.json). */

.stats {
  border-block: 1px solid var(--hairline);
  background: var(--bg-tint);
}

.stats__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 16px;
  margin-block: 0;
  padding-block: 40px;
}

@media (min-width: 860px) {
  .stats__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stats__list div {
  display: flex;
  flex-direction: column-reverse;
  /* In a reversed column this is the top: the figures share one baseline row whatever their labels wrap to. */
  justify-content: flex-end;
  gap: 4px;
}

.stats__list dd {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stats__list dt {
  font-size: 0.9375rem;
  color: var(--text-2);
}

/* Sections */

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

/* Every other section after the hero is the lighter surface, whichever sections the flags let through. */
main > .section:nth-of-type(even) {
  background: var(--bg-tint);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(48px, 7vw, 96px);
  align-items: center;
}

.split .phone {
  width: min(70vw, 300px);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }

  .split--reverse .split__copy {
    order: 2;
  }
}

.split__copy > p:not(.caps, .lead) {
  margin-top: 20px;
  color: var(--text-2);
  max-width: 34em;
}

.panels {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 560px) {
  .panels {
    grid-template-columns: 1fr 1fr;
  }
}

.panel,
.card,
.plan {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

main > .section:nth-of-type(even) .panel,
main > .section:nth-of-type(even) .card {
  background: var(--surface-raised);
  border-color: transparent;
}

.panel p:last-child,
.card p:last-child {
  color: var(--text-2);
}

.ticks {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
  max-width: 34em;
}

.ticks li {
  position: relative;
  padding-left: 30px;
  font-size: 1.125rem;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.35em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3E%3Cpath d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm3.6 5.6-4.2 5a.8.8 0 0 1-1.2 0l-2-2.2 1.1-1.1 1.5 1.5 3.6-4.2 1.2 1Z"/%3E%3C/svg%3E')
    center / contain no-repeat;
}

.cards {
  display: grid;
  gap: 12px;
  margin-top: 40px;
  padding: 0;
  list-style: none;
}

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

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

.cards--new {
  margin-top: 28px;
}

/* 3D clips */

.demos__controls {
  margin-top: 28px;
}

.clips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

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

.clip figure {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: #fdfdfd;
}

.clip video {
  /* The renders put bars, plates and frames right at their own edges: the whole frame, inset on the same white,
     so nothing touches the tile's border or its rounded corners. */
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 676 / 520;
  padding: 7% 8% 5%;
  object-fit: contain;
  /* The renders' own ground (#fdfdfd, sampled from the posters), so the inset leaves no visible edge. */
  background: #fdfdfd;
}

.clip figcaption {
  padding: 10px 14px 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1d1d1f;
  background: #ffffff;
  border-top: 1px solid #e8e8ed;
}

/* Pricing */

.plans {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 760px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan--pro {
  border: 2px solid var(--accent);
}

.price {
  margin: 10px 0 4px;
  color: var(--text-2);
}

.price .num {
  font-size: 2.75rem;
  margin-right: 4px;
}

.prices {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}

.prices .num {
  font-size: 1.75rem;
  margin-right: 4px;
}

.price-alt {
  color: var(--text-2);
  margin-bottom: 16px;
}

/* FAQ */

.faq {
  margin-top: 24px;
  border-top: 1px solid var(--hairline);
}

.faq__item {
  border-bottom: 1px solid var(--hairline);
}

.faq__item summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  font-size: 1.1875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq__item summary::after {
  content: '+';
  flex: 0 0 auto;
  font: 400 1.5rem/1 var(--font-rounded);
  color: var(--text-2);
  transition: rotate 0.2s ease;
}

.faq__item[open] summary::after {
  rotate: 45deg;
}

.faq__item p {
  padding-bottom: 24px;
  color: var(--text-2);
  max-width: 40em;
}

/* Closing call to action */

.section--cta {
  text-align: center;
}

.cta img {
  margin: 0 auto 28px;
  border-radius: 16px;
}

.cta .lead {
  margin-inline: auto;
}

/* Footer */

.footer {
  padding-block: 48px 64px;
  border-top: 1px solid var(--hairline);
  font-size: 0.9375rem;
  color: var(--text-2);
}

.footer__inner {
  display: grid;
  gap: 28px;
}

@media (min-width: 760px) {
  .footer__inner {
    grid-template-columns: 1fr auto;
  }

  .footer__legal {
    grid-column: 1 / -1;
  }
}

.footer__brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer__brand img {
  border-radius: 8px;
}

.footer__brand strong {
  color: var(--text);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 0;
  list-style: none;
}

.footer__links a {
  display: inline-block;
  padding-block: 8px;
}

.footer__legal {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-3);
}

.notfound {
  padding-block: var(--space);
  min-height: 60vh;
}

.notfound .lead {
  margin: 20px 0 32px;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
