@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-semi-condensed-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 400; font-display: swap; src: url("fonts/kalam-400-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --cover: #22372a;
  --paper: #e9e5a7;
  --paper-shade: #dfda96;
  --rule: #b3c6a2;
  --ink: #2a4a2e;
  --graphite: #34322d;
  --red: #a3302a;
  --line: 1.75rem;
  --remarks: 15rem;
  --printed: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --pencil: "Kalam", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cover);
  color: var(--graphite);
  font: 400 1.0625rem/var(--line) var(--text);
  font-variant-numeric: tabular-nums;
  padding: 2.5rem 1.5rem 3.5rem;
}
::selection { background: #c6d79f; color: var(--ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

/* One sheet of the book: printed ruling across the page, a double margin rule before the remarks column. */
.sheet {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: calc(var(--line) * 2) 2.5rem calc(var(--line) * 2) 2.5rem;
  background-color: var(--paper);
  background-image:
    linear-gradient(to left,
      transparent calc(var(--remarks) + 3.75rem - 1px), var(--ink) calc(var(--remarks) + 3.75rem - 1px),
      var(--ink) calc(var(--remarks) + 3.75rem), transparent calc(var(--remarks) + 3.75rem),
      transparent calc(var(--remarks) + 3.75rem + 3px), var(--ink) calc(var(--remarks) + 3.75rem + 3px),
      var(--ink) calc(var(--remarks) + 3.75rem + 4px), transparent calc(var(--remarks) + 3.75rem + 4px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, 0.55), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--remarks);
  column-gap: 2.5rem;
  align-content: start;
}
.main { grid-column: 1; min-width: 0; }
.remarks { grid-column: 2; min-width: 0; }
.full { grid-column: 1 / -1; min-width: 0; }

/* Printed header: the page's own matter is green. */
.head { display: contents; }
.title { grid-column: 1; margin: 0; }
.title .job {
  display: block;
  font: 600 0.8125rem/var(--line) var(--printed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.title .name {
  display: block;
  font: 400 2.375rem/calc(var(--line) * 2) var(--pencil);
  color: var(--graphite);
  text-decoration: none;
}
.sheets {
  grid-column: 2;
  font: 600 0.8125rem/var(--line) var(--printed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.sheets ol { list-style: none; margin: 0; padding: 0; }
.sheets li { display: flex; gap: 0.75rem; align-items: baseline; }
.sheets .no { width: 1.5rem; text-align: center; }
.sheets a { text-decoration: none; }
.sheets a:hover { text-decoration: underline; }
.sheets [aria-current="page"] { position: relative; color: var(--graphite); }

h1, h2, h3 { color: var(--ink); font-family: var(--printed); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: 2.25rem; line-height: calc(var(--line) * 2); letter-spacing: -0.01em; margin-top: calc(var(--line) * 2); }
h2 { font-size: 0.9375rem; line-height: var(--line); letter-spacing: 0.08em; text-transform: uppercase; margin-top: calc(var(--line) * 2); }
h3 { font-size: 1.25rem; line-height: var(--line); margin-top: var(--line); }
p { margin: 0 0 var(--line); max-width: 40rem; }
.lede { font-size: 1.1875rem; max-width: 38rem; }
.pencil { font-family: var(--pencil); color: var(--graphite); font-size: 1.0625rem; }
.small { font-size: 0.9375rem; }

/* The booking. Rows sit on the printed ruling; columns are printed rules. */
.book { margin: var(--line) 0 0; overflow-x: auto; }
.book table { width: 100%; border-collapse: collapse; min-width: 44rem; }
.book caption {
  text-align: left;
  caption-side: bottom;
  font-size: 0.875rem;
  color: var(--graphite);
  line-height: var(--line);
}
.book th, .book td {
  height: var(--line);
  padding: 0 0.75rem;
  border-right: 1px solid var(--rule);
  white-space: nowrap;
  text-align: right;
  vertical-align: bottom;
  line-height: calc(var(--line) - 1px);
}
.book th {
  font: 600 0.8125rem/calc(var(--line) - 1px) var(--printed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.book th:first-child, .book td:first-child { text-align: left; padding-left: 0; }
.book td.note, .book th.note {
  width: calc(var(--remarks) + 1.25rem);
  text-align: left;
  border-right: 0;
  padding-left: 1.25rem;
}
.book tr > :nth-last-child(2) { border-right: 0; }
.book td.note { font-family: var(--pencil); font-size: 1rem; }
.book tr.struck td:not(.note) {
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
}

/* Red pencil marks. */
.ring { position: relative; display: inline-block; }
.ring > svg {
  position: absolute;
  inset: -0.45rem -0.6rem -0.35rem;
  width: calc(100% + 1.2rem);
  height: calc(100% + 0.8rem);
  overflow: visible;
  pointer-events: none;
}
.ring path, .tick path, .legend path, .gone path {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.red { color: var(--red); }

.legend { margin: 0; padding: 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 3rem 1fr; align-items: center; min-height: var(--line); }
.legend svg { width: 2.25rem; height: 1.25rem; overflow: visible; }

.checked { display: flex; gap: 0.75rem; align-items: center; margin-top: var(--line); }
.tick svg { width: 2rem; height: 1.5rem; overflow: visible; }

/* Checks sheet: one entry per check, same furniture each time. */
.entry { display: contents; }
.entry h3 { grid-column: 1; }
.entry .what { grid-column: 1; }
.entry .limit { grid-column: 2; margin: 0; }
.entry .limit dt {
  font: 600 0.8125rem/var(--line) var(--printed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.entry .limit dd { margin: 0; font-family: var(--pencil); }
.entry .booked { font-size: 0.9375rem; }
.entry .name { position: relative; display: inline-block; }
.entry .name svg {
  position: absolute;
  inset: -0.4rem -0.9rem -0.3rem;
  width: calc(100% + 1.8rem);
  height: calc(100% + 0.7rem);
  overflow: visible;
  opacity: 0;
}
.entry .name path {
  fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 320; stroke-dashoffset: 320;
}
.entry h3:target .name svg { opacity: 1; }
.entry h3:target .name path { animation: draw 700ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.log { margin: 0; padding: 0; list-style: none; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; column-gap: 1.25rem; margin-bottom: var(--line); max-width: 46rem; }
.log time { font: 600 0.875rem/var(--line) var(--printed); letter-spacing: 0.06em; color: var(--ink); }

.foot {
  grid-column: 1 / -1;
  margin-top: calc(var(--line) * 2);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font: 600 0.75rem/var(--line) var(--printed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

@media (max-width: 52rem) {
  body { padding: 0.75rem 0.5rem 1.5rem; }
  .sheet {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--line) 1.25rem calc(var(--line) * 2);
    background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  }
  .main, .remarks, .title, .sheets, .entry h3, .entry .what, .entry .limit { grid-column: 1; }
  .remarks.marks { order: 1; }
  .after { order: 2; }
  .foot { order: 3; }
  .sheets ol { display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
  .sheets .no { width: auto; }
  h1 { font-size: 1.75rem; margin-top: var(--line); }
  .lede { font-size: 1.0625rem; }
  .head .job { display: none; }
  .book tr.skip { display: none; }
  .legend { margin-bottom: var(--line); }
  .book { margin-top: 0; }
  .title .name { font-size: 2rem; }
  .book td.note, .book th.note { padding-left: 1rem; width: 14rem; }
  .entry .limit { margin-top: 0; }
  .log li { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .entry h3:target .name path { animation: none; stroke-dashoffset: 0; }
}
