/* NB: two units: --room (1.92% of the screen height) places and sizes the furniture; --shelf sizes everything on the shelf */
:root {
    --wall: #fff;
    --floor: #67b346; /* NB: floor color */
    --pink: #ff48b0; /* NB: fluorescent pink */
    --room: 1.92dvh;
    --shelf: min(calc(var(--room) / 26), calc((100vw - 16px) / 1540));
}

@font-face { font-family: "Hershey"; src: url("assets/fonts/Hershey-Noailles-Times-Simplex-Bold.otf") format("opentype"); font-display: swap; }
/* NB: ornament fonts for the student covers, so every computer shows the same ones */
@font-face { font-family: "Zapf Dingbats"; src: url("assets/fonts/ZapfDingbats.ttf") format("truetype"); }
@font-face { font-family: "Bodoni Ornaments"; src: url("assets/fonts/Bodoni Ornaments.ttf") format("truetype"); }

[hidden] {
    display: none !important;
}

/* NB: read aloud but not shown */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--wall);
    font-family: "Hershey", Georgia, serif;
}

/* NB: the book spread: a soft fold down the middle, pages darkening at the edges */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 21;
    background:
        linear-gradient(to right,
            rgba(0, 0, 0, 0.000) 43.95%,
            rgba(0, 0, 0, 0.002) 44.45%,
            rgba(0, 0, 0, 0.008) 44.95%,
            rgba(0, 0, 0, 0.022) 45.45%,
            rgba(0, 0, 0, 0.044) 45.95%,
            rgba(0, 0, 0, 0.076) 46.45%,
            rgba(0, 0, 0, 0.117) 46.95%,
            rgba(0, 0, 0, 0.170) 47.45%,
            rgba(0, 0, 0, 0.234) 47.95%,
            rgba(0, 0, 0, 0.311) 48.45%,
            rgba(0, 0, 0, 0.400) 48.95%,
            rgba(0, 0, 0, 0.503) 49.45%,
            rgba(0, 0, 0, 0.620) 49.95%,
            rgba(0, 0, 0, 0.620) 50.05%,
            rgba(0, 0, 0, 0.503) 50.55%,
            rgba(0, 0, 0, 0.400) 51.05%,
            rgba(0, 0, 0, 0.311) 51.55%,
            rgba(0, 0, 0, 0.234) 52.05%,
            rgba(0, 0, 0, 0.170) 52.55%,
            rgba(0, 0, 0, 0.117) 53.05%,
            rgba(0, 0, 0, 0.076) 53.55%,
            rgba(0, 0, 0, 0.044) 54.05%,
            rgba(0, 0, 0, 0.022) 54.55%,
            rgba(0, 0, 0, 0.008) 55.05%,
            rgba(0, 0, 0, 0.002) 55.55%,
            rgba(0, 0, 0, 0.000) 56.05%),
        linear-gradient(to right,
            rgba(0, 0, 0, 0.1),
            transparent 3%,
            transparent 97%,
            rgba(0, 0, 0, 0.1));
    mix-blend-mode: multiply;
    opacity: 0.55; /* NB: how strong the fold is */
    pointer-events: none;
}

h2 {
    font-weight: normal;
}

button {
    font: inherit;
    color: #111; /* NB: phones color buttons blue by default */
    cursor: pointer;
}

a {
    color: inherit;
}

/* NB: an arrow after every link that opens a new page */
a[target="_blank"]::after {
    content: "\2009\2197"; /* thin space, north-east arrow */
    content: "\2009\2197" / " (opens in a new tab)";
    display: inline-block;
    font-family: system-ui, sans-serif;
    font-size: 0.85em;
    text-decoration: none;
    text-indent: 0;
}

/* ---------- riso ---------- */

