:root {
  --ink: #2b2430;
  --ink-soft: #3a3340;
  --muted: #6b7280;
  --accent: #853953;
  --accent-dark: #6b2d43;
  --accent-light: #a2566f;
  --accent-faint: #f6eef2;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --border: #e7e2e6;
  --alt-bg: #f4f1ef;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, .brand-name, .section-title, .subsection-title, .hero-title {
  font-family: 'Domine', Georgia, serif;
  font-weight: 600;
}

code, pre {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

a { color: var(--accent-dark); }

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-logo {
  height: 60px;
  width: auto;
}
.brand-name {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -.02em;
}
.main-nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.main-nav a:hover { color: var(--accent-dark); }

/* Tabs */
.main-nav .nav-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .35rem .1rem;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
}
.main-nav .nav-tab:hover { color: var(--accent-dark); }
.main-nav .nav-tab.is-active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Proof-of-concept ribbon */
.ribbon {
  position: fixed;
  top: 18px;
  right: -70px;
  transform: rotate(45deg);
  background: #c0392b;
  color: #fff;
  padding: 7px 46px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  z-index: 80;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  pointer-events: none;
}

/* Hero */
.hero {
  padding: 4rem 0 3.5rem;
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(133,57,83,.10), transparent),
    linear-gradient(180deg, #ffffff, var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 2rem;
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.hero-sub {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 1.6rem;
}
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-visual { display: flex; justify-content: center; }
.hero-sticker {
  width: 100%;
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(133,57,83,.18));
}

/* Buttons */
.btn {
  display: inline-block;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--ink-soft); }
.btn-small {
  padding: .35rem .8rem;
  font-size: .85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 8px;
}
.btn-small:hover { border-color: var(--ink-soft); }

/* Sections */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--alt-bg); border-block: 1px solid var(--border); }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
}
.subsection-title { margin: 2rem 0 .8rem; }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 70ch; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Process flow */
.process { position: relative; margin-top: 1.8rem; }
.process-arrow {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.process-arrow svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent);
  stroke-width: 2;
  fill: var(--accent);
  opacity: .18;
}
.process-cards {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: 0;
}
.process-cards .card {
  flex: 1 1 200px;
  margin: 0;
  padding-top: 3rem;
  position: relative;
}
.card-step {
  position: absolute;
  top: 1rem;
  left: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.flow-arrow {
  flex: none;
  display: flex;
  align-items: center;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0 .2rem;
}

.notice, .note {
  margin-top: 1.6rem;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  font-size: .95rem;
}
.notice {
  background: var(--accent-faint);
  border: 1px solid #e6ccd6;
  color: var(--accent-dark);
}
.notice.warn {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}
.note { color: var(--muted); }
.note code { background: var(--alt-bg); padding: .1em .3em; border-radius: 4px; }

/* Prompt */
.prompt-box {
  background: #1e1e24;
  color: #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.4rem 0;
  box-shadow: var(--shadow);
}
.prompt-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  background: #16161b;
  font-size: .85rem;
  color: #cbd5e1;
}
.prompt-box pre {
  margin: 0;
  padding: 1.2rem;
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.55;
}

.steps { margin: 0; padding-left: 1.3rem; }
.steps li { margin-bottom: .7rem; }
.steps code { background: var(--alt-bg); padding: .1em .3em; border-radius: 4px; }

/* Upload */
.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2.2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop-zone.dragover { border-color: var(--accent); background: #fff7ed; }
.drop-zone input { display: none; }
.drop-zone-icon { font-size: 1.6rem; color: var(--muted); }
.drop-zone-text { color: var(--muted); font-size: .95rem; }
.drop-zone-text code { color: var(--ink-soft); }

.upload-status { margin-top: 1rem; font-size: .95rem; color: var(--ink-soft); }

.checklist { margin-top: 1rem; }
.checklist h3 { margin: 0 0 .6rem; font-size: 1rem; }
.checklist ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.checklist li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  color: var(--ink-soft);
}
.checklist .dot {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-block; flex: none;
}
.dot.ok { background: var(--ok); }
.dot.missing { background: var(--bad); }
.dot.rec { background: var(--warn); }
.checklist-legend {
  display: flex;
  gap: .8rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: .85rem;
}
.checklist-legend .dot { width: 12px; height: 12px; display: inline-block; }

