/* ════════════════════════════════════════════════════════════════════
   MOONDOG · Marketing site layer — builds on app.css design tokens.
   Header / nav / footer / hero / sections / animations.
   ════════════════════════════════════════════════════════════════════ */

img, svg, video { max-width: 100%; height: auto; }
.img-fluid { display: block; border-radius: var(--r-lg); }

/* ── Skip link (a11y) ── */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r-md); }
.skip-link:focus { left: 12px; top: 12px; }

/* Consistent, visible keyboard focus for links and header chrome
   (buttons/inputs are handled in app.css). Mouse clicks stay ring-free. */
a:focus-visible,
.lang-current:focus-visible,
.icon-btn:focus-visible,
.nav-toggle:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; border-radius: var(--r-sm); }

/* ── Site header / nav (extends .topbar from app.css) ── */
.site-header { padding-inline: clamp(16px, 4vw, 40px); }
.site-header .brand { font-size: 19px; }
.site-header .brand .mark { font-size: 21px; }
.nav-links a.navlink { font-size: 14px; color: var(--text-soft); padding: 8px 12px; border-radius: var(--r-md); transition: color .18s var(--ease), background .18s var(--ease); }
.nav-links a.navlink:hover, .nav-links a.navlink[aria-current="page"] { color: var(--text); background: var(--accent-bg); }
.nav-toggle { width: 42px; height: 42px; border-radius: var(--r-md); border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-size: 18px; line-height: 1; align-items: center; justify-content: center; }
.nav-toggle:hover { border-color: var(--border-strong); }
.nav-cta { margin-left: 4px; }

/* ── Mobile nav dropdown (refines the design-system collapse) ── */
@media (max-width: 860px) {
  .site-header.nav-open .nav-links { gap: 2px; padding: 10px 16px 18px; border-top: 1px solid var(--border-soft); }
  .site-header.nav-open .nav-links a.navlink { font-size: 16px; padding: 13px 10px; width: 100%; }
  .site-header.nav-open .nav-links .lang-menu,
  .site-header.nav-open .nav-links .theme-menu { align-self: flex-start; margin-top: 8px; }
  .site-header.nav-open .nav-links .lang-pop,
  .site-header.nav-open .nav-links .theme-pop { right: auto; left: 0; }
  .site-header.nav-open .nav-links .nav-cta { width: 100%; justify-content: center; margin: 12px 0 0; padding: 13px; font-size: 15px; }
}

/* ── Language switcher ── */
.lang-switch { position: relative; display: inline-flex; }
.lang-switch > summary { list-style: none; cursor: pointer; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-current { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-soft); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; transition: border-color .18s var(--ease), color .18s var(--ease); }
.lang-switch[open] .lang-current, .lang-current:hover { border-color: var(--accent); color: var(--accent); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); padding: 6px; z-index: 60; }
.lang-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--text); }
.lang-menu a:hover { background: var(--accent-bg2); color: var(--accent); }
.lang-menu a[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* ── Theme menu (light / dark / system) ── */
.theme-menu { position: relative; display: inline-flex; }
.theme-menu > summary { list-style: none; cursor: pointer; }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); padding: 6px; z-index: 60; min-width: 150px; }
.theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; }
.theme-opt:hover { background: var(--accent-bg2); color: var(--accent); }
.theme-opt[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.theme-opt[aria-checked="true"]::after { content: "✓"; margin-left: auto; }

/* ── Sections ── */
.section { width: 100%; margin: 0 auto; padding: clamp(56px, 9vw, 120px) 20px; max-width: calc(var(--w-workspace) + 40px); }
.section.tight { padding-block: clamp(40px, 6vw, 72px); }
.section.narrow { max-width: calc(var(--w-form) + 40px); }
.section + .section { padding-top: 0; }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { display: block; margin-bottom: 14px; }
.section-head h2 { margin-bottom: 14px; }

/* ── Hero ── */
.hero { width: 100%; margin: 0 auto; max-width: calc(var(--w-workspace) + 40px); padding: clamp(44px, 6.5vw, 88px) 20px clamp(44px, 6vw, 80px); }
.hero.center { text-align: center; }
.hero .eyebrow { display: block; margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 5.8vw, 70px); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 22px; max-width: 18ch; }
.hero.center h1 { margin-inline: auto; }
.hero .lede { max-width: 56ch; margin-bottom: 30px; font-size: clamp(16.5px, 1.7vw, 20px); line-height: 1.58; color: var(--text-soft); }
.hero.center .lede { margin-inline: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero.center .hero-actions { justify-content: center; }
.hero-usps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 44px auto 0; padding: 28px 0 0; max-width: 1000px; border-top: 1px solid var(--border); text-align: left; }
.hero-usps li { display: flex; flex-direction: column; gap: 5px; }
.hero-usps strong { font-size: 14.5px; color: var(--text); position: relative; padding-left: 20px; }
.hero-usps strong::before { content: "\2726"; position: absolute; left: 0; top: 1px; color: var(--accent); font-size: 11px; }
.hero-usps span { font-size: 13px; color: var(--text-muted); line-height: 1.5; padding-left: 20px; }
@media (max-width: 760px) { .hero-usps { grid-template-columns: 1fr; gap: 16px; max-width: 440px; } }

