/* -----------------------------------------------------------------
   Scammer4U paper site
   Plain CSS, no preprocessor, no framework.
   ----------------------------------------------------------------- */

:root {
  --bg: #fafaf7;
  --ink: #1a1a1a;
  --ink-soft: #4a4a48;
  --rule: #d9d6cc;
  --rule-soft: #e8e5db;
  --accent: #a14a2a;
  --accent-soft: #c97a5a;
  --warn-bg: #f5e9c8;
  --warn-ink: #6b4f12;
  --serif: "Source Serif 4", Charter, Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --measure-wide: 56rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* -----------------------------------------------------------------
   Top nav
   ----------------------------------------------------------------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  transition: transform 220ms ease;
}

.topnav.is-hidden {
  transform: translateY(-110%);
}

.topnav .brand {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.topnav nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.topnav nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.topnav nav a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .topnav nav { display: none; }
}

/* -----------------------------------------------------------------
   Section layout
   ----------------------------------------------------------------- */

main { padding-bottom: 4rem; }

section {
  padding: 4rem 1.5rem;
  border-bottom: 1px solid var(--rule-soft);
}

section:last-child { border-bottom: none; }

.prose,
.gallery-section > .prose {
  max-width: var(--measure);
  margin: 0 auto;
}

.prose h2,
.prose h3 {
  font-family: var(--sans);
  letter-spacing: -0.005em;
  color: var(--ink);
}

.prose h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1.1rem;
}

/* Make in-text bold land a little less aggressively */
.prose b, .prose strong { font-weight: 600; }

/* -----------------------------------------------------------------
   Hero
   ----------------------------------------------------------------- */

.hero {
  text-align: left;
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding-top: 5.5rem;
  padding-bottom: 4rem;
}

.hero .kicker {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  max-width: 20ch;
}

.hero .subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  max-width: 44ch;
}

.hero .lede {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 2rem;
  max-width: 50ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.pending-note {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--warn-ink);
  background: var(--warn-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
}

.hero-figure {
  margin: 2rem 0 0;
  max-width: var(--measure-wide);
}

.hero-figure img {
  border: 1px solid var(--rule);
  background: #fff;
}

.hero-figure figcaption {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.65rem;
  max-width: 60ch;
}

/* -----------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  line-height: 1.2;
  transition: background 150ms ease, color 150ms ease;
}

.btn.primary:hover { background: var(--accent); border-color: var(--accent); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

button.btn { font: inherit; font-family: var(--sans); font-size: 0.92rem; font-weight: 500; }

.btn[data-pending="true"] {
  position: relative;
  opacity: 0.85;
}

/* -----------------------------------------------------------------
   Big stat
   ----------------------------------------------------------------- */

.big-stat {
  border-top: 2px solid var(--accent);
  padding-top: 1.5rem;
  margin: 1.5rem 0 2.5rem;
}

.big-stat-number {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(3.5rem, 11vw, 6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-block;
}

.big-stat-unit {
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-left: 0.5rem;
  vertical-align: 0.5rem;
}

.big-stat-caption {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  margin: 1.1rem 0 0;
  max-width: 50ch;
}

/* -----------------------------------------------------------------
   Pull quote
   ----------------------------------------------------------------- */

.pull-quote {
  margin: 2.5rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--accent);
}

.pull-quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.pull-quote cite {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* -----------------------------------------------------------------
   Figures
   ----------------------------------------------------------------- */

.figure-wide {
  max-width: var(--measure-wide);
  margin: 2.25rem auto;
}

.figure-wide img {
  background: #fff;
  border: 1px solid var(--rule);
}

.figure-wide figcaption,
.caption {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.65rem;
  max-width: 60ch;
  line-height: 1.5;
}

/* -----------------------------------------------------------------
   Stats strip
   ----------------------------------------------------------------- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.2rem 1.6rem;
  margin: 1.75rem 0 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stats-strip > div { margin: 0; }

.stats-strip dt {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--ink);
}

.stats-strip dd {
  margin: 0.15rem 0 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* -----------------------------------------------------------------
   Bar chart (CSS-only)
   ----------------------------------------------------------------- */

.bar-chart {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 1rem;
}

.bar-chart li {
  display: grid;
  grid-template-columns: 11rem 1fr 4rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
}

.bar-chart .bar-label {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
}

.bar-chart .bar {
  background: var(--rule-soft);
  height: 14px;
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.bar-chart .bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 900ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

.bar-chart.is-visible li .bar-fill {
  width: var(--w);
}

.bar-chart .bar-value {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
}

@media (max-width: 540px) {
  .bar-chart li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .bar-chart .bar-value { text-align: left; }
}

/* -----------------------------------------------------------------
   Gallery
   ----------------------------------------------------------------- */

.gallery-section {
  max-width: var(--measure-wide);
  margin: 0 auto;
}

.gallery-section .prose { padding: 0; }

.gallery {
  position: relative;
  margin: 2rem 0 1rem;
}

.gallery-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.25rem 0.25rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.gallery-track::-webkit-scrollbar { height: 8px; }
.gallery-track::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }

.gallery-track figure {
  flex: 0 0 320px;
  margin: 0;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--rule);
}

.gallery-track img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--rule);
}

