/*
 * Prepi — marketing site
 * ======================
 * Three static pages: a landing page, terms, privacy. No build step and no
 * dependencies, so it drops onto Netlify, Vercel, GitHub Pages or any bucket
 * as-is — which is all the App Store submission needs it to be.
 *
 * The palette and type are lifted from the app itself so the site and the
 * product read as one thing.
 */

:root {
  --brand: #00823e;
  --protein: #4ac777;
  --carbs: #f4be4f;
  --fat: #f87962;
  --cream: #fdfaf1;
  --ink: #1f1a13;
  --ink-muted: #6d685f;
  --border: #e3ded1;
  --display: "Fraunces", Georgia, serif;
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, var(--cream) 55%);
  min-height: 100vh;
}

a {
  color: inherit;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

/* ------------------------------------------------------------- landing */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  min-height: min(78vh, 720px);
  padding-top: 8px;
}

@media (max-width: 780px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    text-align: center;
    min-height: 0;
  }
  .hero .card {
    margin: 0 auto;
    max-width: 280px;
  }
  .stores {
    justify-content: center;
  }
}

.mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
}

.lede {
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 46ch;
}

@media (max-width: 780px) {
  .lede {
    margin-inline: auto;
  }
}

/* --------------------------------------------------- the shareable card */

/*
 * The app's "rail" plate card, rebuilt in CSS. In the product this is drawn on
 * a 1080x1920 canvas and handed to the share sheet; here it is the hero, at the
 * same 9:16 so what the site shows is the thing people actually post.
 */
.card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  overflow: hidden;
  background: #111;
  box-shadow:
    0 1px 2px rgba(31, 26, 19, 0.14),
    0 12px 28px -8px rgba(31, 26, 19, 0.22),
    0 40px 80px -32px rgba(31, 26, 19, 0.3);
}

.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The scrim is what makes white type legible over any photograph. */
.card .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 9, 5, 0.92) 12%, rgba(4, 9, 5, 0.45) 38%, transparent 62%);
}

.card .body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 22px 20px;
  color: #fff;
}

.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e0e6ff;
  color: #4c4db5;
}

.card h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.1;
  margin: 10px 0 0;
}

.macros {
  display: grid;
  grid-template-columns: 1.22fr 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.macros .bar {
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

.macros .v {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  line-height: 1;
  margin-top: 9px;
}

.macros .k {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-top: 5px;
}

.card .sign {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  margin-top: 16px;
  opacity: 0.95;
}

/* ------------------------------------------------------- store buttons */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px 11px 17px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  line-height: 1.15;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.store:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.store small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.02em;
  opacity: 0.82;
}

.store strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- foot */

footer {
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

footer .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 24px 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}

footer a {
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
}

footer a:hover {
  text-decoration: underline;
}

footer .spacer {
  margin-left: auto;
}

@media (max-width: 780px) {
  footer .inner {
    justify-content: center;
    text-align: center;
  }
  footer .spacer {
    margin-left: 0;
    width: 100%;
  }
}

/* --------------------------------------------------------- legal pages */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.back {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-muted);
}

.doc h1 {
  font-size: clamp(30px, 5vw, 42px);
  margin-top: 20px;
}

.doc .updated {
  color: var(--ink-muted);
  font-size: 13px;
  margin-top: 10px;
}

.doc h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  margin: 38px 0 0;
  scroll-margin-top: 84px;
}

.doc h3 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 15.5px;
  margin: 22px 0 0;
}

.doc p,
.doc li {
  font-size: 15.5px;
  line-height: 1.65;
  color: #3a352c;
}

.doc p {
  margin: 12px 0 0;
}

.doc ul {
  padding-left: 20px;
  margin: 10px 0 0;
}

.doc li {
  margin-top: 7px;
}

.doc a {
  color: var(--brand);
  text-underline-offset: 2px;
}

.doc .lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

/* At-a-glance summary that opens the privacy page. */
.doc .summary {
  margin: 22px 0 0;
  padding: 4px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffdf6;
}

.doc .summary h2 {
  font-size: 16px;
  margin-top: 16px;
}

.doc .summary ul {
  margin-top: 10px;
}

/* Sub-processor / data table. */
.doc .table-wrap {
  overflow-x: auto;
  margin: 14px 0 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.doc th,
.doc td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: #3a352c;
  line-height: 1.5;
}

.doc thead th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: #fdfaf1;
}

.doc tbody tr:last-child td {
  border-bottom: none;
}

.doc .contact-box {
  margin: 20px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdf6;
}

.doc .contact-box p {
  margin-top: 4px;
}

.note {
  border: 1px dashed var(--border);
  background: #fffdf6;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-top: 26px;
}

