:root {
  --ink: #111111;
  --body: #2f2f2f;
  --soft: #6a6a6a;
  --muted: #9a9a9a;
  --link: #2d6df6;
  --bg: #ffffff;
  --hair: #ededed;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--body);
  font-family: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 680px; margin: 0 auto; padding: 56px 28px 72px; }

/* Index masthead */
.masthead { margin: 4px 0 8px; }
.masthead-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.masthead-title { font-size: 34px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; margin: 0 0 8px; line-height: 1.1; }
.masthead-tagline { font-size: 17px; font-weight: 500; color: var(--soft); margin: 0; }

/* Post list (cards) */
.posts { margin: 30px 0 0; }
.post-item { border-top: 1px solid var(--hair); }
.post-item:last-child { border-bottom: 1px solid var(--hair); }
.post-item-link { display: block; padding: 26px 0; color: inherit; }
.post-item-link:hover { text-decoration: none; }
.post-item-date { font-size: 12.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 7px; }
.post-item-title { font-size: 21px; font-weight: 700; color: var(--ink); letter-spacing: -0.018em; line-height: 1.25; margin: 0 0 8px; transition: color 0.15s ease; }
.post-item-link:hover .post-item-title { color: var(--link); }
.post-item-excerpt { font-size: 15.5px; line-height: 1.55; margin: 0 0 10px; color: var(--soft); max-width: 60ch; }
.post-item-more { font-size: 13.5px; font-weight: 600; color: var(--muted); transition: color 0.15s ease; }
.post-item-link:hover .post-item-more { color: var(--link); }
.post-item-arrow { display: inline-block; transition: transform 0.15s ease; }
.post-item-link:hover .post-item-arrow { transform: translateX(3px); }