.gallery-track figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 0.65rem 0.75rem 0.85rem;
  line-height: 1.4;
}

.gallery-nav {
  position: absolute;
  top: 100px;
  transform: translateY(-50%);
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
}

.gallery-nav.prev { left: -8px; }
.gallery-nav.next { right: -8px; }

.gallery-nav:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

@media (max-width: 720px) {
  .gallery-nav { display: none; }
  .gallery-track figure { flex-basis: 80vw; }
}

.gallery-note { max-width: var(--measure); margin: 0 auto; }

/* -----------------------------------------------------------------
   Authors and cite
   ----------------------------------------------------------------- */

.cite-section .author-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-family: var(--sans);
}

.cite-section .author-list .author-name {
  color: var(--ink);
  font-weight: 500;
}

.cite-section .author-list sup {
  font-size: 0.7em;
  color: var(--ink-soft);
}

.affiliations {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.contact {
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.contributors {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 1.25rem;
  max-width: 60ch;
  line-height: 1.55;
}

.contributors-label {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  margin-right: 0.55rem;
  padding: 0.18rem 0.5rem;
  background: var(--rule-soft);
  border-radius: 2px;
  vertical-align: 0.1rem;
}

.bibtex {
  background: #ffffff;
  border: 1px solid var(--rule);
  padding: 1.1rem 1.2rem;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  margin: 1rem 0 0;
  color: var(--ink);
  white-space: pre;
}

#copy-bibtex.is-copied {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* -----------------------------------------------------------------
   Footer
   ----------------------------------------------------------------- */

footer {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
}

footer p { margin: 0 0 0.55rem; max-width: 64ch; }

/* -----------------------------------------------------------------
   View toggle (button group)
   ----------------------------------------------------------------- */

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0 1.25rem;
  font-family: var(--sans);
}

.view-toggle button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.4rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border-right: 1px solid var(--rule);
  transition: background 150ms ease, color 150ms ease;
}

.view-toggle button:last-child { border-right: 0; }

.view-toggle button:hover { color: var(--ink); }

.view-toggle button.is-active {
  background: var(--ink);
  color: var(--bg);
}

/* -----------------------------------------------------------------
   Mitigation table
   ----------------------------------------------------------------- */

.table-scroll {
  margin: 0 0 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mitigation-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
  min-width: 32rem;
}

.mitigation-table th,
.mitigation-table td {
  padding: 0.55rem 0.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 220ms ease;
}

.mitigation-table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}

