/* Seekapedia — styles */
:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #4c4c4c;
  --line: #e4e4dd;
  --accent: #4b6bfb;
  --accent-soft: #eaefff;
  --good: #1f9d55;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #14151a;
  --panel: #1c1e26;
  --ink: #ececf1;
  --muted: #b9b9c8;
  --line: #2b2e3a;
  --accent: #7d93ff;
  --accent-soft: #232842;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* Layout */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: 11px 0;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* inner row centered to the same 1400px width as the content, so the logo sits above the sidebar and actions above the content's right edge */
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
}
.brand { grid-column: 1; display: inline-flex; align-items: center; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 66px; width: auto; max-width: min(320px, 40vw); display: block; filter: brightness(0); }
.brand-text { display: none; font-weight: 800; font-size: 26px; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.brand-grad { background: linear-gradient(90deg, #1565ff 0%, #12a5e5 55%, #2fe6c2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .dot { color: var(--accent); }
/* dark theme: recolor the logo letters to white, no background chip */
[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); background: none; border-radius: 0; padding: 0; }
.search { grid-column: 2; display: flex; justify-content: center; }
.search input { width: 100%; max-width: 560px; }
.topbar-actions { grid-column: 3; display: flex; align-items: center; gap: 8px; }
.search input {
  width: 100%; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.topbar .spacer { flex: 1; }
.iconbtn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 7px 11px; font-size: 13px;
}
.iconbtn:hover { border-color: var(--accent); }

.shell { display: grid; grid-template-columns: 240px 1fr; gap: 0; max-width: 1400px; margin: 0 auto; }
/* Ask-first homepage: no article index in the chrome */
body.route-home .shell { grid-template-columns: 1fr; max-width: 920px; }
body.route-home .sidebar { display: none; }
.nav-articles[hidden] { display: none !important; }
.sidebar {
  border-right: 1px solid var(--line); padding: 18px 14px;
  position: sticky; top: 100px; align-self: start; height: calc(100vh - 100px);
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
}
#nav { display: flex; flex-direction: column; min-height: 0; flex: 1; }
/* the article list scrolls internally (Explore stays pinned below) */
.articles-scroll {
  flex: none; height: 50vh; min-height: 0; overflow-y: auto; overflow-x: hidden;
  perspective: 700px; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.articles-scroll::-webkit-scrollbar { width: 6px; }
.articles-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.articles-scroll::-webkit-scrollbar-track { background: transparent; }
/* rolodex / wheel-picker effect: items curl and fade toward the top & bottom edges */
@supports (animation-timeline: view()) {
  @keyframes rolodex-wheel {
    0%   { opacity: .5; transform: rotateX(38deg) scale(.95); }
    20%, 80% { opacity: 1; transform: none; }
    100% { opacity: .5; transform: rotateX(-38deg) scale(.95); }
  }
  .articles-scroll .navlink {
    animation: rolodex-wheel linear both;
    animation-timeline: view();
    animation-range: cover;
    transform-origin: center;
  }
}
.sidebar h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 8px 6px; }
.navlink {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink); font-size: 14px; cursor: pointer;
}
.navlink:hover { background: var(--accent-soft); text-decoration: none; }
.navlink.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navlink .ic { width: 18px; text-align: center; opacity: .8; }
.loadmore { display: block; width: calc(100% - 8px); margin: 6px 4px 4px; padding: 8px 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.loadmore:hover { border-color: var(--accent); }

.main { padding: 10px 34px 80px; min-width: 0; }

/* Cards & primitives */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.card h3 { margin: 18px 0 6px; font-size: 15px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; }
.pill.gray { background: var(--bg); color: var(--muted); border-color: var(--line); }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:hover { filter: brightness(1.05); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.two, .grid.three { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* Confidence meter */
.conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.conf .bar { width: 60px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.conf .bar > i { display: block; height: 100%; background: var(--good); }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Feature grid on home */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.feat {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel);
  cursor: pointer; transition: transform .08s ease, border-color .12s ease;
}
.feat:hover { transform: translateY(-2px); border-color: var(--accent); }
.feat .n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.feat h4 { margin: 6px 0 4px; font-size: 14px; }
.feat p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Source cards */
.source { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.source .meters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 8px; font-size: 12px; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .track { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter .track > i { display: block; height: 100%; }
.lean-scale { position: relative; height: 6px; background: linear-gradient(90deg,#3b82f6,#e5e7eb,#ef4444); border-radius: 3px; }
.lean-scale > .mark { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--panel); transform: translateX(-50%); }

/* Debate */
.debate { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.debate .side { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.debate .side.pro { border-top: 3px solid var(--good); }
.debate .side.con { border-top: 3px solid var(--bad); }
.debate .arg { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.judge { margin-top: 14px; background: var(--accent-soft); border-radius: 10px; padding: 14px; }

/* Timeline / slider */
.range { width: 100%; accent-color: var(--accent); }
.timeline { position: relative; padding-left: 18px; }
.timeline .ev { position: relative; padding: 8px 0 8px 14px; border-left: 2px solid var(--line); }
.timeline .ev::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .ev .yr { font-family: var(--mono); font-size: 12px; color: var(--accent); }

/* Bias highlight */
.bias-flag { background: rgba(217,119,6,.22); border-bottom: 2px solid var(--warn); cursor: help; border-radius: 2px; padding: 0 2px; }

/* Knowledge map canvas */
#kmap { width: 100%; height: 420px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: block; }

/* Quiz */
.opt { display: block; width: 100%; text-align: left; padding: 11px 14px; margin: 6px 0; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; }
.opt:hover { border-color: var(--accent); }
.opt.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--panel)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }

/* Chat / dialogue */
.chatlog { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding: 4px; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; font-size: 14px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.inline-input { display: flex; gap: 8px; margin-top: 10px; }
.inline-input input, .inline-input select, textarea, select { font-family: inherit; font-size: 14px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.inline-input input { flex: 1; }

/* Sim */
.sim-out { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.field { margin: 10px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* Feed */
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sig { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; align-self: flex-start; }

/* Doc explorer */
.doc { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.doc .fields { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 6px 0; }
.doc blockquote { margin: 8px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 8px 8px 0; font-style: italic; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border: none; background: none; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.hero { padding: 30px; background: linear-gradient(135deg, var(--accent-soft), var(--panel)); border-radius: 16px; border: 1px solid var(--line); margin-bottom: 22px; }
.hero h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.03em; }
.ask-hero h1 { font-size: clamp(28px, 4vw, 36px); }
.ask-box textarea { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); color: var(--ink); font-family: inherit; }
.ask-box textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.featured { background: linear-gradient(135deg, var(--accent-soft), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.feat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Current Events (In-the-news style box) */
.newsbox { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.newsbox-head { background: linear-gradient(90deg, var(--accent-soft), transparent); color: var(--ink); font-weight: 800; font-size: 15px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.newsbox-body { padding: 2px; }
.newsbox-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; }
.news-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; text-decoration: none; color: var(--ink); transition: background .12s; }
.news-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.news-row:hover { background: var(--accent-soft); text-decoration: none; }
.news-thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: var(--bg); border: 1px solid var(--line); }
.news-thumb-ph { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.news-txt { min-width: 0; flex: 1; }
.news-line { font-size: 14px; line-height: 1.4; color: var(--ink); }
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.news-desc { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.news-tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }
.news-badge { font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px; }
.news-badge.on-site { color: var(--accent); border-color: var(--accent); }

/* Then & Now comparison */
.thennow { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--bg); }
.tn-title { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.tn-cols { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tn-col { flex: 1; text-align: center; padding: 12px 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.tn-now { border-color: var(--accent); }
.tn-year { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tn-val { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.tn-arrow { flex: 0 0 auto; font-size: 20px; color: var(--muted); }
.tn-delta { text-align: center; margin: 12px 0 8px; font-weight: 700; color: var(--accent); }

/* Section confidence chart (gauge-style, 0–100% scale) */
.conf-bars { display: flex; gap: 20px; padding-top: 8px; align-items: flex-end; }
.conf-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.conf-track { position: relative; width: 100%; max-width: 130px; height: 160px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.conf-track::before { content: "100%"; position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--muted); }
.conf-fill { position: absolute; left: 0; right: 0; bottom: 0; min-height: 20px; border-radius: 0 0 7px 7px; transition: height .6s ease; }
.conf-cap { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.conf-lbl { font-size: 11px; text-align: center; margin-top: 8px; line-height: 1.3; }
.kbd { font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.notice { font-size: 13px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--line); }
.spark { display: inline-block; }

/* Research Room share + challenge modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.share-card { background: linear-gradient(150deg, var(--accent-soft), var(--panel)); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.sc-brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin-bottom: 12px; }
.sc-eyebrow { font-size: 10px; letter-spacing: .12em; color: var(--accent); font-weight: 800; margin-top: 12px; }
.sc-q { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; }
.sc-a { font-size: 14px; margin-top: 4px; line-height: 1.5; }
.sc-foot { margin-top: 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 40px; }
.foot-inner { max-width: 1400px; margin: 0 auto; padding: 22px 34px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { font-size: 13px; color: var(--muted); }
.foot-links a:hover { color: var(--accent); }

/* Cookie consent banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 760px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  padding: 16px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.cookie-banner .cb-text { flex: 1; min-width: 240px; font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.cookie-banner .cb-actions { display: flex; gap: 10px; }
@media (max-width: 560px) { .cookie-banner .cb-actions { width: 100%; } .cookie-banner .cb-actions .btn { flex: 1; } }
