/* App pages (policies, terms, account deletion): the field guide's type and
   colour, set for long reading. Tokens and faces match field.css. */

@font-face {
  font-family: "Anybody";
  src: url("fonts/anybody-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --night: #0f1f19;
  --paper: #f6f9f7;
  --ink: #11201a;
  --kingfisher: #15b4cc;
  --chestnut: #732c19;
  --leaf: #bdd24e;
  --rule: rgb(17 32 26 / .4);
  --tint: #ece3df;            /* chestnut at ~12% on paper */
  --pad: clamp(1.25rem, 5vw, 5rem);
  --display: "Anybody", "Arial Narrow", sans-serif;
  --text: "Literata", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  scrollbar-color: var(--chestnut) var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.65 var(--text);
}

::selection { background: var(--leaf); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 4px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.skip { position: absolute; left: -999px; z-index: 30; background: var(--leaf); color: var(--ink); padding: .75rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header band, in the apps entry's chestnut. */
.doc-head {
  background: var(--chestnut);
  color: #fff;
  padding: 1.25rem var(--pad) clamp(2.5rem, 6vw, 4.5rem);
}
.doc-head.has-plate {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  column-gap: clamp(1.5rem, 4vw, 4rem);
}
.doc-trail { grid-column: 1 / -1; padding-bottom: clamp(2.5rem, 7vw, 5.5rem); }
.doc-trail ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  list-style: none;
  font: 700 1rem/1.4 var(--display);
  font-stretch: 110%;
}
.doc-trail a { display: inline-block; padding: .4rem 0; }
.doc-title { align-self: end; container-type: inline-size; }
.doc-head h1 {
  font-size: clamp(2.75rem, 15cqi, 7.5rem);
  font-stretch: 150%;
  line-height: .86;
  text-transform: uppercase;
  overflow-wrap: break-word; /* a long single word wraps rather than overflowing */
  -webkit-hyphens: auto;
  hyphens: auto;
}
.doc-sub { margin-top: 1.25rem; max-width: 34ch; font: 700 clamp(1.25rem, 2.2vw, 1.75rem)/1.25 var(--display); font-stretch: 115%; text-wrap: balance; }
.doc-meta { margin-top: .75rem; font-size: 1rem; font-variant-numeric: tabular-nums; }
.doc-plate { align-self: end; }
.doc-plate img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.doc-plate figcaption { font: 600 .875rem/1.45 var(--display); font-stretch: 105%; padding-top: .625rem; }
.doc-plate figcaption i { font-family: var(--text); font-weight: 400; }

/* Body: a contents column that stays put, and the text at a reading measure. */
.doc-body {
  display: grid;
  grid-template-columns: 14rem minmax(0, 46rem);
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad) clamp(3.5rem, 8vw, 6rem);
}
.doc-body.solo { grid-template-columns: minmax(0, 46rem); } /* no contents column */
.doc-toc { position: sticky; top: 1.5rem; align-self: start; font: 600 1rem/1.35 var(--display); font-stretch: 105%; }
.doc-toc h2 { font-size: 1rem; font-stretch: 120%; text-transform: uppercase; padding-bottom: .5rem; border-bottom: 3px solid var(--ink); }
.doc-toc ol, .doc-toc ul { list-style: none; }
.doc-toc li { border-bottom: 1px solid var(--rule); }
.doc-toc a { display: block; padding: .5rem 0; text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }

.doc-text > * + * { margin-top: 1rem; }
.doc-text p, .doc-text li { max-width: 62ch; text-wrap: pretty; }
.doc-lede { font-size: 1.3125rem; line-height: 1.5; }
.doc-text section { margin-top: clamp(3rem, 6vw, 4.5rem); }
.doc-text section > * + * { margin-top: 1rem; }
.doc-text h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  font-stretch: 130%;
  text-transform: uppercase;
  padding-bottom: .75rem;
  border-bottom: 3px solid var(--ink);
}
.doc-text h3 { font-size: 1.375rem; font-stretch: 115%; line-height: 1.15; margin-top: 2rem; }
.doc-text ul, .doc-text ol { padding-left: 1.25rem; }
.doc-text li + li { margin-top: .5rem; }
.doc-text li::marker { color: var(--chestnut); }
.doc-text strong { font-weight: 600; }
.doc-text code { font: 600 .9em/1 var(--display); font-stretch: 105%; overflow-wrap: anywhere; }

