/* requaint.app: one stylesheet (docs/PLAN-cos-53.md 3.1). Tokens on :root, dark values for
   prefers-color-scheme: dark, system fonts, rem sizes so text follows the browser's text size.
   The class names are the page contract with pages/ and partials/ (site/README.md "Page contract"). */

:root {
  --bg: #fffaf7;
  --surface: #ffffff;
  --surface-2: #fdf0ea;
  --text: #1d1a1c;
  --text-muted: #5c5458;
  --border: #e8dcd6;
  --accent: #b42d48;          /* links, buttons: 6.4:1 on --bg */
  --accent-hover: #962038;
  --on-accent: #ffffff;
  --brand-1: #ff8a5b;         /* the app icon's gradient */
  --brand-2: #f2546b;
  --focus: #1f6feb;
  --ok: #1d7a46;
  --error: #b3261e;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --max: 72rem;
  --narrow: 42rem;
  --gutter: 1rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141114;
    --surface: #1d191c;
    --surface-2: #261f23;
    --text: #f4eef0;
    --text-muted: #b9aeb3;
    --border: #3a3135;
    --accent: #ff8f86;        /* 7.9:1 on --bg */
    --accent-hover: #ffb0a8;
    --on-accent: #1d0d10;
    --focus: #7ab2ff;
    --ok: #6fd39a;
    --error: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

@media (min-width: 40rem) {
  :root { --gutter: 1.5rem; }
}

/* ---------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
}
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p, ul, ol, dl, table { margin: 0 0 var(--space-3); }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

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

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -10rem;
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-3); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- layout */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.section { padding-block: var(--space-6); }
.section--alt { background: var(--surface-2); }
.section__head { max-width: var(--narrow); margin-bottom: var(--space-5); }
.section__head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lead { font-size: 1.2rem; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }

/* Grid children may shrink below their longest word, so text wraps at large text sizes on a narrow
   screen instead of pushing the page sideways (200 % text at 320 px). */
.grid > *, .hero__grid > *, .plans > * { min-width: 0; }

.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

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

/* ---------- header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 3.75rem;
  flex-wrap: wrap;
}
.brand {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.45em;
  vertical-align: -0.18em;
  border-radius: 0.3em;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

.site-footer {
  margin-top: var(--space-6);
  padding-block: var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}
.site-footer__other { margin-bottom: var(--space-3); }
.site-footer__fine { margin: 0 0 var(--space-1); font-size: 0.875rem; }

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.button--secondary { background: transparent; color: var(--accent); }
.button--secondary:hover { background: var(--surface-2); color: var(--accent-hover); }
.button--small { min-height: 2.5rem; padding: 0.4rem 1rem; font-size: 0.95rem; }
.button--block { display: flex; width: 100%; }

/* ---------- hero and screenshots */

.hero { padding-block: var(--space-5) var(--space-6); }
.hero__grid {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}
@media (min-width: 52rem) {
  .hero__grid { grid-template-columns: 1.15fr 0.85fr; }
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-4); }
/* Apple's badge artwork as it comes (static/badges/, launch only): no frame, no recolouring; 48 px
   tall, above Apple's 40 px minimum. */
.app-store-badge { display: inline-block; line-height: 0; border-radius: 0.5rem; }
.app-store-badge img { height: 3rem; width: auto; }

/* A screenshot in a plain rounded frame (no Apple device frame, plan 3.3). */
.bezel {
  max-width: 20rem;
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 2.25rem;
  padding: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.bezel img { border-radius: 1.8rem; width: 100%; }
.bezel--small { max-width: 15rem; }

.figure { margin: 0; }
.figure figcaption { margin-top: var(--space-3); color: var(--text-muted); text-align: center; }

/* ---------- the moment, claims, trust */

.steps { counter-reset: step; }
.step h3::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.85em;
}

.claim { display: grid; gap: var(--space-3); align-content: start; }

/* Where it fits: text-only cards, then the business page's one boundary line. */
/* The padding gives way on a narrow screen with large text (200 % at 320 px), so words keep whole. */
.uses .card { padding: min(var(--space-4), 6vw); }
.uses .card > :last-child { margin-bottom: 0; }
.uses .card h3 { margin-bottom: var(--space-2); }
@media (max-width: 18em) {
  .uses .card h3 { hyphens: auto; }
}
.uses__boundary { max-width: var(--narrow); margin: var(--space-5) 0 0; }

.trust__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.trust__list li {
  position: relative;
  padding-left: 2rem;
}
.trust__list li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.35em;
  width: 0.55rem;
  height: 0.95rem;
  border: solid var(--ok);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* ---------- pricing
   Monthly / yearly switch without JavaScript: two radios before .plans,
   <input class="period" type="radio" name="period" id="period-monthly">
   <input class="period" type="radio" name="period" id="period-yearly" checked>
   then .price-monthly / .price-yearly inside each plan. */