/* NB: everything prints in riso (filters made in script.js) */
.riso .room > img,
.riso .shelf::before,
.riso .row::before,
.riso .row::after {
    filter: url(#riso);
}

/* NB: covers and posters have type on them, so they print with a finer grain than the room */
.riso .poster,
.riso .zine img {
    filter: var(--print, url(#riso-covers)); /* archival covers get their own two inks (script.js) */
}

/* NB: student covers take their sheet ink in the riso print; without it, green prints black and blue pink */
.student {
    --ink: var(--flat-ink);
}

.riso .student {
    --ink: var(--riso-ink, var(--flat-ink));
}

/* NB: student covers are flat riso ink, so they print solid with crisp type */
.riso .student .cover {
    filter: url(#riso-flat);
}

/* NB: a clicked zine or poster shows its original colors */
.poster.is-selected,
.zine.is-selected img,
.student.is-selected .cover {
    filter: none;
}

/* NB: without the riso print (switched off, or phones and tablets), the shelf's frame and planks are flat fluoro pink */
body:not(.riso) .shelf::before {
    border-image: none;
    border-color: var(--pink);
}

body:not(.riso) .row::after {
    background: var(--pink);
}

/* NB: the class zine, the card and the page buttons print with the finest grain */
.riso .page,
.riso .reader nav button,
.riso .catalog-card {
    filter: url(#riso-fine);
}

/* ---------- room ---------- */

/* NB: compact paper doll house, filling the screen. 
   hidden until script.js  makes the riso print */
.room {
    position: relative;
    height: 100dvh;
    overflow: hidden;
    background: var(--wall);
    visibility: hidden;
    animation: reveal 0s 3s forwards;
}

.ready .room {
    visibility: visible;
    animation: none;
}

@keyframes reveal {
    to { visibility: visible; }
}

/* the floor, with its own riso grain */
.room::before {
    content: "";
    position: absolute;
    inset: calc(44 * var(--room)) 0 0;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.33  0 0 0 0 0.32  0 0 0 0 0.16  0 0 0 -2.6 1.45'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
        var(--floor);
}

/* NB: without the riso print, the floor is fluorescent pink too */
body:not(.riso) .room::before {
    background-color: var(--pink);
}

/* everything is placed by its center, measured in --room from the middle of the set */
.room > img,
.poster {
    position: absolute;
    translate: -50%;
    pointer-events: none;
}

/* posters open a card, like the zines; they hang behind the lamp and the fig */
.poster {
    pointer-events: auto;
    cursor: pointer;
}

.poster img {
    display: block;
    width: 100%;
}

/* NB: the light switch, on the wall beside the shelf: the riso print on (dark) or off (white) */
.light-switch {
    position: absolute;
    top: calc(19.6 * var(--room));
    left: calc(50% + 32.4 * var(--room)); /* just right of the shelf */
    width: calc(2.6 * var(--room));
    translate: -50%;
    rotate: 1deg;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.light-switch img {
    display: block;
    width: 100%;
}

.riso .light-switch img:last-child,
body:not(.riso) .light-switch img:first-child {
    display: none;
}

.riso .light-switch img {
    filter: contrast(1.6) brightness(0.9) url(#riso-covers); /* dark enough to print as solid black, so it reads as a switch */
}

/* front to back: the trolley, its plant and the chair, then the sofa, lamp and fig, then the shelf */
.side-table,
.plant-propagating,
.ake {
    z-index: 3;
}

.couch,
.floor-lamp,
.plant-fig {
    z-index: 2;
}

/* NB: everything is slighly off alignment; death to eurocentric grids!!! */
.plant-hanging     { rotate: 2deg; }
.poster-3          { rotate: 2.5deg; }
.poster-4          { rotate: -3deg; }
.floor-lamp        { rotate: -1.5deg; }
.side-table        { rotate: -2.5deg; }
.plant-propagating { rotate: 4deg; }
.couch             { rotate: -1deg; }
.side-table-2      { rotate: 2deg; }
.plant-fig         { rotate: -2deg; }
.ake               { rotate: 3deg; }

/* measured from the top; lower on the floor is closer, so bigger */
.plant-hanging     { top: calc(-2.91 * var(--room)); left: calc(50% - 40.23 * var(--room)); width: calc(13.7 * var(--room)); }
.poster-3          { top: calc(0.5 * var(--room)); left: calc(50% + 14.76 * var(--room) + 25vw); width: calc(12.6 * var(--room)); }
.poster-4          { top: calc(19.5 * var(--room)); left: calc(50% - 14.75 * var(--room) - 25vw); width: calc(11.1 * var(--room)); }
.floor-lamp        { top: calc(16.04 * var(--room)); left: calc(50% - 32.82 * var(--room)); width: calc(11.57 * var(--room)); }
.side-table        { top: calc(43.2 * var(--room)); left: calc(50% - 30.26 * var(--room)); width: calc(11.13 * var(--room)); }
.plant-propagating { top: calc(39.94 * var(--room)); left: calc(50% - 28.87 * var(--room)); width: calc(5.36 * var(--room)); }
.side-table-2      { top: calc(39.18 * var(--room)); left: calc(50% + 30.72 * var(--room)); width: calc(10.8 * var(--room)); }
.couch             { top: calc(32 * var(--room)); left: calc(50% + 0.4 * var(--room)); width: calc(48.65 * var(--room)); }
.plant-fig         { top: calc(16.8 * var(--room)); left: calc(50% + 39.5 * var(--room)); width: calc(28.34 * var(--room)); }
.ake               { top: calc(36.5 * var(--room)); left: calc(50% - 44 * var(--room)); width: calc(19.77 * var(--room)); }

/* ---------- shelf ---------- */

/* NB: an open frame hung on the wall, behind the sofa */
.shelf {
    position: absolute;
    z-index: 1;
    top: calc(3 * var(--room));
    left: 50%;
    width: calc(1500 * var(--shelf));
    translate: -50%;
    border: calc(20 * var(--shelf)) solid transparent;
}

/* the wooden frame, on its own layer */
.shelf::before {
    content: "";
    position: absolute;
    inset: calc(-20 * var(--shelf));
    border: calc(20 * var(--shelf)) solid #bd7441;
    border-image: url("assets/textures/wooden-border.png") 27 / calc(20 * var(--shelf)) stretch;
    pointer-events: none;
}

.row {
    position: relative;
    padding-bottom: calc(15 * var(--shelf)); /* room for the plank */
}

.row::before,
.row::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

/* NB: a black strap across each row, like in cree's reference photo */
.row::before {
    bottom: calc(45 * var(--shelf));
    z-index: 8;
    height: max(2.5px, calc(5 * var(--shelf)));
    background: black;
}

/* the plank */
.row::after {
    bottom: 0;
    z-index: 9;
    height: calc(15 * var(--shelf));
    background: url("assets/textures/wooden-border.png") 0 0 / cover;
}

.scroll {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: calc(6 * var(--shelf)) calc(20 * var(--shelf)) 0;
}

/* ---------- zines ---------- */

/*
    NB: a crowded shelf: a zine may shrink its slot so the row fits, while its cover
    keeps full size and tucks behind the next one. hovering lifts it to the front.
*/
.zine {
    position: relative;
    flex: 0 1 auto;
    min-width: calc(14 * var(--shelf)); /* always a spine showing */
    text-decoration: none;
    transform-origin: 50% 100%;
    transition: transform 0.3s ease;
}

/* the last zine keeps its full width, so nothing hangs past the frame */
.zine:last-child {
    flex-shrink: 0;
}

/* NB: not lined up: small leans in an uneven pattern */
.zine:nth-child(2n)  { rotate: -0.8deg; }
.zine:nth-child(3n)  { rotate: 1.1deg; translate: 0 calc(2 * var(--shelf)); }
.zine:nth-child(5n)  { rotate: -1.8deg; }
.zine:nth-child(7n)  { rotate: 2.1deg; translate: 0 calc(3 * var(--shelf)); }
.zine:nth-child(11n) { rotate: -3deg; }
.zine:nth-child(13n) { rotate: 0.5deg; translate: 0 calc(4 * var(--shelf)); }

/* on phones and tablets they stand straight */
@media (hover: none) {
    .zine { rotate: none; translate: none; }
}

/* NB: a zine lifts on hover (mouse only: on touch screens hover sticks after a tap) or keyboard focus */
.zine:focus-visible {
    z-index: 15;
    transform: translateY(calc(-12 * var(--shelf)));
}

@media (hover: hover) {
    .zine:hover {
        z-index: 15;
        transform: translateY(calc(-12 * var(--shelf)));
    }
}

.zine.is-selected {
    z-index: 10;
    transform: translateY(calc(-25 * var(--shelf))) scale(1.2);
}

/* archival covers keep their image's shape, sized by height */
.zine img {
    display: block;
    width: auto;
    max-width: none;
}

.zine-letter img  { height: calc(225 * var(--shelf)); } /* 8.5 x 11 */
.zine-half img    { height: calc(174 * var(--shelf)); } /* 5.5 x 8.5 */
.zine-quarter img { height: calc(113 * var(--shelf)); } /* 4.25 x 5.5 */

/* NB: student zines: white type and an ornament on flat riso ink. script.js sizes each line to the cover */
.student {
    z-index: 5;
    flex-shrink: 0; /* always fully visible */
}

.student .cover {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* each line only as long as its words, so it can be measured */
    box-sizing: border-box;
    width: calc(var(--w) * var(--shelf));
    height: calc(var(--h) * var(--shelf));
    padding: calc(8 * var(--shelf)) calc(8 * var(--shelf)) calc(40 * var(--shelf)); /* the title stays above the shelf's strap */
    color: white;
    background: var(--ink);
    line-height: 0.92;
    white-space: nowrap;
}

.student .cover span {
    display: block; /* one line each */
}

/* NB: layouts, from the sheet's layout column */
.student[data-layout="bottom"] .cover {
    justify-content: flex-end; /* the title at the foot of the cover */
}

.student[data-layout="vertical"] .cover {
    writing-mode: vertical-rl; /* read top to bottom, like a japanese or korean cover */
}

.student[data-layout="spine"] .cover {
    writing-mode: vertical-rl;
    writing-mode: sideways-lr; /* read bottom to top, like a book spine */
}

.student[data-layout="big"] .cover {
    text-transform: uppercase; /* tight capitals, for short titles */
    line-height: 0.82;
}

/* NB: the ornament, its own line of the title: dingbats (✈ ✍ ❤) are set in zapf dingbats, everything else (letters, " ≥ …) in bodoni ornaments */
.student .cover .ornament {
    display: block;
    flex: none;
    margin: calc(4 * var(--shelf)) 0;
    font-family: "Zapf Dingbats", "Bodoni Ornaments", serif;
}

.student .cover .ornament svg {
    display: block;
    writing-mode: horizontal-tb; /* the ornament stands upright, even beside a vertical title */
    width: 100%;
    height: 100%;
    overflow: visible;
}

.student .cover .ornament.bodoni {
    font-family: "Bodoni Ornaments", serif;
}

.student[data-layout="bottom"] .ornament {
    order: -1; /* above a title at the foot of the cover */
}

/* ---------- catalog card ---------- */

.catalog-card {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 30;
    box-sizing: border-box;
    width: min(245px, 100vw - 48px);
    padding: 1rem;
    background: /* NB: the paper, washed out so it stays light behind the caption */
        linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
        url("assets/textures/paper-page.webp") center / cover,
        white;
    border: 1px solid black;
    font-size: 13px;
    line-height: 1.5;
    hyphens: none;
    -webkit-hyphens: none;
}

/* a zine low on the screen gets its card at the top instead */
.catalog-card.top {
    top: 24px;
    bottom: auto;
}

.catalog-close {
    float: right;
    border: none;
    background: none;
    font-size: 22px;
}

.catalog-title {
    margin: 5px 0;
    font-size: 20px;
    line-height: 1.1;
}

.catalog-by,
.catalog-link {
    font-size: 16px;
}

.catalog-description {
    margin: 18px 0;
    white-space: pre-line; /* a line break in the sheet starts a new line */
}

.catalog-link {
    display: inline-block;
    padding-top: 12px;
}

.catalog-link:hover {
    font-weight: bold;
}

/* NB: the blog post link sits under read zine */
.catalog-post {
    display: block;
    padding-top: 6px;
}

/* ---------- class zine ---------- */

.reader {
    padding: 0;
    border: none;
    background: none;
    overflow: visible;
}

.reader::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.reader nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    color: white;
}

.reader nav button,
.reader nav select {
    min-width: 2.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid black;
    border-radius: 0;
    background: white;
    color: black;
    font: 13.333px system-ui, sans-serif;
    cursor: pointer;
}

/* NB: the print menu looks like the buttons beside it: no arrow, centered */
.reader nav select {
    appearance: none;
    text-align: center;
}

/* NB: a six-column grid on faded paper */
.page {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: 0.8rem;
    align-content: start;
    box-sizing: border-box;
    width: min(430px, 88vw);
    aspect-ratio: 5.5 / 8.5;
    max-height: 80vh;
    padding: 1.5rem 1.6rem;
    overflow: auto;
    background:
        linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
        url("assets/textures/paper-page.webp") center / cover,
        white;
    border: 1px solid black;
    font-size: 1rem;
    line-height: 1.3;
}

.page > * {
    grid-column: 1 / -1;
    margin: 0;
}

/* NB: the page number, stamped big and pink in the top right */
.page .head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2.2rem;
    padding-bottom: 0.4rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    rotate: -0.6deg;
}

.page .head span {
    color: var(--pink);
    font-size: 3.2rem;
    line-height: 0.6;
    rotate: -12deg;
    translate: 0 0.5rem;
}

/* ---------- dada type ---------- */

.page .pink { color: var(--pink); }
.page .up   { text-transform: uppercase; letter-spacing: 0.02em; }
.page .tilt { display: inline-block; rotate: -6deg; }
.page .hi   { display: inline-block; translate: 0 -0.45em; }
.page .lo   { display: inline-block; translate: 0 0.35em; }
.page .huge { font-size: 1.6em; line-height: 0.9; }
.page .wide { letter-spacing: 0.35em; }
.page .flip { display: inline-block; rotate: 180deg; }

/* a word in a black box */
.page .inv {
    padding: 0 0.15em;
    color: #fffdf5;
    background: #111;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* a phrase on a cut paper strip */
.page .strip {
    display: inline-block;
    padding: 0 0.2em;
    background: #fffdf5;
    border: 1px solid #111;
    rotate: 2deg;
}

/* an oversized mark */
.page .mark {
    display: inline-block;
    color: var(--pink);
    font-size: 2.6em;
    line-height: 0;
    rotate: 12deg;
}

/* NB: ransom-note words: each letter cut from a different font (script.js splits them) */
@font-face { font-family: "Earwig"; src: url("assets/fonts/earwig-factory.regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Maternidad"; src: url("assets/fonts/MaternidadML.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Pasionaria"; src: url("assets/fonts/PasionariaRegular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Redaction"; src: url("assets/fonts/Redaction35-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "WalkingOCR"; src: url("assets/fonts/Walking-OCR-reg-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "HersheyFutura"; src: url("assets/fonts/Hershey-Noailles-Futura-Simplex-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Panton"; src: url("assets/fonts/Panton.otf") format("opentype"); font-display: swap; }

.page .ransom {
    white-space: nowrap;
}

.page .ransom span {
    display: inline-block;
    -webkit-text-stroke: 0;
}

.page .ransom span:nth-child(7n + 1) { font-family: "Earwig", "Hershey", serif; }
.page .ransom span:nth-child(7n + 2) { font-family: "Maternidad", "Hershey", serif; }
.page .ransom span:nth-child(7n + 3) { font-family: "Redaction", "Hershey", serif; }
.page .ransom span:nth-child(7n + 4) { font-family: "Pasionaria", "Hershey", serif; }
.page .ransom span:nth-child(7n + 5) { font-family: "WalkingOCR", "Hershey", serif; }
.page .ransom span:nth-child(7n + 6) { font-family: "Hershey", serif; }
.page .ransom span:nth-child(7n)     { font-family: "HersheyFutura", "Hershey", serif; }
.page .ransom span:nth-child(11n)    { font-family: "Panton", "Hershey", serif; } /* missing letters fall back to hershey */

.page .ransom span:nth-child(5n + 1) { rotate: -9deg; font-size: 1.15em; }
.page .ransom span:nth-child(5n + 2) { rotate: 6deg; translate: 0 0.08em; padding: 0 0.05em; color: #fffdf5; background: #111; }
.page .ransom span:nth-child(5n + 3) { rotate: -3deg; font-size: 0.8em; text-transform: uppercase; }
.page .ransom span:nth-child(5n + 4) { rotate: 11deg; translate: 0 -0.1em; padding: 0 0.04em; color: #fffdf5; background: var(--pink); }
.page .ransom span:nth-child(5n)     { rotate: -5deg; font-size: 1.3em; border: 1px solid currentColor; }

/* NB: a subtle baseline shift, letter by letter */
.page .shift span {
    display: inline-block;
}

.page .shift span:nth-child(3n + 1) { translate: 0 -0.12em; }
.page .shift span:nth-child(3n + 2) { translate: 0 0.08em; }
.page .shift span:nth-child(5n)     { translate: 0 -0.05em; }

/* ---------- page 1: cover ---------- */

/* NB: title, term and names in one centered column */
.page.cover {
    grid-template-rows: 1fr auto auto auto 1fr;
    justify-items: center;
    row-gap: 0.4rem;
    text-align: center;
}

.cover h2 {
    grid-row: 2;
    font-size: 5.6rem;
    line-height: 0.95;
    letter-spacing: -0.01em;
}

.cover h2 .big  { font-size: 1.35em; -webkit-text-stroke: 0.035em currentColor; }
.cover h2 .tilt { margin: 0 0.15em; font-size: 0.6em; rotate: 8deg; translate: 0 -0.2em; }
.cover h2 .inv  { display: inline-block; font-size: 0.42em; vertical-align: middle; rotate: -6deg; }
.cover h2 .pink.ransom span:nth-child(2) { color: #111; background: none; } /* NB: the e in "web": plain black, no box */

/* like a rubber stamp */
.cover .term {
    grid-row: 3;
    margin-top: 1rem;
    padding: 0 0.3em;
    color: var(--pink);
    border: 2px solid var(--pink);
    font-size: 2.6rem;
    rotate: -5deg;
}

/* NB: the teachers' names, a loose centered stack, each a little off */
.cover .names {
    grid-row: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.4rem;
}

.cover .name {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.1;
}

.cover .n1 { rotate: 4deg; translate: 18% 0; color: var(--pink); }
.cover .n2 { rotate: -4deg; translate: -16% 0; }
.cover .n3 { rotate: 3deg; translate: 10% 0; }

/* ---------- page 2: welcome, scattered across the grid ---------- */

.scatter {
    grid-template-rows: auto repeat(10, auto) 1fr;
    row-gap: 0.15rem;
    font-size: 1.15rem;
    line-height: 1.1;
}

.scatter .ransom { font-size: 2.6rem; line-height: 1; }
.scatter .w1  { rotate: -4deg; }
.scatter .w2  { grid-column: 3 / -1; justify-self: end; }
.scatter .w3  { grid-column: 1 / 3; margin-top: 0.6rem; rotate: 6deg; }
.scatter .w4  { justify-self: center; rotate: 3deg; }
.scatter .w4 .ransom { font-size: 2.5rem; }
.scatter .w5  { grid-column: 5 / -1; justify-self: end; font-size: 1.5rem; }
.scatter .w6  { grid-column: 1 / 4; margin-top: 0.8rem; }
.scatter .w7  { grid-column: 3 / -1; margin-bottom: 0.7rem; rotate: -7deg; }
.scatter .w8  { grid-column: 2 / -1; text-align: right; }
.scatter .w9  { margin-top: 0.8rem; rotate: -2deg; }
.scatter .w10 { margin-top: 0.5rem; text-align: right; rotate: 2deg; }
.scatter .w10 .ransom { font-size: 2.2rem; }

/* ---------- page 3: about, centered on the page ---------- */

.about {
    grid-template-rows: auto 1fr auto auto auto auto auto auto 1fr;
    row-gap: 1.15rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.about .lede {
    grid-row: 3;
    justify-self: center;
    font-size: 1.4rem;
    line-height: 1.05;
    rotate: -3deg;
}

.about .lede .ransom { font-size: 2.2rem; }
.about .col  { grid-row: 4; grid-column: 1 / 5; }
.about .col2 { grid-row: 5; grid-column: 3 / -1; }
.about .col3 { grid-row: 6; rotate: -1.5deg; }
.about .col4 { grid-row: 8; margin-top: -0.3rem; }

/* NB: "unconventional" as concrete poetry: big, on the right, letters growing and falling out of line */
.about .unconv {
    grid-row: 7;
    justify-self: end;
    margin-top: -0.4rem;
    font-size: 1.45rem;
    line-height: 1;
    white-space: nowrap;
}

.about .concrete span {
    display: inline-block;
}

.about .concrete span:nth-child(n + 5)  { font-size: 1.3em; }
.about .concrete span:nth-child(n + 10) { font-size: 1.7em; color: var(--pink); }
.about .concrete span:nth-child(2n)     { translate: 0 0.18em; rotate: 6deg; }
.about .concrete span:nth-child(3n)     { translate: 0 -0.22em; rotate: -9deg; }
.about .concrete span:nth-child(7n)     { translate: 0 0.4em; rotate: 14deg; }
.about .concrete span:last-child        { translate: 0 0.55em; rotate: 24deg; }

/* ---------- page 4: annotated bibliography ---------- */

.back {
    line-height: 1.35;
}

.back h3 {
    margin-bottom: 0.8rem;
    font-size: 1.7rem;
    font-weight: normal;
    line-height: 1;
}

.back h3 .small {
    display: block;
    font-size: 0.55em;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.back h3 .tilt {
    font-size: 1.25em;
    rotate: -3deg;
}

.back .disclaimer {
    margin-bottom: 1.2rem;
}

.bib h4 {
    margin: 1.4em 0 0.6em;
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* NB: hanging indents, a hairline between entries, annotations in pink */
.bib p {
    margin: 0;
    padding: 0.45em 0 0 1.6em;
    border-top: 1px solid rgba(0, 0, 0, 0.25);
    text-indent: -1.6em;
    overflow-wrap: anywhere;
}

.bib .note {
    margin: 0.15em 0 0.7em 1.6em;
    padding: 0;
    border: none;
    text-indent: 0;
    color: var(--pink);
}

/* NB: each citation is its own link: no underline, no arrow, pink on hover */
.bib a {
    text-decoration: none;
}

.bib a::after {
    content: none;
}

.bib a:hover,
.bib a:focus-visible {
    color: var(--pink);
}

/* ---------- the blog zine: one student's post per page ---------- */

.post {
    line-height: 1.4;
}

.post-title {
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
    font-weight: normal;
    line-height: 1.05;
    color: var(--pink);
}

.post-name {
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.post h4 {
    margin: 0.6em 0 0.4em;
    font-size: 1.1rem;
}

.post p + p {
    margin-top: 0.7em;
}

.post a {
    overflow-wrap: anywhere;
}

/* NB: a post's images, full width, each with its caption (the line under it) set smaller */
.post img {
    display: block;
    width: 100%;
    height: auto;
    margin: 1em 0 0.4em;
}

.post img + p {
    margin-top: 0;
    font-size: 0.85em;
}

/* ---------- phones ---------- */

/* NB: on tall screens, just the shelf, with as many rows as fit (script.js makes them) */
@media (max-aspect-ratio: 3/4) {
    .room > :not(.shelf),
    .room::before,
    body::before {
        display: none;
    }

    .shelf {
        --shelf: min(calc((100vw - 16px) / (var(--shelf-width, 520) + 40)), calc((100dvh - 32px) / (var(--rows, 4) * 250 + 60)));
        top: 50%;
        width: calc(var(--shelf-width, 520) * var(--shelf));
        translate: -50% -50%;
    }

    .row:not(.fit) {
        display: none;
    }

    /* on a narrow shelf, student zines may tuck behind their neighbors too, but sit in front; the class zine is never squeezed */
    .student:not(:last-child) {
        flex-shrink: 1;
    }

    .zine[href="#class-zine"] {
        z-index: 6;
        flex-shrink: 0;
    }

    .catalog-card {
        right: 50%;
        translate: 50%;
    }

    .cover h2 {
        font-size: 3.3rem;
    }

    .cover .term {
        font-size: 1.8rem;
    }

    .scatter .ransom,
    .scatter .w4 .ransom {
        font-size: 2rem;
    }
}

/* ---------- print: the class zine on a letter sheet, ready for the riso ---------- */

/*
    NB: front: pages 1–4 on one letter sheet, each a quarter of it (4.25 x 5.5in) with a .125in margin. the top row
    prints upside down, so the sheet folds into a quarter-size zine. back: a poster of every cover (script.js scatters
    them). two inks: black and fluoro pink, as on screen. the print menu (script.js) sets a plate: a riso master prints
    its ink in black and leaves the other out. riso ink is translucent, so where they overlap the inks blend (nothing
    is knocked out). laser prints pink as gray. the preview shows both inks on paper, blending
*/
.print-poster,
.page .online {
    display: none;
}

@page {
    size: letter;
    margin: 0;
}

@media print {
    :root {
        --k: #000;         /* black ink */
        --p: var(--pink);  /* pink ink */
        --paper: #fff;
        --on-k: var(--paper); /* type cut out of black ink */
        --on-p: var(--paper); /* type cut out of pink ink */
    }

    /* NB: a master leaves the other ink out altogether, type cut out of it too, so nothing is knocked out of its own ink */
    body[data-plate="black"] { --p: transparent; --on-p: transparent; }
    body[data-plate="pink"]  { --k: transparent; --on-k: transparent; --p: #000; }
    body[data-plate="laser"] { --p: #808080; }

    /* NB: the riso preview: the inks on uncoated paper, multiplied where they overlap like translucent ink */
    body[data-plate="preview"] { --k: #1e1c1e; --paper: #faf8f3; }
    body[data-plate="preview"] :is(#class-zine, .print-poster) { background: var(--paper); }
    body:is([data-plate="preview"], [data-plate="laser"]) :is(.page *, .poster-cover) { mix-blend-mode: multiply; } /* laser too, so gray blends like ink */

    html,
    body {
        overflow: visible;
        background: white;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body::before,
    body > :not(#class-zine, .print-poster) {
        display: none !important;
    }

    * {
        filter: none !important;
    }

    /* the front: four quarter-letter pages */
    #class-zine {
        display: block !important;
        position: relative;
        inset: auto;
        width: 8.5in;
        height: 11in;
        max-width: none;
        max-height: none;
        margin: 0;
        overflow: hidden;
        break-after: page;
    }

    #class-zine nav,
    .reader::backdrop {
        display: none;
    }

    /*
        NB: each page fills its quarter inside the .125in margin (4 x 5.25in): it's laid out --vw px wide, in the quarter's
        shape, then scaled to fit. a narrower --vw sets the type bigger; each page's is picked so it fills the page
    */
    #class-zine .page {
        display: grid !important;
        position: absolute;
        top: 0;
        left: 0;
        width: calc(var(--vw) * 1px);
        height: calc(var(--vw) * 1.3125px);
        max-height: none;
        padding: 0;
        aspect-ratio: auto;
        overflow: hidden;
        color: var(--k);
        background: none;
        border: none;
        --fit: calc(384 / var(--vw));
        transform-origin: 0 0;
    }

    #class-zine .cover   { --vw: 465; }
    #class-zine .scatter { --vw: 445; }
    #class-zine .about   { --vw: 435; }
    #class-zine .back    { --vw: 450; }

    /*
        NB: the printed back page keeps just the student credits, then a qr code to sfpc.study/webzines (its white border
        is its padding) and a line pointing to the webzine for the full credits
    */
    #class-zine .page.back {
        display: flex !important;
        flex-direction: column;
    }

    .back .disclaimer,
    .bib h4:nth-of-type(2),
    .bib h4:nth-of-type(2) ~ * {
        display: none;
    }

    /* the student credits alone, so no hanging indent */
    .bib .students {
        padding-left: 0;
        text-indent: 0;
    }

    .bib .students + .note {
        margin-left: 0;
    }

    #class-zine .online {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        margin-top: auto;
        font-size: 1.15rem;
        line-height: 1.15;
    }

    .online .qr {
        flex: none;
        width: calc(0.85in / var(--fit));
    }

    body[data-plate="pink"] .qr {
        visibility: hidden;
    }

    /*
        bottom row upright, top row upside down: 3 2 / 4 1. NB: pages are moved with transforms, not left and top,
        so their unscaled boxes stay on the sheet: chrome cuts off anything whose unscaled box runs past the page
    */
    #class-zine .cover   { transform: translate(4.375in, 5.625in) scale(var(--fit)); }
    #class-zine .back    { transform: translate(0.125in, 5.625in) scale(var(--fit)); }
    #class-zine .scatter { transform: translate(8.375in, 5.375in) rotate(180deg) scale(var(--fit)); }
    #class-zine .about   { transform: translate(4.125in, 5.375in) rotate(180deg) scale(var(--fit)); }

    /* every color is one of the two inks, or paper */
    .page .pink,
    .page .mark,
    .page .head span,
    .cover .n1,
    .about .concrete span:nth-child(n + 10),
    .bib .note {
        color: var(--p);
    }

    .cover .term {
        color: var(--p);
        border-color: var(--p);
    }

    .page .inv { color: var(--on-k); background: var(--k); }
    .page .strip { background: var(--on-k); border-color: var(--k); }
    .page .ransom span:nth-child(5n + 2) { color: var(--on-k); background: var(--k); }
    .page .ransom span:nth-child(5n + 4) { color: var(--on-p); background: var(--p); }
    .cover h2 .pink.ransom span:nth-child(2) { color: var(--k); background: none; }

    /* NB: solid hairlines in the bibliography (no gray) */
    .bib p {
        border-top: 0.5pt solid var(--k);
    }

    .bib a {
        color: inherit;
    }

    /* the back: every cover, scattered (script.js places each by its center, and sets their size as --shelf) */
    .print-poster {
        display: block;
        position: relative;
        width: 8.5in;
        height: 11in;
        overflow: hidden;
        break-before: page;
    }

    .poster-cover {
        position: absolute;
        translate: -50% -50%;
    }

    .poster-cover[data-ink="pink"] .cover  { color: var(--on-p); background: var(--p); }
    .poster-cover[data-ink="black"] .cover { color: var(--on-k); background: var(--k); }
}
