/* Tokens, type, and the pieces every section shares. */
@font-face { font-family: 'Malartre Gravee'; src: url('../fonts/Malartre-Gravee.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Malartre Fine'; src: url('../fonts/Malartre-Fine.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Malartre Texte'; src: url('../fonts/Malartre-Texte.woff2') format('woff2'); font-display: swap; }
/* Noto Serif draws no arrow: the arrows of the rows come from this file, and from it alone. */
@font-face { font-family: 'Malartre Fleche'; src: url('../fonts/Malartre-Fleche.woff2') format('woff2'); font-display: swap; unicode-range: U+2192-2193; }

:root {
  --night: #0b0b0a;
  --paper: #f4f1ea;
  --mute: #9b978f;
  /* The one colour of the issue. Taken from the leather jacket of the last photograph. */
  --red: #d21b10;
  --serif: 'Malartre Gravee', Georgia, serif;
  --serif-long: 'Malartre Fine', Georgia, serif;
  /* The text: Malartre Texte, the small-size drawing of the family of the titles (tools/police.py). */
  --text: 'Malartre Texte', 'Malartre Fleche', Georgia, serif;
  --pad: 20px;
  --gap: 20px;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Nothing may make the page wider than the screen, even for an instant (a title set in a wider
   fallback face before its own arrives): on a phone the whole layout would widen with it. */
html { -webkit-text-size-adjust: 100%; background: var(--night); overflow-x: clip; }

body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
/* A <picture> only offers a lighter file: it takes no place, its image sits where it was. */
picture { display: contents; }

/* The display face is Malartre, our own cut (tools/police.py; LISEZMOI, section Police).
   Gravee, its engraved style (tools/gravure.py), sets the few giant words: the name, the
   numbers, the project titles, the last call. The spacing is in the font, so no
   letter-spacing here. */
.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.9;
}

/* A title that runs over several lines takes Fine, the lighter and wider style. */
.display--long { font-family: var(--serif-long); }
/* No word left alone on the last line of a paragraph (the serif text runs wider than the sans did). */
p, dd, .tally__text, .service__note { text-wrap: pretty; }

/* Section label: a hairline that draws itself across the page, what this is, and one fact. */
.label {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  font-size: 17px;
}
.label::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(var(--p, 1));
  transform-origin: left;
}
.label h2 { font: inherit; }

/* A credit line, as under a magazine photograph: small, complete sentences, no ornament. */
.credit { font-size: 11.5px; line-height: 1.35; color: var(--mute); }

/* A fact sheet: label and value on a ruled line, aligned. Only facts that can be checked. */
.facts { font-size: 14px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.facts > div { display: grid; grid-template-columns: 9.5ch 1fr; column-gap: 12px; padding: 6px 0 7px; border-top: 1px solid rgba(244, 241, 234, 0.24); }
.facts dt { color: var(--mute); }

/* A link as a ruled row with its arrow. */
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-top: 1px solid currentColor;
  padding: 12px 0 14px;
  font-size: 22px;
}
.row:last-child { border-bottom: 1px solid currentColor; }
.row__arrow { transition: transform 0.5s var(--out); }
@media (hover: hover) { .row:hover .row__arrow { transform: translateX(6px); } }

/* An action is a solid red button. */
.button {
  display: inline-block;
  background: var(--red);
  color: #fff;
  padding: 9px 16px 10px;
  line-height: 1.2;
  transition: background-color 0.3s ease;
}
@media (hover: hover) { .button:hover { background: #b3150c; } }

/* Film grain over everything: one tile, shifted a few times a second. */
.grain {
  position: fixed;
  inset: -160px;
  z-index: 90;
  pointer-events: none;
  background: url(../img/grain.webp) 0 0 / 160px 160px;
  animation: grain 0.9s steps(1) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  14% { transform: translate(-70px, 45px); }
  28% { transform: translate(55px, -110px); }
  42% { transform: translate(-125px, -30px); }
  57% { transform: translate(90px, 120px); }
  71% { transform: translate(-35px, 95px); }
  85% { transform: translate(115px, -60px); }
}

/* The bar: name, sections written as a sentence, and the way to get in touch. Its three parts
   set the vertical lines the rest of the page is laid on. */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px var(--pad);
  font-size: 17px;
  transition: transform 0.6s var(--out);
}
.bar::before {
  content: '';
  position: absolute;
  inset: 0 0 -40px 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(11, 11, 10, 0.86), rgba(11, 11, 10, 0));
  opacity: var(--shade, 0);
  pointer-events: none;
}
.bar.is-away { transform: translateY(-110%); }
.bar__nav { display: none; }
.bar__nav a { position: relative; display: inline-block; }
/* The section being read: a short red rule under its name. */
.bar__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--out);
}
.bar__nav a.is-current::after { transform: scaleX(1); }

.pages { position: relative; z-index: 1; background: var(--night); }
.block { padding: 84px var(--pad) 0; }

@media (min-width: 900px) {
  /* The twelve columns every page is laid on: a step is a column and its gap. */
  :root {
    --pad: 44px;
    --colw: calc((100vw - 2 * var(--pad) - 11 * var(--gap)) / 12);
    --step: calc(var(--colw) + var(--gap));
    /* Three columns wide. */
    --w3: calc(3 * var(--colw) + 2 * var(--gap));
  }
  body { font-size: 19px; }
  .label { font-size: 19px; }
  .credit { font-size: 12.5px; }
  .facts { font-size: 15px; }
  .row { font-size: 23px; }
  .bar { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); padding: 22px var(--pad); font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -0.01em; }
  .bar__name { grid-column: 1 / span 4; }
  .bar__nav { display: block; grid-column: 7 / span 5; }
  .bar__contact { grid-column: 12; justify-self: end; padding: 6px 18px 8px; }
  .block { padding-top: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .bar, .row__arrow, .button, .bar__nav a::after { transition: none; }
}

/* Capture mode: no transition may still be running when the picture is taken. */
.is-shot .bar, .is-shot .bar__nav a::after { transition: none; }