/* ── Feature grid ── */
.features { display: grid; gap: 20px; }
.features.cols-2 { grid-template-columns: repeat(2, 1fr); }
.features.cols-3 { grid-template-columns: repeat(3, 1fr); }
.features.cols-4 { grid-template-columns: repeat(4, 1fr); }
.feature { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; transition: border-color .25s var(--ease), transform .25s var(--ease); }
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature .feature-ico { color: var(--accent); margin-bottom: 16px; line-height: 0; min-height: 26px; }
.feature .feature-ico svg { width: 26px; height: 26px; display: block; }
.feature .feature-ico-char { font-size: 22px; line-height: 1; }
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { color: var(--text-soft); font-size: 14px; line-height: 1.6; margin: 0; }
@media (max-width: 900px) { .features.cols-3, .features.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features.cols-2, .features.cols-3, .features.cols-4 { grid-template-columns: 1fr; } }

/* ── CTA band ── */
.cta-band { width: 100%; margin: 0 auto; max-width: calc(var(--w-workspace) + 40px); padding: 0 20px clamp(56px, 9vw, 110px); }
.cta-inner { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(36px, 6vw, 64px); text-align: center; box-shadow: var(--shadow-soft); }
.cta-inner h2 { margin-bottom: 14px; }
.cta-inner p { color: var(--text-soft); max-width: 52ch; margin: 0 auto 28px; }

/* ── Prose (rich text) ── */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose p, .prose li { color: var(--text-soft); line-height: 1.7; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 18px; color: var(--text); font-family: var(--serif); font-size: 19px; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); background: var(--bg1); margin-top: 40px; }
.footer-inner { width: 100%; margin: 0 auto; max-width: calc(var(--w-workspace) + 40px); padding: clamp(40px, 6vw, 72px) 20px 40px; display: grid; gap: 40px; grid-template-columns: 1.6fr 1fr 1fr; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-blurb { color: var(--text-soft); font-size: 14px; max-width: 42ch; line-height: 1.6; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: var(--text-soft); font-size: 14px; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 20px 20px 28px; max-width: calc(var(--w-workspace) + 40px); margin: 0 auto; }
.footer-bottom .hint { font-size: 12.5px; }
.footer-social { display: flex; gap: 12px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .footer-inner { grid-template-columns: 1fr; } }

/* ── Scroll reveal (progressive; honours reduced motion) ── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }
/* No-JS fallback: the inline head script strips .no-js before paint for JS
   users, so this only ever shows content to visitors with JS disabled. */
.no-js .reveal { opacity: 1; transform: none; transition: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { scroll-behavior: auto !important; }
}

/* Staging ribbon */
.staging-ribbon { background: var(--amber); color: var(--on-accent); text-align: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px; }

/* ════════════════════════════════════════════════════════════════════
   Phase 2 — marketing block styles
   ════════════════════════════════════════════════════════════════════ */

/* ── Problem / Solution ── */
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ps-col { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
.ps-problem { background: var(--bg1); }
.ps-solution { border-color: var(--accent-line); }
.ps-col .eyebrow { display: block; margin-bottom: 16px; }
.ps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ps-list li { display: flex; gap: 12px; font-size: 14.5px; color: var(--text-soft); line-height: 1.5; }
.ps-mark { flex: 0 0 auto; width: 20px; text-align: center; }
.ps-x { color: var(--text-dim); }
.ps-check { color: var(--accent); }
.ps-solution .ps-list li { color: var(--text); }
@media (max-width: 720px) { .ps-grid { grid-template-columns: 1fr; } }

/* ── Value proposition ── */
.usp { text-align: center; }
.usp .eyebrow { display: block; margin-bottom: 18px; }
.usp-statement { font-family: var(--serif); font-size: clamp(24px, 3.6vw, 38px); line-height: 1.25; letter-spacing: -0.01em; margin: 0 auto; max-width: 24ch; }
.usp-points { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 3vw, 44px); max-width: 980px; margin: clamp(40px, 5vw, 56px) auto 0; text-align: left; }
.usp-point { flex: 1 1 240px; max-width: 320px; display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 2px solid var(--accent-line); }
.usp-point strong { font-size: 15.5px; color: var(--text); }
.usp-point span { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); }
@media (max-width: 560px) { .usp-point { flex-basis: 100%; max-width: 100%; } }

