/* By My Word - store-readiness legal shell (WP-F15) - shared stylesheet.
   Design system: "The Thread" (design-spec/01-foundations.md). Token values are
   copied verbatim from packages/tokens/tokens.css so these no-build pages need no
   pipeline; when a token changes, re-sync the :root block below from that file.

   Loaded as an EXTERNAL stylesheet (not inline) so the CSP can stay
   `style-src 'self'` with NO 'unsafe-inline'. No @import, no remote fonts. */

/* ---- tokens (subset used by the shell; verbatim from packages/tokens) ---- */
:root {
  --paper: #FAF6F1;
  --paper-2: #F1E9DF;
  --porcelain: #FDFBF7;
  --surface: #FFFFFF;
  --surface-tint: #FDFAF6;
  --ink: #23201B;                    /* TEXT - AAA (15.08:1 on paper) */
  --ink-70: rgba(35,32,27,.70);      /* TEXT - 5.79:1 */
  --ink-quiet: #74604A;              /* TEXT - 5.55:1 (captions/meta) */
  --ink-52: rgba(35,32,27,.52);      /* GLYPH only - never text */
  --ink-38: rgba(35,32,27,.38);      /* DECOR only - never text */
  --line: rgba(35,32,27,.10);
  --line-2: rgba(35,32,27,.16);

  --sage: #7A9278;
  --sage-deep: #5E7860;              /* primary action; white label = 4.85:1 */
  --sage-deep-hover: #4F6A52;
  --sage-tint: #E7EDE5;
  --sage-text: #576F58;              /* TEXT - 5.11:1 paper */
  --coral: #D9704A;                  /* referee end; accent (fills carry ink) */
  --coral-tint: #F7E2D7;
  --coral-text: #A34D2E;             /* TEXT - 5.34:1 paper (links/attention) */
  --gold: #C8892A;
  --gold-deep: #A76E1E;
  --gold-text: #865C15;              /* TEXT - 5.49:1 paper */

  --grad-display: linear-gradient(105deg, var(--sage-deep) 0%, var(--coral) 78%);
  --grad-footer: linear-gradient(135deg, #2C3B2D 0%, #3A4D3B 42%, #6D4433 100%);

  --font-display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-btn: 100px;

  --shadow-sm: 0 2px 8px rgba(60,44,30,.06);
  --shadow-md: 0 18px 44px -22px rgba(60,44,30,.30), 0 4px 14px rgba(60,44,30,.06);
  --shadow-porcelain: 0 38px 84px -46px rgba(60,44,30,.34), 0 6px 20px rgba(60,44,30,.05);

  --ease-out: cubic-bezier(.22,.61,.36,1);
  --dur-ui: 200ms;
  --wrap: 1120px;
  --read: 720px;
}

/* ---- reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink-70);
  background: var(--paper);
  /* Ambient page bloom - faint sage + coral washes at the corners, over paper */
  background-image:
    radial-gradient(60% 45% at 8% 0%, rgba(122,146,120,.12), transparent 70%),
    radial-gradient(55% 40% at 100% 12%, rgba(217,112,74,.09), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 .5em;
  text-wrap: balance;
}
p { text-wrap: pretty; margin: 0 0 1em; }
a { color: var(--coral-text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
strong { color: var(--ink); font-weight: 600; }
img, svg { max-width: 100%; }

/* Visible focus rings everywhere (design-spec: 2px sage-deep 25% offset) */
:focus-visible {
  outline: 2px solid rgba(94,120,96,.55);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-md);
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  box-shadow: var(--shadow-md); z-index: 50; text-decoration: none;
}
.skip:focus { left: 8px; }

/* ---- layout ---- */
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
main { flex: 1 0 auto; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250,246,241,.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { color: inherit; }
.brand__mark { display: block; width: 34px; height: 20px; flex: none; }
.brand__word {
  font-family: var(--font-display); font-weight: 600; font-size: 16.5px;
  letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
}
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links a {
  font-family: var(--font-display); font-weight: 500; font-size: 14.5px;
  color: var(--ink-70); text-decoration: none;
}
.nav__links a:hover { color: var(--ink); }
@media (max-width: 620px) {
  .nav__links { gap: 14px; }
  .nav__links a.hide-sm { display: none; }
}
/* Design-spec: <=560px the nav shows the mark only (brand text hidden). The footer
   keeps its full wordmark. */
@media (max-width: 560px) {
  .nav .brand__word { display: none; }
}

/* ---- buttons (pills) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  line-height: 1; min-height: 48px; padding: 0 26px;
  border-radius: var(--r-btn); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform var(--dur-ui) var(--ease-out),
              background-color var(--dur-ui) var(--ease-out),
              box-shadow var(--dur-ui) var(--ease-out),
              color var(--dur-ui) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
/* sage-deep primary keeps a WHITE label (4.85:1) and DEEPENS on hover */
.btn--primary {
  background: var(--sage-deep); color: #fff;
  box-shadow: 0 8px 20px -10px rgba(94,120,96,.7);
}
.btn--primary:hover { background: var(--sage-deep-hover); color: #fff; }
.btn--ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-2);
}
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---- hero (home) ---- */
.hero { padding: 72px 0 40px; }
.eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: 500;
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sage-text);
  background: var(--sage-tint); padding: 7px 14px; border-radius: var(--r-btn);
}
.hero h1 {
  font-size: clamp(44px, 9vw, 96px); letter-spacing: -0.045em; line-height: .94;
  margin: 20px 0 0;
}
.hero h1 .em {
  background: var(--grad-display);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-70);
  max-width: 56ch; margin: 22px 0 0; line-height: 1.6;
}

