/* ============================================================
   Dr-CiK project page
   Clean, light, editorial-minimal. Warm neutral paper + one
   restrained teal-ink accent. Serif display + Inter body.
   ============================================================ */

:root {
  /* ServiceNow-aligned palette: deep navy + brand green */
  --navy: #032d42;         /* ServiceNow dark */
  --navy-2: #0a3a4c;
  --green: #62d84e;        /* ServiceNow bright green (fills / CTAs / accents) */
  --green-hover: #7be86a;
  --bg: #0b2c3a;           /* dark base */
  --bg-soft: rgba(255, 255, 255, 0.06);
  --surface: rgba(255, 255, 255, 0.045);   /* glass panels */
  --surface-2: rgba(255, 255, 255, 0.08);
  --ink: #eaf3f0;          /* near-white text */
  --ink-soft: #c6d6db;
  --muted: #93a7b0;
  --faint: #6f858e;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #62d84e;       /* green reads great on dark */
  --accent-dark: #79e668;  /* hover / secondary */
  --accent-soft: rgba(98, 216, 78, 0.16);
  --gold: #e0c060;
  --bad: #ff8f76;
  --max: 1280px;
  --content: 1280px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 24px 60px rgba(0, 0, 0, 0.38);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  background:
    radial-gradient(1100px 760px at 90% -8%, rgba(34, 98, 150, 0.55), transparent 58%),
    radial-gradient(1050px 950px at -8% 112%, rgba(40, 126, 88, 0.48), transparent 56%),
    linear-gradient(158deg, #0a2a3c 0%, #0b2f3b 46%, #0c332f 100%);
  background-attachment: fixed;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- top nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 249, 0.86);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 18px;
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.18rem; letter-spacing: 0.1px; color: var(--ink); }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 0.92rem; font-weight: 600; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--accent-dark);
}
.nav-links .nav-cta:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 760px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 78px 0 24px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 auto 18px;
  max-width: 22ch;
}
.hero .tagline {
  max-width: 60ch;
  margin: 0 auto 12px;
  color: var(--ink-soft);
  font-size: 1.22rem;
  line-height: 1.5;
}
.hero .tagline em { font-family: var(--serif); font-style: italic; color: var(--accent-dark); }

/* authors */
.authors { max-width: 920px; margin: 26px auto 6px; color: var(--ink-soft); font-size: 1.18rem; line-height: 1.95; }
.authors a { color: var(--ink-soft); border-bottom: 1px solid var(--line-strong); }
.authors a:hover { color: var(--accent); }
.authors .sup { color: var(--accent); font-size: 0.7em; vertical-align: super; font-weight: 700; }
.affil { max-width: 64ch; margin: 12px auto 0; color: var(--muted); font-size: 1.05rem; }
.affil .sup { color: var(--accent); font-weight: 700; }

/* link badges */
.badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 30px 0 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.96rem;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.badge:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent-dark); }
.badge.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge.solid:hover { background: var(--accent-dark); color: #fff; }
.badge svg { width: 17px; height: 17px; }

/* ---------- figure ---------- */
.teaser { padding: 34px 0 8px; }
.figure-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f8fa;   /* light frame so the diagram stays legible on dark */
  box-shadow: var(--shadow);
  padding: 16px;
}
.figure-card img { display: block; width: 100%; border-radius: 8px; }
.figure-cap { margin: 14px 6px 2px; text-align: center; color: var(--muted); font-size: 0.92rem; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-head { max-width: 70ch; margin: 0 auto 30px; text-align: center; }
.section-kicker {
  display: block; margin-bottom: 12px;
  color: var(--accent); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.section h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.08; letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.section h2.left, .section-head.left { text-align: left; margin-left: 0; }
.lede { color: var(--ink-soft); font-size: 1.1rem; line-height: 1.7; }
.prose { max-width: 70ch; margin: 0 auto; color: var(--ink-soft); }
.prose p { margin: 0 0 1.1em; }
.prose strong { color: var(--ink); font-weight: 650; }

/* ---------- motivation pull / definition ---------- */
.def-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.def-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 24px; box-shadow: var(--shadow);
}
.def-card .tag { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }
.def-card h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 6px 0 10px; }
.def-card p { margin: 0; color: var(--muted); font-size: 0.99rem; }
@media (max-width: 760px) { .def-row { grid-template-columns: 1fr; } }

