/* ==========================================================================
   Shared site theme — tokens + inner pages + chrome
   Change colours here; section body classes override for pillar pages.
   ========================================================================== */

:root {
  --bg: #04060a;
  --fg: #f5f7fa;
  --muted: #c8cfd8;
  --accent: #c08a20;
  --accent2: #f0d060;
  --card: #0f1520;
  --line: rgba(192, 138, 32, 0.28);
  --btn: #c08a20;
  --btnfg: #0a0a0a;
  --display: "Cormorant Garamond", Georgia, serif;
  --label: "DM Mono", ui-monospace, monospace;
  --body: "Nunito", -apple-system, sans-serif;
  --font-size-base: 18px;
  --max: 960px;
}

/* Landing-page default (home) — used with body.home */
body.home {
  --bg: #07080c;
  --fg: #f3ece2;
  --muted: #d8d0c4;
  --accent: #d7c6a6;
  --accent2: #c08a20;
  --card: #10131a;
  --line: rgba(243, 236, 226, 0.14);
  --btn: #c4450c;
  --btnfg: #fff7f0;
  --display: Fraunces, Georgia, serif;
  --body: Outfit, system-ui, sans-serif;
}

body.bfut {
  --bg: #04060a;
  --fg: #f4ead4;
  --muted: #e0d0a0;
  --accent: #c08a20;
  --accent2: #f0d060;
  --card: #0b0f16;
  --btn: #c41e1e;
  --btnfg: #fff5f5;
  --display: "Cormorant Garamond", Georgia, serif;
}

body.consc {
  --bg: #061016;
  --fg: #e7f4f1;
  --muted: #c5e4de;
  --accent: #3dbeb0;
  --accent2: #9ee8d8;
  --card: #0a181f;
  --btn: #1f7a54;
  --btnfg: #f3fff8;
  --display: Fraunces, Georgia, serif;
}

body.adv {
  --bg: #071a42;
  --fg: #f7f4ec;
  --muted: #c9d8f0;
  --accent: #e0b15c;
  --accent2: #f3d89a;
  --card: #0e2f66;
  --line: rgba(201, 216, 240, 0.18);
  --btn: #1d4ed8;
  --btnfg: #f7f4ec;
  --display: "Libre Baskerville", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: var(--font-size-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent2); }
a:hover { color: var(--accent); }
h1, h2, h3 {
  font-family: var(--display);
  color: var(--fg);
  line-height: 1.25;
  font-weight: 500;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: 1.5rem; margin-top: 2.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); color: var(--accent); }
h3 { font-size: 1.2rem; margin-top: 1.4rem; }

/* ---- Global chrome nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-brand {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.site-nav a {
  font-family: var(--label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 999px;
}
.site-nav a:hover { color: var(--accent2); }
.site-nav a.on {
  background: var(--btn);
  color: var(--btnfg);
}
.site-nav a.on:hover { color: var(--btnfg); }
.nav-tools {
  display: flex; align-items: center; gap: 8px;
}
.nav-tools a, .nav-tools button {
  font-family: var(--label);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}
.nav-tools a:hover, .nav-tools button:hover {
  border-color: var(--accent);
  color: var(--accent2);
}
.search-form {
  display: none;
  position: absolute;
  top: 100%; right: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  gap: 8px;
}
.search-form.open { display: flex; }
.search-form input {
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
}
.nav-burger {
  display: none;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-burger span {
  display: block; width: 22px; height: 2px; background: var(--fg);
  margin: 5px 0; border-radius: 2px;
}
@media (max-width: 820px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 12px 16px;
  }
  .nav-burger { display: block; }
}

/* Section local nav (BFUT inner pages) */
.section-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px 0;
}
.section-nav a {
  font-family: var(--label);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}
.section-nav a:hover, .section-nav a.on { color: var(--accent2); border-color: var(--accent); }

/* Content shell for papers/articles */
.content-wrap, .paper-body, article.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.placeholder-flag { display: none; }

/* Engagement / appreciation / ads */
.ad-slot {
  max-width: var(--max);
  margin: 1.8rem auto;
  padding: 0.9rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.engagement-bar {
  max-width: var(--max);
  margin: 2rem auto;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.engagement-bar button, .engagement-bar .share-btn {
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
}
.engagement-bar button:hover, .engagement-bar .share-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
}
.appreciation {
  max-width: var(--max);
  margin: 2rem auto;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.appreciation h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  border: 0; padding: 0; color: var(--accent);
}
.appreciation p { margin: 0 0 0.8rem; color: var(--fg); }
.appreciation .apps { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.appreciation .apps a {
  display: inline-flex; align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btnfg);
  text-decoration: none;
  font-weight: 700;
}
.appreciation .apps img { height: 88px; width: auto; border-radius: 8px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.4rem 1.4rem;
  margin-top: 2rem;
}
.site-footer-inner { max-width: var(--max); margin: 0 auto; }
.site-footer a { color: var(--fg); text-decoration: none; }
.site-footer a:hover { color: var(--accent2); }
.footer-social { display: flex; flex-wrap: wrap; gap: 14px; margin: 1rem 0; }
.footer-social a {
  font-family: var(--label);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-meta { color: var(--muted); font-size: 0.95rem; }

/* Scholarly / tables / TOC leftovers for papers */
.doi-link { color: var(--accent2); text-decoration: underline; font-family: var(--label); }
table { border-collapse: collapse; width: 100%; margin: 1.4rem 0; }
th, td { border: 1px solid var(--line); padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; }
th { background: var(--card); color: var(--accent); font-family: var(--label); }
.toc { background: var(--card); border: 1px solid var(--line); padding: 1.2rem 1.4rem; margin: 1.6rem 0; border-radius: 8px; }
blockquote { border-left: 4px solid var(--accent); margin-left: 0; padding: 0.7rem 1.1rem; background: var(--card); }