.period-switch {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: var(--space-1);
  padding: var(--space-1);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.period-switch label {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
input.period { position: absolute; opacity: 0; width: 1px; height: 1px; }
#period-monthly:checked ~ .period-switch label[for="period-monthly"],
#period-yearly:checked ~ .period-switch label[for="period-yearly"] {
  background: var(--accent);
  color: var(--on-accent);
}
#period-monthly:focus-visible ~ .period-switch label[for="period-monthly"],
#period-yearly:focus-visible ~ .period-switch label[for="period-yearly"] {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
#period-monthly:checked ~ .plans .price-yearly,
#period-yearly:checked ~ .plans .price-monthly { display: none; }

.plans {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 56rem) {
  .plans { grid-template-columns: repeat(2, 1fr); max-width: 52rem; }
}
.plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.plan--featured { border: 2px solid var(--accent); }
.plan h3 { margin: 0; }
.plan__price { font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 0; }
.plan__price small { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.plan ul { padding-left: 1.2rem; margin: 0; }
.plan__action { margin-top: auto; display: grid; gap: var(--space-2); }
.plan__note { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.pricing__label { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- waitlist form */

.join {
  max-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.field label, .choices legend { font-weight: 600; }
input[type="email"], input[type="text"] {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.choices { border: 0; padding: 0; margin: 0 0 var(--space-3); }
.choices label { display: inline-flex; align-items: center; gap: var(--space-2); margin-right: var(--space-4); min-height: 2.75rem; }
input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.join__tier { margin: 0 0 var(--space-3); font-weight: 600; }
.form-note { margin: var(--space-3) 0 0; color: var(--text-muted); font-size: 0.9rem; }
.form-error { margin: var(--space-3) 0 0; color: var(--error); font-weight: 600; }
.form-thanks { font-size: 1.15rem; font-weight: 600; color: var(--ok); }
/* The honeypot: out of sight and out of the tab order; people never fill it. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

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

.faq { max-width: var(--narrow); }
.faq details {
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-3);
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 1.1rem;
  list-style-position: outside;
}
.faq details > :not(summary) { margin-top: var(--space-2); }

/* ---------- notices (thanks, unsubscribe, 404) */

.notice { padding-block: var(--space-6); }
.unsubscribe-form { margin-top: var(--space-4); }

/* ---------- legal pages (docs/legal/*.md rendered by build.mjs) */

.legal { padding-block: var(--space-5); }
.legal h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.6rem); }
.legal h2 { font-size: 1.45rem; margin-top: var(--space-5); scroll-margin-top: var(--space-3); }
.legal h3 { font-size: 1.15rem; margin-top: var(--space-4); scroll-margin-top: var(--space-3); }
.legal ul, .legal ol { padding-left: 1.4rem; }
.legal li { margin-bottom: var(--space-2); }
.legal li > ul { margin-top: var(--space-2); }
.legal table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.legal th, .legal td {
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}
.legal th { background: var(--surface-2); }
.legal code { font-size: 0.95em; }

/* ---------- articles (articles/*.md rendered by build.mjs into templates/article.html; the list is pages/articles.html) */

.article { padding-block: var(--space-5) 0; }
.article__head { margin-bottom: var(--space-5); }
.article__head h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.6rem); }
.article__head .eyebrow a { color: inherit; text-decoration: none; }
.article__head .eyebrow a:hover { text-decoration: underline; }
.article__head .lead { margin-bottom: 0; }
.article__body { font-size: 1.075rem; line-height: 1.7; }
.article__body h2 { font-size: 1.45rem; margin-top: var(--space-5); scroll-margin-top: var(--space-3); }
.article__body h3 { font-size: 1.15rem; margin-top: var(--space-4); }
.article__body ul, .article__body ol { padding-left: 1.4rem; }
.article__body li { margin-bottom: var(--space-2); }
.article-note {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.article-note > :last-child, .article-cta > :last-child, .article-card > :last-child { margin-bottom: 0; }
.article-cta {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.article-cta h2 { font-size: 1.35rem; }
.article-more { margin-top: var(--space-6); }
.article-more h2 { font-size: 1.35rem; }
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.article-card {
  padding: min(var(--space-4), 6vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.article-card h2, .article-card h3 { font-size: 1.2rem; margin: 0 0 var(--space-2); }
.article-card h2 a, .article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h2 a:hover, .article-card h3 a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- print */

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --text-muted: #333; --accent: #000; }
  .site-header, .skip-link, .button, .app-store-badge, .join, .site-footer__other, .period-switch { display: none !important; }
  .section, .notice, .legal, .article { padding-block: 1rem; }
  .article-cta, .article-more { display: none !important; }
  a { color: #000; }
  .legal a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .bezel { box-shadow: none; }
  details > :not(summary) { display: block; }
}
