/* Case file: a project's drawer (STANDING 2026-11-30, "Fuck yes"). A stack of paper sheets on the drawer deck,
   divider cards as chapters. Tokens and type from BLUEPRINT §3; radii 0; the only shadow is the paper contact line.
   Reads with hatch.css (tokens, fonts, plate). Works with no JS.

   ONE GRID (Ed, 30 Nov: "Shit is misaligned, off center"). Every edge on this page comes from three numbers:
   --col  the file column: the strip's plate and close glyph, every paper's edges and every tab sit on it
   --pad  the paper's inner margin, the same on every sheet and divider
   .sg    the sheet grid inside --pad: 12 columns on desktop, one on phone; figures fill their columns
   Nothing is tilted and nothing is centred inside a column. Gate: .scratch/keep/align.py (measured rects). */

:root {
  --wallw: 20px;                       /* drawer wall: column edge to the drawer's side */
  --pad: 20px;
  --colmax: 1080px;
  --stripH: 56px;
}
@media (min-width: 600px) { :root { --wallw: 32px; --pad: 32px; } }
@media (min-width: 900px) { :root { --pad: 48px; } }
:root { --wall-s: max(var(--wallw), env(safe-area-inset-left), env(safe-area-inset-right)); }

/* ---------- the strip: the slot, shrunk to the top of the screen ---------- */
.strip {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--wall);
  border-bottom: 1px solid rgb(138 143 147 / .4);
}
/* the slot's lit seam: the light the drawer is read by */
.strip::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--amber);
}
.strip-in {
  width: min(var(--colmax), 100% - 2 * var(--wall-s)); margin-inline: auto; min-height: var(--stripH);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.strip .plate { padding: 8px 10px; white-space: nowrap; }
.strip .plate .when { display: none; }
@media (min-width: 600px) { .strip .plate .when { display: inline; } }
@media (max-width: 599px) { .strip .plate { font-size: 12px; padding: 8px; } .strip .here h1 { font-size: 15px; } }
.strip .here { display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 0; flex: 1 1 auto; }
.strip .plate { flex: 0 0 auto; }
.strip .here h1 {
  margin: 0; font: 600 17px/1 var(--sans); font-stretch: 112%; color: var(--amber); white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 900px) { .strip .here h1 { font-size: 19px; } }
/* 44px target; the glyph's right edge sits on the column edge */
.strip .close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -14px; flex: 0 0 auto;
  color: var(--ink); text-decoration: none;
}
.strip .close svg { width: 16px; height: 16px; }
.strip .close:hover svg, .strip .close:focus-visible svg { color: var(--amber); }

/* ---------- the drawer: steel deck under the slot light, walls an even step outside the column ---------- */
.drawer {
  position: relative;
  width: min(var(--colmax) + 2 * var(--wall-s), 100%); margin: 0 auto;
  padding: 32px var(--wall-s) 72px;
  /* light from the slot falls on the first metre of the deck and dies out; the rest is the steel in the dark */
  background:
    linear-gradient(180deg, rgb(255 160 40 / .16) 0, rgb(255 160 40 / .05) 360px, rgb(255 160 40 / 0) 900px),
    var(--deck-tex, none),
    #121313;
  background-size: auto, 512px 512px, auto;
  /* walls drawn inside the box so they never shift the column */
  box-shadow: inset 1px 0 0 rgb(138 143 147 / .4), inset -1px 0 0 rgb(138 143 147 / .4);
}
@media (min-width: 900px) { .drawer { padding-top: 48px; padding-bottom: 96px; } }
.file { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }

