/* Holdfast site. Colours and type follow DESIGN.md ("The Register"): archival board ground,
   label stock for the one stamped line, date-stamp violet for links and nothing else. */

:root {
  color-scheme: light dark;
  --board: #EEF0EC;
  --label-stock: #FAFBF8;
  --ink: #141815;
  --ink-secondary: #555C57;
  --hairline: #C9CEC8;
  --stamp-violet: #4B3FB8;
  --buckram-green: #1E6B45;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --board: #101412;
    --label-stock: #1A1F1C;
    --ink: #ECEFEA;
    --ink-secondary: #A3ABA5;
    --hairline: #2B322E;
    --stamp-violet: #A79BFF;
    --buckram-green: #5FCB8E;
  }
}

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

html {
  background: var(--board);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 106.25%; /* 17 px, the iOS body size */
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--hairline) var(--board);
  caret-color: var(--stamp-violet);
}

body { margin: 0; }

::selection { background: var(--stamp-violet); color: var(--board); }

a {
  color: var(--stamp-violet);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--stamp-violet);
  outline-offset: 3px;
  border-radius: 2px;
}

.page {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header: the name and the two other pages. */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline);
}
.masthead .name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}
.masthead .name img { width: 32px; height: 32px; border-radius: 7px; display: block; }
.masthead nav { display: flex; gap: 1.5rem; }
.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.masthead nav a:hover { text-decoration: underline; }
.masthead nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main { padding: 3rem 0 4rem; }

h1, h2, h3 { text-wrap: balance; margin: 0; }
h1 {
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
  font-weight: 700;
}
.doc h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.5rem); }
h2 {
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin-top: 3rem;
}
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.75rem; }

p, ul, ol, dl, figure { margin: 0.75rem 0 0; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.4rem; }

.lead { font-size: 1.2rem; line-height: 1.45; margin-top: 1.5rem; }
.note { color: var(--ink-secondary); }
.dated { color: var(--ink-secondary); margin-top: 1rem; }

/* The register line: the app's one signature. A counted, dated fact on label stock. */
.register {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--label-stock);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.register svg { flex: none; width: 1.35rem; height: 1.35rem; margin-top: 0.1rem; color: var(--buckram-green); }
.register .count { display: block; font-size: 0.94rem; font-weight: 500; }
.register .detail { display: block; font-size: 0.8rem; color: var(--ink-secondary); }
figcaption { margin-top: 0.6rem; font-size: 0.8rem; color: var(--ink-secondary); }

/* A ruled list: one statement per line, as in a ledger. */
.ruled { list-style: none; padding: 0; margin-top: 1.25rem; border-bottom: 1px solid var(--hairline); }
.ruled li { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--hairline); }

/* Terms and their answers on the support page. */
.answers h3 { margin-top: 2rem; }

address { font-style: normal; margin-top: 0.75rem; }

.colophon {
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-secondary);
  font-size: 0.8rem;
}
.colophon p { margin: 0; }
.colophon p + p { margin-top: 0.35rem; }
.colophon a { display: inline-block; padding: 0.6rem 0; margin-right: 1.25rem; }

@media (max-width: 26rem) {
  main { padding-top: 2.25rem; }
  h2 { margin-top: 2.5rem; }
}
