/* ============ PRINT ============
   The procurement, pricing, security and AI-use pages get forwarded inside
   companies and printed or saved to PDF by people who will never see the site.
   That printout is a brand surface. Without this it prints as a dark-banded,
   video-shaped mess with a nav bar across the top of every page.

   Goals: black text on white, the content only, links that still tell you where
   they went, and nothing orphaned across a page break. */

@media print {
  /* Print has its own palette on purpose: the warm ivory ground and navy ink are
     a screen design. On paper they waste toner and lose contrast, so print gets
     true black on true white. Logged in design/design-decisions.md. */
  :root{
    --print-ink:#000;
    --print-paper:#fff;
    --print-muted:#444;
    --print-soft:#555;
    --print-rule:#bbb;
    --print-rule-strong:#999;
  }

  /* --- kill the atmosphere --- */
  .sky, .grain, .wipe, .field, canvas,
  video, .phero-media, .scene-media, .bigfoot-media,
  .nav, .nav-toggle, .skip-link, .qq, .qq-pill,
  .hero-scroll, .scroll-line, .pulse, .orb,
  .cta, .film-foot, .ticker, .shelf-board,
  [data-magnetic] .arr {
    display: none !important;
  }

  /* --- paper --- */
  @page { margin: 18mm 16mm; }

  html, body {
    background: var(--print-paper) !important;
    color: var(--print-ink) !important;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  /* Hero: it is a full-viewport video block with a dark gradient overlay painted
     by .phero::after. Killing the video is not enough - the pseudo-element still
     prints a dark slab and the min-height still eats a whole sheet. */
  .phero, .scene, .bigfoot, .film, .film-stage, .hero {
    min-height: 0 !important; height: auto !important;
    padding: 0 0 10pt !important; overflow: visible !important;
  }
  .phero::after, .phero::before,
  .scene-media::after, .scene-media::before,
  .bigfoot::after, .bigfoot::before,
  .band::after, .band::before,
  .phero-media::after, .phero-media::before {
    display: none !important; background: none !important; content: none !important;
  }
  .phero-foot { display: none !important; }
  .ptitle { margin-top: 0 !important; }

  /* every band, pane and panel becomes plain paper */
  .band, .pane, .play, .receipt, .q-panel, .s-panel, .h-panel,
  .phero, .scene, .bigfoot, main, section, article, footer {
    background: none !important;
    box-shadow: none !important;
    color: var(--print-ink) !important;
    min-height: 0 !important;
  }
  .band *, .phero *, .scene * { color: var(--print-ink) !important; }

  /* --- type --- */
  h1, h2, h3 { color: var(--print-ink) !important; page-break-after: avoid; break-after: avoid; }
  h1 { font-size: 20pt; margin: 0 0 6pt; }
  h2 { font-size: 14pt; margin: 14pt 0 4pt; }
  h3 { font-size: 11.5pt; margin: 10pt 0 3pt; }
  p, li, td, th { orphans: 3; widows: 3; }
  p { margin: 0 0 7pt; max-width: none !important; }
  .kicker, .eyebrow, .srow-code {
    color: var(--print-muted) !important; font-size: 8pt; letter-spacing: .1em;
  }

  /* --- the pieces a buyer actually reads --- */
  ul, ol { margin: 0 0 8pt 14pt; padding: 0; }
  li { margin-bottom: 3pt; break-inside: avoid; }
  table { width: 100%; border-collapse: collapse; break-inside: auto; }
  th, td {
    border-bottom: .5pt solid var(--print-rule) !important;
    padding: 4pt 6pt !important; text-align: left; vertical-align: top;
    color: var(--print-ink) !important;
  }
  thead { display: table-header-group; }   /* repeat headers across pages */
  tr { break-inside: avoid; }

  /* keep a term and its definition together */
  dl, .guar > div, .td-card, .cs-list li, .receipt li { break-inside: avoid; }

  /* --- links: a printed link that hides its destination is useless --- */
  a { color: var(--print-ink) !important; text-decoration: underline; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: var(--print-soft); }
  main a[href^="mailto:"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: var(--print-soft); }
  /* internal nav links do not need a URL appended */
  a[href$=".html"]::after, a[href^="#"]::after { content: ""; }

  /* --- footer becomes the source line --- */
  footer {
    border-top: .5pt solid var(--print-rule-strong) !important;
    padding-top: 6pt; margin-top: 14pt;
    font-size: 8pt; color: var(--print-muted) !important;
    display: block !important;
  }
  footer .f-links { display: none !important; }

  /* --- the interactive demos cannot print; say so rather than print a husk --- */
  .g-board, .g-bar, .g-result, .q-form, .s-form, .h-form, .m-left { display: none !important; }
  .play::after {
    content: "This is an interactive demonstration. Open the playground page in a browser to use it.";
    display: block; font-style: italic; color: var(--print-soft); font-size: 9pt;
  }

  /* reveal.js hides things until scrolled into view; print must show everything */
  [data-reveal], .reveal, .in, .card, .mani-line {
    opacity: 1 !important; transform: none !important; visibility: visible !important;
  }
  * { animation: none !important; transition: none !important; }
}
