/**
 * Repose · marketing design system
 *
 * One stylesheet for every page under marketing/. Before this, the nav
 * was defined in fourteen places and the colour tokens in seven, which
 * is why the site had drifted — each page was a separate hand-copy that
 * aged independently.
 *
 * Rules for working in here:
 *   - Page-specific styles stay in that page's <style> block. Anything
 *     that appears on two pages belongs in this file instead.
 *   - Motion is opt-in per element (.reveal) and always degrades to
 *     "just show it" under prefers-reduced-motion.
 *   - No layout shift, ever. Reveals move 14px and fade; they never
 *     collapse or resize a box.
 */

/* ─── tokens ──────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Warm neutrals — cream to ink, a softly lit room before bed. */
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #FCFAF6;
  --surface-3: #F4EFE5;
  --border: #ECE6D8;
  --border-2: #DDD5C2;

  --ink: #0E0E10;
  --ink-2: #3E3B36;
  --ink-3: #7A7468;
  --ink-4: #A8A095;

  /* Candle glow, not Apple-orange and not fintech-pink. */
  --amber: #DA7A4F;
  --amber-2: #C6643A;
  --amber-soft: #FBEDDF;
  --amber-faint: #FCF5EC;

  --green: #15803D;
  --green-dot: #22C55E;
  --green-soft: #DCFCE7;

  --bad: #B91C1C;
  --bad-soft: #FEE2E2;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(40, 30, 20, 0.05);
  --shadow-md: 0 4px 16px rgba(40, 30, 20, 0.06), 0 2px 6px rgba(40, 30, 20, 0.03);
  --shadow-lg: 0 24px 60px rgba(40, 30, 20, 0.10), 0 6px 18px rgba(40, 30, 20, 0.05);
  --shadow-product: 0 40px 100px rgba(40, 30, 20, 0.12), 0 14px 28px rgba(40, 30, 20, 0.06), 0 0 0 1px rgba(40, 30, 20, 0.04);

  /* One easing for the whole site. Gentle out-cubic — nothing here
     should feel springy; the product is about calm. */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.55s;
}

/* ─── reset + base ────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html, body { background: var(--bg); }

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", system-ui, sans-serif;
  font-feature-settings: "ss01" on, "cv11" on, "kern" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Soft dawn from the upper right — the mark's weather, sitewide. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 85% -10%, rgba(218, 122, 79, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 50% at 15% 110%, rgba(218, 122, 79, 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::selection { background: var(--amber-soft); color: var(--amber-2); }

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

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ─── type scale ──────────────────────────────────────────────── */

h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.042em;
  color: var(--ink);
}

.section-title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.032em;
  color: var(--ink);
}

.section-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-2);
  margin-bottom: 12px;
}

.section-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 620px;
}

/* ─── nav ─────────────────────────────────────────────────────── */

nav {
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
}

/* The artwork fills ~47% of its 32-unit box, so the SVG runs larger
   than the type to match cap height. See scripts/brand-assets.ts. */
.logo-mark-svg {
  width: 30px;
  height: 30px;
  color: var(--amber);
  margin-right: 10px;
  flex: 0 0 auto;
}

.nav-links { display: flex; align-items: center; gap: 30px; }

.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
  position: relative;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.current { color: var(--ink); }

.nav-links a.current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.nav-actions { display: flex; align-items: center; gap: 18px; }

.nav-actions .signin {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-actions .signin:hover { color: var(--ink); }

/* Sticky nav that materialises a background once you scroll past the
   hero — set by marketing.js, not by scroll listeners in each page. */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}

/* Anything scrolled to by an anchor must clear the sticky bar, or the
   nav's blur sits on top of the thing you jumped to. */
section[id], [id] { scroll-margin-top: 88px; }

