/* ════════════════════════════════════════════════════════════════════════════════════════
   print.css — WP3 · any page → the A4 "Interim Report Nº 01 / 中期报告 第 01 号" (§6.9).
   Link with media="print" (or it scopes itself with @media print below). Ink on white, one red.
   The luminous plate swaps to its ink-on-paper engraving bake (WP4:
   /img/plate-engraving-landscape.webp). Nothing interactive prints; nothing is clipped;
   no text below 8pt (≈ 10.7px).
   ════════════════════════════════════════════════════════════════════════════════════════ */

@page {
  size: A4;
  margin: 15mm 15mm 17mm 17mm;
  @bottom-left {
    content: "Interim Report Nº 01 · zhouyixiaoxiao.com";
    font: 400 8pt/1 "ZX Plex Mono", "IBM Plex Mono", monospace;
    letter-spacing: .08em;
    color: #6A6458;
  }
  @bottom-right {
    content: "p. " counter(page) " / " counter(pages);
    font: 400 8pt/1 "ZX Plex Mono", "IBM Plex Mono", monospace;
    letter-spacing: .08em;
    color: #6A6458;
  }
}
@page :first { @bottom-left { content: ""; } }
/* zh pages use a named page so the running footer reads in Chinese */
@page zh {
  @bottom-left {
    content: "中期报告 第 01 号 · zhouyixiaoxiao.com";
    font: 400 8pt/1 "ZX Plex Mono", "PingFang SC", "Songti SC", monospace;
    letter-spacing: .08em;
    color: #6A6458;
  }
}
@page zh:first { @bottom-left { content: ""; } }

