/* fairsies marketing — opinionated, no framework, mobile-first.
   System fonts. Light/dark adaptive. Matches src/picker/render.ts so the
   marketing page and the in-product picker feel of-a-piece. */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --fg: #111;
  --fg-muted: rgba(0, 0, 0, 0.62);
  --fg-faint: rgba(0, 0, 0, 0.42);
  --rule: rgba(127, 127, 127, 0.22);
  --card: #fff;
  --card-2: #fafafa;
  --accent: #007AFF;
  --error: #FF3B30;
  --imsg-them: #e5e5ea;   /* gray bubble — outbound from operator on iMessage */
  --imsg-them-fg: #111;
  --imsg-me: #007AFF;     /* blue bubble — sent by you */
  --imsg-me-fg: #fff;
  --hl-yellow: #fff8e1;
  --hl-yellow-border: #ffe082;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #f5f5f7;
    --fg-muted: rgba(245, 245, 247, 0.66);
    --fg-faint: rgba(245, 245, 247, 0.44);
    --rule: rgba(127, 127, 127, 0.32);
    --card: #2c2c2e;
    --card-2: #242426;
    --imsg-them: #2c2c2e;
    --imsg-them-fg: #f5f5f7;
    --hl-yellow: rgba(255, 193, 7, 0.12);
    --hl-yellow-border: rgba(255, 193, 7, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 56px 0;
  border-bottom: 1px solid var(--rule);
}
section:last-of-type { border-bottom: none; }

@media (min-width: 720px) {
  section { padding: 80px 0; }
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
h1 {
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
@media (min-width: 720px) {
  h1 { font-size: 52px; }
}
h2 {
  font-size: 26px;
  line-height: 1.2;
}
@media (min-width: 720px) {
  h2 { font-size: 32px; }
}
h3 {
  font-size: 19px;
  line-height: 1.3;
}

p {
  margin: 0 0 16px;
}
p.lede {
  font-size: 20px;
  color: var(--fg-muted);
  line-height: 1.45;
}
@media (min-width: 720px) {
  p.lede { font-size: 22px; }
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 12px;
}

.accent { color: var(--accent); }
.muted { color: var(--fg-muted); }
.strike { text-decoration: line-through; opacity: 0.55; }

ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin: 0 0 6px; }
li.tight { margin: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

code, kbd, .mono {
  font: 0.92em/1.4 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: var(--card-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .hero { padding: 120px 0 80px; }
}
.hero .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-muted);
  margin: 0 0 40px;
}
.hero .brand .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  margin-top: 24px;
  max-width: 580px;
}
.hero-meta {
  margin-top: 32px;
  font-size: 14px;
  color: var(--fg-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.hero-meta span::before {
  content: "·";
  margin-right: 12px;
  color: var(--fg-faint);
}
.hero-meta span:first-child::before { content: none; margin: 0; }

/* ---------- Pain artifact ---------- */

.pain-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 24px 0 4px;
}

.artifact {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.45;
}
.artifact .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}
.artifact .ts {
  font: 12px ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  color: var(--fg-faint);
  margin-right: 8px;
}
.artifact .name {
  font-weight: 600;
}

/* mock spreadsheet cells */
.cells {
  display: grid;
  grid-template-columns: 110px repeat(3, 1fr) 80px;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  font: 13px/1.3 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}
.cells > div {
  background: var(--card);
  padding: 6px 8px;
}
.cells .head {
  background: var(--card-2);
  font-weight: 600;
  color: var(--fg-muted);
}
.cells .y { color: #34c759; }
.cells .n { color: var(--error); }
.cells .q { color: #ff9500; }

/* ---------- iMessage bubbles (inline SVG-feel via CSS) ---------- */

.phone {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 18px 14px 22px;
  max-width: 360px;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.phone .phone-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--fg-muted);
}
.phone .avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #ffcc00, #ff9500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.phone .who { font-weight: 600; color: var(--fg); }
.phone .stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.35;
  word-wrap: break-word;
}
.bubble.them {
  background: var(--imsg-them);
  color: var(--imsg-them-fg);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.bubble.me {
  background: var(--imsg-me);
  color: var(--imsg-me-fg);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.bubble + .bubble.them,
.bubble + .bubble.me {
  margin-top: 2px;
}
.bubble.them + .bubble.me,
.bubble.me + .bubble.them {
  margin-top: 10px;
}
.bubble a { color: inherit; }
.bubble.me a { color: #fff; text-decoration: underline; }
.bubble .link { display: inline-block; font: 13px ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; opacity: 0.9; }
.signoff {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.85;
}

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--rule);
}
.timeline li {
  position: relative;
  padding: 0 0 18px 36px;
  margin: 0;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
}
.timeline li.silent::before { border-color: var(--fg-faint); }
.timeline li .t {
  font: 13px/1.2 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}
.timeline li.silent .t { color: var(--fg-faint); }
.timeline li .what {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
}
.timeline li .who {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 2px;
}

/* ---------- Stats / by-the-numbers ---------- */

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}
@media (min-width: 540px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
.stat {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 18px 16px;
}
.stat .n {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 8px;
  line-height: 1.4;
}
.stat .vs {
  font-size: 12px;
  color: var(--fg-faint);
  margin-top: 4px;
}

/* ---------- Segment grid ("works for") ---------- */

.segments {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 20px;
}
@media (min-width: 560px) {
  .segments { grid-template-columns: 1fr 1fr; }
}
.segment {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px;
}
.segment h3 {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.segment .ico {
  font-size: 20px;
  width: 26px;
  text-align: center;
}
.segment p {
  margin: 0;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.45;
}
.segment.tier-15 {
  border-color: rgba(0, 122, 255, 0.4);
  background: rgba(0, 122, 255, 0.04);
}

/* ---------- Refusal callout ---------- */

.refusal {
  background: var(--hl-yellow);
  border: 1px solid var(--hl-yellow-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  margin: 8px 0 0;
}
.refusal .who {
  font-weight: 600;
  margin-right: 6px;
}

/* ---------- CTA ---------- */

.cta {
  text-align: center;
  padding: 80px 0 96px;
}
.cta h2 { margin-bottom: 12px; }
.cta p { max-width: 480px; margin: 0 auto 28px; color: var(--fg-muted); }
.cta a.btn {
  display: inline-block;
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
}
.cta a.btn:hover { filter: brightness(1.05); }
.cta .small {
  display: block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--fg-faint);
}

/* ---------- "What changed" tech beats ---------- */

.beats {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.beats li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  align-items: start;
}
.beats li:last-child { border-bottom: none; }
.beats .year {
  font: 600 14px/1.2 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  color: var(--accent);
  padding-top: 2px;
}
.beats .what { font-size: 15px; }
.beats .what strong { font-weight: 600; }
.beats .what span { display: block; font-size: 13px; color: var(--fg-muted); margin-top: 2px; }

/* ---------- Misc helpers ---------- */

.colophon {
  text-align: center;
  font-size: 12px;
  color: var(--fg-faint);
  padding: 28px 0 40px;
}
.colophon a { color: inherit; text-decoration: underline; }

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