/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/public-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/public-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/public-sans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/public-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/public-sans-800.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
}

:root {
  --paper: #f5f3ee;
  --paper-2: #efece5;
  --card: #ffffff;
  --ink: #15140f;
  --ink-2: #2a2820;
  --muted: #6b6659; /* darkened from #8a857a for WCAG AA on paper */
  --hair: #e5e2da;
  --hair-2: #d9d5cb;
  --accent: #2e46e6;
  --accent-deep: #1d33c9;
  --accent-soft: #e5e8fb;
  --accent-on-dark: #a7b4ff;
  --success: #4a6b3a;
  --warn: #9c6b2e;
  --error: #a64545;

  --phone-bg: #ffffff;
  --phone-ink: #15140f;
  --phone-ink-2: #2a2820;
  --phone-muted: #6b6659;
  --phone-hair: #e5e2da;
  --phone-accent: #2e46e6;

  --dl-bg: #15140f;
  --dl-ink: #f5f3ee;
  --dl-muted: rgba(245,243,238,0.65);
  --dl-body: rgba(245,243,238,0.78);
  --dl-accent: #a7b4ff;
  --dl-store-bg: #f5f3ee;
  --dl-store-bg-hover: #ffffff;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 0 rgba(21,20,15,0.04), 0 8px 24px -12px rgba(21,20,15,0.10);
  --shadow-soft: 0 1px 0 rgba(21,20,15,0.03), 0 2px 10px -6px rgba(21,20,15,0.08);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --paper: #15140f;
    --paper-2: #1c1a14;
    --card: #1d1a14;
    --ink: #f1ede2;
    --ink-2: #d6d0c1;
    --muted: #a8a294;
    --hair: #2b2820;
    --hair-2: #38342a;
    --accent: #8090ff;
    --accent-deep: #a7b4ff;
    --accent-soft: #232542;
    --shadow-card: 0 1px 0 rgba(0,0,0,0.3), 0 12px 28px -14px rgba(0,0,0,0.6);
    --shadow-soft: 0 1px 0 rgba(0,0,0,0.25), 0 4px 14px -8px rgba(0,0,0,0.45);
    --dl-bg: #0d0c08;

    --phone-bg: #1d1a14;
    --phone-ink: #f1ede2;
    --phone-ink-2: #d6d0c1;
    --phone-muted: #a8a294;
    --phone-hair: #2b2820;
    --phone-accent: #8090ff;
  }
}
:root[data-theme="dark"] {
  --paper: #15140f;
  --paper-2: #1c1a14;
  --card: #1d1a14;
  --ink: #f1ede2;
  --ink-2: #d6d0c1;
  --muted: #a8a294;
  --hair: #2b2820;
  --hair-2: #38342a;
  --accent: #8090ff;
  --accent-deep: #a7b4ff;
  --accent-soft: #232542;
  --shadow-card: 0 1px 0 rgba(0,0,0,0.3), 0 12px 28px -14px rgba(0,0,0,0.6);
  --shadow-soft: 0 1px 0 rgba(0,0,0,0.25), 0 4px 14px -8px rgba(0,0,0,0.45);
  --dl-bg: #0d0c08;

  --phone-bg: #1d1a14;
  --phone-ink: #f1ede2;
  --phone-ink-2: #d6d0c1;
  --phone-muted: #a8a294;
  --phone-hair: #2b2820;
  --phone-accent: #8090ff;
}