/* Topic chips + filter (index) */
.topic-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.topic-filter button { font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--soft); background: #fafafa; border: 1px solid var(--hair); border-radius: 999px; padding: 5px 13px; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.topic-filter button:hover { color: var(--ink); border-color: #d8d8d8; }
.topic-filter button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.topic-filter .topic-count { color: var(--muted); font-weight: 500; margin-left: 5px; }
.topic-filter button[aria-pressed="true"] .topic-count { color: rgba(255,255,255,0.6); }
.post-item.is-hidden { display: none; }
.posts-empty { font-size: 15px; color: var(--muted); margin: 28px 0 0; display: none; }
.post-item-topics { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.topic-chip { font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--soft); background: #f4f4f4; border-radius: 999px; padding: 3px 10px; }

/* Topic chips (post header) */
.post-head-topics { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.post-head-topics a { font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--soft); background: #f4f4f4; border-radius: 999px; padding: 3px 10px; }
.post-head-topics a:hover { color: var(--ink); text-decoration: none; }

/* Owner-only scoring control (hidden until /api/me confirms the session). */
.score-control { display: none; align-items: center; gap: 2px; margin: 14px 0 0; }
.score-control.is-owner { display: inline-flex; }
.post-item .score-control { margin: 12px 0 0; }
.score-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.score-star { font: inherit; font-size: 18px; line-height: 1; background: none; border: 0; padding: 0 1px; cursor: pointer; color: #dcdcdc; transition: color 0.12s ease; }
.score-star.on { color: #f5a623; }
.score-control:hover .score-star { color: #dcdcdc; }
.score-star:hover, .score-star:hover ~ .score-star { color: #dcdcdc; }
.score-star.hot { color: #f5a623; }
.score-clear { font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: none; border: 0; cursor: pointer; margin-left: 10px; }
.score-clear:hover { color: var(--ink); }

.site-foot { margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--hair); font-size: 14px; line-height: 1.6; color: var(--muted); }
.site-foot strong { color: var(--ink); font-weight: 600; }

/* Post */
.back-top { margin: 0 0 36px; padding: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.back-top:hover { color: var(--ink); text-decoration: none; }
.post-head { margin: 0 0 32px; }
.post-head h1 { font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; line-height: 1.18; margin: 0 0 10px; }
.post-head-meta { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0; }
.content h2 a, .content h3 a { color: inherit; }
.content { font-size: 16.5px; line-height: 1.65; }
.content h2 { font-size: 21px; font-weight: 600; color: var(--ink); margin: 38px 0 12px; letter-spacing: -0.01em; }
.content h3 { font-size: 18px; font-weight: 600; color: var(--ink); margin: 30px 0 10px; }
.content p { margin: 0 0 18px; }
.content ul, .content ol { padding-left: 22px; margin: 0 0 18px; }
.content li { margin: 0 0 8px; }
/* Tables and figures break out wider than the reading column. */
.content table { border-collapse: collapse; width: min(94vw, 920px); margin: 26px 0; font-size: 14px;
  position: relative; left: 50%; transform: translateX(-50%); }
.content th, .content td { text-align: left; padding: 8px 12px; border: 1px solid var(--hair); vertical-align: top; }
.content th { white-space: nowrap; }
.content th { background: #fafafa; font-weight: 600; color: var(--ink); }
.content blockquote { margin: 0 0 18px; padding: 2px 0 2px 18px; border-left: 2px solid var(--hair); color: var(--muted); font-style: italic; }
.content img { max-width: 100%; height: auto; border-radius: 6px; }
.content figure { margin: 30px 0; width: min(94vw, 920px); position: relative; left: 50%; transform: translateX(-50%); }
.content figure svg { display: block; width: 100%; height: auto; }
.content figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: #f5f5f5; padding: 1px 5px; border-radius: 4px; }
.content pre { background: #f7f7f7; padding: 16px; border-radius: 8px; overflow-x: auto; }
.content pre code { background: none; padding: 0; }
.content hr { border: none; border-top: 1px solid var(--hair); margin: 32px 0; }

.related { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--hair); }
.related h2 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 14px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin: 0 0 10px; }
.related a { font-size: 16px; font-weight: 500; color: var(--ink); }
.related a:hover { color: var(--link); text-decoration: none; }

.byline { display: flex; gap: 14px; align-items: flex-start; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--hair); font-size: 14px; line-height: 1.55; color: var(--muted); }
.byline strong { color: var(--ink); font-weight: 600; }
.byline-photo { border-radius: 50%; flex: 0 0 auto; object-fit: cover; }
.byline-updated { color: var(--muted); }

.back { margin-top: 32px; display: inline-block; font-size: 15px; color: var(--muted); }
.back:hover { color: var(--ink); text-decoration: none; }

/* Audio player ("Listen" — ElevenLabs narration) */
.audio-player { margin: 0 0 30px; padding: 13px 16px; border: 1px solid var(--hair); border-radius: 11px; background: #fafafa; }
.audio-player-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 9px; }
.audio-player audio { width: 100%; height: 36px; display: block; }

/* Hidden GEO playbook — no visible affordance; type "geo" or click the corner hotspot. */
.geo-dot { position: fixed; right: 8px; bottom: 8px; width: 14px; height: 14px; padding: 0; border: 0; background: transparent; opacity: 0; cursor: default; z-index: 40; }
.geo-overlay { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(12, 14, 22, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.geo-overlay.open { display: flex; }
.geo-card { position: relative; width: 100%; max-width: 720px; max-height: 84vh; overflow: auto; background: #0f1115; color: #d7dbe4; border: 1px solid #232733; border-radius: 14px; padding: 28px 30px 26px; box-shadow: 0 24px 70px rgba(0,0,0,0.45); font-size: 14px; line-height: 1.55; }
.geo-card h2 { color: #fff; font-size: 18px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.geo-sub { color: #8a93a3; font-size: 12.5px; margin: 0 0 22px; }
.geo-group { margin: 0 0 18px; }
.geo-group h3 { color: #7fb0ff; font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; margin: 0 0 9px; }
.geo-group ul { margin: 0; padding-left: 18px; }
.geo-group li { margin: 0 0 7px; color: #c4cad6; }
.geo-foot { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid #232733; color: #6b7585; font-size: 11.5px; }
.geo-close { position: absolute; top: 22px; right: 24px; border: 1px solid #2c313d; background: #181b22; color: #8a93a3; font: inherit; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.geo-close:hover { color: #fff; border-color: #3a4150; }

@media (max-width: 700px) {
  .content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 480px) {
  .wrap { padding: 44px 24px 56px; }
  .masthead-title { font-size: 28px; }
  .post-head h1 { font-size: 26px; }
  .post-item-title { font-size: 19px; }
}