.mitigation-table tbody th[scope="row"] {
  text-align: left;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.mitigation-table td.pool,
.mitigation-table th.pool {
  border-left: 1px solid var(--rule);
  font-weight: 600;
  color: var(--ink);
}

.mitigation-table tr.delta-row {
  border-top: 1px solid var(--rule);
}

.mitigation-table tr.delta-row th,
.mitigation-table tr.delta-row td {
  border-bottom: 0;
  color: var(--ink);
  font-weight: 500;
  padding-top: 0.75rem;
}

.mitigation-table tr.delta-row td.pool {
  color: var(--accent);
  font-weight: 600;
}

/* Heatmap mode */
.mitigation-table[data-view="heatmap"] tbody tr:not(.delta-row) td {
  background: rgba(161, 74, 42, calc(var(--rate) * 0.95));
  color: var(--ink);
}

.mitigation-table[data-view="heatmap"] tbody tr:not(.delta-row) td[style*="--rate: 0.7"],
.mitigation-table[data-view="heatmap"] tbody tr:not(.delta-row) td[style*="--rate: 0.8"],
.mitigation-table[data-view="heatmap"] tbody tr:not(.delta-row) td[style*="--rate: 0.9"] {
  color: #fff;
}

/* -----------------------------------------------------------------
   Callout aside (Llama outlier)
   ----------------------------------------------------------------- */

.callout {
  background: #f3efe4;
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  font-family: var(--serif);
}

.callout p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}

.callout strong { font-weight: 600; }

/* -----------------------------------------------------------------
   Factor cards (details / summary)
   ----------------------------------------------------------------- */

.factor-cards {
  display: grid;
  gap: 0.6rem;
  margin: 1.25rem 0 1rem;
}

.factor-card {
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: 2px;
  font-family: var(--sans);
  transition: border-color 150ms ease;
}

.factor-card[open] { border-color: var(--ink-soft); }

.factor-card summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.8rem;
  align-items: center;
  user-select: none;
}

.factor-card summary::-webkit-details-marker { display: none; }
.factor-card summary::marker { content: ""; }

.factor-card summary:hover { background: rgba(0, 0, 0, 0.02); }

.factor-card summary::after {
  content: "+";
  display: inline-block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink-soft);
  width: 1.25rem;
  text-align: center;
  transition: transform 200ms ease;
}

.factor-card[open] summary::after {
  content: "\2212"; /* unicode minus, used here as a close icon, not as punctuation */
}

.factor-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
}

.factor-stats {
  display: inline-flex;
  gap: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.factor-effect { color: var(--ink); font-weight: 500; }

.factor-q { color: var(--ink-soft); }

.factor-verdict {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-weight: 600;
}

.factor-body {
  padding: 0 1rem 1rem;
  font-family: var(--serif);
}

.factor-body p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 60ch;
}

@media (max-width: 540px) {
  .factor-card summary {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name verdict"
      "stats stats";
    row-gap: 0.4rem;
  }
  .factor-name { grid-area: name; }
  .factor-verdict { grid-area: verdict; }
  .factor-stats { grid-area: stats; }
  .factor-card summary::after { display: none; }
}

/* -----------------------------------------------------------------
   Verdict cards
   ----------------------------------------------------------------- */

.verdict-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.verdict-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent-soft);
  padding: 1.1rem 1.25rem 1.25rem;
  font-family: var(--sans);
}

.verdict-card.wide { border-top-color: var(--accent); }

.verdict-card header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.verdict-card h4 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.verdict-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  font-weight: 600;
}

.verdict-card.narrow .verdict-badge {
  background: var(--accent-soft);
}

.verdict-card dl {
  margin: 0 0 0.85rem;
  font-size: 0.83rem;
}

.verdict-card dl > div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-top: 1px solid var(--rule-soft);
}

.verdict-card dl > div:first-child { border-top: 0; }

.verdict-card dt {
  color: var(--ink-soft);
  font-weight: 500;
}

.verdict-card dd {
  margin: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.verdict-card p {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

/* -----------------------------------------------------------------
   Sanity grid
   ----------------------------------------------------------------- */

.sanity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 0.5rem;
}

.sanity {
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}

.sanity-stat {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 2.1rem;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.01em;
}

.sanity-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0.45rem 0 0.65rem;
}

.sanity p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 40ch;
}

/* -----------------------------------------------------------------
   Reduced motion
   ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .bar-chart .bar-fill { width: var(--w); }
}

/* -----------------------------------------------------------------
   Print
   ----------------------------------------------------------------- */

@media print {
  .topnav, .gallery-nav, .cta-row { display: none; }
  body { font-size: 11pt; }
  section { padding: 1rem 0; border-bottom: none; }
  a { color: var(--ink); text-decoration: none; }
}
