/* ==========================================================================
   Upturn · pre-launch site styles
   Brand tokens live in :root. Swap colors/fonts here.
   ========================================================================== */

:root {
  /* ---- Brand colors ---- */
  --color-primary: #451b69;       /* grape: buttons, wordmark, stat figures, footer */
  --color-primary-dark: #35134f;
  --color-accent: #cd1755;        /* berry: dot, links */
  --color-ink: #140d20;           /* headings / body */
  --color-muted: #57535f;         /* secondary text */
  --color-bg: #fffbf8;            /* cream page */
  --color-card: #ffffff;
  --color-border: #e8e2e9;
  --color-field: #d9d1dd;
  --color-error: #b0122a;

  --color-stat-pink: #ffe1ef;
  --color-stat-lilac: #f3e1fd;
  --color-stat-sky: #dcf0fd;
  --color-stat-peach: #ffe6d6;

  --gradient-headline: linear-gradient(90deg, #cc086c 0%, #e34528 100%);
  --gradient-bar: linear-gradient(90deg, #f25094 0%, #f57a3f 100%);
  --gradient-waitlist: linear-gradient(135deg, #e9caff 0%, #fcdbec 50%, #ffdac3 100%);

  /* ---- Typography ---- */
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --fs-h1: clamp(2.5rem, 1.6rem + 2.4vw, 3.5rem);
  --fs-h2: clamp(2.25rem, 1.5rem + 2.4vw, 3.5rem);

  /* ---- Layout ---- */
  --container: 72rem;
  --gutter: 1.5rem;
  --section-space: clamp(4rem, 3rem + 3vw, 5rem);
  --radius-xl: 2rem;
  --radius-md: 0.75rem;
  --shadow-soft: 0 30px 60px -30px rgb(69 27 105 / 0.25), 0 8px 20px -12px rgb(69 27 105 / 0.12);
  --header-h: 4.75rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
a { color: var(--color-accent); text-underline-offset: 0.25em; }
ul[role="list"] { list-style: none; padding: 0; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--color-primary); color: #fff; padding: 0.5rem 1rem; border-radius: 999px;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--color-primary); color: #fff;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 0.75rem 1.5rem;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.btn:hover { color: #fff; opacity: 0.9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--small { padding: 0.75rem 1.5rem; font-size: 1.0625rem; }
.btn--large { padding: 1.125rem 2.25rem; font-size: 1.1875rem; }
.btn--block { width: 100%; }

/* ---------- Pill label ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid var(--color-border); background: var(--color-card);
  color: var(--color-primary); font-size: 0.875rem; font-weight: 600; line-height: 1.4;
}
.pill--plain { border-color: transparent; }
.pill__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--color-accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 251 248 / 0.85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.wordmark { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.04em; color: var(--color-primary); text-decoration: none; }
.wordmark:hover { color: var(--color-primary); }
.wordmark--light, .wordmark--light:hover { color: #fff; }
.nav__actions { display: flex; align-items: center; gap: 1.5rem; }
.nav__links { display: none; gap: 1.5rem; font-size: 1.0625rem; }
.nav__links a { color: var(--color-muted); text-decoration: none; transition: color 0.2s; }
.nav__links a:hover { color: var(--color-ink); }
@media (min-width: 768px) { .nav__links { display: flex; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(40rem 26rem at 85% 8%, rgb(255 182 220 / 0.55), transparent 70%),
    radial-gradient(28rem 22rem at 100% 70%, rgb(255 210 180 / 0.35), transparent 70%),
    radial-gradient(32rem 18rem at 60% 105%, rgb(190 228 255 / 0.55), transparent 70%),
    var(--color-bg);
}
.hero__grid { display: grid; gap: 2.5rem; align-items: center; padding-block: 3rem 4rem; }
.hero__title { margin-top: 2rem; font-size: var(--fs-h1); }
.text-gradient {
  background: var(--gradient-headline);
  -webkit-background-clip: text; background-clip: text;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  color: transparent;
}
.hero__sub { margin-top: 1.75rem; max-width: 16em; font-size: 1.25rem; line-height: 1.65; color: var(--color-muted); }
.hero__copy .btn { margin-top: 2.5rem; }
.hero__media { width: 100%; max-width: 28rem; margin-inline: auto; }
.hero__title { max-width: 11em; font-size: clamp(2.25rem, 1.5rem + 2vw, 3.25rem); }
.hero__line { display: block; text-wrap: balance; }
@media (min-width: 768px) {
  .hero__grid { grid-template-columns: 1.05fr 1fr; gap: 3rem; padding-block: 5.5rem 4rem; }
  .hero__media { max-width: none; margin-right: 0; }
}

/* ---------- Photos (gradient + label show until the image file exists) ---------- */
.media { position: relative; overflow: hidden; display: grid; place-items: center; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media__label { color: rgb(69 27 105 / 0.55); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.02em; }
.media--hero {
  aspect-ratio: 4 / 5; border-radius: var(--radius-xl); box-shadow: var(--shadow-soft);
  background: linear-gradient(160deg, #ffd6e8 0%, #f1d9ff 45%, #ffe3cf 100%);
}
.media--card { aspect-ratio: 4 / 3; }
.media--a { background: linear-gradient(150deg, #e6effa, #dcf0fd); }
.media--b { background: linear-gradient(150deg, #fbeee3, #ffe1ef); }
.media--c { background: linear-gradient(150deg, #ffd9c7, #f3e1fd); }
.media--d { background: linear-gradient(150deg, #f3e1fd, #ffe1ef); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-space); }
.section--white { background: var(--color-card); }
.section__title { margin-top: 1.75rem; max-width: 15em; font-size: var(--fs-h2); }
.section__title--wide { max-width: 15em; }
.lead { margin-top: 1.75rem; max-width: 26em; font-size: 1.375rem; line-height: 1.5; color: var(--color-muted); }

/* ---------- Evidence stats ---------- */
.stats { display: grid; gap: 1.5rem; margin-top: 3rem; }
.stat { display: flex; flex-direction: column; padding: 2.5rem 2rem; border-radius: var(--radius-xl); }
.stat--pink { background: var(--color-stat-pink); }
.stat--lilac { background: var(--color-stat-lilac); }
.stat--sky { background: var(--color-stat-sky); }
.stat--peach { background: var(--color-stat-peach); }
.stat__label { font-size: 1.3125rem; letter-spacing: -0.03em; }
.nowrap { white-space: nowrap; }
.stat__figure { margin-top: 1.75rem; font-size: clamp(2.75rem, 2rem + 2vw, 3.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--color-primary); }
.meter, .segments { margin-top: 1.75rem; height: 0.625rem; }
.meter { border-radius: 999px; background: var(--color-card); overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--value); border-radius: inherit; background: var(--gradient-bar); }
.segments { display: flex; gap: 0.375rem; }
.segments span { flex: 1; border-radius: 999px; background: var(--gradient-bar); }
.stat__text { margin-top: 1.75rem; font-size: 1.0625rem; line-height: 1.6; color: var(--color-muted); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
  /* subgrid keeps label / figure / meter / text rows aligned across all four cards */
  .stat { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; padding: 2.25rem 1.75rem; }
  .stat__label { align-self: start; }
  .stat__figure { font-size: 2.75rem; white-space: nowrap; }
}

/* Animate the bars filling in when revealed */
.js .stat.reveal .meter span { width: 0; transition: width 1.2s var(--ease) 0.3s; }
.js .stat.reveal.is-visible .meter span { width: var(--value); }

/* ---------- Approach cards ---------- */
.cards { display: grid; gap: 1.5rem; margin-top: 3rem; }
.card { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-card); }
.card__body { padding: 1.75rem 1.375rem 2rem; }
.card__title { font-size: 1.75rem; letter-spacing: -0.04em; }
.card__body p { margin-top: 1rem; font-size: 1.0625rem; line-height: 1.6; color: var(--color-muted); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Connect / form ---------- */
.connect { background: var(--gradient-waitlist); }
.connect__grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .connect__grid { grid-template-columns: 1fr 1fr; } }

.form-card { border-radius: var(--radius-xl); background: var(--color-card); padding: 2rem; box-shadow: var(--shadow-soft); }
@media (min-width: 768px) { .form-card { padding: 3rem; } }
.form__note { font-size: 0.875rem; color: var(--color-muted); }
.field-row { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row + .field, .field + .field:not(.field-row .field) { margin-top: 1.5rem; }
.field label { display: block; margin-bottom: 0.625rem; font-size: 1.0625rem; font-weight: 600; }
.field input:not([type="checkbox"]), .field select {
  width: 100%; padding: 0.875rem 1.25rem;
  border: 1px solid var(--color-field); border-radius: 1.25rem;
  background: var(--color-card); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgb(69 27 105 / 0.15); }
.field [aria-invalid="true"] { border-color: var(--color-error) !important; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 3rem; }
.select svg { position: absolute; right: 1rem; top: 50%; width: 1.125rem; height: 1.125rem; transform: translateY(-50%); pointer-events: none; color: var(--color-muted); }
.field__hint { margin-top: 0.75rem; font-size: 0.875rem; color: var(--color-muted); }
.field__error { font-size: 0.875rem; color: var(--color-error); }
.field__error:not(:empty) { margin-top: 0.375rem; }

.field--check { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; align-items: start; }
.field--check input { width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; accent-color: var(--color-primary); }
.field--check label { margin: 0; font-weight: 400; font-size: 0.875rem; color: var(--color-muted); }
.field--check label strong { font-weight: 600; color: var(--color-ink); }
.field--check label a { color: inherit; text-underline-offset: 2px; }
.field--check .field__error { grid-column: 2; }
.form .btn { margin-top: 1.5rem; }

.form-success { text-align: center; padding-block: 2rem; outline: none; }
.form-success h3 { font-size: 2rem; color: var(--color-primary); }
.form-success p { margin-top: 0.75rem; color: var(--color-muted); }

/* ---------- Footer ---------- */
/* ---------- Sources & citations ---------- */
.cite { font-size: 0.65em; line-height: 0; margin-left: 0.1em; }
.cite a { color: var(--color-accent); text-decoration: none; font-weight: 600; }
.cite a:hover { text-decoration: underline; }
.sources { border-top: 1px solid var(--color-border); padding-block: 3.5rem; }
.sources__title { font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); }
.sources__list { list-style: none; padding: 0; margin-top: 1.75rem; display: grid; gap: 0.875rem; font-size: 0.9375rem; line-height: 1.55; color: var(--color-muted); }
.sources__list li { scroll-margin-top: calc(var(--header-h) + 1rem); }
.sources__list li:target { color: var(--color-ink); }
.sources__list sup { font-size: 0.7em; color: var(--color-ink); }
.sources__list a { color: inherit; text-decoration: underline; text-decoration-color: var(--color-field); text-underline-offset: 2px; }
.sources__list a:hover { color: var(--color-accent); text-decoration-color: currentColor; }
.sources__list.is-collapsed li:nth-child(n+3) { display: none; }
.sources__list.is-collapsed li:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sources__toggle { display: block; margin: 1.5rem auto 0; padding: 0.5rem 1rem; border: 0; background: none; font: inherit; font-weight: 600; color: var(--color-ink); cursor: pointer; }
.sources__toggle:hover { color: var(--color-accent); }

.site-footer { background: var(--color-primary); color: rgb(255 255 255 / 0.85); padding-block: 2.5rem; }
.footer__inner { display: flex; flex-direction: column; gap: 1.5rem; }
.footer__privacy { max-width: 36rem; }
@media (min-width: 768px) {
  .footer__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease) var(--reveal-delay, 0ms), transform 0.7s var(--ease) var(--reveal-delay, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .stat.reveal .meter span { transition: none; }
}