/* ---- porcelain content card ---- */
.card {
  background: var(--porcelain); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-porcelain);
  padding: 32px;
}
@media (min-width: 720px) { .card { padding: 40px; } }

/* ---- "how it works" mini strip (home) ---- */
.how { padding: 20px 0 8px; }
.how__grid {
  display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 24px;
}
@media (min-width: 720px) { .how__grid { grid-template-columns: repeat(3, 1fr); } }
.how__item { display: flex; gap: 14px; align-items: flex-start; }
.how__num {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: #fff; background: var(--sage-deep);
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.how__num.coral { background: var(--coral); color: var(--ink); }
.how__item h3 { font-size: 17px; margin: 2px 0 4px; }
.how__item p { font-size: 15px; margin: 0; color: var(--ink-70); }

/* ---- waitlist form ---- */
.waitlist { margin-top: 36px; }
.waitlist h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.03em; }
.field { display: block; margin: 0 0 16px; }
.field > .label {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 13.5px; color: var(--ink); margin: 0 0 7px;
}
.input, .select {
  width: 100%; font-family: var(--font-body); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 13px 14px; min-height: 48px;
  transition: border-color var(--dur-ui) var(--ease-out),
              box-shadow var(--dur-ui) var(--ease-out);
}
.input::placeholder { color: var(--ink-quiet); }
.input:focus, .select:focus {
  outline: none; border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(94,120,96,.18);
}
.persona { display: flex; flex-wrap: wrap; gap: 10px; }
.persona label {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-btn);
  padding: 10px 16px; min-height: 44px; cursor: pointer;
  transition: border-color var(--dur-ui) var(--ease-out),
              background-color var(--dur-ui) var(--ease-out);
}
.persona input { position: absolute; opacity: 0; width: 0; height: 0; }
.persona label:hover { border-color: var(--sage-deep); }
.persona .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line-2); flex: none;
  transition: background-color var(--dur-ui) var(--ease-out);
}
/* Checked state via the ADJACENT-SIBLING selector - universally supported, so the
   custom dot always reflects selection even where :has() is unavailable. */
.persona input:checked + .dot { background: var(--sage-deep); }
.persona input:focus-visible + .dot {
  outline: 2px solid rgba(94,120,96,.55); outline-offset: 3px;
}
/* :has() adds the label chrome as a progressive enhancement (no-op if unsupported). */
.persona label:has(input:checked) {
  border-color: var(--sage-deep); background: var(--sage-tint);
}
.waitlist__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.waitlist__note { font-size: 13px; color: var(--ink-quiet); margin: 14px 0 0; }

/* Live status region for the async submit */
.formstatus { font-family: var(--font-display); font-weight: 500; font-size: 14px; margin-top: 6px; }
.formstatus.is-ok { color: var(--sage-text); }
.formstatus.is-err { color: var(--coral-text); }
.formstatus:empty { display: none; }

/* No-JS message: shown only when scripting is unavailable */
.nojs {
  margin-top: 18px; font-size: 14px; color: var(--ink-quiet);
  border-left: 2px solid var(--line-2); padding-left: 14px;
}