/* ── Animation wrapper (standalone block) ── */
.anim-frame { max-width: 860px; margin: 0 auto; }

/* ── Security badges ── */
.badge-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 36px; }

/* ── Logo cloud ── */
.logo-cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 36px; }
.logo-chip { font-size: 15px; letter-spacing: .04em; color: var(--text-muted); opacity: .8; }

/* ── Testimonials ── */
.testimonials { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.testimonial { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; margin: 0; }
.testimonial blockquote { margin: 0 0 18px; font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--text); }
.testimonial figcaption { display: flex; flex-direction: column; gap: 2px; }
.t-author { font-size: 14px; font-weight: 500; }
.t-role { font-size: 12.5px; }
@media (max-width: 720px) { .testimonials { grid-template-columns: 1fr; } }

/* ── Stats band ── */
.stats-band { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(36px, 6vw, 84px); padding: clamp(32px, 4vw, 46px); background: var(--bg1); border: 1px solid var(--border); border-radius: var(--r-xl); }
.stat { text-align: center; flex: 0 1 180px; }
.stat-value { font-size: clamp(30px, 4.4vw, 46px); color: var(--accent); line-height: 1; }
.stat-fix { font-size: .6em; }
.stat-label { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 560px) { .stats-band { gap: 32px 44px; } .stat { flex-basis: 130px; } }