.nav-wrap.scrolled {
  background: rgba(250, 247, 242, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

/* ─── buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: white;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 1px 2px rgba(0,0,0,0.12);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 4px 14px rgba(0,0,0,0.18);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  color: var(--ink-2);
  background: transparent;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, gap 0.2s ease;
}

.btn-secondary:hover { color: var(--ink); gap: 10px; }

.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: var(--radius); }

/* ─── mobile nav ──────────────────────────────────────────────── */

.nav-burger {
  display: none;
  cursor: pointer;
  padding: 7px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--surface);
}
.nav-burger svg { display: block; width: 18px; height: 18px; stroke: var(--ink-2); }

.mobile-nav {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 14px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(40,30,20,0.08);
}
.mobile-nav a {
  display: block;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 8px;
}
.mobile-nav a:hover { background: var(--surface-2); color: var(--ink); }
.mobile-nav.open { display: block; }

@media (max-width: 760px) {
  .nav-burger { display: inline-flex; }
  .nav-links { display: none; }
  .nav-actions .signin { display: none; }
}

/* ─── footer ──────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
  padding: 44px 0 56px;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo { font-size: 19px; }
.footer-brand .logo-mark-svg { width: 26px; height: 26px; margin-right: 8px; }

.footer-tag {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 12px;
  max-width: 280px;
  line-height: 1.55;
}

.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--ink); }

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-4);
  flex-wrap: wrap;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  text-decoration: none;
}
.footer-status:hover { color: var(--ink-2); }
.footer-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-dot);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ─── motion ──────────────────────────────────────────────────── */

/**
 * Opt in with class="reveal". marketing.js adds .in when the element
 * crosses into view. Elements start visible if JS never runs — the
 * hidden state is applied by the script, so a failed load degrades to
 * a plain static page rather than a blank one.
 */
.js-motion .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}

.js-motion .reveal.in {
  opacity: 1;
  transform: none;
}

/* Children stagger in sequence — set --i on each child. */
.js-motion .reveal-group > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js-motion .reveal-group.in > * {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-motion .reveal,
  .js-motion .reveal-group > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── proof strip ─────────────────────────────────────────────── */

/**
 * The compact sibling of the landing page's proof band. Same live
 * numbers, one row, for pages where credibility needs establishing
 * without stealing the section that follows.
 */
.proof-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 30px 0 26px;
  margin: 8px 0 0;
}

.ps-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.ps-item {
  padding: 0 34px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.ps-item:last-child { border-right: none; }

.ps-n {
  display: block;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ps-item.is-hero .ps-n { color: var(--amber-2); }

.ps-l {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 5px;
}

.ps-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-4);
  margin-top: 18px;
}
.ps-note a { color: var(--amber-2); text-decoration: none; }
.ps-note a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .ps-item { border-right: none; padding: 12px 20px; }
  .ps-row { gap: 4px; }
}

/* ─── mid-page CTA band ───────────────────────────────────────── */

/**
 * A long page shouldn't make someone scroll to the end to find the
 * door. Sits at the halfway mark, deliberately quieter than the
 * closing CTA so it reads as an offer, not a nag.
 */
.cta-band {
  background: var(--amber-faint);
  border: 1px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 84px 0 0;
  flex-wrap: wrap;
}

.cta-band-text { flex: 1 1 340px; }

.cta-band-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin-bottom: 6px;
}

.cta-band-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.cta-band-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ─── the live three-continent check ───────────────────────────────
   One field a visitor can actually use. Lives in the homepage hero and
   on /tools/down-checker; behaviour is in /check.js. */

