/* RootVision whitepaper: long-form styles, scoped under .paper.
   Colours come from the site's tokens (css/site.css); the fallbacks match the site's dark theme. */

.paper {
  --wp-bg: var(--bg, #0b0f0c);
  --wp-text: var(--text, #e6ebe7);
  --wp-muted: var(--muted, #9aa59d);
  --wp-accent: var(--accent, #43b049);
  --wp-surface: var(--surface, #121914);
  --wp-border: var(--border, #243027);

  max-width: 72ch;
  margin: 0 auto;
  padding: 3rem 16px 5rem;
  color: var(--wp-text);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.paper > * + * { margin-top: 1.1em; }

/* Title block */
.paper .paper-head { margin-bottom: 2.5rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--wp-border); }
.paper .kicker {
  margin: 0 0 .75rem;
  color: var(--wp-accent);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.paper h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.paper .subtitle { margin: .75rem 0 0; color: var(--wp-muted); font-size: 1.15rem; line-height: 1.5; }
.paper .meta { margin: 1.25rem 0 0; color: var(--wp-muted); font-size: .9rem; }
.paper .head-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.paper .btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .6em 1.15em;
  border: 1px solid var(--wp-accent);
  border-radius: 6px;
  background: var(--wp-accent);
  color: #06210a;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.paper .btn:hover { filter: brightness(1.08); }
.paper .btn:focus-visible { outline: 2px solid var(--wp-text); outline-offset: 2px; }

/* Notice */
.paper .notice {
  padding: 1rem 1.25rem;
  border: 1px solid var(--wp-border);
  border-left: 3px solid var(--wp-accent);
  border-radius: 6px;
  background: var(--wp-surface);
  font-size: .95rem;
}
.paper .notice p { margin: 0; }
.paper .notice p + p { margin-top: .5em; }

/* Contents */
.paper nav.toc {
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--wp-border);
  border-radius: 6px;
  background: var(--wp-surface);
  font-size: .95rem;
}
.paper nav.toc h2 { margin: 0 0 .5rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wp-muted); }
.paper nav.toc p { margin: 0 0 .35rem; }
.paper nav.toc ol { margin: 0; padding-left: 1.4em; columns: 2 18ch; column-gap: 2rem; }
.paper nav.toc li { break-inside: avoid; }

/* Headings */
.paper h2 {
  margin-top: 3rem;
  font-size: 1.55rem;
  line-height: 1.25;
  scroll-margin-top: 5rem;
}
.paper h2 .num { color: var(--wp-accent); margin-right: .4em; font-variant-numeric: tabular-nums; }
.paper h3 { margin-top: 2rem; font-size: 1.15rem; line-height: 1.3; }
.paper h2 + p, .paper h3 + p { margin-top: .6em; }

.paper p, .paper ul, .paper ol { margin-bottom: 0; }
.paper ul, .paper ol { padding-left: 1.4em; }
.paper li + li { margin-top: .35em; }
.paper strong { color: var(--wp-text); font-weight: 650; }
.paper a { color: var(--wp-accent); text-underline-offset: 2px; }
.paper abbr { text-decoration: none; border-bottom: 1px dotted var(--wp-muted); }

.paper .abstract {
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  background: var(--wp-surface);
  border: 1px solid var(--wp-border);
}
.paper .abstract h2 { margin-top: 0; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wp-muted); }

/* Placeholder marker for numbers not yet confirmed */
.paper .tbd {
  padding: 0 .3em;
  border-radius: 3px;
  background: rgba(230, 180, 60, .16);
  color: #e8c46a;
  font-size: .9em;
  font-weight: 600;
  white-space: nowrap;
}

/* Figures */
.paper figure { margin: 2rem 0; }
.paper figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--wp-border);
  border-radius: 6px;
  background: var(--wp-surface);
}
.paper figure.tall img { max-height: 70vh; width: auto; max-width: 100%; margin: 0 auto; }
.paper figcaption { margin-top: .6rem; color: var(--wp-muted); font-size: .88rem; line-height: 1.5; }
.paper figcaption b { color: var(--wp-text); font-weight: 600; }
.paper .fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .paper .fig-pair { grid-template-columns: 1fr; } }

/* Process steps */
.paper ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.paper ol.steps > li {
  position: relative;
  padding-left: 2.6em;
  counter-increment: step;
}
.paper ol.steps > li + li { margin-top: .9em; }
.paper ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .1em;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  border: 1px solid var(--wp-accent);
  color: var(--wp-accent);
  font-size: .85em;
  font-weight: 600;
  line-height: 1.75em;
  text-align: center;
}

/* Tables */
.paper .table-wrap { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
.paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  line-height: 1.5;
}
.paper caption { caption-side: top; text-align: left; padding-bottom: .5rem; color: var(--wp-muted); font-size: .88rem; }
.paper th, .paper td { padding: .55rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--wp-border); }
.paper thead th { color: var(--wp-muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; border-bottom-color: var(--wp-accent); }
.paper table.spec th[scope="row"] { width: 34%; color: var(--wp-muted); font-weight: 500; }
.paper table.spec tr.group th {
  padding-top: 1.1rem;
  color: var(--wp-accent);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.paper table.spec tbody tr:not(.group):hover { background: var(--wp-surface); }

.paper .note { color: var(--wp-muted); font-size: .9rem; }
.paper hr { border: 0; border-top: 1px solid var(--wp-border); margin: 3rem 0; }

/* Print: clean black on white, no site chrome */
@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #000 !important; }
  #site-header, #site-footer, .no-print { display: none !important; }

  .paper {
    --wp-text: #000;
    --wp-muted: #444;
    --wp-accent: #1f6b25;
    --wp-surface: #fff;
    --wp-border: #bbb;
    max-width: none;
    padding: 0;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.5;
  }
  .paper a { color: #000; text-decoration: none; }
  .paper .abstract, .paper .notice, .paper nav.toc { background: #fff; border-color: #999; }
  .paper .tbd { background: none; color: #000; border: 1px solid #000; }
  .paper h2, .paper h3 { break-after: avoid; page-break-after: avoid; }
  .paper figure, .paper table, .paper .notice, .paper .abstract { break-inside: avoid; page-break-inside: avoid; }
  .paper figure img { border-color: #999; max-height: 120mm; width: auto; max-width: 100%; }
  .paper .table-wrap { overflow: visible; }
  .paper nav.toc ol { columns: 2; }
  .paper table.spec tbody tr:hover { background: none; }
}
