/* Layout: a red screen-print poster band carrying the artwork, then a cream "paper" sheet
   with black ink text. One deliberate brand look (taken from the The Art of PDF artwork),
   so it reads the same in light and dark viewers. */
:root {
  --red: #b90f0e;          /* poster red, sampled from the artwork */
  --red-deep: #8f0b0b;
  --cream: #efdcc7;        /* the moon and lettering */
  --paper: #f6ebdd;
  --ink: #12171b;          /* the gorilla's black */
  --ink-soft: #4d4640;
  --rule: #d6c1aa;
  --display: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif;
  --label: "Space Mono", ui-monospace, Menlo, monospace;
  --body: "Atkinson Hyperlegible", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.wrap {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Poster band ---------- */
.poster {
  position: relative;
  background-color: var(--red);
  /* Fine speckle, like the ink texture in the artwork. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  padding-block: clamp(28px, 5vw, 56px) 0;
}
.poster-inner {
  max-width: 64rem; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: end; gap: clamp(20px, 4vw, 48px);
}
.art {
  display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 1 / 1;
  border-radius: 6px;
  box-shadow: 0 0 0 4px var(--ink), 10px 10px 0 4px var(--ink);
  margin-bottom: clamp(28px, 5vw, 56px);
}
.intro { display: grid; gap: 18px; padding-bottom: clamp(28px, 5vw, 56px); min-width: 0; }
.tag {
  font-family: var(--label); font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream); display: flex; align-items: center; gap: 10px;
}
.tag::before, .tag::after { content: ""; height: 2px; width: 28px; background: currentColor; opacity: .8; }
h1 {
  font-family: var(--display); font-weight: 400; margin: 0; color: var(--cream);
  font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 0.95; letter-spacing: 0.01em;
  text-transform: uppercase; text-wrap: balance;
  text-shadow: 3px 3px 0 var(--ink);
}
.lede { margin: 0; color: var(--cream); max-width: 32rem; font-size: 1.1rem; }
nav { display: flex; flex-wrap: wrap; gap: 10px; }
nav a {
  font-family: var(--label); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--cream); background: var(--ink);
  padding: 8px 14px; border-radius: 4px;
}
nav a:hover { background: var(--cream); color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

/* ---------- Paper sheet ---------- */
.sheet-wrap { padding-block: clamp(28px, 5vw, 56px) 64px; }
.sheet {
  /* An A4 page: 210 mm wide, at least as tall as A4 (it grows if needed). */
  width: 100%; max-width: 210mm; margin: 0 auto; aspect-ratio: 210 / 297;
  align-content: start;
  background: var(--paper); border-radius: 6px;
  padding-block: clamp(28px, 5vw, 52px);
  padding-inline: clamp(20px, 6vw, 60px);
  display: flex; flex-direction: column; gap: 44px;
  box-shadow: 10px 10px 0 var(--red);
}
.sheet a:focus-visible, .sheet button:focus-visible { outline-color: var(--red); }

section { display: grid; gap: 16px; scroll-margin-top: 24px; }
h2 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 1.55rem; line-height: 1.1; letter-spacing: 0.01em; margin: 0; text-wrap: balance;
}
h3 { font-family: var(--body); font-weight: 700; font-size: 1.1rem; margin: 0; }
p { margin: 0; }
section > p, .qa p, li { max-width: 40rem; }

/* Contact "form field", like the forms the app fills in. */
.field { display: grid; gap: 6px; }
.field-label {
  font-family: var(--label); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.field-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 16px;
  border-bottom: 3px solid var(--ink); padding-bottom: 6px;
}
.email {
  font-family: var(--display); font-size: clamp(1.25rem, 4.6vw, 1.7rem);
  color: var(--red); text-decoration: none; overflow-wrap: anywhere; min-width: 0; user-select: all;
}
.copy {
  margin-left: auto; font: 700 0.8rem var(--label); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 4px; padding: 8px 12px; cursor: pointer;
}
.copy:hover { background: var(--red); }
.note { font-size: 0.95rem; color: var(--ink-soft); }

.qa { display: grid; gap: 22px; }
.qa > div { display: grid; gap: 6px; }

/* Divider: a signature line with a small label, as on a form. */
.sigline { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 10px; color: var(--ink-soft); }
.sigline span { font-family: var(--label); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }
.sigline i { border-bottom: 2px dashed var(--rule); height: 1px; }

.policy { display: grid; gap: 22px; }
.policy > div { display: grid; gap: 8px; }
.effective {
  justify-self: start; font-family: var(--label); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 3px 9px; transform: rotate(-1.5deg);
}
ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
li::marker { color: var(--red); }
kbd {
  font-family: var(--label); font-size: 0.8em; border: 1.5px solid var(--ink); border-bottom-width: 3px;
  border-radius: 4px; padding: 0 5px; background: var(--paper); white-space: nowrap;
}

/* Keyboard shortcuts: a two-column list like a form's fields. */
.keys { display: grid; gap: 0; border-top: 3px solid var(--ink); }
.keys > div {
  display: grid; grid-template-columns: minmax(9.5rem, auto) 1fr; gap: 6px 16px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.keys dt { margin: 0; white-space: nowrap; }
.keys dd { margin: 0; }
.keys-group {
  font-family: var(--label); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin-top: 10px;
}
/* A worked example, set like a sticky note on the paper. */
.recipe {
  background: #fff6c8; border: 2px solid var(--ink); border-radius: 4px;
  padding: 16px 18px; display: grid; gap: 10px; box-shadow: 5px 5px 0 var(--ink);
}
.recipe h3 { font-family: var(--label); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.recipe ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.lead { font-size: 1.12rem; }
@media (max-width: 520px) {
  .keys > div { grid-template-columns: 1fr; gap: 2px; }
}

footer {
  max-width: 210mm; margin: 28px auto 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-family: var(--label); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cream);
}

@media (max-width: 720px) {
  .poster-inner { grid-template-columns: 1fr; align-items: start; }
  .art { max-width: 380px; justify-self: center; margin-bottom: 8px; }
  .intro { padding-bottom: 36px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Compact band (every page after the first) ---------- */
.band { padding-block: 18px; }
.band-inner {
  max-width: 210mm; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 56px; height: 56px; border-radius: 4px; box-shadow: 0 0 0 3px var(--ink), 5px 5px 0 3px var(--ink); }
.brand span {
  font-family: var(--display); color: var(--cream); font-size: 1.6rem; text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--ink); line-height: 1;
}
.band nav { margin-left: auto; }
nav a[aria-current="page"] { background: var(--cream); color: var(--ink); }

/* ---------- Page foot: page number and next / previous, like a document ---------- */
.pagefoot {
  margin-top: auto; padding-top: 18px; border-top: 2px solid var(--ink);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  font-family: var(--label); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.pagefoot a { color: var(--red); text-decoration: none; }
.pagefoot a:hover { text-decoration: underline; }
.pagefoot .num { color: var(--ink-soft); }
@media (max-width: 720px) {
  .sheet { aspect-ratio: auto; }
  .band nav { margin-left: 0; }
}

/* ---------- Clips and screenshots (See it page, and one clip on some pages) ---------- */
.clips { display: grid; gap: 28px; }
.clip { margin: 0; display: grid; gap: 10px; }
.clip video, .shots img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--red-deep);
  border: 2px solid var(--ink); border-radius: 6px; box-shadow: 5px 5px 0 var(--ink);
}
.clip figcaption { font-size: 0.98rem; max-width: 40rem; }
.clip figcaption a, .shots a { color: var(--red); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 20px; }
.shots img { aspect-ratio: 16 / 10; }
.shots a:hover img { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
@media (prefers-reduced-motion: reduce) { .clip video { animation: none; } }

/* ---------- All features page ---------- */
.feat-index { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 6px; }
.feat-index a {
  font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink); border-radius: 4px; padding: 3px 8px;
}
.feat-index a:hover { background: var(--red); color: var(--cream); border-color: var(--red); }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 22px 28px; }
.feat { display: grid; gap: 8px; align-content: start; border-top: 3px solid var(--ink); padding-top: 10px; scroll-margin-top: 16px; }
.feat h3 { margin: 0; }
.feat ul { gap: 5px; }
.feat .more { margin: 2px 0 0; font-size: 0.92rem; }
.feat .more a { color: var(--red); }
/* Links within the text: the poster red, like the other links. */
.qa a, .keys dd a, .policy a { color: var(--red); }