@media print {
  :root, :root[data-theme="dark"] {
    --paper:#FFFFFF; --paper-2:#F6F3EC; --paper-3:#E9E3D6;
    --ink:#111; --ink-2:#333; --ink-3:#555; --ink-4:#999;
    --rule:rgba(0,0,0,.22); --rule-strong:#111;
    --verm:#C4351C; --verm-ink:#A82C16; --verm-wash:rgba(196,53,28,.08);
    --surface:transparent;
    --fs-body:10.5pt; --fs-body-zh:10.5pt; --fs-caption:8.5pt; --fs-mono:8pt; --fs-min:8pt; --fs-slip:8pt; --fs-readout:8.5pt;
    --fs-lede:12.5pt; --fs-h2:20pt; --fs-h3:13pt;
    --fs-display-xl:34pt; --fs-display-l:40pt; --fs-giant:120pt;
    --lh-body:1.45; --lh-body-zh:1.7;
    --margin:0mm; --gutter:5mm; --hdr:0px; --rail:0px; --strip-h:0px;
    --section-gap:10mm;
    --plate-h:88mm;
    color-scheme: light;
  }
  html, body { background: #fff !important; color: var(--ink); }
  html:lang(zh) body { page: zh; }
  body { font-size: var(--fs-body); line-height: var(--lh-body); }
  body::before, body::after { display: none !important; content: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }

  /* never print interactive chrome */
  .skip, .thumbs, .console, .console-lite, .passport, .stamp, .toast, .lang-suggest, .key-help,
  .sheet, .sheet-backdrop, .ev-card, .plate__hint, .plate__toast, .plate-controls, .plate-chip,
  .plate__gl, .plate__fx, .plate__glow, .site-header__nav, .site-header__now, .theme-switch,
  .sound-switch, .figure__controls, .stepper__steps, .console__foot, .measure-link, .chapter-next__hint,
  .reply-card, .your-passage, .hist__canvas, .hist__stage > canvas, .hist__seal, .noscript-note,
  .plate__noscript, canvas, video, [data-print="hide"], .no-print { display: none !important; }
  [data-print="show"], .print-only { display: block !important; }

  /* layout resets: no fixed/sticky, no rails, no viewport units */
  .page { padding: 0 !important; }
  .wrap, .site-header__inner, .site-footer__inner { max-width: none; padding-inline: 0; }
  .site-header { position: static; height: auto; padding: 0 0 4mm; border-bottom: 1.5pt solid var(--ink); }
  .site-header__inner { height: auto; }
  .site-header__identity { display: block !important; max-width: none; white-space: normal; }
  .site-header__id::after {
    content: "Interim Report Nº 01";
    margin-left: auto;
    font: 500 8pt/1 var(--f-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--verm-ink);
  }
  :lang(zh) .site-header__id::after, .site-header__id:lang(zh)::after { content: "中期报告 第 01 号"; font-family: var(--f-cjk-ui); }
  .site-header__id { width: 100%; }
  .seal { width: 12mm; height: 12mm; }
  .site-footer { margin-top: 8mm; padding: 4mm 0 0; }
  .site-footer__cols { display: none; }
  .site-footer__meta { margin-top: 0; border-top: 0; padding-top: 0; }

  /* type */
  h1, h2, h3, h4, .section__head, .figure__head, .opener__title, .chapter__section-title { break-after: avoid; page-break-after: avoid; }
  p, li, dd { orphans: 3; widows: 3; }
  .card10, .ch-card, .keyfig, .paper-card, .figure, .colophon-box, .cv__item, .ledger tr, .ledger__row, .boundary__link, .results-table tr, .sidenote, blockquote { break-inside: avoid; page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .prose a[href^="http"]::after, .ledger__title a[href^="http"]::after, .cv__what a[href^="http"]::after, .paper-card__links a[href^="http"]::after {
    content: " \2014 " attr(href);
    font: 400 8pt/1.2 var(--f-mono);
    letter-spacing: 0;
    color: var(--ink-3);
    word-break: break-all;
  }
  .card10__reach a[href^="http"]::after { content: " " attr(href); text-transform: none; letter-spacing: 0; font-size: 8pt; color: var(--ink-3); }
  .card10__reach a[href^="mailto:"]::after { content: " " attr(href); text-transform: none; letter-spacing: 0; font-size: 8pt; }

  /* masthead + 10-second card = the report's cover block */
  .masthead { min-height: 0; padding-block: 5mm 3mm; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .masthead__glyph { min-height: 30mm; margin-block: 0; margin-left: 0; font-size: 54pt; text-indent: 0; }
  .masthead__glyph > .giant { top: 0; margin-left: 0; }
  .card10 { background: none; font-size: 9.5pt; border-top-width: 1.5pt; }

  /* the plate prints as its engraving: ink on paper, markers as ink rings, slips as plain labels */
  .plate-fig {
    grid-template-columns: 9mm minmax(0, 1fr);
    grid-template-areas: "lanes stage" ". hist" ". cap";
    row-gap: 4mm;
  }
  .lane__label, .lane__no { display: none; }
  .lane { padding: 0; align-items: center; }
  .lane__glyph { font-size: 12pt; }
  .hist { height: auto; display: grid; grid-template-columns: minmax(0, 1fr) 55mm; grid-template-areas: "head head" "stage readout"; column-gap: 5mm; }
  .hist__head { grid-area: head; display: flex; flex-wrap: wrap; gap: 2mm 6mm; align-items: baseline; }
  .hist__stage { grid-area: stage; height: 30mm; flex: none; }
  .hist__readout { grid-area: readout; }
  .plate {
    height: var(--plate-h);
    background: #fff url("/img/plate-engraving-landscape.webp") center / 100% 100% no-repeat !important;
    border: .75pt solid var(--ink);
    color: var(--ink);
  }
  .plate::after, .plate::before, .plate__fog, .plate__grid { display: none !important; }
  .plate__print { display: none !important; }
  .plate__edge { color: var(--ink-3); }
  .ev { color: var(--ink); }
  .ev__dot { background: #fff; border-color: var(--ink); box-shadow: none; }
  .ev--origin .ev__dot, .ev--reached .ev__dot { background: var(--ink); border-color: var(--ink); }
  .ev--target::before { border-color: var(--verm); }
  .ev__label.slip { background: rgba(255,255,255,.9); color: var(--ink); border: 0; box-shadow: none; font-size: 8pt; padding: 0 2px; }
  .ev--p3 .ev__label { display: none; }
  .arc-label { background: #fff; color: var(--verm-ink); border-color: var(--verm); }
  .plate-fig__lanes { height: var(--plate-h); }
  .hist__static { display: block !important; }
  .plate-fig__stage::before, .plate-fig__stage::after { border-color: var(--ink); }

  /* chapters flow as report sections */
  .chapter > * + * { margin-top: 8mm; }
  .opener { min-height: 0; padding-block: 4mm; align-items: start; }
  .opener::after { display: none; }
  .opener__glyph { font-size: 110pt; margin-left: 0; }
  .figure__stage { min-height: 0; border-color: var(--ink); }
  .figure__stage--dark { background: #fff !important; color: var(--ink); border: .75pt solid var(--ink); }
  .figure__stage--dark::after { display: none; }
  .figure__static { display: block !important; visibility: visible !important; }
  .js .figure.is-live .figure__static { visibility: visible !important; }
  .lane-crop img { filter: invert(1) grayscale(1) contrast(1.1); }
  .ch-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-card { min-height: 0; padding: 3mm 3mm 3mm 0; }
  .ch-card::before { display: none; }
  .ch-card__glyph { font-size: 28pt; }
  .ch-card__thesis { -webkit-line-clamp: unset; display: block; }
  .chapter-next { display: none; }
  .boundary { padding-block: 6mm 0; }
  .boundary::before { background: var(--ink); height: 1pt; box-shadow: none !important; left: 0; right: 0; }
  .boundary__glyph { font-size: 80pt; }
  .boundary__link { padding: 2mm 0; }
  .boundary__link-v { font-size: 16pt; }
  .boundary__link-go { display: none; }
  .boundary .boundary__link { flex-wrap: wrap; }
  .boundary .boundary__link::after, .boundary a.boundary__link.ext::after {
    content: attr(href);
    flex: 1 1 100%;
    font: 400 8pt/1.2 var(--f-mono);
    letter-spacing: 0;
    color: var(--ink-3);
    word-break: break-all;
  }
  .contact-sheet, .filmstrip { background: #fff !important; box-shadow: none; }
  .contact-sheet__frame { background: #fff; border: .5pt solid var(--ink-3); }
  .cv { padding-block: 0; }
  .cv__section, .cv__contact-block, .cv__contact-block + .cv__section { grid-column: 1 / -1; }
  .paper-card { grid-template-columns: minmax(0, 1fr); padding: 3mm 0; }
  .paper-card > * { grid-column: 1 !important; grid-row: auto !important; justify-self: start !important; text-align: left; max-width: none; }
  .cv__grid { gap: 5mm; }
  .tk { border-color: var(--verm); }
  .table-scroll { overflow: visible; }
  .results-table, .ledger { font-size: 9pt; }
  .sidenotes { display: block; }
  .sidenote { margin: 2mm 0; }
  .reveal, .js .reveal { opacity: 1 !important; filter: none !important; }
  .stepper--scroll { min-height: 0; }
  .stepper--scroll .stepper__sticky { position: static; }
  img { break-inside: avoid; max-width: 100% !important; }
}
