/*
 * HolyScribe's web pages (help, privacy, terms), printed in the app's own inks:
 * Sunlit by day, Evening when the phone is dark (mobile/src/theme/fan/palettes.ts).
 * Young Serif for titles, Figtree for reading. One narrow column, made to be read on a phone.
 */
:root {
  --bg: #fbe8c5;
  --raised: #fcf4e0;
  --text: #411130;
  --text-2: #542541;
  --muted: #6a3b56;
  --ink: #411130;
  --on-ink: #fcf4e0;
  --gold: #fdb34c;
  --teal: #055959;
  --hair: rgba(65, 17, 48, 0.14);
  --selection: rgba(65, 17, 48, 0.22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #250e1c;
    --raised: #321727;
    --text: #f5eede;
    --text-2: #daccb5;
    --muted: #c0ae95;
    --ink: #f6ad3b;
    --on-ink: #250e1c;
    --gold: #f6ad3b;
    --teal: #7fc4bd;
    --hair: rgba(245, 238, 222, 0.14);
    --selection: rgba(246, 173, 59, 0.22);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 "Figtree", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--selection); }

.page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

/* The top: the fan and the name, which leads back to the start. */
.mast {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font: 400 1.0625rem/1 "Young Serif", Georgia, serif;
  padding: 0.5rem 0;
}
.mast img { width: 1.75rem; height: 1.75rem; }

h1 {
  margin: 2.5rem 0 0;
  font: 400 clamp(2.25rem, 9vw, 3rem)/1.06 "Young Serif", Georgia, serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lede {
  margin: 1rem 0 0;
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}
.updated { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--muted); }

h2 {
  margin: 3rem 0 0;
  font: 400 1.5rem/1.2 "Young Serif", Georgia, serif;
  letter-spacing: -0.01em;
}
h3 { margin: 1.75rem 0 0; font-weight: 700; font-size: 1.0625rem; line-height: 1.4; }
p, ul, ol { margin: 0.75rem 0 0; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.4rem; }
strong { font-weight: 700; }

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible,
summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* A promise: the line that matters most, set apart on the raised paper. */
.promise {
  margin: 2rem 0 0;
  padding: 1.25rem 1.25rem 1.35rem;
  border-radius: 1.25rem;
  background: var(--raised);
  font: 400 1.25rem/1.45 "Young Serif", Georgia, serif;
  text-wrap: pretty;
}

/* Help: each question opens in place. */
.faq { margin-top: 0.5rem; border-top: 1px solid var(--hair); }
details { border-bottom: 1px solid var(--hair); }
summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-weight: 600;
  line-height: 1.45;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.4rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 200ms ease-out;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: 0.65rem; }
details > div { padding: 0 0 1.1rem; color: var(--text-2); }
details > div p:first-child { margin-top: 0; }

/* The way to reach a person. */
.contact {
  margin: 3rem 0 0;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: var(--ink);
  color: var(--on-ink);
}
.contact h2 { margin: 0; color: var(--on-ink); }
.contact p { color: var(--on-ink); opacity: 0.9; }
.contact a { color: var(--on-ink); text-decoration-color: var(--gold); }

/* The start page: the three pages as a plain list. */
.pages { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--hair); }
.pages li { margin: 0; border-bottom: 1px solid var(--hair); }
.pages a {
  display: block;
  padding: 1.1rem 0;
  text-decoration: none;
}
.pages a span { display: block; font: 400 1.375rem/1.25 "Young Serif", Georgia, serif; }
.pages a small { display: block; margin-top: 0.25rem; font-size: 0.9375rem; color: var(--muted); }
.pages a:hover span { text-decoration: underline 2px var(--gold); text-underline-offset: 0.2em; }

.foot {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
  font-size: 0.875rem;
  color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.75rem; }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  summary::after { transition: none; }
}
