/* Black / White Reading System 01 — shared stylesheet (candidate, not approved).
   Shared rules only. Per-piece judgement (which line is an anchor, where a plate sits) lives in each page's markup.
   No JavaScript, no motion, no scroll-driven behaviour anywhere in the system. */

/* ---- faces (local, OFL; files and licences in shared/fonts/) ---- */
@font-face{font-family:"Inter";font-weight:400;font-style:normal;font-display:swap;src:url(fonts/inter-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Inter";font-weight:500;font-style:normal;font-display:swap;src:url(fonts/inter-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"EB Garamond";font-weight:400;font-style:normal;font-display:swap;src:url(fonts/eb-garamond-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"EB Garamond";font-weight:400;font-style:italic;font-display:swap;src:url(fonts/eb-garamond-latin-400-italic.woff2) format("woff2")}
@font-face{font-family:"EB Garamond";font-weight:500;font-style:normal;font-display:swap;src:url(fonts/eb-garamond-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:500;font-style:normal;font-display:swap;src:url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2")}

/* ---- tokens ---- */
:root{
  --serif:"EB Garamond",Georgia,"Times New Roman",serif;
  --sans:"Inter",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  /* prose: 18 px at 390, ~22 px from about 1200 px; measure ~62–70 characters */
  --fs:clamp(1.125rem, 0.98rem + 0.55vw, 1.375rem);
  --lh:1.6;
  --measure:32em;
  --gutter:clamp(1.25rem, 5vw, 5.5rem);      /* 20 px at 390 */
  --gap:clamp(2rem, 5vw, 5rem);              /* copy ↔ artwork */
  --art-col:34rem;                            /* artwork column on wide screens */
  --section:clamp(3.5rem, 8vh, 6.5rem);       /* between passages */
}

/* ---- the two fields: the web constitution's white and black, nothing else ---- */
.field-white{--bg:#FFFFFF;--fg:#000000;--prose:#000000;--quiet:#6B6862;--rule:rgba(0,0,0,.14)}
.field-black{--bg:#000000;--fg:#FFFFFF;--prose:#E7E4DD;--quiet:#9A968E;--rule:rgba(255,255,255,.18)}
/* --prose on black is the master's own running-prose tint (rgb 231 228 221); primary lines stay pure white */

*{box-sizing:border-box}
html{background:var(--bg);color:var(--fg);-webkit-text-size-adjust:100%;scroll-behavior:auto}
body{margin:0;font:400 var(--fs)/var(--lh) var(--serif);color:var(--prose);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img{display:block;max-width:100%;height:auto}
a{color:inherit;text-decoration-color:var(--quiet);text-underline-offset:.18em}
a:hover{text-decoration-color:currentColor}
:focus-visible{outline:2px solid currentColor;outline-offset:4px}

/* ---- chrome: one quiet line at the top, one at the end; mono, small ---- */
.site{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:clamp(1rem,2.4vw,1.75rem) var(--gutter);font:500 .75rem/1.45 var(--mono);letter-spacing:.06em;color:var(--quiet)}
.site-foot{padding:4rem var(--gutter) 3rem;font:500 .75rem/1.6 var(--mono);letter-spacing:.06em;color:var(--quiet);border-top:1px solid var(--rule);margin-top:var(--section)}
.site-foot p{margin:0 0 .5em;max-width:none}
.site-foot nav a{margin-right:1.5em}

/* ---- the reading column; artwork may use the column to its right ---- */
.piece{max-width:calc(var(--measure) + var(--art-col) + var(--gap) + 2 * var(--gutter));margin-inline:auto;padding-inline:var(--gutter)}
.piece > *{max-width:var(--measure)}
.piece p{margin:0 0 .9em;text-wrap:pretty;hyphens:manual}
.piece p:last-child{margin-bottom:0}
.passage,.plate,.opening,.closing{margin-block:var(--section)}
.opening{margin-top:clamp(2rem,7vh,5rem)}
.piece-end{margin-top:var(--section)}

/* ---- labels: the piece's own labels, rendered as the master renders them (mono, small, uppercase, quiet) ---- */
.label{font:500 .75rem/1.5 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--quiet);margin:0 0 1.1rem;max-width:none}
h2.label{margin:0 0 1.4rem}
.label.after{margin:1.6rem 0 0}              /* a label that closes its passage, as Coast's do */
.piece-end p{font:500 .75rem/1.5 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--quiet);margin:0;max-width:none}

/* ---- hierarchy ----
   title     Inter 500, large, tight
   question  Inter 500, the entry orientation
   anchor    Inter 500, a passage's load-bearing statement
   beat      Inter 500, a short statement inside the flow
   memory    EB Garamond, the reflective line the master already sets in Garamond
   prose     EB Garamond, continuous
   quiet     prose-sized, in the quiet colour; italic is used sparingly for an aside */
h1{font:500 clamp(2.5rem, 1.3rem + 4.2vw, 5.25rem)/.95 var(--sans);letter-spacing:-.04em;color:var(--fg);margin:0 0 1.25rem;max-width:11ch;text-wrap:balance}
.question{font:500 clamp(1.25rem, 1rem + 1vw, 1.875rem)/1.2 var(--sans);letter-spacing:-.02em;color:var(--fg);margin:0 0 .9em;max-width:20em;text-wrap:balance}
.lead{font-size:1.08em}
.anchor{font:500 clamp(1.75rem, 1.1rem + 2.4vw, 3.25rem)/1.05 var(--sans);letter-spacing:-.03em;color:var(--fg);margin:1.1em 0 .6em;max-width:12em;text-wrap:balance}
.beat{font:500 clamp(1.375rem, 1.05rem + 1.2vw, 2.125rem)/1.18 var(--sans);letter-spacing:-.02em;color:var(--fg);margin:1em 0 .7em;max-width:16em;text-wrap:balance}
.beat + .beat{margin-top:0}
.memory{font:400 clamp(1.625rem, 1.1rem + 2vw, 3rem)/1.15 var(--serif);letter-spacing:-.01em;color:var(--fg);margin:.8em 0 .8em;max-width:14em;text-wrap:balance}
.memory.small{font-size:clamp(1.25rem, 1rem + 1.1vw, 1.875rem)}
.quiet{color:var(--quiet)}
.aside{font-style:italic;color:var(--quiet)}
em{font-style:italic}
.lines span{display:block}
.stack p{margin-bottom:.35em}                /* a run of short statements kept together as one group */
.stack{margin-block:1.2em}

/* ---- composition patterns ----
   .passage            continuous essay (one column)
   .with-art           passage with artwork: copy + artwork side by side ≥ 1000 px, artwork below (or where the DOM puts it) on narrow screens
   .plate              full-width artwork with its own label above
   .closing            closing sequence: statement lines + the returning artwork */
.art{margin:1.6em 0 1.8em;max-width:none}
.art img{width:100%}
.art.portrait img{max-width:min(100%, 34rem)}
.art.tall img{max-width:min(100%, 22rem)}
.art.square img{max-width:min(100%, 36rem)}
.art.wide img{max-width:min(100%, 54rem)}
.plate{max-width:none}
.plate .art{margin-top:0}
.plate .art img{max-width:min(100%, 44rem)}
.with-art{max-width:none;display:grid;grid-template-columns:minmax(0,1fr)}
.with-art > .copy{max-width:var(--measure)}
.opening.with-art,.opening{max-width:none}
.opening > :not(.art):not(.copy){max-width:var(--measure)}
.with-art > .copy > :last-child{margin-bottom:0}
@media (min-width:1000px){
  .with-art{grid-template-columns:minmax(0,var(--measure)) minmax(0,var(--art-col));column-gap:var(--gap);align-items:start}
  .with-art > .copy{grid-column:1}
  .with-art > .art{grid-column:2;grid-row:1 / span 9;margin:.3em 0 0;align-self:start}
  .with-art.art-first > .copy{grid-column:2}
  .with-art.art-first > .art{grid-column:1}
  .with-art .art.portrait img,.with-art .art.tall img,.with-art .art.square img{max-width:100%}
  .with-art .art.portrait img{width:min(100%, 78svh * var(--ar, 0.6664))}
  .with-art .art.tall img{width:min(100%, 78svh * var(--ar, 0.4))}
  .with-art .art.square img{width:min(100%, 78svh)}
  .with-art .art.wide img{width:100%}
}
@media (min-width:1000px) and (max-width:1199px){:root{--art-col:24rem;--gap:2.5rem}}
@media (max-width:480px){.piece{padding-inline:1.25rem}}

/* No transitions or animations exist in this system. Stated explicitly for reduced-motion users anyway. */
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{.site,.site-foot nav{display:none}.piece{max-width:none}}