/* ================================================================== nav
 * One bar across every page — landing, privacy, terms — so the three
 * read as tabs of one site rather than three separate documents.
 */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 250, 241, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--ink);
}

.nav .brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.nav .links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.nav .links a {
  text-decoration: none;
  color: var(--ink-muted);
  padding: 8px 12px;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav .links a:hover {
  color: var(--ink);
  background: rgba(31, 26, 19, 0.05);
}

.nav .links a[aria-current="page"] {
  color: var(--brand);
}

.nav .links .cta {
  background: var(--ink);
  color: var(--cream);
}

.nav .links .cta:hover {
  background: #000;
  color: var(--cream);
}

@media (max-width: 560px) {
  .nav .links .hide-sm {
    display: none;
  }
  .nav .inner {
    padding: 12px 18px;
  }
}

/* ============================================================= demo walk
 * A scrollable "someone using the app": four real screens in a phone
 * frame, each with a line on what that screen is for. Rows alternate
 * side on desktop and stack phone-first on mobile.
 */

.demo {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(60% 40% at 12% 0%, rgba(0, 130, 62, 0.06), transparent 70%),
    radial-gradient(50% 40% at 100% 30%, rgba(244, 190, 79, 0.08), transparent 70%);
}

.demo-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 24px 24px;
}

.demo-eyebrow {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.demo-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 10px 0 0;
  max-width: 18ch;
}

.demo-row {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 40px 64px;
  align-items: center;
  padding: 64px 0;
}

.demo-row + .demo-row {
  border-top: 1px solid var(--border);
}

/* Even rows mirror: phone moves to the right, copy takes the left. */
.demo-row:nth-of-type(even) {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.demo-row:nth-of-type(even) .phone-col {
  order: 2;
}

.demo-copy .step {
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.demo-copy h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 10px 0 0;
}

.demo-copy p {
  margin: 14px 0 0;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 40ch;
}

.demo-copy .tags {
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-copy .tags span {
  font-size: 12.5px;
  font-weight: 700;
  color: #2f6b47;
  background: rgba(0, 130, 62, 0.1);
  border-radius: 999px;
  padding: 6px 11px;
}

@media (max-width: 820px) {
  .demo-inner {
    padding-top: 56px;
  }
  .demo-row,
  .demo-row:nth-of-type(even) {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 48px 0;
    text-align: center;
  }
  .demo-row .phone-col,
  .demo-row:nth-of-type(even) .phone-col {
    order: -1;
  }
  .demo-copy p {
    margin-inline: auto;
  }
  .demo-copy .tags {
    justify-content: center;
  }
}

/* --------------------------------------------------------------- phone */

.phone-col {
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: 300px;
  max-width: 78vw;
  aspect-ratio: 393 / 852;
  background: #0d0f0d;
  border-radius: 46px;
  padding: 11px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.04) inset,
    0 2px 6px rgba(31, 26, 19, 0.16),
    0 26px 50px -16px rgba(31, 26, 19, 0.32),
    0 60px 90px -50px rgba(0, 130, 62, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
  .phone {
    animation: phone-float 7s ease-in-out infinite;
  }
  .demo-row:nth-child(even) .phone {
    animation-delay: -3.5s;
  }
}

@keyframes phone-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.phone .screen {
  position: absolute;
  inset: 11px;
  border-radius: 35px;
  overflow: hidden;
  background: var(--cream);
}

/* Dynamic Island — the pill-shaped cutout with the selfie camera at its
 * right edge, centred in the app's own status-bar inset so it never clips
 * UI. Matched to the iPhone the app screenshots were taken on. */
.phone .cam {
  position: absolute;
  top: 15px;
  left: 50%;
  z-index: 3;
  width: 82px;
  height: 23px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #05070b;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.phone .cam::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 7px;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #33475c 0 24%, #0a0f18 68%);
  box-shadow: inset 0 0 2px rgba(120, 170, 255, 0.45);
}

.phone .screen img {
  display: block;
  width: 100%;
  height: 100%;
  /*
   * The screenshots share the frame's aspect ratio and carry their own
   * status-bar padding, so `cover` fills the screen edge to edge with
   * nothing cropped. No notch overlay — the app's own top inset is the
   * only thing above the header.
   */
  object-fit: cover;
  object-position: top center;
}

.phone .pill {
  display: none;
}

/* ------------------------------------------------------------- closer */

.closer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 72px 24px 84px;
}

.closer h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: -0.02em;
  margin: 0;
}

.closer p {
  margin: 14px auto 26px;
  max-width: 40ch;
  color: var(--ink-muted);
  font-size: 17px;
  line-height: 1.55;
}

.closer .stores {
  justify-content: center;
}

/* ------------------------------------------------------- scroll reveal */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .reveal.in {
    opacity: 1;
    transform: none;
  }
}
