/* PlurPO project page */

:root {
  --ink: #141a24;
  --ink-soft: #465063;
  --ink-faint: #7d8696;
  --line: #e6e9ef;
  --line-strong: #d3d8e1;
  --bg: #ffffff;
  --bg-alt: #f7f8fb;
  --surface: #ffffff;

  --accent: #2f5fd0;        /* PlurPO */
  --accent-deep: #1b2f5e;
  --accent-wash: #eaf0fc;
  --muted-mark: #8a8f99;    /* baselines */
  --human: #5b616b;
  --ok: #1b5e3a;
  --ok-wash: #e6f3ec;
  --fail: #a32a2a;
  --fail-wash: #fbeaea;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebf1;
    --ink-soft: #b3bac7;
    --ink-faint: #848c9b;
    --line: #262c37;
    --line-strong: #343b48;
    --bg: #12161d;
    --bg-alt: #171c25;
    --surface: #1b212b;
    --accent: #6f95f0;
    --accent-deep: #c9d7fa;
    --accent-wash: #1f2a42;
    --muted-mark: #7f8694;
    --human: #aab1bd;
    --ok: #6cc596;
    --ok-wash: #173226;
    --fail: #ec8a8a;
    --fail-wash: #3a1d1f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  counter-reset: sec;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section-head { max-width: 800px; }
.section-head.narrow { margin: 0 0 36px; }
#problem .lede { max-width: 800px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 13px 28px;
  display: flex; align-items: center; gap: 18px;
}
.nav-brand { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--accent-deep); }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink-soft); font-size: 13.5px; font-weight: 500; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 720px) { .nav-links { display: none; } }

/* hero */
.hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 56px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 5.2vw, 52px); line-height: 1.08;
  letter-spacing: -0.022em; margin: 0 auto 26px;
  color: var(--accent-deep);
}
.authors { font-size: 16.5px; margin: 0 0 6px; line-height: 1.8; }
.authors b { font-weight: 600; white-space: nowrap; }
.authors sup, .affil sup { color: var(--accent); font-weight: 600; }
.affil { font-size: 14px; color: var(--ink-faint); margin: 0 0 30px; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; padding: 10px 20px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent-deep); color: var(--bg); border-color: var(--accent-deep); }
.btn svg { width: 16px; height: 16px; }