html { color-scheme: light; transition: background-color .3s ease; }
:root[data-theme="dark"], :root[data-theme="auto"] { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { color-scheme: dark; }
}
:root[data-theme="dark"] { color-scheme: dark; }
body { transition: background-color .3s ease, color .3s ease; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.mono.accent { color: var(--accent); }
.mono.ink { color: var(--ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Focus rings: visible only for keyboard users */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-tab:focus-visible,
.store-btn:focus-visible,
.theme-toggle:focus-visible,
.nav-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 16px; text-decoration: none; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-bottom-color: var(--hair); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.wordmark {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.wordmark .dot { color: var(--accent); }
.nav-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.nav-tab:hover { background: var(--hair); }
.nav-tab.active,
.nav-tab[aria-current="true"] { background: var(--ink); color: var(--paper); }
.nav-cta {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  transition: background .18s ease, transform .18s ease;
}
.nav-cta:hover { background: var(--accent-deep); text-decoration: none; }

.theme-toggle {
  margin-left: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, border-color .18s ease, transform .25s ease;
  flex: 0 0 36px;
}
.theme-toggle:hover { background: var(--paper-2); border-color: var(--hair-2); }
.theme-toggle svg { display: block; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-toggle .sun { display: block; }
  :root[data-theme="auto"] .theme-toggle .moon { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}
.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.eyebrow-row .pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
h1.hero-title {
  font-size: clamp(46px, 6.4vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 24px;
  text-wrap: balance;
}
h1.hero-title .accent { color: var(--accent); display: block; }
.hero-sub {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 460px;
  margin: 0 0 36px;
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 0;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hair-2);
}
.btn-ghost:hover { background: var(--paper-2); text-decoration: none; }
.hero-foot {
  margin-top: 36px;
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-foot .mono { color: var(--muted); }

/* Hero phone */
.phone-stack {
  display: flex;
  justify-content: center;
  position: relative;
}
.phone {
  width: 320px;
  background: var(--phone-bg);
  border-radius: 36px;
  box-shadow: var(--shadow-card), 0 30px 60px -28px rgba(0,0,0,0.28);
  padding: 18px 18px 16px;
  border: 1px solid var(--phone-hair);
  position: relative;
  aspect-ratio: 9 / 19.5;
  display: flex;
  flex-direction: column;
}
.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--phone-ink);
  font-weight: 600;
  padding: 2px 6px 14px;
}
.phone-status .notch {
  width: 8px; height: 8px; border-radius: 50%; background: var(--phone-ink);
}
.phone-status .signals {
  display: inline-flex; gap: 5px; align-items: center;
  color: var(--phone-ink);
}
.phone-status svg { display: block; }
.phone-body { flex: 1; display: flex; flex-direction: column; padding: 6px 6px 0; color: var(--phone-ink); }
.phone-wordmark {
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
  color: var(--phone-ink);
}
.phone-wordmark .dot { color: var(--phone-accent); }
.phone-eyebrow {
  margin-top: 64px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.14em;
  color: var(--phone-muted); text-transform: uppercase;
}
.phone-h {
  margin-top: 12px;
  font-size: 30px;
  line-height: 1.0;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--phone-ink);
}
.phone-h .a { color: var(--phone-accent); display: block; }
.phone-sub {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--phone-ink-2);
  max-width: 240px;
}
.phone-spacer { flex: 1; }
.phone-cta {
  background: var(--phone-accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 0;
  text-align: center;
  border-radius: 999px;
  margin: 0 4px 8px;
}
.phone-foot-mono {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--phone-muted);
  padding-bottom: 8px;
}
.phone-bar {
  width: 100px;
  height: 4px;
  border-radius: 999px;
  background: var(--phone-ink);
  margin: 4px auto 4px;
}

/* ---------- Section base ---------- */
section.block {
  padding: 96px 0;
  border-top: 1px solid var(--hair);
}
.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  margin-bottom: 48px;
  align-items: start;
}
.section-head .mono { padding-top: 8px; }
.section-title {
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  font-weight: 800;
  margin: 0 0 16px;
  text-wrap: balance;
}
.section-lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 620px;
  margin: 0;
  text-wrap: pretty;
}

/* ---------- "What it does" cards ---------- */
.what {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.what-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--hair);
  padding: 28px 26px 30px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 240px;
}
.what-card .num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}
.what-card h3 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.018em;
  font-weight: 700;
  margin: 0 0 12px;
}
.what-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.5;
}

