/* Pacts marketing site — shared styles. Dependency-free (system fonts, no CDN),
   responsive, and light/dark aware. Brand palette mirrors the app's theme.ts. */

:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-alt: #f1eefb;
  --border: #e6e2f2;
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  /* Button roles are SEPARATE tokens from --primary/--primary-dark on purpose.
     Those two flip to LIGHT violets in dark mode because they're text/border colours
     there (a link on a dark ground). Reusing them as a button *background* with white
     text inverted the relationship and produced 2.72:1 on .btn-primary and 1.85:1 on
     the closing CTA — the most important button on the page, effectively invisible.
     Fixed 2026-08-21; every pair below is >= 4.5:1 in BOTH themes. */
  --btn-bg: #7c3aed;         /* white text on this: 5.70 */
  --btn-bg-hover: #6d28d9;   /* white text on this: 7.10 */
  --btn-on-white: #6d28d9;   /* violet text on a white pill: 7.10 */
  --accent: #16a34a;
  --text: #1e1b2e;
  --muted: #655f7a;          /* was #7a7592 — failed on all three surfaces (4.39/4.08/3.84) */
  --star: #f59e0b;
  --hero-from: #7c3aed;
  --hero-to: #8a3fe8;        /* was #9f5bff — white hero copy on it was 3.88 */
  --radius: 16px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141220;
    --surface: #1e1b2e;
    --surface-alt: #2a2640;
    --border: #3a3553;
    --primary: #a78bfa;
    --primary-dark: #c4b5fd;
    /* Deliberately NOT the two above: those are the light violets that read as text on a
       dark ground. A filled button needs a dark ground of its own under white text. */
    --btn-bg: #6d28d9;         /* white text on this: 7.10 */
    --btn-bg-hover: #5b21b6;   /* white text on this: 8.98 */
    --btn-on-white: #5b21b6;   /* violet text on the white pill in .cta-band: 8.98 */
    --accent: #22c55e;
    --text: #f3f1fa;
    --muted: #a9a3c2;
    --hero-from: #6d28d9;
    --hero-to: #7c3aed;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
/* Respect the OS-level "reduce motion" preference: smooth scrolling is exactly the
   kind of motion people disable it for, and an unconditional rule overrides them. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Solid first: any browser without color-mix() would otherwise get NO background on a
     STICKY bar, and page content scrolls visibly through it. The second line wins where
     it is supported. */
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
/* The real app mark (apps/app/assets/icon.png, downscaled to web/icon.png at 192px so
   it stays crisp on a 2x/3x display at its 32px box). It carries its own violet ground,
   so the gradient that stood in behind the old 🤝 emoji is gone — leaving it would put a
   second violet square behind an image that already has one. */
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  display: block; object-fit: contain;
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
/* Mobile nav. This used to be `display: none` on .hide-sm, which removed BOTH "How it
   works" and "Guides" with no hamburger replacing them — so on phones, where most of the
   traffic is, the guides (the SEO on-ramp) were unreachable from the nav and the only
   nav element was the CTA. They're two short words each; they fit. Tighten instead of
   hide, and let the bar wrap if a narrow device still can't take it. */
@media (max-width: 640px) {
  .nav .wrap { flex-wrap: wrap; row-gap: 8px; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .nav-links { gap: 14px; }
  .nav-links a.hide-sm { font-size: 14px; }
  .nav-links .btn { padding: 9px 16px; font-size: 14px; }
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary { background: var(--btn-bg); color: #fff; }
.btn-primary:hover { background: var(--btn-bg-hover); text-decoration: none; }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); text-decoration: none; }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: 84px 0 96px;
  text-align: center;
}
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -0.02em; }
.hero p { font-size: clamp(17px, 2.4vw, 21px); max-width: 640px; margin: 0 auto 30px; opacity: 0.95; }
/* /get's desktop hand-off: a laptop visitor can't install, so show the QR instead.
   Hidden below 720px, where the store buttons are already the right answer. */
.send-to-phone { display: none; }
.send-to-phone p { margin: 12px auto 0; max-width: 420px; font-size: 15px; }
@media (min-width: 720px) {
  .send-to-phone { display: block; margin-top: 36px; }
}

/* The hero used to render BOTH of its buttons as .btn-outline, so the page had no
   primary call to action above the fold — the download and the tour looked equally
   optional. The download now takes the solid white pill, the same pairing .cta-band
   already uses (white ground + --btn-on-white), so its contrast is proven. */
.hero .btn-primary { background: #fff; color: var(--btn-on-white); }
.hero .btn-primary:hover { background: #f2eefb; text-decoration: none; }
.hero .btn-outline { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.5); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,0.24); }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.eyebrow {
  display: inline-block; font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; opacity: 0.9; margin-bottom: 14px;
}

/* ── Sections ────────────────────────────────────────────────────── */
section { padding: 68px 0; }
section h2 { font-size: clamp(26px, 4vw, 36px); text-align: center; margin: 0 0 12px; letter-spacing: -0.01em; }
section .lead { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 44px; font-size: 18px; }

.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card .ico { font-size: 30px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); }

.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-alt); color: var(--primary-dark); font-weight: 800; font-size: 17px;
  margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 19px; }
.step p { margin: 0; color: var(--muted); }

.alt { background: var(--surface-alt); }