.upload-actions { margin-top: 1.2rem; }
.signoff {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}
.signoff h3 { margin: 0 0 .5rem; font-size: 1rem; }
.signoff .muted { font-size: .9rem; margin: 0 0 .8rem; }
.signoff-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .8rem;
  margin: 0 0 .9rem;
}
.signoff-fields label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .85rem;
  color: var(--muted);
}
.signoff-fields input,
.signoff-fields select {
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
}
.signoff-check {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  font-size: .9rem;
  color: var(--ink-soft);
}
.git-cmds {
  background: var(--alt-bg);
  padding: .9rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: .8rem 0;
}
.git-cmds code { font-size: .85rem; color: var(--ink); }
.submit-result a.btn { margin-top: .5rem; }
.submit-result {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  font-size: .95rem;
}
.submit-result.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--ok); }

/* Table */
.table-controls {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1.4rem 0;
}
.table-controls input[type="search"],
.table-controls select {
  padding: .6rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}
.table-controls input[type="search"] { flex: 1; min-width: 220px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.repro-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.repro-table th, .repro-table td {
  padding: .8rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.repro-table th { background: var(--alt-bg); font-weight: 700; white-space: nowrap; }
.repro-table tr:last-child td { border-bottom: none; }
.repro-table td a { text-decoration: none; font-weight: 600; }

.pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill-ok { background: #dcfce7; color: var(--ok); }
.pill-warn { background: #fef3c7; color: var(--warn); }
.pill-bad { background: #fee2e2; color: var(--bad); }
.pill-muted { background: #e5e7eb; color: var(--muted); }

.badge {
  display: inline-block;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: .6rem;
}
.badge-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-note { background: #e5e7eb; color: var(--muted); }

.empty, .count { margin-top: 1rem; color: var(--muted); }
.count { font-size: .9rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.6rem 0;
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent-dark); }
.footer-creators {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  padding: .9rem 0;
  border-top: 1px solid var(--border);
}
.footer-creators-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.creator-logo {
  display: inline-flex;
  align-items: center;
  opacity: .8;
  transition: opacity .15s;
}
.creator-logo:hover { opacity: 1; }
.creator-logo img {
  height: 32px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* Workflow (Mermaid) */
.workflow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-top: 1.4rem;
  overflow-x: auto;
}
.workflow .mermaid {
  display: flex;
  justify-content: center;
  min-width: 640px;
  font-family: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* About */
.about-creators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: .4rem;
}
.creator-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1.2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.creator-card:hover { border-color: var(--accent); }
.creator-card img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.citation-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}
.citation-box p { margin: 0; }
.citation-box code { background: var(--alt-bg); padding: .1em .3em; border-radius: 4px; }

@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .main-nav { gap: .9rem; flex-wrap: wrap; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-sticker { max-width: 180px; }
  .process-arrow { display: none; }
  .process-cards { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
  .signoff-fields { grid-template-columns: 1fr; }
}

/* ORCID icon (sized like a character in the line) */
.orcid-link { display: inline-block; vertical-align: middle; line-height: 0; }
.orcid-icon { height: 1em; width: auto; display: inline-block; vertical-align: -0.14em; opacity: .85; }
.orcid-link:hover .orcid-icon { opacity: 1; }

/* Report cell: Summary / Discuss + comment-count badge */
.report-cell a { display: inline-block; }
.report-link { font-weight: 600; }
.discuss-link { color: var(--muted); }
.discuss-link:hover { color: var(--accent-dark); }
.comment-badge { position: relative; color: var(--muted); margin-top: .4rem; }
.comment-badge:hover { color: var(--accent-dark); }
.comment-badge svg { display: inline-block; vertical-align: middle; }
.badge-circle { position: absolute; top: -6px; right: -10px; min-width: 15px; height: 15px; border-radius: 999px; font-size: .62rem; font-weight: 700; color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }
.badge-circle.grey { background: #cbd5e1; }
.badge-circle.colored { background: var(--accent); }

/* Expandable table rows */
.article-row { cursor: pointer; }
.article-row:hover td { background: var(--alt-bg); }
.article-row .chev { display: inline-block; color: var(--muted); margin-right: .55rem; vertical-align: middle; transition: transform .18s ease; }
.article-row.open .chev { transform: rotate(90deg); }
.article-row .title { font-weight: 700; }
.article-row .doi { color: var(--muted); font-size: .85rem; }
.detail-row td { background: var(--surface); border-bottom: 1px solid var(--border); }
.detail-wrap { padding: .3rem .2rem .6rem .4rem; }

.chain-head { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: .9rem; }
.chain-head .cnt { color: var(--ink); font-weight: 700; }
.chain-head .g, .chain-head .b { display: inline-flex; align-items: center; gap: .25rem; }
.chain-head .g { color: var(--ok); }
.chain-head .b { color: var(--bad); }

.chain { display: flex; flex-wrap: wrap; align-items: flex-start; }
.spine { display: flex; flex-wrap: wrap; align-items: center; row-gap: .5rem; }
.raws { display: flex; flex-direction: column; gap: .45rem; }
.raws.multi { padding-right: .3rem; }
.raws .node { margin: 0; }

.node { display: inline-flex; align-items: center; gap: .45rem; background: var(--alt-bg); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .7rem; font-size: .82rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.node .ico { display: inline-flex; color: var(--muted); }
.node.output { border-color: var(--accent); }
.node.output .ico { color: var(--accent); }
.node.data.na { border-style: dashed; border-color: #cbd5e1; color: var(--muted); opacity: .85; }
.node.claim { border-color: var(--border); gap: .4rem; }
.node.claim a { text-decoration: none; font-weight: 600; color: var(--ink); }
.na-badge { display: inline-flex; align-items: center; justify-content: center; width: 1.1em; height: 1.1em; border-radius: 50%; background: var(--bad); color: #fff; font-size: .7em; font-weight: 700; flex: 0 0 auto; }

.link { display: inline-block; width: 26px; height: 2px; background: #cbd5e1; flex: 0 0 auto; }
.link.h { align-self: center; }
.link.grey { background: #e5e7eb; }

.claims { display: flex; flex-direction: column; gap: .5rem; margin-left: 1rem; border-left: 2px solid #e5e7eb; padding-left: 12px; }
.claim { display: flex; align-items: center; gap: .4rem; }
.claim .status { display: inline-flex; align-items: center; justify-content: center; width: 1.2em; height: 1.2em; border-radius: 50%; flex: 0 0 auto; }
.claim .status.ok { color: var(--ok); background: #dcfce7; }
.claim .status.bad { color: var(--bad); background: #fee2e2; }
.claim.good .node.claim { border-color: var(--ok); }
.claim.issue .node.claim { border-color: var(--bad); }

.chain-legend { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; font-size: .82rem; color: var(--muted); margin: 0 0 1rem; }
.chain-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chain-legend .lg { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; font-size: .7rem; font-weight: 700; }
.chain-legend .lg.green { color: var(--ok); background: #dcfce7; }
.chain-legend .lg.red { color: var(--bad); background: #fee2e2; }
.chain-legend .lg.grey { color: var(--muted); background: #e5e7eb; }

/* Construction */
.construction { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: 2.6rem 1.5rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; margin-top: 1.6rem; }
.construction h3 { margin: 0; }
.construction .muted { max-width: 42rem; margin: 0; }

/* Creators */
.creators-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; margin-top: 1.6rem; }
.creator { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; padding: 1.6rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; text-decoration: none; color: inherit; transition: border-color .18s ease, transform .18s ease; }
.creator:hover { border-color: var(--accent); transform: translateY(-2px); }
.creator .logo { display: block; height: 56px; max-width: 200px; object-fit: contain; margin: 0 auto; }

@media (max-width: 640px) {
  .chain { flex-direction: column; }
  .claims { margin-left: 0; border-left: none; padding-left: 0; margin-top: .8rem; }
  .spine { row-gap: .4rem; }
  .creators-grid { grid-template-columns: 1fr; }
}