/* ── Pricing ── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.tier { position: relative; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.tier-featured { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.tier-badge { position: absolute; top: -11px; left: 30px; }
.tier-name { font-size: 20px; }
.tier-price { font-size: 30px; color: var(--text); }
.tier-period { font-size: 13px; color: var(--text-muted); margin-left: 6px; font-family: var(--sans); }
.tier-desc { font-size: 13.5px; line-height: 1.5; }
.tier-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tier-features li { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-soft); }
.tier-features li span { color: var(--accent); }
.tier .btn { margin-top: 8px; }
@media (max-width: 860px) { .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

/* ── FAQ ── */
.faq { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px; cursor: pointer; list-style: none; font-size: 16px; color: var(--text); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-toggle { flex: 0 0 auto; font-family: var(--mono); color: var(--accent); font-size: 18px; transition: transform .2s var(--ease); }
.faq-item[open] .faq-toggle { transform: rotate(45deg); }
.faq-answer { padding: 0 4px 22px; }
.faq-answer p { margin: 0; color: var(--text-soft); line-height: 1.65; max-width: 60ch; }

/* ════════════════════════════════════════════════════════════════════
   Phase 3 — blog
   ════════════════════════════════════════════════════════════════════ */

/* Toolbar: category filters + RSS */
.blog-toolbar { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.blog-rss { font-size: 11px; letter-spacing: .12em; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; }
.blog-rss:hover { border-color: var(--accent); color: var(--accent); }

/* Post grid + cards */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; transition: border-color .25s var(--ease), transform .25s var(--ease); }
.post-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-card-media { aspect-ratio: 16 / 10; background: var(--bg3); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.post-card-img { width: 100%; height: 100%; object-fit: cover; }
.post-card-cover { width: 100%; height: 100%; }
.cover-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card:hover .cover-art { transform: scale(1.015); }
.cover-art { transition: transform .4s var(--ease); }
.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-cat { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.post-card-title { font-size: 19px; line-height: 1.25; }
.post-card-intro { font-size: 13.5px; color: var(--text-soft); line-height: 1.55; margin: 0; flex: 1; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--text-muted); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 44px; }

/* Article */
.post .breadcrumb { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-muted); margin-bottom: 20px; }
.post .breadcrumb a { color: var(--text-muted); }
.post .breadcrumb a:hover { color: var(--accent); }
.post-header h1 { margin: 10px 0 16px; }
.post-header .lede { margin-bottom: 22px; }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.byline-author { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.byline-avatar { border-radius: 999px; }
.post-hero { margin: 32px 0; }
.post-hero img { border-radius: var(--r-lg); }
.post-hero-cover { aspect-ratio: 21 / 8; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.post-hero-cover .cover-art { height: 100%; }

/* Article body: blocks reuse section wrappers — flatten them inside the post */
.post-body { margin-top: 8px; }
.post-body .section { width: auto; max-width: none; margin: 1.5em 0 0; padding: 0; }
.post-body .section:first-child { margin-top: 0; }
/* Comfortable long-form reading: larger body, capped measure (~66ch). */
.post-body .prose { max-width: 66ch; }
.post-body .prose p, .post-body .prose li { font-size: 17px; line-height: 1.75; }
.post-body .prose h2 { font-size: clamp(24px, 2.4vw, 30px); }
.post-body .prose h3 { font-size: clamp(19px, 1.9vw, 22px); }
.post-body .section-head { margin-bottom: .4em; }
.post-body figure.section img { border-radius: var(--r-lg); }

.pullquote { font-family: var(--serif); font-size: clamp(20px, 3vw, 28px); line-height: 1.35; color: var(--text); border-left: 3px solid var(--accent); padding-left: 22px; margin: 0; }
.pullquote-by { margin-top: 10px; font-size: 13px; padding-left: 22px; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ════════════════════════════════════════════════════════════════════
   Phase 5 — lead capture
   ════════════════════════════════════════════════════════════════════ */
.nav-cta { margin-left: 4px; }
.lead-form { margin-top: 8px; }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.lead-grid .field-wide { grid-column: 1 / -1; }
.field-consent { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 20px; }
.field-consent input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
.field-consent label { font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }
.lead-thanks { text-align: center; padding: clamp(40px, 8vw, 80px) 0; }
.lead-thanks-mark { display: block; font-size: 40px; color: var(--accent); margin-bottom: 18px; }
.lead-thanks p { font-family: var(--serif); font-size: clamp(20px, 3vw, 28px); margin-bottom: 28px; }
@media (max-width: 560px) { .lead-grid { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════════════════════════════
   Phase 9 — article data blocks (stat callout, bar chart, data table)
   ════════════════════════════════════════════════════════════════════ */
.stat-callout { display: flex; flex-direction: column; gap: 6px; margin: 32px 0; padding: 24px 28px; border-left: 3px solid var(--accent); background: var(--bg1); border-radius: var(--r-md); }
.stat-callout-value { font-family: var(--serif); font-size: clamp(34px, 5.5vw, 54px); line-height: 1; color: var(--accent); }
.stat-callout-label { font-size: 15px; color: var(--text-soft); line-height: 1.5; max-width: 52ch; }
.stat-callout-source { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }

.chart { margin: 32px 0; }
.chart-title { font-size: 14px; font-weight: 500; margin-bottom: 18px; color: var(--text); }
.chart-bars { display: flex; flex-direction: column; gap: 12px; }
.chart-row { display: grid; grid-template-columns: minmax(96px, 30%) 1fr auto; align-items: center; gap: 14px; }
.chart-label { font-size: 13px; color: var(--text-soft); }
.chart-track { height: 14px; background: var(--bg3); border-radius: 999px; overflow: hidden; }
.chart-fill { display: block; height: 100%; width: var(--w); min-width: 2px; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); border-radius: 999px; }
.chart-val { font-size: 12.5px; color: var(--text); text-align: right; min-width: 52px; }
.chart-source, .data-table-source { font-size: 11px; color: var(--text-muted); margin-top: 12px; letter-spacing: .03em; }

.data-table-wrap { margin: 32px 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table caption { text-align: left; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); padding: 8px 16px 10px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border-soft); color: var(--text-soft); }
.data-table td:first-child { color: var(--text); }

/* ════════════════════════════════════════════════════════════════════
   Phase 4 — glossary
   ════════════════════════════════════════════════════════════════════ */
.glossary-search { margin-bottom: 24px; }
.glossary-search input { max-width: 100%; }
.glossary-az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 36px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.glossary-az a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: var(--r-sm); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; color: var(--text-soft); }
.glossary-az a:hover { border-color: var(--accent); color: var(--accent); }
.glossary-group { margin-bottom: 40px; scroll-margin-top: 90px; }
.glossary-letter { font-family: var(--mono); font-size: 14px; color: var(--accent); letter-spacing: .1em; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.glossary-list { margin: 0; }
.glossary-row { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr; gap: 8px 28px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.glossary-row dt { margin: 0; }
.glossary-row dt a { font-family: var(--serif); font-size: 18px; color: var(--text); }
.glossary-row dt a:hover { color: var(--accent); }
.glossary-row dd { margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.55; }
@media (max-width: 640px) { .glossary-row { grid-template-columns: 1fr; gap: 4px; } }

/* Term page */
.term-header h1 { margin: 10px 0 12px; }
.term-aka { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.term-short { margin-bottom: 8px; }
.term-body { margin-top: 24px; }
.term-back { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Auto-linked glossary terms in content */
.glossary-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--accent); cursor: help; transition: color .15s var(--ease), border-color .15s var(--ease); }
.glossary-link:hover { color: var(--accent); border-bottom-style: solid; }

/* Related terms (educational cross-links) */
.term-related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.term-related-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 20px; }
.term-related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.term-related-item { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg2); transition: border-color .2s var(--ease), transform .2s var(--ease); }
.term-related-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.trt-title { font-family: var(--serif); font-size: 16px; color: var(--text); }
.term-related-item:hover .trt-title { color: var(--accent); }
.trt-def { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
@media (max-width: 560px) { .term-related-grid { grid-template-columns: 1fr; } }

/* ── Anchor offset (sticky header) + smooth in-page scroll ── */
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }

/* ── Back-to-top button ── */
.to-top {
  position: fixed; right: clamp(16px, 3vw, 30px); bottom: clamp(16px, 3vw, 30px); z-index: 60;
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--text-soft);
  cursor: pointer; box-shadow: var(--shadow-soft);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px);
  transition: opacity .28s var(--ease), transform .28s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.to-top.is-in { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--border-strong); }
.to-top:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.to-top svg { width: 20px; height: 20px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .to-top { transition: opacity .2s linear; transform: none; }
}

/* ── Listen to this article (on-device narration) ── */
.listen { display: inline-flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.listen[hidden] { display: none; }
.listen-btn { display: inline-flex; align-items: center; gap: 11px; padding: 8px 18px 8px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg2); color: var(--text-soft); font-family: var(--sans); font-size: 13.5px; cursor: pointer; transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease); }
.listen-btn:hover { border-color: var(--border-strong); color: var(--text); }
.listen-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.listen-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.listen-ico svg { width: 15px; height: 15px; display: block; }
.listen-ico .ico-pause { display: none; }
.listen-btn[data-state="playing"] .listen-ico .ico-play { display: none; }
.listen-btn[data-state="playing"] .listen-ico .ico-pause { display: block; }
.listen-label { font-weight: 500; letter-spacing: .01em; }
.listen-meta { font-size: 12px; color: var(--text-muted); }