/* ── Screenshots ─────────────────────────────────────────────────── */
/* The site shipped with ZERO images until 2026-08-21 — a visitor decided whether to
   install a visual product without seeing it. These are the real store screenshots
   (marketing/store-screenshots/play-phone/), resized to 620px wide for the web; their
   captions are the vetted store captions, so they carry copy as well as picture. */
.shots { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); max-width: 900px; margin: 0 auto; }
/* The grid items are <picture> elements since 2026-09-01 (WebP with a PNG fallback).
   A grid item is blockified anyway, so this is belt-and-braces — but `.shots img`'s
   `width: 100%` resolves against the picture, and an inline picture would make that
   percentage meaningless if the blockification rule ever stopped applying. */
.shots picture { display: block; }
.shots img {
  width: 100%; height: auto; display: block; border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px -18px rgba(30, 27, 46, 0.5);
}
@media (prefers-color-scheme: dark) {
  .shots img { box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.8); }
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 4px 20px; margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ── Article / blog ──────────────────────────────────────────────── */
.article { max-width: 720px; margin: 0 auto; padding: 56px 0; }
.article h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.12; margin: 0 0 10px; letter-spacing: -0.02em; }
.article .meta { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
.article h2 { font-size: 24px; margin: 36px 0 12px; text-align: left; }
.article p, .article li { font-size: 18px; color: var(--text); }
.article ul { padding-left: 22px; margin: 10px 0 20px; }
.article li { margin-bottom: 8px; }
.article li:last-child { margin-bottom: 0; }
.article blockquote {
  border-left: 4px solid var(--primary); margin: 24px 0; padding: 6px 18px;
  color: var(--muted); font-style: italic;
}
.callout {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin: 28px 0;
}
.callout p { margin: 0; }

.post-list { list-style: none; padding: 0; display: grid; gap: 18px; }
.post-list a.post {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; color: var(--text);
}
.post-list a.post:hover { border-color: var(--primary); text-decoration: none; }
.post-list h3 { margin: 0 0 6px; font-size: 21px; }
.post-list p { margin: 0; color: var(--muted); }

/* ── CTA band + footer ───────────────────────────────────────────── */
.cta-band { background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band .btn-primary { background: #fff; color: var(--btn-on-white); }
.cta-band .btn-primary:hover { background: #f2eefb; }

footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
footer .foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--border); }
footer a:hover { color: var(--text); text-decoration-color: currentColor; }

/* Keyboard focus. Without this a keyboard or switch user has no idea where they are on
   the page — the site had no focus style at all. :focus-visible keeps the ring off
   mouse clicks, so it costs sighted mouse users nothing. */
:focus-visible {
  outline: 3px solid var(--primary-dark);
  outline-offset: 2px;
  border-radius: 4px;
}
.hero :focus-visible { outline-color: #fff; }

/* ── Official store badges (stacked, rev. 2026-08-31) ─────────────────────────
   Apple and Google both FORBID recreating, recolouring, restyling or DISTORTING
   these. /badges/ holds the official artwork, unmodified except that Google's PNG
   was cropped to its content box (646x250 -> 564x168 — transparent margin only,
   the artwork untouched, which both brands allow). Never hand-draw a replacement,
   and never set width AND height on one: that stretches it.

   THE TWO CANNOT BE THE SAME SIZE IN BOTH DIMENSIONS. Their artwork aspect ratios
   differ — Google 564/168 = 3.36:1, Apple 119.664/40 = 2.99:1 — and squashing
   either to close that gap is precisely what the guidelines prohibit. So one axis
   gives, and WHICH one is decided by the layout, not by preference:
     · side by side, the eye reads the shared top and bottom edge -> equal HEIGHT
       looks aligned (and the widths differ, 134 vs 120 at height 40);
     · stacked, it reads the shared left and right edge -> equal WIDTH does.
   They are stacked (owner, 2026-08-31: side by side "the alignment is an issue"),
   so it is one width and height:auto — the opposite of the 2026-08-30 revision,
   which was correct for the row it was written for.

   History, so it is not re-broken: an earlier revision cancelled Google's baked-in
   padding with NEGATIVE FRACTIONAL margins (-10.08px / -10.56px). Those round
   differently at 2x/3x device pixel ratio, so a real phone showed a 1-2px offset
   that headless renders at 1x never reproduced. Nothing here is fractional.

   `display: inline-block` is load-bearing: /get and /join hide a badge with
   `style.display = "none"` and rely on the CSS default to show it again. */
.store-badge { display: inline-block; line-height: 0; }
.btn-row { align-items: center; }
/* min() so a 320px phone doesn't get a badge wider than its own column; on every
   width above ~322px this is a flat 180px, so no fractional rendering. */
.store-badge img { display: block; width: min(180px, 56vw); height: auto; }
/* The stack itself. Addressed by ID on purpose: BOTH /get/ and /join/ redefine
   .btn-row in a <style> block that comes after this file, so a class here would
   lose the cascade to them; an id outranks both. #store-row is the id on each.
   The 16px gap clears Google's clear-space rule (1/4 the badge height = ~13px at
   this size) and Apple's (10% = ~6px). `order` still reorders the visitor's own
   platform to the top — column flex honours it exactly as the row did. */
#store-row { flex-direction: column; align-items: center; gap: 16px; }

/* The hero mark on /get and /join — the app icon, at the size the 🤝 emoji it replaced
   used to occupy. Same 22% corner radius the launchers apply, so it reads as the app. */
.hero-mark { width: 72px; height: 72px; border-radius: 16px; display: block; margin: 0 auto; }
