/*
 * Holonova print layer — A4 documents (DPA, NDA, SOW, proposals).
 *
 * 2026-07-27: this file now IMPORTS the token system instead of redeclaring it.
 * It previously hardcoded nine colour values and three font stacks as literals,
 * plus one hue (#FBF3EA) that existed in no token file at all, while
 * DESIGN_SYSTEM.md claimed "there is no second token file". The two agreed only
 * because a human had typed the same values twice, which is exactly the drift
 * that let the logo colour diverge from the token colour for five months.
 *
 * Documents render in the LIGHT theme. Everything here is page furniture:
 * page size, print typography in points, table rules, break control. No colour
 * or font value is defined in this file.
 *
 * The running header and the "DRAFT, NOT FOR SIGNATURE" footer are injected by
 * tooling/render-contract-pdf.mjs through Chrome's margin templates, which live
 * outside this stylesheet and cannot use it.
 */

@import "holonova-tokens.css";

/* Documents are always light, whatever the screen system defaults to. */
:root { color-scheme: light; }
html { --forced-light: 1; }
body.contract {
  /* Pull in the light semantic set explicitly rather than relying on a
     data-theme attribute the renderer would have to remember to set. */
  --color-canvas: var(--paper-0);
  --color-surface: var(--paper-0);
  --color-surface-raised: var(--paper-50);
  --color-well: var(--orange-tint);
  --color-text: var(--slate-900);
  --color-text-secondary: var(--slate-600);
  --color-text-muted: var(--slate-600);
  --color-text-signal: var(--orange-action);
  --color-line: rgb(22 24 28 / .14);
  --color-line-strong: #C9C7C1;
  --color-action: var(--orange-action);

  background: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 10.5pt;
  line-height: 1.55;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

@page { size: A4; }

html, body { margin: 0; padding: 0; }
main { display: block; }

/* ---- Document typography (points, not the screen ramp) ----
   The screen display ramp is sized for a landing page. A contract is set for
   reading, so the fluid clamp() steps are deliberately not used here. */
.contract h1 {
  font-weight: 700; font-size: 21pt; line-height: 1.2; letter-spacing: -.02em;
  margin: 0 0 4pt; padding-bottom: 8pt;
  border-bottom: 2.5pt solid var(--color-action);
}
.contract h2 { font-weight: 600; font-size: 13.5pt; line-height: 1.3;
  color: var(--color-text); margin: 20pt 0 6pt; break-after: avoid; }
.contract h3 { font-weight: 600; font-size: 11.5pt; line-height: 1.35;
  margin: 14pt 0 5pt; break-after: avoid; }
.contract h4 { font-weight: 600; font-size: 10.5pt; margin: 12pt 0 4pt; break-after: avoid; }
.contract p { margin: 0 0 7pt; orphans: 2; widows: 2; max-width: none; }
.contract strong { font-weight: 600; }
.contract em { font-style: italic; }

/* A printed contract reads as prose. Keep the text, drop the web link styling. */
.contract a { color: inherit; text-decoration: none; }

.contract ul, .contract ol { margin: 0 0 8pt; padding-left: 16pt; }
.contract li { margin: 0 0 3pt; }

/* Cautions ("DRAFT, NOT FOR SIGNATURE") must survive visibly onto page one.
   A tinted well plus a full hairline, not a heavy side stripe: the tint already
   does the work the stripe was doing. */
.contract blockquote {
  margin: 10pt 0 12pt; padding: 9pt 12pt;
  background: var(--color-well);
  border: 0.75pt solid var(--color-action);
  border-radius: 3pt;
  break-inside: avoid;
}
.contract blockquote p { margin: 0 0 4pt; font-size: 10pt; }
.contract blockquote p:last-child { margin-bottom: 0; }
.contract blockquote strong { color: var(--color-text-signal); }

/* ---- Tables, including the annex tables carrying visible blanks ---- */
.contract table { width: 100%; border-collapse: collapse; margin: 8pt 0 12pt;
  font-size: 9pt; line-height: 1.4; break-inside: auto; }
.contract thead { display: table-header-group; }
.contract th {
  background: var(--slate-900); color: var(--paper-0);
  font-weight: 600; text-align: left; padding: 5pt 7pt;
  border: 0.75pt solid var(--slate-900); vertical-align: top;
}
.contract td { padding: 5pt 7pt; border: 0.75pt solid var(--color-line-strong); vertical-align: top; }
.contract tbody tr:nth-child(even) { background: var(--paper-50); }
.contract tr { break-inside: avoid; }
/* "To be filled in" markers read as deliberate gaps. */
.contract td em { color: var(--color-text-signal); font-style: italic; }

/* Horizontal rules separate body from annexes: each becomes a page break. */
.contract hr { border: 0; height: 0; margin: 0; break-after: page; }

.contract code { font-family: var(--font-mono); font-size: 9pt;
  background: var(--paper-50); padding: .5pt 3pt; border-radius: 2pt; color: inherit; }

/* ---- Signature blocks ----
   A signature block split across a page break is the one layout failure a
   contract cannot ship with, and nothing previously protected it. */
.contract .signatures,
.contract table:last-of-type { break-inside: avoid; }
.contract h2:last-of-type ~ table { break-inside: avoid; }

/* Defensive: the screen effects layer must never reach a legal document, even
   if a page somehow loads both stylesheets and prints the result. */
*, *::before, *::after {
  box-shadow: none !important; text-shadow: none !important;
  animation: none !important; transition: none !important; transform: none !important;
}