/* Summary: the field guide's entry table. */
.doc-summary { margin-top: 2rem; border-top: 3px solid var(--ink); }
.doc-summary div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.doc-text h2 + .doc-summary { margin-top: 0; border-top: 0; } /* the h2's rule already heads it */
.doc-summary dt { font: 800 1rem/1.7 var(--display); font-stretch: 115%; }
.doc-summary dd { max-width: 54ch; }

/* Data tables: ruled, square, no fills. */
.doc-table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.doc-table caption { text-align: left; font: 700 1rem/1.4 var(--display); font-stretch: 110%; padding-bottom: .5rem; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: .75rem 1rem .75rem 0; border-bottom: 1px solid var(--rule); }
.doc-table thead th { font: 800 .9375rem/1.4 var(--display); font-stretch: 115%; border-bottom: 3px solid var(--ink); }
.doc-table tbody th { font-weight: 600; width: 38%; }
.doc-table td:nth-child(2) { width: 22%; }

/* A note that changes how the reader acts. Full border, tinted ground. */
.note { background: var(--tint); border: 1px solid var(--chestnut); padding: 1rem 1.25rem; }
.note > * + * { margin-top: .5rem; }

/* Numbered steps: chestnut numerals in the display face. */
.doc-steps { list-style: none; padding-left: 0 !important; counter-reset: step; }
.doc-steps li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.doc-steps li + li { margin-top: 0; }
.doc-steps li::before { content: counter(step); font: 900 1.5rem/1.1 var(--display); font-stretch: 130%; color: var(--chestnut); font-variant-numeric: tabular-nums; }

/* Primary action: a square kingfisher block, leaf on hover. */
.button {
  display: inline-block;
  padding: .85rem 1.4rem;
  background: var(--kingfisher);
  color: var(--ink);
  font: 800 1rem/1.2 var(--display);
  font-stretch: 120%;
  text-decoration: none;
}
.button:hover { background: var(--leaf); }

/* Close */
.doc-foot { background: var(--night); color: #fff; padding: calc(var(--pad) * 1.1) var(--pad); }
.doc-foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; padding-top: .75rem; border-top: 3px solid currentColor; }
.doc-foot ul a { display: inline-block; padding: .4rem 0; font: 700 1rem/1.4 var(--display); font-stretch: 110%; }
.doc-foot p { margin-top: 2rem; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .doc-head.has-plate { grid-template-columns: minmax(0, 1fr); }
  .doc-plate { margin-top: 2rem; }
  .doc-head h1 { font-stretch: 115%; font-size: clamp(2.5rem, 15cqi, 5rem); }
  .doc-body { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; }
  .doc-summary div { grid-template-columns: minmax(0, 1fr); gap: .125rem; }
}

@media (max-width: 600px) {
  /* Tables become stacked rows so nothing scrolls sideways. */
  .doc-table thead { position: absolute; left: -999px; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td { display: block; }
  .doc-table tr { padding: .75rem 0; border-bottom: 1px solid var(--rule); }
  .doc-table th, .doc-table td { border: 0; padding: .125rem 0; }
  .doc-table tbody th, .doc-table td:nth-child(2) { width: auto; } /* drop the desktop column widths */
  .doc-table tbody th { padding-bottom: .375rem; }
  .doc-table td[data-label]::before { content: attr(data-label) ": "; font: 700 .9375rem/1.4 var(--display); font-stretch: 110%; }
}

@media print {
  .doc-head, .doc-foot { background: none; color: var(--ink); }
  .doc-toc, .skip, .doc-plate { display: none; }
  .doc-body { display: block; }
}
