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

:root {
  --bg: #04060a;
  --fg: #f5f7fa;
  --muted: #ead9b0;
  --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: #f0e6d2;
  --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: #f0d48a;
  --accent: #c08a20;
  --accent2: #f0d060;
  --card: #0b0f16;
  --btn: #c41e1e;
  --btnfg: #fff5f5;
  --display: "Cormorant Garamond", Georgia, serif;
}

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

body.adv {
  --bg: #071a42;
  --fg: #f7f4ec;
  --muted: #d6e6ff;
  --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; overflow-x: hidden; max-width: 100%; }
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;
  overflow-x: hidden;
  max-width: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--accent2); }
a:hover { color: var(--accent); }
h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.25;
  font-weight: 500;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); color: #5eead4; } /* cyan / light teal */
h2 { font-size: 1.5rem; margin-top: 2.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); color: #f43f5e; } /* rose red */
h3 { font-size: 1.2rem; margin-top: 1.4rem; color: #4ade80; } /* light green */

/* ---- Global chrome nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  max-width: 100%;
  flex-wrap: wrap;
}
.site-brand {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-brand .brand-logo {
  width: 44px; height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
}
.site-header {
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.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 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.site-nav a:hover {
  color: var(--accent2);
  border-color: var(--line);
}
.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: 6px;
  flex-wrap: wrap;
  max-width: 100%;
  justify-content: flex-end;
}
.nav-tools .who {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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; }
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #1f1f1f !important;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 10px 16px;
  font-weight: 600;
  font-family: Arial, sans-serif;
  font-size: 15px;
  text-decoration: none !important;
  min-height: 44px;
}
.google-btn:hover { background: #f7f8f8; color: #1f1f1f !important; filter: none; }
.search-form input {
  min-width: 0;
  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-header { padding: 8px 10px; }
  .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;
    z-index: 120;
  }
  .nav-burger { display: block; }
  .nav-tools a, .nav-tools button {
    padding: 6px 9px;
    font-size: 0.68rem;
  }
  .section-nav { padding: 10px 12px 6px; gap: 8px; }
  .section-nav a.nav-btn {
    font-size: 0.72rem;
    padding: 8px 12px !important;
  }
  .content-wrap, .paper-body, article.content {
    padding: 20px 14px 48px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* 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.nav-btn, .section-nav a {
  font-family: var(--label);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
}

/* 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: #93c5fd;
  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: #f43f5e;
}
.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-map { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 1.2rem; }
.footer-map a { font-size: 0.92rem; }
.footer-meta { color: var(--fg); font-size: 0.95rem; opacity: 0.92; }

/* 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: #22d3ee; 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); }


/* Bright labels — never muted gold/grey */
.kicker, .mono, .paper-id, .sec-h, .ref {
  color: #22d3ee !important; /* cyan */
}
.paper-title, .site-brand span {
  color: #f8fafc;
}
a { color: #38bdf8; }
a:hover { color: #86efac; }
.site-nav a { color: #e2e8f0; }
.site-nav a.on { background: #2563eb; color: #fff; }

.list-title { margin: 0; border: 0; padding: 0; color: #4ade80; }
.path-ref { margin-left: .6rem; color: #38bdf8; }

/* Coloured section buttons */
.section-nav { gap: 10px; padding: 16px 20px 8px; }
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 16px !important;
  border-radius: 999px !important;
  font-family: var(--label);
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none !important;
  border: 0 !important;
}
.nb-red { background: #e11d48; color: #fff !important; }
.nb-cyan { background: #0891b2; color: #fff !important; }
.nb-green { background: #16a34a; color: #fff !important; }
.nb-blue { background: #2563eb; color: #fff !important; }
.nb-orange { background: #ea580c; color: #fff !important; }

.act-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.act-btn {
  display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: 8px;
  font-family: var(--label); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none !important; color: #fff !important;
}
.act-read { background: #2563eb; }
.act-pdf { background: #16a34a; }
.act-slides { background: #ea580c; }
.act-run { background: #0891b2; }
.paper-card { margin: 14px 0; padding: 16px 18px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.scope-box { max-width: 42rem; }

.article-list { list-style: none; margin: 1.2rem 0; padding: 0; }
.article-list li { margin: 0; border-bottom: 1px solid var(--line); }
.article-list a {
  display: block;
  padding: 14px 4px;
  color: #38bdf8 !important;
  text-decoration: underline !important;
  font-size: 1.05rem;
}
.article-list a:hover { color: #86efac !important; }

table.compare th, table.compare td { border: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left; }
table.compare th { color: #38bdf8; }

.nav-in-menu { display: none; }
.search-form { max-width: calc(100vw - 24px); }
.search-form input { min-width: 0; width: min(220px, 70vw); }
.hero, .wrap, .content-wrap { max-width: 100%; }
img, svg, video { max-width: 100%; height: auto; }

@media (max-width: 900px) {
  .site-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    gap: 8px;
  }
  .site-brand { min-width: 0; }
  .site-brand span { display: inline; font-size: 0.92rem; }
  .nav-tools { display: none !important; }
  .nav-in-menu { display: list-item; }
  .nav-burger { display: block !important; justify-self: end; }
}

.nav-group details { margin: 0; }
.nav-group summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  color: #fff;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group details a {
  display: block;
  padding: 8px 16px 8px 22px;
  font-size: 0.75rem;
}
.ng-adv details { background: #1e3a8a; }
.ng-bfut details { background: #9a3412; }
.ng-consc details { background: #115e59; }
.site-nav .nav-group { width: 100%; }

.house-ad { max-width: var(--max); margin: 1.4rem auto 0; padding: 0 20px 8px; }
.house-ad-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 22px 20px;
  border-radius: 18px;
  text-decoration: none !important;
  min-height: 168px;
  justify-content: center;
}
.house-ad-kicker {
  font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 800;
}
.house-ad-title {
  font-family: var(--display); font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1.15; font-weight: 600;
}
.house-ad-line { font-size: 1rem; line-height: 1.45; opacity: 0.92; }
.house-ad-cta {
  margin-top: 6px; width: fit-content;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--label); font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(0,0,0,.22);
}
.tone-ember .house-ad-card { background: #9a3412; color: #fff7ed !important; }
.tone-gold .house-ad-card { background: #b45309; color: #fffbeb !important; }
.tone-cyan .house-ad-card { background: #0e7490; color: #ecfeff !important; }
.tone-teal .house-ad-card { background: #0f766e; color: #f0fdfa !important; }
.house-ad-card:hover { filter: brightness(1.06); }

.house-ad-paper { font-size: 0.95rem; font-weight: 700; opacity: 0.95; }
.house-ad-foot {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: flex-end;
  text-align: right; gap: 2px;
  font-family: var(--label); font-size: 0.68rem; letter-spacing: 0.04em;
  opacity: 0.9;
}
.house-ad-card { position: relative; }
.house-ad-img { width: 100%; height: auto; border-radius: 12px; display: block; margin-bottom: 8px; }