/* The block currently being narrated */
.post .is-reading { background: var(--accent-bg2); border-radius: 4px; box-shadow: 0 0 0 6px var(--accent-bg2); transition: background .25s var(--ease), box-shadow .25s var(--ease); }
@media (prefers-reduced-motion: reduce) { .post .is-reading { transition: none; } }

/* ── Ambient celestial background (home only): bodies on tilted orbits ── */
.orbit-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: .72; }
[data-theme="light"] .orbit-bg { opacity: .52; }
.orbit-dustfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit-dust circle { fill: var(--accent); opacity: .32; }
/* Faint, differently-tilted orbit rings. */
.orbit-ring { position: absolute; top: 50%; left: 50%; border: 1px solid var(--accent-line); border-radius: 50%; }
.orbit-ring-0 { width: 88vw; height: 72vh; transform: translate(-50%, -50%) rotate(-10deg); }
.orbit-ring-1 { width: 60vw; height: 80vh; top: 47%; opacity: .5; transform: translate(-50%, -50%) rotate(24deg); }
/* Bodies — positioned in viewport px (translate) + scale by JS. */
.orbit-body { --b: .4; position: absolute; top: 0; left: 0; will-change: transform; }
.orbit-glow { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, var(--accent), transparent 70%); opacity: var(--b); }
.orbit-body-star .orbit-glow { left: -100px; top: -100px; width: 200px; height: 200px; }
.orbit-mark { position: absolute; left: -21px; top: -21px; width: 42px; height: 42px; }
.orbit-mark path { fill: var(--accent); opacity: .9; }
.orbit-body-orb .orbit-glow { left: -52px; top: -52px; width: 104px; height: 104px; filter: blur(1px); }
.orbit-body-far .orbit-glow { left: -34px; top: -34px; width: 68px; height: 68px; filter: blur(2.5px); }
/* Keep content above the field. */
main, .site-footer { position: relative; z-index: 1; }
@media (max-width: 767px) {
  .orbit-bg { opacity: .42; }
  .orbit-ring-0 { width: 128vw; height: 56vh; }
  .orbit-ring-1 { display: none; }
  .orbit-body-far { display: none; }
}
@media (prefers-reduced-motion: reduce) { .orbit-body { will-change: auto; } }