/* ---------- Promise ---------- */
.promise-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 44px 48px 32px;
  box-shadow: var(--shadow-card);
}
.promise-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--hair);
}
.promise-row:first-child { border-top: 0; }
.promise-row .n {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.promise-row.last .n { color: var(--accent); }
.promise-row .label {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.promise-row .meta {
  font-size: 13px;
  color: var(--muted);
  max-width: 340px;
  text-align: right;
  text-wrap: pretty;
}

/* ---------- Download ---------- */
.download-card {
  background: var(--dl-bg);
  color: var(--dl-ink);
  border-radius: var(--radius-lg);
  padding: 56px 56px 52px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px -24px rgba(21,20,15,0.35);
}
.download-card::before {
  content: "";
  position: absolute;
  inset: auto -120px -180px auto;
  width: 360px; height: 360px;
  background: radial-gradient(closest-side, rgba(46,70,230,0.35), transparent 70%);
  pointer-events: none;
}
.download-card .mono { color: var(--dl-muted); }
.download-card h2 {
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  font-weight: 800;
  margin: 16px 0 14px;
  text-wrap: balance;
}
.download-card h2 .accent { color: var(--dl-accent); display: block; }
.download-card p {
  margin: 0;
  color: var(--dl-body);
  font-size: 16.5px;
  max-width: 420px;
  text-wrap: pretty;
}
.store-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}
.store-btn {
  appearance: none;
  background: var(--dl-store-bg);
  color: #15140f;
  border: 0;
  border-radius: 16px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
  position: relative;
  z-index: 1;
}
.store-btn:hover { background: var(--dl-store-bg-hover); transform: translateY(-1px); text-decoration: none; }
.store-btn .glyph {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
}
.store-btn .lines {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}
.store-btn .top {
  font-size: 11px;
  font-weight: 500;
  color: #6b6659;
  letter-spacing: 0.04em;
}
.store-btn .bot {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: #15140f;
  margin-top: 2px;
}
.store-btn .badge-mono {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b6659;
  padding-left: 12px;
  border-left: 1px solid #e5e2da;
  align-self: stretch;
  display: flex;
  align-items: center;
}

/* ---------- Policy + Terms ---------- */
.doc {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  box-shadow: var(--shadow-soft);
}
.doc + .doc { margin-top: 24px; }
.doc h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
}
.doc h3:first-of-type { margin-top: 0; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc .legal-emph {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 10px 0 16px;
  font-size: 13.5px;
  line-height: 1.6;
  letter-spacing: 0.005em;
}
.doc p {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 68ch;
}
.doc ul {
  margin: 8px 0 16px;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 68ch;
}
.doc li { margin-bottom: 4px; }
.doc .updated {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--hair);
  padding: 56px 0 80px;
  margin-top: 24px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.foot-wordmark {
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.025em;
}
.foot-wordmark .dot { color: var(--accent); }
.foot-tag {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 320px;
}
.foot-col h4 {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin: 4px 0 14px;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 8px; }
.foot-col a, .foot-col button.linklike {
  color: var(--ink);
  font-size: 15px;
  background: transparent; border: 0; padding: 0; font: inherit; cursor: pointer;
}
.foot-col a:hover, .foot-col button.linklike:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom {
  margin-top: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 48px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .phone-stack { order: -1; }
  .phone { width: 280px; }
  .section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
  .what { grid-template-columns: 1fr; }
  .promise-card, .doc { padding: 32px 26px; }
  .download-card { grid-template-columns: 1fr; padding: 36px 28px; gap: 24px; }
  .store-btn .badge-mono { display: none; }
  .promise-row { grid-template-columns: 72px 1fr; gap: 16px; padding: 18px 0; }
  .promise-row .meta { grid-column: 1 / -1; text-align: left; }
  .promise-row .n { font-size: 28px; }
  .promise-row .label { font-size: 18px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav-tabs .nav-tab { padding: 8px 10px; font-size: 13px; }
  section.block { padding: 64px 0; }
}
@media (max-width: 540px) {
  .nav-tab.hide-sm { display: none; }
  h1.hero-title { font-size: 44px; }
}

/* Subtle reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Progressive enhancement: if JS disabled, show all content immediately */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* Reduced motion: respect user preference */
@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;
  }
  .reveal { opacity: 1; transform: none; }
}
