/* primerapp.ai — the only stylesheet.
   Tokens lifted from the app's "Daylight" system so the site and the app read
   as one product. No webfont, no CDN, no external request of any kind. */

:root {
  --accent: #5B6ABF;
  --accent-ink: #FFFFFF;
  /* Link *text* only. #5B6ABF is 4.93:1 on --card but 4.49:1 on --bg, which
     misses 4.5:1 — and links sit on --bg in the nav, footer and post lists.
     This is the same indigo a shade darker: 5.45:1 on --card, 4.96:1 on --bg.
     Darker, never lighter, per the spec. Buttons, marks, borders and the focus
     ring keep --accent exactly. */
  --accent-text: #5563B7;
  --bg: #F4F4F6;
  --card: #FFFFFF;
  --ink: #17181B;
  --ink-soft: #5B5D66;
  --ask-bg: #E8F3EC;
  --ask-ink: #1E6B43;
  --radius-card: 18px;
  --radius-pill: 999px;

  --rule: rgba(23, 24, 27, 0.10);
  --shadow: 0 1px 2px rgba(23, 24, 27, 0.05), 0 8px 24px rgba(23, 24, 27, 0.06);
  --measure: 68ch;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark mode. Accent lightened only here: #5B6ABF on a dark surface is too low
   contrast, #98A4E8 on #17181B is ~7.4:1. Light mode keeps #5B6ABF exactly. */
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #98A4E8;
    --accent-ink: #14151A;
    /* On dark surfaces #98A4E8 is already 7.28:1, so text and fill agree. */
    --accent-text: #98A4E8;
    --bg: #101116;
    --card: #191A20;
    --ink: #ECEDF2;
    --ink-soft: #A3A6B4;
    --ask-bg: #16281E;
    --ask-ink: #8FD3AC;
    --rule: rgba(236, 237, 242, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

/* ---------- links and focus ---------- */

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-pill);
  z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { display: block; }

section { padding: 3rem 0; }
section + section { border-top: 1px solid var(--rule); }

/* ---------- header ---------- */

.site-header { padding: 1.5rem 0; }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand img { display: block; width: 32px; height: 32px; }
.brand:hover { text-decoration: underline; }

.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }

/* ---------- typography ---------- */

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.lede { font-size: 1.15rem; color: var(--ink-soft); }
.soft { color: var(--ink-soft); }

/* ---------- hero ---------- */

.hero { padding: 2.5rem 0 3.5rem; border-top: 0; }
.hero .mark { width: 64px; height: 64px; display: block; margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 2.9rem); margin-bottom: 0.4em; }
.hero .lede { max-width: 54ch; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-pill);
}
.btn:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- three blocks ---------- */

.blocks {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .blocks { grid-template-columns: repeat(3, 1fr); }
}

.block {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.block h3 { margin-bottom: 0.35em; }
.block p { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }

/* ---------- privacy promise ---------- */

.promise {
  background: var(--ask-bg);
  color: var(--ask-ink);
  border-radius: var(--radius-card);
  padding: 1.75rem;
}
.promise h2 { color: var(--ask-ink); }
.promise ul { margin: 0; padding-left: 1.25rem; }
.promise li { margin-bottom: 0.5em; }
.promise li:last-child { margin-bottom: 0; }
.promise strong { font-weight: 700; }

/* ---------- post list (landing "latest writing" + /blog/) ---------- */

.posts { list-style: none; margin: 0; padding: 0; }

.posts li { border-top: 1px solid var(--rule); }
.posts li:first-child { border-top: 0; }

.post-link {
  display: block;
  padding: 1.25rem 0;
  text-decoration: none;
  color: inherit;
}
.post-link:hover .post-title { text-decoration: underline; text-decoration-thickness: 2px; }

.post-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent-text);
  margin-bottom: 0.2em;
}
.post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.4em;
}
.post-excerpt { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }

.more { margin-top: 1.5rem; font-size: 0.95rem; }

.empty {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

/* ---------- article ---------- */

.article {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  margin: 1rem 0 2rem;
}

@media (min-width: 720px) {
  .article { padding: 3rem 2.5rem; }
}

.article-head { margin-bottom: 2rem; }
.article-head h1 { margin-bottom: 0.3em; }
.article-head .post-date { font-size: 0.9rem; margin: 0; }

.article-body > :first-child { margin-top: 0; }
.article-body > :last-child { margin-bottom: 0; }
.article-body h2 { margin-top: 2em; }
.article-body h3 { margin-top: 1.75em; }

.article-body ul, .article-body ol { padding-left: 1.4rem; margin: 0 0 1.15em; }
.article-body li { margin-bottom: 0.4em; }

.article-body blockquote {
  margin: 1.5em 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}

.article-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5em 0;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  margin: 1.5em 0;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

.article-body pre {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0 0 1.15em;
}
.article-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.88em;
}

.back-link { display: inline-block; font-size: 0.95rem; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- 404 ---------- */

.notfound { padding: 5rem 0; text-align: center; }
.notfound .lede { margin-left: auto; margin-right: auto; }
.cta-row.center { justify-content: center; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fade-in 420ms ease-out both; }
  @keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
}