/* ---------- pipeline / how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
.step {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px; box-shadow: var(--shadow);
}
.step .num {
  display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark);
  font-weight: 800; font-size: 0.95rem; margin-bottom: 14px;
}
.step h3 { font-size: 1.06rem; font-weight: 700; margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.stat { padding: 26px 20px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .big { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; line-height: 1; color: var(--ink); }
.stat .lab { margin-top: 8px; color: var(--muted); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
}

/* ---------- findings ---------- */
.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.finding {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 24px; box-shadow: var(--shadow);
}
.finding .metric { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--accent-dark); }
.finding .metric.warn { color: var(--bad); }
.finding p { margin: 12px 0 0; color: var(--muted); font-size: 0.96rem; line-height: 1.55; }
.finding p strong { color: var(--ink); }
@media (max-width: 820px) { .findings { grid-template-columns: 1fr; } }

/* ============================================================
   Leaderboard
   ============================================================ */
.lb-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.seg {
  display: inline-flex; padding: 4px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-soft);
}
.seg button {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  color: var(--muted); font-weight: 650; font-size: 0.92rem; font-family: var(--sans);
  transition: all 120ms ease;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.lb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-toggle {
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  padding: 6px 13px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--sans);
}
.chip-toggle:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-toggle .swatch { width: 9px; height: 9px; border-radius: 999px; background: currentColor; opacity: 0.8; }

.lb-note { color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin: 0 0 16px; max-width: 90ch; }