.lc { max-width: 560px; margin: 0 auto; text-align: left; }
.lc-form {
  display: flex; gap: 8px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 14px; box-shadow: 0 1px 2px rgba(60, 40, 10, 0.04), 0 8px 24px -12px rgba(60, 40, 10, 0.18);
}
.lc-form:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.lc-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15.5px; color: var(--ink); padding: 10px 12px;
}
.lc-input::placeholder { color: var(--ink-4); }
.lc-btn {
  border: 0; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px;
  background: var(--ink); color: #fff;
}
.lc-btn:hover { background: #26262b; }
.lc-btn[disabled] { opacity: 0.6; cursor: default; }
.lc-alt { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.lc-alt a { color: var(--ink-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.lc-error { color: var(--red, #B91C1C); font-size: 13.5px; margin: 10px 4px 0; }

.lc-result {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.lc-result[hidden] { display: none; }
.lc-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--ink-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.lc-head strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.lc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.lc-row.is-wait .lc-dot { animation: lc-wait 1.1s ease-in-out infinite; }
.lc-row.is-ok .lc-dot { background: #22C55E; }
.lc-row.is-bad .lc-dot { background: #B91C1C; }
.lc-where { color: var(--ink); font-weight: 500; }
.lc-where small { color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lc-what { color: var(--ink-2); font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.lc-row.is-wait .lc-what { color: var(--ink-4); }
.lc-row.is-bad .lc-what { color: #B91C1C; }
.lc-note { padding: 0 16px 10px 42px; margin-top: -6px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--border); word-break: break-all; }
.lc-verdict { padding: 14px 16px; font-size: 14px; line-height: 1.5; color: var(--ink-2); background: var(--surface-2); }
.lc-verdict.is-held { background: var(--amber-faint); }
.lc-verdict.is-down { background: #FDF1F1; }
.lc-verdict strong { color: var(--ink); }
.lc-next { padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--border); }
.lc-next span { font-size: 13px; color: var(--ink-3); }
.lc-next a { font-size: 14px; font-weight: 600; color: #fff; background: var(--amber-2); padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.lc-next a:hover { background: var(--amber); }

@keyframes lc-wait { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lc-row.is-wait .lc-dot { animation: none; } }
@media (max-width: 540px) {
  .lc-form { flex-direction: column; }
  .lc-btn { width: 100%; }
  .lc-what { font-size: 12px; }
}

/* ─── replay of a real held decision (homepage) ────────────────────
   Markup comes from src/lib/held-replay.ts. Events appear one at a
   time once the block scrolls into view (.in, set by marketing.js);
   without JS or with reduced motion everything is simply visible. */

.rp {
  max-width: 760px; margin: 56px auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(60, 40, 10, 0.04), 0 24px 60px -30px rgba(60, 40, 10, 0.28);
}
.rp-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.rp-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-2); }
.rp-meta { font-size: 12px; color: var(--ink-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rp-tape { list-style: none; margin: 0; padding: 8px 0; }
.rp-ev {
  display: grid; grid-template-columns: 74px 12px 96px 1fr; gap: 12px; align-items: center;
  padding: 7px 20px; font-size: 13.5px;
}
.rp-t, .rp-what { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.rp-t { color: var(--ink-4); }
.rp-dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; }
.rp-where { color: var(--ink); font-weight: 500; }
.rp-what { color: var(--ink-2); }
.rp-ev.is-bad { background: #FDF3F2; }
.rp-ev.is-bad .rp-dot { background: #B91C1C; }
.rp-ev.is-bad .rp-what { color: #B91C1C; }
.rp-decision { background: var(--amber-faint); }
.rp-decision .rp-dot { background: var(--amber); border-radius: 2px; }
.rp-decision .rp-where { color: var(--amber-2); }
.rp-decision .rp-what { color: var(--ink); }
.rp-decision.is-clear { background: transparent; }
.rp-decision.is-clear .rp-dot { background: #22C55E; }
.rp-foot {
  padding: 16px 20px; border-top: 1px solid var(--border);
  font-size: 14.5px; line-height: 1.55; color: var(--ink-2);
}
.rp-foot strong { color: var(--ink); }
.rp-again {
  margin-left: 6px; border: 1px solid var(--border-2); background: var(--surface);
  font: inherit; font-size: 12.5px; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.rp-again:hover { border-color: var(--ink-3); color: var(--ink); }
.rp-note { padding: 0 20px 16px; font-size: 12.5px; color: var(--ink-3); }
.rp-note a { color: var(--amber-2); text-decoration: none; font-weight: 500; }

.js-motion .rp .rp-ev, .js-motion .rp .rp-foot { opacity: 0; transform: translateY(4px); }
.js-motion .rp.in .rp-ev, .js-motion .rp.in .rp-foot {
  animation: rp-in 0.35s ease-out forwards;
  animation-delay: calc(0.35s + var(--i) * 0.42s);
}
.rp:not(.in) .rp-again { visibility: hidden; }
@keyframes rp-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js-motion .rp .rp-ev, .js-motion .rp .rp-foot { opacity: 1; transform: none; animation: none; }
}
@media (max-width: 540px) {
  .rp-ev { grid-template-columns: 58px 10px 1fr; row-gap: 2px; }
  .rp-what { grid-column: 3; }
}