/* ---------- paper ---------- */
.sheet, .divider {
  position: relative; min-width: 0; background: var(--paper); color: var(--print);
  padding: var(--pad); box-shadow: 0 1px 0 rgba(0, 0, 0, .5);
  font: 400 14px/1.55 var(--mono); font-stretch: 87.5%;
}
@media (min-width: 900px) { .sheet { font-size: 15px; } }
.sheet.narrow { width: min(100%, 600px); }
.sheet > :last-child, .sg > * > :last-child, .sg > * > section > :last-child { margin-bottom: 0; }
.sheet p { margin: 0 0 1em; max-width: 64ch; }
.sheet a { color: var(--print); text-decoration: underline 1px; text-underline-offset: 3px; }
.sheet a:hover { text-decoration-thickness: 2px; }
.sheet :focus-visible { outline-color: var(--print); }
.sheet h2, .sheet h3, .divider h2 { font-family: var(--sans); color: var(--print); margin: 0; text-wrap: balance; }
.sheet h3 { font-weight: 700; font-stretch: 112%; font-size: 19px; line-height: 1.2; margin: 1.6em 0 .55em; }
.sheet .tag + h3, .sheet h3.first { margin-top: 0; }
@media (min-width: 900px) { .sheet h3 { font-size: 21px; } }
.sheet strong { font-weight: 600; }

/* lists: the bullet sits on the column edge, the text after it */
.sheet ul:not([class]) { list-style: none; margin: 0 0 1em; padding: 0; max-width: 64ch; }
.sheet ul:not([class]) > li { position: relative; padding-left: 1.3em; margin: .3em 0; }
.sheet ul:not([class]) > li::before { content: "–"; position: absolute; left: 0; top: 0; }

/* tag: the printed label in a 1px box */
.tag {
  display: block; width: fit-content; max-width: 100%; margin: 0 0 16px; padding: 3px 7px 2px; border: 1px solid var(--print);
  font: 600 10px/1.3 var(--mono); font-stretch: 100%; letter-spacing: .12em; text-transform: uppercase; color: var(--print);
}
@media (min-width: 900px) { .tag { font-size: 11px; } }
/* source line at the foot of a sheet: every claim names where it came from and when it was read */
.src {
  margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--print);
  font: 400 11px/1.5 var(--mono); font-stretch: 87.5%; color: var(--print);
}
.src p { margin: 0; max-width: none; }
/* pencil: only the client's first words */
.pencil { font: 400 36px/1.05 "Reenie Beanie", cursive; color: var(--graphite); margin: 0 0 14px; text-wrap: balance; }
@media (min-width: 900px) { .pencil { font-size: 40px; } }

/* ---------- the sheet grid ---------- */
.sg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.sg > * { min-width: 0; margin: 0; }
@media (min-width: 900px) {
  .sg { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; row-gap: 32px; }
  .sg > * { grid-column: var(--c, 1 / -1); }
  .sg > .stick { position: sticky; top: calc(var(--stripH) + 24px); }
}

