/* A calm, reading-first style for the blog-only site.
   Soft off-white paper, gentle ink, one blue accent. Follows the visitor's
   light or dark system setting. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-var-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfaf7;
  --ink: #2b2d31;
  --muted: #6b6f76;
  --rule: #e7e4dc;
  --accent: #2f5fd0;
  --accent-ink: #ffffff;
  --accent-soft: #e9effc;
  --code-bg: #f1efe9;
  color-scheme: light;
}
/* Dark: follows the system unless the visitor picked a theme with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181b;
    --ink: #d9d7d2;
    --muted: #9a9ca1;
    --rule: #2c2e33;
    --accent: #8bb0f5;
    --accent-ink: #12141a;
    --accent-soft: #1f2a40;
    --code-bg: #212226;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17181b;
  --ink: #d9d7d2;
  --muted: #9a9ca1;
  --rule: #2c2e33;
  --accent: #8bb0f5;
  --accent-ink: #12141a;
  --accent-soft: #1f2a40;
  --code-bg: #212226;
  color-scheme: dark;
}

/* ---------- Reading tools: text size and theme ---------- */
.tools { display: inline-flex; align-items: center; gap: 6px; }
.tool {
  display: inline-grid; place-items: center;
  min-width: 36px; height: 36px; padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 600 0.875rem/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool:active { transform: scale(0.94); background: var(--accent-soft); }
.tool:disabled { opacity: 0.4; cursor: default; transform: none; border-color: var(--rule); color: var(--ink); }
.tool svg { width: 18px; height: 18px; }
.tool .small { font-size: 0.75rem; }
.tool .large { font-size: 1rem; }
.tools .sep { width: 1px; height: 20px; background: var(--rule); margin: 0 4px; }
/* Show the icon for the theme you would switch TO. */
.tool .sun { display: none; }
:root[data-theme="dark"] .tool .sun { display: block; }
:root[data-theme="dark"] .tool .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .tool .sun { display: block; }
  :root:not([data-theme]) .tool .moon { display: none; }
}
.top-right { display: flex; align-items: center; gap: 16px; }
.home-tools { position: fixed; top: 16px; right: 16px; z-index: 2; }
.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; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

h1, h2, h3 {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ---------- The one button ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1.0625rem/1 "Inter", system-ui, sans-serif;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(47, 95, 208, 0.22); text-decoration: none; }
.button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.button .arrow { transition: transform 0.15s ease; }
.button:hover .arrow { transform: translateX(3px); }

/* ---------- Home ---------- */
.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
}
.home .logo {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 1.125rem/1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.home h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 0 0 12px; font-weight: 700; }
.home p { margin: 0 0 36px; color: var(--muted); max-width: 30rem; }

/* ---------- Reading pages ---------- */
.page { max-width: 42rem; margin: 0 auto; padding: 32px 20px 80px; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 20px; margin-bottom: 48px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.top a { color: var(--muted); text-decoration: none; }
.top a:hover { color: var(--accent); }
.top .home-link { font-weight: 600; color: var(--ink); }

.eyebrow { font-size: 0.875rem; color: var(--muted); margin: 0 0 8px; }

/* Blog list */
.page > h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 40px; }
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { border-top: 1px solid var(--rule); }
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts a { display: block; padding: 24px 0; color: inherit; text-decoration: none; }
.posts h2 { font-size: 1.375rem; margin: 0 0 6px; transition: color 0.15s ease; }
.posts a:hover h2 { color: var(--accent); }
.posts p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.posts .meta { font-size: 0.875rem; margin-top: 10px; }

/* Article */
article header h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); margin: 0 0 14px; }
article header .meta { color: var(--muted); font-size: 0.9375rem; margin: 0 0 40px; }
article h2 { font-size: 1.5rem; margin: 2.2em 0 0.6em; }
article p, article ul, article ol { margin: 0 0 1.25em; }
article ul, article ol { padding-left: 1.3em; }
article li { margin-bottom: 0.4em; }
article li::marker { color: var(--muted); }
article code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
article blockquote {
  margin: 1.6em 0; padding: 0.2em 0 0.2em 1.2em;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
}
.end {
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem; color: var(--muted);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.end a { text-decoration: none; }

@media (max-width: 480px) {
  body { font-size: 1.0625rem; }
  .top { margin-bottom: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Long-form article extras ---------- */
.dek { font-size: 1.1875rem; line-height: 1.6; color: var(--muted); margin: 0 0 18px; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 0.9375rem; margin: 0 0 32px; }
.byline strong { color: var(--ink); font-weight: 600; }
.hero-img { margin: 0 0 40px; }
.hero-img img { border-radius: 14px; }
article h3 { font-size: 1.1875rem; margin: 1.8em 0 0.5em; }

figure { margin: 2em 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--rule); }
figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 10px; line-height: 1.55; }

.takeaways {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 22px 26px 8px;
  margin: 2em 0;
}
.takeaways h2 { font-size: 1.125rem; margin: 0 0 10px; }
.takeaways ul { margin: 0 0 1em; }
.takeaways li { font-size: 1rem; line-height: 1.65; }

.toc { border-left: 2px solid var(--rule); padding: 2px 0 2px 20px; margin: 2em 0; }
.toc-title { font-weight: 600; font-size: 0.9375rem; margin: 0 0 6px !important; }
.toc ol { margin: 0 !important; padding-left: 1.2em; font-size: 0.9375rem; line-height: 1.6; }
.toc li { margin: 0.2em 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; margin: 2em 0; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
caption { text-align: left; color: var(--muted); font-size: 0.875rem; padding-bottom: 10px; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 600; border-bottom: 2px solid var(--rule); }
tbody th { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.faq h3 { font-size: 1.0625rem; margin: 1.5em 0 0.35em; }
.faq p { margin-bottom: 0.8em; }

.sources { font-size: 0.9375rem; line-height: 1.6; }
.sources li { margin-bottom: 0.7em; overflow-wrap: anywhere; }

.author-box { margin-top: 48px; padding: 20px 22px; border: 1px solid var(--rule); border-radius: 14px; font-size: 0.9375rem; line-height: 1.6; color: var(--muted); }
.author-box strong { color: var(--ink); }

/* Very small phones: let the header wrap instead of overflowing. */
.top { flex-wrap: wrap; row-gap: 12px; column-gap: 12px; }
@media (max-width: 380px) {
  .top-right { gap: 10px; }
  .tools { gap: 4px; }
  .tools .sep { display: none; }
  .tool { min-width: 32px; height: 32px; padding: 0 6px; }
}