.lb-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.lb-scroll { overflow-x: auto; }
table.lb { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.lb thead th {
  position: sticky; top: 0;
  background: var(--bg-soft);
  text-align: right; padding: 14px 14px; white-space: nowrap;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer; user-select: none;
}
table.lb thead th.left { text-align: left; }
table.lb thead th.sortable:hover { color: var(--ink); }
table.lb thead th .arrow { color: var(--accent); margin-left: 4px; font-size: 0.8em; }
table.lb tbody td { padding: 13px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
table.lb tbody td.left { text-align: left; }
table.lb tbody tr:last-child td { border-bottom: 0; }
table.lb tbody tr:hover td { background: var(--accent-soft); }

.rank { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--faint); width: 1%; }
.rank.top1 { color: var(--gold); }
.rank.top2, .rank.top3 { color: var(--accent-dark); }

.model-cell { display: flex; flex-direction: column; gap: 3px; }
.model-name { font-weight: 700; color: var(--ink); }
.model-sub { font-size: 0.8rem; color: var(--faint); font-weight: 500; }

.type-tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.type-agentic { background: rgba(98,216,78,0.16); color: #a9ec99; }
.type-direct_llm { background: rgba(90,140,220,0.18); color: #a9c6f2; }
.type-ts_model { background: rgba(224,192,96,0.16); color: #e6d08a; }
.type-statistical { background: rgba(160,175,185,0.16); color: #c4d2d9; }
.type-retrieval { background: rgba(210,130,170,0.16); color: #eeb3d3; }

.fam-tag { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.fam-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 7px; vertical-align: middle; }
.fam-no_context { background: #9aa1a6; }
.fam-deep_research { background: var(--accent); }
.fam-original_context { background: var(--gold); }

.metric-cell { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.metric-cell .se { color: var(--faint); font-weight: 500; font-size: 0.84em; }
.metric-primary { position: relative; }
.bar-wrap { position: relative; }
.bar-track { margin-top: 5px; height: 4px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); opacity: 0.55; }
.best-pill { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.03em; vertical-align: middle; }
.fail-cell { color: var(--faint); font-variant-numeric: tabular-nums; }
.fail-cell.has { color: var(--bad); }

.lb-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 0.84rem; }
.lb-legend span { display: inline-flex; align-items: center; }

.submit-cta {
  margin-top: 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--bg-soft); padding: 20px 24px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.submit-cta p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.submit-cta strong { color: var(--ink); }

/* ---------- showcase preview cards ---------- */
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.case-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px; box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease;
}
.case-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.case-card .case-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.case-card .mini-chip { font-size: 0.74rem; font-weight: 650; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.case-card h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.case-card p { margin: 0 0 16px; color: var(--muted); font-size: 0.92rem; flex: 1; }
.case-card .case-link { font-weight: 700; color: var(--accent-dark); font-size: 0.92rem; }
@media (max-width: 820px) { .case-grid { grid-template-columns: 1fr; } }

/* ---------- citation ---------- */
.cite-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #0f1413; color: #e7ece9; box-shadow: var(--shadow); overflow: hidden;
}
.cite-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.cite-head span { font-size: 0.82rem; color: #9fb0ab; font-weight: 600; letter-spacing: 0.04em; }
.copy-btn { border: 1px solid rgba(255,255,255,0.18); background: transparent; color: #cfe0db; cursor: pointer; padding: 5px 12px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; font-family: var(--sans); }
.copy-btn:hover { background: rgba(255,255,255,0.08); }
.cite-card pre { margin: 0; padding: 18px; overflow-x: auto; font-family: var(--mono); font-size: 0.84rem; line-height: 1.6; color: #d7e2de; }

/* ---------- footer ---------- */
.site-footer { padding: 40px 0 60px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- width refinement ----------
   Constrain ALL section content to a centered column so nothing runs
   edge-to-edge. The full-width hairline divider (the .section top border)
   is intentional; only the content inside is capped. */
.section { padding-left: 24px; padding-right: 24px; }
.section > * { max-width: var(--content); margin-left: auto; margin-right: auto; }
.section > .section-head { max-width: 70ch; }   /* text column stays narrower */
.section > .prose { max-width: 72ch; }
.section > #leaderboard { max-width: var(--max); } /* data table gets a little more room */
.section > .cite-card { max-width: 760px; }        /* citation block is narrower */

/* ---------- leaderboard: trust badges, protocol tags, empty state ---------- */
.trust-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.02em;
}
.trust-badge.verified { background: var(--accent); color: #fff; }
.trust-badge.paper { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.proto-tag {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
}
.proto-tag.proto-hidden80 { background: var(--accent); color: #fff; }
.proto-tag.proto-paper240 { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.lb-empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface); padding: 36px 28px; text-align: center;
}
.lb-empty p { margin: 0 auto 16px; max-width: 56ch; color: var(--muted); }

/* two stacked track leaderboards */
.lb-track { margin-top: 30px; }
.lb-track:first-of-type { margin-top: 20px; }
.lb-track-head { margin-bottom: 12px; }
.lb-track-title {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin: 0 0 2px;
  display: flex; align-items: baseline; gap: 10px;
}
.lb-track-title::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent);
  display: inline-block;
}
.lb-track-blurb { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ============================================================
   ServiceNow theme: dark navy nav + hero, brand-green highlights
   ============================================================ */

/* green CTA buttons everywhere (green fill, navy text) */
.badge.solid { background: var(--green); border-color: var(--green); color: var(--navy); }
.badge.solid:hover { background: var(--green-hover); border-color: var(--green-hover); color: var(--navy); }

/* green highlights read on light bg with navy text */
.best-pill,
.trust-badge.verified,
.proto-tag.proto-hidden80 { background: var(--green); color: var(--navy); }
.bar-fill { background: var(--green); opacity: 0.75; }
.fam-dot.fam-deep_research { background: var(--green); }
.lb-track-title::before { background: var(--green); }
.step .num { background: var(--accent-soft); color: var(--accent-dark); }

/* dark navy top nav */
.site-nav {
  background: rgba(3, 45, 66, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.brand { color: #ffffff; }
.brand .dot { color: var(--green); }
.nav-links a { color: #b7c6ce; }
.nav-links a:hover { color: #ffffff; }
.nav-links .nav-cta { color: var(--green); border-color: rgba(255, 255, 255, 0.24); }
.nav-links .nav-cta:hover { background: var(--green); border-color: var(--green); color: var(--navy); }

/* hero sits on the page-wide brand gradient */
header#top {
  background: transparent;
  color: #e8f1ee;
}
header#top .eyebrow { color: var(--green); }
header#top h1 { color: #ffffff; }
header#top .tagline { color: #c7d6dc; }
header#top .tagline em { color: var(--green); font-style: italic; }
header#top .authors, header#top .authors span { color: #c1d0d7; }
header#top .authors a { color: #ffffff; border-bottom: 1px solid rgba(255, 255, 255, 0.30); }
header#top .authors a:hover { color: var(--green); }
header#top .authors .sup, header#top .affil .sup { color: var(--green); }
header#top .affil { color: #93a7b0; }
header#top .badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
  color: #e8f1ee;
}
header#top .badge:hover { border-color: var(--green); color: #ffffff; }
header#top .badge.solid { background: var(--green); border-color: var(--green); color: var(--navy); }
header#top .figure-card {
  background: #f5f8fa;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
header#top .figure-cap { color: #93a7b0; }

/* citation block in brand navy */
.cite-card { background: #04252f; }
.cite-head { border-bottom-color: rgba(255, 255, 255, 0.10); }

/* footer accent */
.site-footer a:hover { color: var(--accent-dark); }

/* ServiceNow marks */
.hero-mark { display: block; margin: 0 auto 22px; width: 80px; height: 80px; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; }
.foot-logo { height: 22px; width: auto; }
