/* Peak's pages: type first, one warm light, a fine grain, no boxes. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Black";
  src: url("../fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #030202;
  --text: #F5EEE4;
  --quiet: #B4A694;
  --accent: #E0A458;
  --line: rgba(245, 238, 228, 0.1);
  --gutter: max(20px, env(safe-area-inset-left));
  --measure: 41rem;
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  background:
    radial-gradient(ellipse 60rem 32rem at 18% -14rem, rgba(239, 229, 216, 0.075), rgba(150, 112, 79, 0.035) 45%, rgba(3, 2, 2, 0) 72%) no-repeat,
    var(--ground);
}

/* A still film grain, the app's texture, never moving. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: rgba(224, 164, 88, 0.32); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(224, 164, 88, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -6rem;
  z-index: 10;
  padding: 0.55em 1.1em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ground);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* The top bar: the wordmark, and the 3 pages. */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 72rem;
  margin: 0 auto;
  padding: 22px var(--gutter) 0;
}
.bar img { display: block; width: 76px; height: auto; }
.bar nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 0.9375rem; }
.bar nav a { color: var(--quiet); text-decoration: none; }
.bar nav a:hover { color: var(--text); }
.bar nav a[aria-current="page"] { color: var(--text); }

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 2rem;
}

.intro { max-width: var(--measure); padding: 4.5rem 0 1rem; }
h1 {
  margin: 0;
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-weight: 400;
  font-size: clamp(2.75rem, 1.5rem + 5vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
}
h1.long { font-size: clamp(2.2rem, 1.2rem + 3.8vw, 3.6rem); line-height: 1; }
.date { margin: 1.1rem 0 0; color: var(--quiet); font-size: 0.9375rem; }

/* The support email, said once and large. */
.mail { margin: 2rem 0 0.5rem; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 650; letter-spacing: -0.01em; }
.mail a { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.mail + p { color: var(--quiet); font-size: 0.9375rem; max-width: 34rem; }

/* A list of pages, one per line. */
.links { list-style: none; padding: 0; margin: 2.5rem 0 0; max-width: var(--measure); }
.links li { margin: 0; border-top: 1px solid var(--line); }
.links li:last-child { border-bottom: 1px solid var(--line); }
.links a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}
.links a::after { content: "\2192"; color: var(--quiet); font-weight: 400; }
.links a:hover { color: var(--accent); }
.links a:hover::after { color: var(--accent); }
.lead { margin: 1.75rem 0 0; font-size: 1.25rem; line-height: 1.55; }
.lead + p { margin-top: 1rem; color: var(--quiet); }

/* The index stands beside the text on wide screens, and folds away on phones. */
.layout { display: block; }
.index-phone { margin: 2.5rem 0 0; border-top: 1px solid var(--line); }
.doc .index-phone + section { margin-top: 0; }
.index-phone summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.index-phone summary::-webkit-details-marker { display: none; }
.index-phone summary::after { content: "+"; color: var(--quiet); font-size: 1.35rem; font-weight: 400; line-height: 1; }
.index-phone[open] summary::after { content: "\2212"; }
.index-phone ol { margin: 0.25rem 0 1.5rem; }
.index-wide { display: none; }
.index ol { list-style: none; padding: 0; counter-reset: part; font-size: 0.9375rem; line-height: 1.45; }
.index li { counter-increment: part; margin: 0 0 0.55rem; }
.index li::before { content: counter(part) "  "; color: var(--quiet); font-variant-numeric: tabular-nums; white-space: pre; }
.index li.unnumbered { counter-increment: none; }
.index li.unnumbered::before { content: none; }
.index a { color: var(--text); text-decoration: none; }
.index a:hover { color: var(--accent); }

@media (min-width: 64rem) {
  .layout {
    display: grid;
    grid-template-columns: 13.5rem minmax(0, var(--measure));
    gap: 5rem;
    align-items: start;
  }
  .index-phone { display: none; }
  .index-wide { display: block; position: sticky; top: 2rem; padding-top: 2.6rem; }
  .index-wide p { margin: 0 0 0.9rem; color: var(--quiet); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
}

/* The parts of a page, divided by one hairline each. */
.doc section { padding: 2.5rem 0 0.25rem; border-top: 1px solid var(--line); margin-top: 2.5rem; scroll-margin-top: 1.5rem; }
.doc section:first-child { margin-top: 2.5rem; }
h2 {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 1rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h2 .n { color: var(--quiet); font-weight: 500; font-variant-numeric: tabular-nums; }
h3 { margin: 1.75rem 0 0.35rem; font-size: 1.0625rem; font-weight: 650; line-height: 1.35; }
h2 + h3 { margin-top: 0.25rem; }
p, ul, ol { margin: 0 0 1rem; }
ul { padding-left: 1.15rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--quiet); }
strong { font-weight: 650; }
.quiet { color: var(--quiet); font-size: 0.9375rem; }

/* Tables read as rows of text, with hairlines and no frame. */
table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.25rem; font-size: 0.96875rem; line-height: 1.5; }
th { text-align: left; color: var(--quiet); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0 1rem 0.6rem 0; }
td { vertical-align: top; padding: 0.85rem 1rem 0.85rem 0; border-top: 1px solid var(--line); }
td:first-child { font-weight: 650; }
th:last-child, td:last-child { padding-right: 0; }

@media (max-width: 40rem) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table, tbody, tr, td { display: block; }
  tr { padding: 0.9rem 0; border-top: 1px solid var(--line); }
  td { border: 0; padding: 0.1rem 0; }
  td[data-label]::before { content: attr(data-label) ": "; color: var(--quiet); }
  .intro { padding-top: 3rem; }
  .lead { font-size: 1.15rem; }
}

.foot {
  max-width: 72rem;
  margin: 4.5rem auto 0;
  padding: 1.5rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.foot a { color: var(--quiet); }
.foot p { margin: 0; }

@media (prefers-contrast: more) {
  :root { --line: rgba(245, 238, 228, 0.35); --quiet: #D8CCBC; }
  body::after { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  body { background: none; color: #1a1612; }
  body::after, .bar nav, .index-wide, .index-phone, .skip { display: none; }
  a { color: inherit; }
}
