/* Notes from the Cafe — the blog's only stylesheet.
   Colors and fonts mirror the app's tokens (ui/src/assets/tokens.css): the
   warm-cafe day palette, and night from the same theme choice (`lsc-theme`).
   Sizes are plain rem against a 16px root (the app's 24px root is its own). */

:root {
  color-scheme: light;
  --paper: #f5efe2;
  --paper-2: #efe7d4;
  --card: #fbf7ec;
  --ink: #1b1611;
  --ink-2: #3d342a;
  --ink-3: #6e5f4c;
  --ink-4: #9a8561;
  --rule: #d8cdb3;
  --rule-soft: #e4dac2;
  --accent: #7a3b1d;
  --accent-2: #9a5234;
  --accent-wash: #f0e4d4;
  --on-accent: #f5efe2;
  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

:root[data-theme='night'] {
  color-scheme: dark;
  --paper: #211a12;
  --paper-2: #2a2217;
  --card: #2d2418;
  --ink: #f0e8d9;
  --ink-2: #d9cdb6;
  --ink-3: #ac9c7e;
  --ink-4: #8a795b;
  --rule: #4c3f2b;
  --rule-soft: #3a3021;
  --accent: #d08e5c;
  --accent-2: #dda271;
  --accent-wash: #382c1e;
  --on-accent: #211a12;
}

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

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.1875rem; /* 19px: comfortable for long reading at any age */
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  /* As the app (base.css). */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-2); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--card); color: var(--ink); padding: 0.5rem 0.75rem;
  font-family: var(--font-sans); font-size: 0.875rem;
}
.skip:focus { left: 0.75rem; top: 0.75rem; z-index: 10; }

/* ── Header and footer ─────────────────────────────────────────────
   Measured from the app's public nav (UiNavBar.vue, logged out) and footer
   (SiteFooter.vue) so the two read as one site: the app's 24px root makes its
   Tailwind sizes 1.5x, so the values here are the computed pixels. */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-row {
  max-width: 1152px; margin: 0 auto; height: 96px; padding: 0 48px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; flex-direction: column; line-height: 1; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  font-family: var(--font-serif); font-size: 27px; font-weight: 500;
  letter-spacing: -0.675px; color: var(--ink);
}
.brand-mark em, .footer-mark em { font-style: italic; font-weight: 400; color: var(--accent); }
.footer-mark em { font-style: normal; }
.brand-beta {
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 2.1px;
  color: var(--ink-4); margin-top: 3px;
}
.site-nav { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.site-nav a, .more-menu a {
  font-family: var(--font-sans); font-size: 19.5px; line-height: 29.25px; font-weight: 500;
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
}
.site-nav a { padding: 9px 18px; border-radius: 9px; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active, .more-menu a.is-active { color: var(--accent); }
.header-end { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }

/* The ☰: only below 900px, where the four links no longer fit. A native
   <details>, so it opens without script. */
.more { position: relative; display: none; }
.more summary {
  list-style: none; cursor: pointer; width: 54px; height: 54px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2);
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover, .more[open] summary { background: var(--paper-2); }
.more summary svg { width: 30px; height: 30px; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 20; width: 220px;
  padding: 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 24px 50px -20px rgba(60, 40, 20, 0.3);
}
.more-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 9px; color: var(--ink-2); }
.more-menu a:hover { background: var(--paper-2); }
.more-menu svg { width: 24px; height: 24px; flex-shrink: 0; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .more { display: block; }
}
@media (max-width: 639px) {
  .header-row { height: 84px; padding: 0 16px; gap: 8px; }
  .header-end { gap: 8px; }
}

.site-footer { margin-top: 4rem; border-top: 1px solid var(--rule-soft); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-row {
  max-width: 1152px; margin: 0 auto; padding: 48px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 36px;
}
.footer-mark { margin: 0; font-family: var(--font-serif); font-size: 22.5px; color: var(--ink-3); }
.footer-line { margin: 0; font-family: var(--font-sans); font-size: 18.75px; color: var(--ink-4); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 30px; font-family: var(--font-sans); font-size: 18.75px; }
.site-footer nav a { color: var(--ink-4); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink-2); }
@media (max-width: 639px) {
  .footer-row { padding: 48px 36px; }
}

/* ── Type ──────────────────────────────────────────────────────────── */
main { padding-top: 2.5rem; }
h1, h2, h3 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2.125rem, 5vw, 2.75rem); margin: 0 0 0.75rem; }
.lede { font-size: 1.3125rem; color: var(--ink-3); margin: 0 0 2rem; }
.meta, .byline, .crumbs, .topics, .count, .pager, .empty {
  font-family: var(--font-sans); font-size: 0.875rem; color: var(--ink-4);
}
.crumbs { margin-bottom: 1rem; }
.crumbs a, .byline a, .topics a { color: var(--ink-3); }

/* ── Blog home ─────────────────────────────────────────────────────── */
.blog-intro { margin-bottom: 1rem; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-card { padding: 1.5rem 0; border-top: 1px solid var(--rule-soft); }
.post-card .meta { margin: 0 0 0.35rem; }
.post-card h2 { font-size: 1.625rem; margin: 0 0 0.35rem; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-card .summary { margin: 0; color: var(--ink-2); }
.empty { font-size: 1rem; padding: 1.5rem 0; border-top: 1px solid var(--rule-soft); }
.topic-list { font-family: var(--font-sans); font-size: 1rem; }

/* ── A post ────────────────────────────────────────────────────────── */
.post-header { margin-bottom: 2rem; }
.byline { margin: 0; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.75rem; margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: 1.375rem; margin: 2rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose li { margin-bottom: 0.35rem; }
.prose blockquote {
  margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic;
}
.prose hr { border: 0; text-align: center; margin: 2.5rem 0; }
.prose hr::before { content: '· · ·'; color: var(--ink-4); letter-spacing: 0.5em; }
.prose code { font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.3em; border-radius: 3px; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--font-sans); font-size: 0.9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule-soft); padding: 0.5rem 0.75rem 0.5rem 0; text-align: left; vertical-align: top; }

figure { margin: 2rem 0; }
figure img { display: block; border-radius: 10px; }
figcaption { font-family: var(--font-sans); font-size: 0.875rem; color: var(--ink-3); margin-top: 0.6rem; }

.video-poster, .video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 0; }
.video-poster {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.25rem;
  padding: 1.25rem; text-decoration: none; color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
}
.video-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4.5rem; height: 4.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--accent); font-size: 1.5rem; padding-left: 0.25rem;
}
.video-title { font-size: 1.375rem; line-height: 1.2; }
.video-note { font-family: var(--font-sans); font-size: 0.8125rem; opacity: 0.85; }

.topics { margin-top: 2rem; }

/* ── Author note ───────────────────────────────────────────────────
   The disclosed affiliation at the end of a post: quiet, set apart by a rule,
   a text link rather than a button. */
.author-note {
  margin: 3rem 0 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.6; color: var(--ink-3);
}
.author-note p { margin: 0 0 0.5rem; }
.author-note strong { color: var(--ink-2); font-weight: 500; }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin: 2rem 0; }

@media (max-width: 30rem) {
  body { font-size: 1.125rem; }
  main { padding-top: 1.75rem; }
}

@media print {
  .site-header, .site-footer, .pager, .video { display: none; }
  body { background: #fff; color: #000; }
}