/* ---------- summary sheet (top of the file) ---------- */
.summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.summary .head h2 {
  font-weight: 800; font-stretch: 125%; letter-spacing: -.01em; line-height: 1;
  font-size: min(56px, 9vw); margin: 0 0 14px;
}
.summary .head .one { margin: 0; font: 400 17px/1.5 var(--sans); max-width: 36em; }
@media (min-width: 900px) { .summary .head .one { font-size: 19px; } }
/* a summary that opens on the tag alone (Who's Ed?) keeps the tag close to the first words */
.summary:not(:has(.head h2)) { gap: 20px; }
.checked { margin-top: 32px; }
.big { font: 500 26px/1.15 var(--mono); font-stretch: 87.5%; font-variant-numeric: tabular-nums; margin: 0 0 10px; }
@media (min-width: 900px) { .big { font-size: 30px; } }
.lines { list-style: none; padding: 0; margin: 0 0 1em; max-width: none; border-top: 1px solid var(--print); }
.lines li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--print); margin: 0; }
.lines li span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.date { font: 600 10px/1.4 var(--mono); font-stretch: 100%; letter-spacing: .12em; text-transform: uppercase; }
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--print); }
@media (min-width: 900px) { .index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
.index li { margin: 0; border-bottom: 1px solid var(--print); }
.index a {
  display: grid; grid-template-columns: 2.6em 1fr; align-items: center; min-height: 48px; text-decoration: none;
}
.index a:hover span:last-child { text-decoration: underline 1px; text-underline-offset: 3px; }
.index a span:first-child { font-variant-numeric: tabular-nums; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- chapters: a divider card with its tab, then its sheets ---------- */
.chapter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 44px; scroll-margin-top: calc(var(--stripH) + 8px); }
.divider { padding-top: 18px; padding-bottom: 22px; }
.divider .tab {
  position: absolute; bottom: 100%; left: 0;
  background: var(--paper); padding: 10px 18px 6px var(--pad);
  font: 600 10px/1 var(--mono); font-stretch: 100%; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
@media (min-width: 900px) { .divider .tab { font-size: 11px; padding-top: 11px; } }
.divider h2 { font-weight: 800; font-stretch: 125%; font-size: 24px; line-height: 1.05; letter-spacing: -.01em; }
@media (min-width: 900px) { .divider h2 { font-size: 32px; } }
.divider p { margin: 8px 0 0; font: 400 13px/1.5 var(--mono); font-stretch: 87.5%; max-width: 72ch; }
@media (min-width: 900px) { .divider p { font-size: 14px; } }

/* ---------- prints: photos and video on whiter photo paper, an even border, the caption printed under ---------- */
.print { margin: 0; background: #FBFAF6; padding: 8px; outline: 1px solid rgb(29 29 28 / .16); outline-offset: -1px; }
.print .pic { position: relative; background: #000; aspect-ratio: var(--ar, 4 / 5); overflow: hidden; }
.print img, .print video { display: block; width: 100%; height: 100%; object-fit: cover; }
.print figcaption { padding: 10px 0 2px; font: 400 12px/1.5 var(--mono); font-stretch: 87.5%; color: var(--print); }
.print figcaption b { font-weight: 600; }
.print .pix { image-rendering: pixelated; }

/* video controls: one square button, print on paper, in the picture's corner */
.vbtn {
  position: absolute; right: 8px; bottom: 8px; height: 44px; min-width: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--paper); color: var(--print); font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.vbtn svg { width: 12px; height: 12px; }

/* contact sheet: several frames on one sheet */
.shots { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .shots { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 900px) { .shots { gap: 16px; } }
.shots.three { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .shots.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.shots .print { padding: 6px; }
.shots .print figcaption { padding: 7px 0 1px; font-size: 11px; }

/* the bout: frame, then what happened and the part of the game that made it */
.beats { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--print); }
.beats li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--print); margin: 0; }
@media (min-width: 900px) { .beats li { grid-template-columns: 120px minmax(0, 1fr); gap: 28px; } }
.beats img { width: 100%; height: auto; display: block; aspect-ratio: 720 / 1560; object-fit: cover; background: #000; }
.beats h3 { margin: 0 0 6px; font-size: 17px; }
.beats h3 span { font: 600 10px/1 var(--mono); letter-spacing: .12em; margin-right: 10px; vertical-align: 2px; }
.beats p { margin: 0 0 .6em; }
.beats .how { font-size: 13px; margin: 0; }
.beats .how b { font-weight: 600; }

/* rules: term and rule, set like a printed spec, wraps on a phone */
.rules { margin: 0 0 1em; border-top: 1px solid var(--print); }
.rules div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--print); }
@media (min-width: 600px) { .rules div { grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; } }
.rules dt { font-weight: 600; }
.rules dd { margin: 0; }

/* numbers set in the receipt face */
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; margin: 0 0 1em; border-top: 1px solid var(--print); }
/* four across where the text column is wide enough for "2,031" in the big face; two in between */
@media (min-width: 600px) and (max-width: 899px), (min-width: 1200px) { .figs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.figs div { padding: 12px 0 14px; border-bottom: 1px solid var(--print); }
.figs dt { font: 600 10px/1.3 var(--mono); font-stretch: 100%; letter-spacing: .12em; text-transform: uppercase; }
.figs dd { margin: 6px 0 0; font: 500 26px/1.15 var(--mono); font-stretch: 87.5%; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .figs dd { font-size: 30px; } }

/* table on paper */
.sheet table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--print); vertical-align: top; }
.sheet thead th { font: 600 10px/1.3 var(--mono); font-stretch: 100%; letter-spacing: .12em; text-transform: uppercase; border-top: 1px solid var(--print); }
.sheet tbody th { font-weight: 600; }
.sheet th.n, .sheet td.n { text-align: right; padding-right: 0; }