/* ---- legal / prose pages ---- */
.doc { padding: 56px 0 24px; }
.doc__head { max-width: var(--read); }
.doc__kicker {
  font-family: var(--font-display); font-weight: 500; font-size: 12.5px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-quiet);
}
.doc h1 { font-size: clamp(32px, 5vw, 50px); letter-spacing: -0.03em; margin-top: 10px; }
.doc__meta { font-size: 14px; color: var(--ink-quiet); margin-top: 4px; }
.prose { max-width: var(--read); margin-top: 8px; }
.prose h2 {
  font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -0.02em;
  margin-top: 44px; padding-top: 6px;
}
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 17.5px; color: var(--ink); margin: 26px 0 6px; }
.prose p, .prose li { color: var(--ink-70); font-size: 16px; line-height: 1.68; }
.prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--ink-52); }
.prose a { color: var(--coral-text); }
.prose strong { color: var(--ink); }
.prose .callout {
  background: var(--sage-tint); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px; margin: 22px 0;
  color: var(--ink); font-size: 15.5px;
}
.prose .callout p:last-child { margin-bottom: 0; }
.toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; margin: 28px 0 8px;
}
.toc p { font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-quiet); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.toc li { margin-bottom: 8px; break-inside: avoid; }
.toc a { color: var(--ink-70); text-decoration: none; font-size: 14.5px; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 560px) { .toc ul { columns: 1; } }

/* ---- footer ---- */
.footer { flex: none; margin-top: 64px; }
.footer__panel {
  background: var(--grad-footer); color: #FDF7EF;
  border-radius: 28px; padding: 44px 32px;
}
.footer__panel .eyebrow {
  background: rgba(255,255,255,.12); color: #F1E6D8;
}
.footer__panel h2 { color: #FDF7EF; font-size: clamp(28px, 4.4vw, 46px); letter-spacing: -0.03em; margin: 16px 0 0; }
.footer__panel h2 .em {
  background: linear-gradient(105deg, #E7B45C, #E7A987);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer__panel p { color: rgba(253,247,239,.82); max-width: 52ch; margin-top: 14px; }
.footer__meta {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; padding: 26px 4px 40px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer__links a {
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  color: var(--ink-70); text-decoration: none;
}
.footer__links a:hover { color: var(--ink); }
.footer__fine { font-size: 13px; color: var(--ink-quiet); padding: 0 4px 40px; }
/* Inner (legal/support/404) pages have no footer CTA panel, so the meta bar needs a
   little top breathing room where the panel would have been. */
.footer__meta--doc { padding-top: 32px; }
.footer__cta { margin-top: 22px; }
@media (max-width: 560px) { .footer__meta { flex-direction: column; align-items: flex-start; } }

/* ---- helpers migrated out of inline style= attributes (keeps CSP style-src 'self') ---- */
/* Shared hidden <svg> defs block (holds the thread-mark gradient). */
.defs { position: absolute; width: 0; height: 0; }
/* Home: "how it works" head card + waitlist card. */
.how__title { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.03em; margin-bottom: 6px; }
.how__lede { color: var(--ink-70); max-width: 60ch; margin: 0; }
.card--narrow { max-width: 640px; }
.card__sub { color: var(--ink-70); margin-top: 6px; }
.waitlist-form { margin-top: 24px; }
.persona-field { border: 0; padding: 0; margin: 0 0 18px; min-inline-size: auto; }
.persona-field > .label { padding: 0; }
.waitlist__actions .waitlist__note { margin: 0; }
/* 404 hero button row. */
.hero__cta { margin-top: 26px; }
/* Support: postal address + inline hint. */
.hint-inline { color: var(--ink-quiet); font-size: 14px; }
.callout--surface { background: var(--surface-tint); }
.postal-addr { margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--ink); line-height: 1.6; }
.postal-note { margin: 10px 0 0; color: var(--ink-quiet); font-size: 13.5px; }

/* ---- entrance motion (gated: killed under reduced-motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(16px); animation: rise .7s var(--ease-out) forwards; }
  .rise.d1 { animation-delay: .06s; }
  .rise.d2 { animation-delay: .12s; }
  .rise.d3 { animation-delay: .18s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Reduced motion: everything visible, no transforms, no smooth scroll */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rise { opacity: 1 !important; transform: none !important; }
}
