/* Open Review Tracker — dark red / parchment / sketch theme, all sans-serif */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --accent: #8f1d27;        /* dark red highlight */
  --accent-dark: #6d141c;
  --accent-deep: #7a1620;
  --accent-deep-dark: #57101a;
  --accent-soft: #f3e3e2;
  --ink: #2b1c1e;
  --ink-soft: #5a4a4c;
  --muted: #83716e;
  --rule: #d9cfc2;
  --bg: #efede7;            /* light gray / parchment background */
  --bg-alt: #e6e1d8;
  --surface: #fbf7ee;       /* parchment surface */
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(43, 28, 30, .06), 0 5px 18px rgba(43, 28, 30, .08);
  --radius: 8px;
  --header-bg: #3a0e0e;     /* very dark red header */
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.045 0'/></filter><rect width='160' height='160' filter='url(%23p)'/></svg>");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.25; color: var(--ink); font-weight: 700; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid #2a0a0c;
}

.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }

.brand {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--sans); font-size: 1.25rem; font-weight: 700; color: #f6ede2;
  white-space: nowrap; letter-spacing: .01em;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark { color: #d98a4a; display: inline-flex; }
.brand-mark svg { display: block; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.site-nav a:not(.btn) { display: block; padding: .45rem .7rem; color: #e0d3cb; border-radius: 6px; font-size: .98rem; }
.site-nav a:not(.btn):hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.site-nav a.is-active { color: #fff; }

.btn { display: inline-block; padding: .5rem 1rem; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.btn-primary { background: var(--accent); color: #fff !important; }
.btn-primary:hover { background: var(--accent-dark); color: #fff !important; text-decoration: none; }
.btn-ghost { border: 1.5px solid var(--accent); color: var(--accent) !important; background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); text-decoration: none; }

/* pill-split segmented buttons (used in listings) */
.pill-split { display: inline-flex; align-items: stretch; border: 1.5px solid var(--accent); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.pill-split a { padding: .45rem .9rem; font-weight: 600; font-size: .92rem; }
.pill-split a:not(:first-child) { border-left: 1.5px solid var(--accent); }
.split-read { background: var(--accent); color: #fff; }
.split-read:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.split-dl { background: #fff; color: var(--accent-deep); }
.split-dl:hover { background: var(--accent-soft); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding: 3rem 0 2.6rem; background: var(--surface); border-bottom: 1px solid var(--rule); }
.hero-kicker { font-weight: 700; color: var(--accent-deep); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 .8rem; }
.hero h1 { font-size: 2.5rem; font-weight: 700; color: var(--ink); margin: 0 0 1rem; max-width: 20ch; letter-spacing: -0.01em; }
.hero-tagline { color: var(--ink-soft); font-size: 1.12rem; max-width: 62ch; margin: 0; }

/* ---------- Intro band (like the pledge band) ---------- */
.intro-band { background: var(--surface); border-bottom: 1px solid var(--rule); padding: 2.8rem 0; }
.intro-card { max-width: 820px; }
.intro-card h1 { font-size: 2.1rem; margin: 0 0 1rem; }
.intro-text { font-size: 1.06rem; max-width: 70ch; margin: 0; }
.intro-band .intro-text + .intro-text { margin-top: 1.05rem; color: var(--ink-soft); }

/* ---------- Citation ---------- */
.citation { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-size: .93rem; }
.cite-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 .3rem; }
.cite-text { margin: 0; color: var(--ink-soft); line-height: 1.6; }

/* ---------- Diamond Reviewer Pledge ---------- */
.pledge-band { background: var(--bg-alt); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 2.4rem 0; }
.pledge-card { display: flex; gap: 2rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.pledge-text { flex: 1 1 60%; }
.pledge-text .hero-kicker { margin-top: 0; }
.pledge-body { font-size: 1.05rem; max-width: 68ch; margin: 0 0 1.1rem; }
.pledge-badge { flex: 0 0 auto; }
.pledge-badge img { width: 168px; height: auto; display: block; border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--rule); transition: transform .15s ease; }
.pledge-badge img:hover { transform: translateY(-2px); }

/* ---------- Sections ---------- */
.section { padding: 2.4rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.6rem; margin: 0; }
.section-head .more { color: var(--accent-deep); font-weight: 600; }

/* ---------- Table (parchment card) ---------- */
.table-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.table-wrap { overflow-x: auto; }

table.reviews { width: 100%; border-collapse: collapse; font-size: .9rem; }
.reviews thead th {
  text-align: left; background: #efe8dc; border-bottom: 1px solid var(--rule);
  padding: .7rem .8rem; font-weight: 700; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); white-space: nowrap;
}
.reviews tbody td { padding: .75rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.reviews tbody tr:nth-child(even) { background: rgba(0, 0, 0, .018); }
.reviews tbody tr:last-child td { border-bottom: none; }
.reviews tbody tr:hover { background: var(--accent-soft); }
.reviews .nowrap { white-space: nowrap; }
.reviews td .muted { color: var(--muted); font-size: .85rem; }
.reviews td.notes, .reviews th.notes { font-size: .78rem; color: var(--muted); max-width: 200px; white-space: normal; overflow-wrap: break-word; line-height: 1.4; }
.reviews th.notes { white-space: nowrap; }

.pill-link {
  display: inline-block; padding: .28rem .7rem; border: 1.5px solid var(--accent);
  border-radius: 999px; color: var(--accent-deep); font-weight: 600; font-size: .85rem; margin: .15rem 0;
}
.pill-link:hover { background: var(--accent-soft); text-decoration: none; }
.pill-link + .pill-link { margin-left: .35rem; }

/* ---------- Cards list ---------- */
.article-list { list-style: none; margin: 0; padding: .4rem 1.6rem; }
.article-card { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.article-card:last-child { border-bottom: none; padding-bottom: 0; }
.article-card .article-section { text-transform: uppercase; letter-spacing: .05em; font-size: .74rem; color: var(--muted); font-weight: 600; margin: 0 0 .3rem; }
.article-card h3 { margin: .1rem 0 .35rem; font-size: 1.18rem; }
.article-card h3 a { color: var(--ink); }
.article-card h3 a:hover { color: var(--accent-deep); }
.article-card-body { min-width: 0; }
.card-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }

/* ---------- Callout ---------- */
.callout { background: var(--accent-soft); border-left: 5px solid var(--accent); border-radius: 8px; padding: 1rem 1.2rem; margin: 1.2rem 0; }
.callout p { margin: .25rem 0; }

/* ---------- Reading pages / prose ---------- */
.page-head { padding: 1.6rem 0 .2rem; }
.page-head h1 { font-size: 2rem; margin: 0 0 .4rem; }
.page-head p { color: var(--ink-soft); margin: 0 0 .4rem; }
.back { margin: 1.2rem 0; display: inline-block; color: var(--accent-deep); font-weight: 600; }

.prose-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem 2.4rem; margin: 1rem 0; }
.review-doc { line-height: 1.75; font-size: 1.03rem; }
.review-doc p { margin: 0 0 1rem; }
.review-doc h1, .review-doc h2, .review-doc h3, .review-doc h4 { margin: 1.5em 0 .6em; line-height: 1.3; }
.review-doc h2 { font-size: 1.45rem; }
.review-doc ul, .review-doc ol { margin: 0 0 1rem; padding-left: 1.5em; }
.review-doc blockquote { margin: 0 0 1rem; border-left: 3px solid var(--rule); padding-left: 1rem; color: var(--ink-soft); }
.review-doc table { border-collapse: collapse; margin: 1rem 0; }
.review-doc th, .review-doc td { border: 1px solid var(--rule); padding: .4rem .7rem; }
.review-doc img { max-width: 100%; height: auto; }
.review-doc a { text-decoration: underline; text-underline-offset: 2px; }

.pdf-viewer { width: 100%; height: 82vh; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-alt); box-shadow: var(--shadow); }
.code-view { background: #2b1c1e; color: #f0e6d8; padding: 1.4rem 1.6rem; border-radius: var(--radius); overflow-x: auto; font-size: .82rem; line-height: 1.55; margin: 0; }

.download-bar { display: flex; align-items: center; gap: .7rem; margin: 1rem 0; flex-wrap: wrap; }
.download-bar .hint { color: var(--muted); font-size: .88rem; }

.osf-note .osf-inner { padding: 1.4rem 1.8rem; }
.osf-note h2 { margin-top: 0; font-size: 1.4rem; }
.osf-note p { margin: 0 0 .7rem; }

/* ---------- Statistics ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.4rem 0 .4rem; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.kpi-num { font-size: 1.9rem; font-weight: 700; color: var(--accent-deep); line-height: 1.1; }
.kpi-label { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

.chart-block { margin: 0 0 2.2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; }
.chart-title { font-size: 1.05rem; margin: 0 0 .8rem; color: var(--ink); }
.chart-box { position: relative; width: 100%; height: 440px; }

.meta-inline { color: var(--muted); font-size: .88rem; margin: .1rem 0; }

/* ---------- Reviewed work column ---------- */
.reviewed-work { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.reviewed-work:hover { color: var(--accent-deep); }
.reviewed-work .ext { font-size: .8em; }

/* ---------- Filters ---------- */
.filters-box { padding: 1rem 1.6rem .2rem; border-bottom: 1px solid var(--rule); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; align-items: end; }
.filter-group { display: flex; flex-direction: column; gap: .3rem; }
.filter-group label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.filter-group select { width: 100%; padding: .45rem .5rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); font: inherit; color: var(--ink); }
.filter-hint { margin: .6rem 0 .2rem; font-size: .82rem; color: var(--muted); min-height: 1em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--header-bg); color: #dccdc3; margin-top: 3rem; padding: 2.4rem 0 2.2rem; }
.site-footer a { color: #e0a88a; }
.site-footer a:hover { color: #fff; }
.footer-cite { margin: 0 0 .5rem; font-size: .95rem; max-width: 75ch; }
.footer-cite em { color: #e9dcd2; }
.footer-repo { margin: 0 0 1.2rem; font-size: .95rem; }
.footer-license { border-top: 1px solid #4a1a1a; padding-top: 1.1rem; font-size: .9rem; color: #bfa598; }

@media (max-width: 680px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 2rem; }
  .header-inner { min-height: 60px; gap: 1rem; flex-wrap: wrap; }
  .site-nav { flex-wrap: wrap; }
  .site-nav a { padding: .2rem .3rem; font-size: .92rem; }
  .prose-card { padding: 1.3rem 1.05rem; }
  .article-list { padding: .4rem .8rem; }
  .card-actions { justify-content: flex-start; }
  .chart-box { height: 320px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table.reviews { min-width: 660px; }
  .wrap { padding: 0 1rem; }
  .download-bar { flex-direction: column; align-items: flex-start; }
  .pdf-viewer { height: 70vh; }
}

@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