/* plaques: three cards in a row on desktop, rewards on one line at the foot */
.plaque { display: flex; flex-direction: column; align-self: stretch; border-top: 1px solid var(--print); padding-top: 14px; }
.plaque h3 { margin: 0 0 8px; font-size: 18px; }
.plaque p { margin: 0 0 14px; }
.plaque .reward { margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--print); font-variant-numeric: tabular-nums; }

/* diagram plate: wide drawing on desktop, a tall one on a phone */
.dia { display: block; width: 100%; height: auto; margin: 0 0 1em; color: var(--print); }
.dia.tall { max-width: 420px; }
.dia.wide { display: none; }
@media (min-width: 900px) { .dia.wide { display: block; } .dia.tall { display: none; } }

/* ---------- receipt: perforated top, the checks with the date they ran ---------- */
.receipt {
  --zz: 6px;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--zz) * 2) var(--zz) repeat-x,
                linear-gradient(#000 0 0) 0 var(--zz) / 100% calc(100% - var(--zz)) no-repeat;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--zz) * 2) var(--zz) repeat-x,
                linear-gradient(#000 0 0) 0 var(--zz) / 100% calc(100% - var(--zz)) no-repeat;
  padding-top: calc(var(--pad) + var(--zz));
}

/* the receipt's rubber stamp: worn red ink, square on the grid (align gate) (Ed 1 Dec: "delivered stamp") */
.stamp {
  display: block; width: fit-content; margin: 6px 0 22px; padding: 8px calc(14px - .16em) 7px 14px; border: 4px double currentColor;
  border-radius: 4px; font: 800 22px/1 var(--sans); font-stretch: 112%; letter-spacing: .16em; text-transform: uppercase;
  color: rgb(178 36 28 / .88); mix-blend-mode: multiply;
  -webkit-mask: var(--ink-wear) 0 0 / 180px 90px; mask: var(--ink-wear) 0 0 / 180px 90px;
  --ink-wear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3.2 0 0 0 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (min-width: 900px) { .stamp { font-size: 26px; } }

/* buttons on paper */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px;
  background: var(--print); color: var(--paper) !important; text-decoration: none !important;
  font: 600 15px/1 var(--sans); font-stretch: 112%; border: 0; border-radius: 0;
}
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- end of the file ---------- */
.file-end {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: center;
  margin-top: 40px; padding-top: 16px; border-top: 1px solid rgb(138 143 147 / .4);
}
.file-end a {
  font: 600 19px/1 var(--sans); font-stretch: 112%; color: var(--ink); text-decoration: none; min-height: 48px;
  display: inline-flex; align-items: center;
}
.file-end a:hover, .file-end a:focus-visible { text-decoration: underline 2px var(--amber); text-underline-offset: 6px; }
@media (min-width: 900px) { .file-end a { font-size: 22px; } }

/* ---------- plain text pages on paper (/privacy/) ---------- */
.privacy.narrow { width: min(100%, 760px); }
.privacy .pv { margin: 0 0 28px; }
.privacy h2 { margin: 0 0 10px; font: 800 20px/1.15 var(--sans); font-stretch: 112%; letter-spacing: -.005em; }
.privacy ul { margin: 0 0 1em; }