.abstract {
  margin: 44px auto 0; max-width: 820px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 32px; position: relative;
}
.abstract::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px;
  background: var(--accent); border-radius: 4px;
}
.abstract h3, .eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 8px; font-weight: 600;
}
.abstract p { margin: 0; font-size: 16.5px; color: var(--ink-soft); }
.abstract b { color: var(--ink); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-width: 1000px; margin: 28px auto 0; text-align: left;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 18px 16px;
  display: flex; flex-direction: column;
}
.stat-num {
  font-family: var(--serif); font-weight: 600; font-size: 25px;
  color: var(--accent-deep); line-height: 1.15; margin-bottom: 8px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat-num .arrow { color: var(--ink-faint); font-weight: 400; }
.stat-label { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; flex: 1; }
.stat-ds { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-top: 10px; letter-spacing: .06em; }
.stats-note { font-size: 12.5px; color: var(--ink-faint); margin: 12px 0 0; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* sections */
section { padding: 76px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.section-alt { background: var(--bg-alt); }
.kicker {
  counter-increment: sec;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.kicker::before {
  content: counter(sec, decimal-leading-zero);
  color: var(--bg); background: var(--accent);
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(25px, 3.6vw, 36px); line-height: 1.15;
  letter-spacing: -0.02em; margin: 0 0 16px; color: var(--accent-deep);
}
.lede { font-size: 17.5px; color: var(--ink-soft); margin: 0 0 14px; }
.lede:last-child { margin-bottom: 0; }
.cite { color: var(--ink-soft); border-bottom: 1px solid var(--line-strong); }
.cite:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.fine { font-size: 13px; color: var(--ink-faint); margin: 14px 0 0; text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px;
}

/* method steps */
.steps-intro { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.steps {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.steps li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px;
}
.step-n {
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 6px; padding: 1px 7px;
}
.steps h4 { font-family: var(--serif); font-size: 17px; margin: 12px 0 6px; font-weight: 600; }
.steps p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* veto demo */
.veto-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; }
.prompt {
  margin: 0; font-family: var(--serif); font-style: italic; font-size: 19px;
  color: var(--ink); max-width: 560px; line-height: 1.45;
}
.hint { font-size: 13px; color: var(--ink-faint); margin: 0; }

.veto-grid { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(4, minmax(64px, 1fr)); }
.veto-grid .h {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line);
}
.veto-grid .h:first-child { text-align: left; padding-left: 14px; }
.veto-row { display: contents; cursor: pointer; }
.veto-row > * {
  padding: 13px 6px; border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.veto-row .resp {
  font-family: var(--serif); font-style: italic; font-size: 16.5px; padding-left: 14px;
  border-left: 3px solid transparent;
}
.veto-row .cell { display: flex; align-items: center; justify-content: center; }
.veto-row:hover > * { background: var(--bg-alt); }
.veto-row.active > * { background: var(--accent-wash); }
.veto-row.active .resp { border-left-color: var(--accent); }
.veto-row:focus-visible { outline: none; }
.veto-row:focus-visible .resp { outline: 2px solid var(--accent); outline-offset: -2px; }
.mark {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.mark svg { width: 13px; height: 13px; }
.mark.accept { color: var(--ok); background: var(--ok-wash); }
.mark.veto { color: var(--fail); background: var(--fail-wash); }
.veto-verdict {
  margin-top: 18px; font-size: 15px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 12px; min-height: 30px; flex-wrap: wrap;
}
.pill {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 6px;
}
.pill.chosen { color: var(--ok); background: var(--ok-wash); }
.pill.rejected { color: var(--fail); background: var(--fail-wash); }
@media (max-width: 640px) {
  .veto-grid { grid-template-columns: minmax(130px, 1.4fr) repeat(4, minmax(44px, 1fr)); }
  .mark span { display: none; }
  .veto-grid .h { font-size: 9px; letter-spacing: 0; padding: 8px 2px; line-height: 1.2; overflow-wrap: anywhere; }
  .veto-row .resp { padding-left: 10px; }
  .veto-row .resp { font-size: 14.5px; }
}

/* segmented controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.seg {
  display: inline-flex; background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px;
}
.seg button, .chip {
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  background: transparent; border: 0; border-radius: 999px; padding: 7px 15px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); font-size: 13px; padding: 6px 12px; }
.chip[aria-checked="true"] { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-wash); font-weight: 600; }
.seg button:focus-visible, .chip:focus-visible, .copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dot plot */
.chart-card { position: relative; }
.chart-sub { font-size: 14px; color: var(--ink-soft); margin: 14px 0 12px; min-height: 22px; }
.chart-sub b { color: var(--ink); font-weight: 600; }
.dotplot { position: relative; }
.row {
  display: grid; grid-template-columns: 250px 1fr 64px; align-items: center;
  height: 42px; border-radius: 8px;
}
.row.hl { background: var(--accent-wash); }
.row .name { font-size: 14px; color: var(--ink-soft); text-align: right; padding-right: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.hl .name { color: var(--ink); font-weight: 700; }
.row .val { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); text-align: right; padding-right: 10px; font-variant-numeric: tabular-nums; }
.row.hl .val { color: var(--ink); font-weight: 600; }
.track { position: relative; height: 100%; }
.track::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 25% 100%;
  border-right: 1px solid var(--line);
}
.dot {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted-mark); box-shadow: 0 0 0 2px var(--surface);
  transform: translate(-50%, -50%);
  transition: left .55s cubic-bezier(.2,.8,.2,1), transform .15s ease;
}
.row.hl .dot { background: var(--accent); width: 16px; height: 16px; }
.row.human .dot { background: var(--surface); border: 2.5px solid var(--human); }
.hit { position: absolute; inset: 0; cursor: default; }
.row:hover .dot { transform: translate(-50%, -50%) scale(1.25); }
.humanline {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1.5px dashed var(--human); opacity: .55; pointer-events: none;
  transition: left .55s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
}
.axis {
  display: flex; justify-content: space-between;
  margin: 6px 64px 0 250px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
}
.axis span { width: 0; display: flex; justify-content: center; }
.chart-note { font-size: 13px; color: var(--ink-faint); margin: 16px 0 0; }
.tooltip {
  position: absolute; pointer-events: none; opacity: 0;
  background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45;
  padding: 8px 11px; border-radius: 8px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px)); transition: opacity .12s ease; z-index: 5;
}
.tooltip b { font-weight: 600; }
.tooltip.show { opacity: 1; }
@media (max-width: 720px) {
  .row { grid-template-columns: 112px 1fr 48px; }
  .row .name { font-size: 11.5px; padding-right: 10px; white-space: normal; line-height: 1.2; }
  .row .val { font-size: 11.5px; padding-right: 4px; }
  .axis { margin: 6px 48px 0 112px; font-size: 10px; }
  .seg button { padding: 7px 11px; font-size: 12.5px; }
  .card { padding: 20px 16px; }
}

/* figures */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.fig { margin: 0; padding: 20px; }
.fig img { width: 100%; height: auto; display: block; border-radius: 6px; background: #fff; }
.fig figcaption { font-size: 13.5px; color: var(--ink-soft); margin-top: 14px; line-height: 1.55; }
.fig figcaption b { color: var(--ink); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* examples */
.ex-block { margin-top: 0; }
.ex-meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px; }
.ex-prompt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 16px;
}
.ex-prompt p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.5; }
.ex-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.resp-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; border-top: 4px solid var(--muted-mark);
}
.resp-card.bad { border-top-color: var(--fail); }
.resp-card.good { border-top-color: var(--ok); }
.resp-card h5 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.resp-card.bad h5 { color: var(--fail); }
.resp-card.good h5 { color: var(--ok); }
.resp-card p { margin: 0; font-size: 15.5px; color: var(--ink); line-height: 1.6; }
.ex-caption { font-size: 14.5px; color: var(--ink-soft); margin: 18px auto 0; max-width: 780px; text-align: center; }
.ex-fade { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .ex-pair { grid-template-columns: 1fr; } }

/* bibtex */
.bib { position: relative; }
.bib pre {
  margin: 0; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px 22px; font-family: var(--mono); font-size: 13px; line-height: 1.6;
  overflow-x: auto; color: var(--ink-soft);
}
.copy {
  position: absolute; top: 10px; right: 10px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 5px 11px; cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }

.footer { padding: 30px 0 40px; text-align: center; font-size: 13px; color: var(--ink-faint); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
