/* ==========================================================================
   Cane Agency — reading-scale.css
   GLOBAL DEVICE READING-SCALE POLICY. Single source of truth for how large
   type renders per device class. Every surface in the project (docs/, drafts/,
   wireframes/, decks/, videos/, 3ds/, apps/, registers) obeys this one file —
   never a second scale rule in a page's own <style>.

   THE SCALE IS COMPUTED, NOT TABULATED. shared/reading-scale.js (loaded in
   <head> by every covered page) measures the viewport and sets `--read-zoom`
   so the page lays out in a CONSTANT READING BOX:

     Device class                          Reading box after the zoom
     -----------------------------------   --------------------------
     Phone (≤600px)                        native, no zoom
     Touch tablet, portrait                ~640 CSS px
     Touch tablet, landscape               ~860 CSS px
     Desktop (fine pointer / >1400px)      native, no zoom
     Print                                 native, no zoom (A4 untouched)

   Why a constant box and not a fixed multiplier: a tablet browser can be
   switched between "mobile view" and "desktop view", and the two report
   different viewport widths for the same glass (834 vs 1024 CSS px on an 11"
   iPad) — desktop view additionally shrinks the whole page to fit and spoofs
   `pointer: fine`. A fixed multiplier therefore renders two different physical
   type sizes: too small in desktop view, too large in mobile view. Scaling to a
   constant box makes both views land on the same physical size, because the box
   always spans the same physical screen width.

   How it applies:
     · `doc-page` documents scale through the component's own `--doc-zoom` hook
       (doc-page.js puts `zoom: var(--doc-zoom, 1)` on the host).
     · every other page scales through a `zoom` on <body>; pages that contain a
       doc-page are excluded so the two never multiply.
     · a page that must render at true pixel size (image generators, fixed-size
       export canvases, device-frame prototypes that ARE the phone) opts out
       with `<body data-read-scale="off">`.
   `zoom` is used deliberately: it lifts token type AND the px sizes documents
   declare locally, without touching layout proportions. Print always renders
   at 1, so A4 geometry is untouched.

   The blocks below are the JS-OFF FALLBACK only — they cover a touch tablet in
   mobile view, the one case CSS can still detect. reading-scale.js overrides
   them inline whenever it runs. Do not add device rules here; change the boxes
   in reading-scale.js.
   ========================================================================== */

:root { --read-zoom: 1; }

@media screen and (min-width: 601px) and (max-width: 1024px) and (pointer: coarse) {
  :root { --read-zoom: 1.3; }
}
@media screen and (min-width: 1025px) and (max-width: 1366px) and (pointer: coarse) {
  :root { --read-zoom: 1.4; }
}

doc-page { --doc-zoom: var(--read-zoom, 1); }
body:not(:has(doc-page)):not([data-read-scale="off"]) { zoom: var(--read-zoom, 1); }

/* Beats the inline value reading-scale.js writes on <html>. */
@media print { :root { --read-zoom: 1 !important; } }
