/* The zine, pushed toward pop art, punk zine and 60s mod: Ben-Day dots,
   black comic outlines and caption boxes; ransom-note headings, staples,
   scrawled marker and photocopy toner; a ska checkerboard band and a mod
   roundel. Every page loads this last.

   Legibility rules it. Running text, numbers, @handles and the stream stay
   in Inter on solid paper or a solid colour at AA; ransom letters, Ben-Day,
   toner and checks go only on display type, borders and backgrounds. */

@font-face { font-family: "Righteous"; src: url(fonts/righteous-latin-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Caveat Brush"; src: url(fonts/caveat-brush-latin-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(fonts/courier-prime-latin-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bowlby One SC"; src: url(fonts/bowlby-one-sc-latin-400.woff2) format("woff2"); font-display: swap; }

:root {
  --comic: #111;
  --mod: "Righteous", var(--display);
  --scrawl: "Caveat Brush", var(--display);
  --checks: conic-gradient(var(--comic) 25%, #fffaf0 0 50%, var(--comic) 0 75%, #fffaf0 0);
  /* Ben-Day: a field of round dots at a size the eye sees as dots. */
  --benday-pink: radial-gradient(circle, #ff7fbf 2.3px, transparent 2.7px) 0 0 / 8px 8px;
  --benday-ink: radial-gradient(circle, rgba(0, 0, 40, 0.26) 2.2px, transparent 2.6px) 0 0 / 9px 9px;
}

/* ---- comic outlines ---- */

/* Every stuck-on piece of paper gets a comic's thick black line and a hard
   black shadow. */
.plate { border: 3.5px solid var(--comic); box-shadow: 6px 6px 0 var(--comic); }
.log li { border-color: var(--comic); border-width: 3px; box-shadow: 4px 4px 0 var(--comic); }
.log li::before { border-top-color: var(--comic); }

/* ---- the ska band ---- */

/* A checkerboard strip under the bar, black and paper, the width of the page. */
.bar { border-bottom: 0; }
.bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  background: var(--checks) 0 0 / 14px 14px;
  border-bottom: 2.5px solid var(--comic);
  pointer-events: none;
}

/* ---- the graph's panel: Ben-Day on blue, and the stats as comic frames ---- */

.panel.plate { background: var(--benday-ink), var(--block); }
.panel .stats, .readings.plate {
  background: var(--benday-pink), var(--sun);
  border: 3.5px solid var(--comic);
  box-shadow: 5px 5px 0 var(--comic);
  border-radius: 2px;
}
/* Each reading its own frame: solid pale yellow, so the number sits on no dots. */
.panel .stats > div, .readings .stats > div {
  padding: 3px 7px 2px;
  background: #fff6b0;
  border: 2.5px solid var(--comic);
}
.stats dt { font-family: var(--mod); font-weight: 400; letter-spacing: 0.06em; color: var(--ink); }
/* Staples where the tape was. */
.panel .stats::after {
  width: 26px;
  height: 7px;
  left: 46%;
  top: -5px;
  background: linear-gradient(#8a8a95, #c9c9d2 40%, #6d6d78);
  border-radius: 2px;
  box-shadow: 34px 0 0 #8a8a95, 0 1px 1px rgba(0, 0, 0, 0.4);
  transform: rotate(-4deg);
}

/* ---- headings ---- */

/* A caption box, as a comic sets its narration: yellow, black-ruled, capitals. */
.panel-title.caption > span:first-child {
  padding: 5px 9px 4px;
  font: 15px/1 var(--mod);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--sun);
  border: 3px solid var(--comic);
  box-shadow: 3px 3px 0 var(--comic);
  text-shadow: none;
}

/* The words a ransom heading was cut from, for a screen reader: there, and
   not drawn. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Ransom-note letters, cut by zine.js, each from a scrap of its own. */
[data-ransom] { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 3px; text-shadow: none; }
.r {
  display: inline-block;
  padding: 0 0.13em;
  line-height: 1.12;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 1px 2px 0 rgba(17, 17, 17, 0.45);
}
.r-gap { width: 0.4em; }
.r-a { font-family: "Bowlby One SC", var(--display); background: #fff; color: var(--ink); }
.r-b { font-family: "Courier Prime", monospace; font-weight: 700; background: var(--sun); color: var(--ink); }
.r-c { font-family: var(--mod); background: var(--comic); color: #fffaf0; }
.r-d { font-family: var(--display); background: var(--pink); color: var(--ink); }
.r-e { font-family: var(--scrawl); background: #c4dcff; color: var(--ink); font-size: 1.15em; }
.r-f { font-family: var(--text); font-weight: 700; background: #fffaf0; color: var(--mention); text-transform: uppercase; }

/* ---- the live lamp: a mod roundel ---- */

.source.live::before {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--comic);
  border-radius: 50%;
  background: radial-gradient(circle, var(--pink) 0 26%, #fffaf0 28% 54%, var(--blue) 56%);
}

/* ---- scrawled marker ---- */

/* An arrow drawn on in marker at the live count, as somebody annotated the
   photocopy. */
.panel .stats > div:first-child::after {
  content: "↙";
  position: absolute;
  z-index: 2;
  left: 54px;
  top: -34px;
  font: 34px/1 var(--scrawl);
  color: var(--pink);
  transform: rotate(-8deg);
  pointer-events: none;
}

/* ---- photocopy toner, behind everything ---- */

/* The graph's circles move with its camera: app.js sets where the tile
   starts and how big it is as the view pans and zooms. A page of text
   scrolls them with its words. */
#stage {
  background:
    url(xerox.png), url(grain.png),
    var(--circles) var(--circles-x, 0px) var(--circles-y, 0px) / var(--circles-size, var(--circles-tile)) var(--circles-size, var(--circles-tile)),
    var(--dots), var(--lavender);
  background-blend-mode: multiply;
}
body.paged { background: url(xerox.png), url(grain.png), var(--ground); background-blend-mode: multiply; }

@media (max-width: 720px) {
  /* The mod face runs wide: on a phone the small readings' names go back
     to the text face, so none of them breaks mid-word. */
  .stats .minor dt { font-family: var(--text); font-weight: 700; letter-spacing: 0.02em; font-size: 10px; overflow-wrap: normal; }
  /* Framed, four small readings are too narrow for their names: two a row. */
  .panel .stats { gap: 8px; }
  .panel .stats div.minor { grid-column: span 6; flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 8px; }
  /* /lanes' four readings, framed, are two a row on a phone, named in the
     text face so none breaks mid-word. */
  .head .readings .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .readings .stats dt { font-family: var(--text); font-weight: 700; letter-spacing: 0.02em; font-size: 10px; overflow-wrap: normal; }
  .panel .stats > div:first-child::after { left: 44px; top: -28px; font-size: 26px; }
}

/* ---- /lanes: the axis labels handwritten, like a tape's track list ---- */

.axis > div:first-child, .axis .rd {
  font: 17px/1 var(--scrawl);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}

/* The stream's fold button sits on the blue: paper, so it reads there. */
.panel .sheet-toggle { color: #fffaf0; border-color: rgba(255, 250, 240, 0.6); }


/* Focus on the blue panel: a paper ring, which the blue sets off at 6.5:1,
   where the plate's ink ring would be lost on it. */
.panel .log li:focus-visible, .panel .sheet-toggle:focus-visible { outline: 3px solid #fffaf0; outline-offset: 2px; }
