/* The reading pages: privacy, terms, support and the "nothing here" page. They load site.css for
   the fonts, the header and the buttons, and this file for paper that is easy to read on, light
   or dark to match the visitor's device. */

:root {
  --paper: #f6f6f7;
  --card: #fdfdfd;
  --ink: #18181b;
  --muted: #52525b;
  --rule: #e2e2e6;
  --accent: #c8152c;
  --accent-soft: rgb(200 21 44 / 0.07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111113;
    --card: #19191c;
    --ink: #ececef;
    --muted: #a5a5ae;
    --rule: #2a2a2f;
    --accent: #ff6f69;
    --accent-soft: rgb(255 111 105 / 0.09);
  }
}

html:has(body.doc) { background: var(--paper); }
body.doc { background: var(--paper); color: var(--ink); }
body.doc ::selection { background: var(--accent); color: var(--card); }
body.doc :focus-visible { outline-color: var(--accent); }

/* ---------- The top of the page: Twdial's red room, with the handset in it ---------- */

.masthead {
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--white);
  background:
    radial-gradient(70% 120% at 82% 40%, var(--red-500) 0%, var(--red-700) 38%, transparent 74%),
    radial-gradient(120% 140% at 50% 50%, transparent 50%, rgb(0 0 0 / 0.45) 100%),
    var(--red-800);
}
.masthead :focus-visible { outline-color: var(--white); }
.masthead ::selection { background: var(--white); color: var(--red-800); }
.masthead .nav { position: relative; inset: auto; }
.masthead .nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1.5px; }
.masthead .nav-links { display: flex; }
.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  max-width: calc(var(--wide) + 2 * var(--pad));
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--pad) clamp(2.75rem, 7vw, 5rem);
}
.masthead h1 { font-size: clamp(2.5rem, 1.4rem + 4vw, 4.5rem); }
.masthead-words { display: grid; gap: 1.1rem; max-width: 40rem; }
.masthead-words p { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.5; color: var(--soft); text-wrap: pretty; }
.masthead .dated { font: 500 0.8125rem/1 var(--mono); color: var(--soft); }
.mini { width: clamp(11rem, 24vw, 19rem); aspect-ratio: 1; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 0.9s ease; }
.mini.is-ready { opacity: 1; }
.mini.is-held { cursor: grabbing; }
.mini-holder { display: grid; place-items: center; }
.mini-holder img { width: clamp(6rem, 14vw, 9rem); height: auto; border-radius: 22%; box-shadow: 0 30px 60px -20px rgb(20 0 4 / 0.7); }
.mini-on .mini-holder img, html:not(.mini-on) .mini { display: none; }

/* ---------- The words ---------- */

.doc-body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 46rem);
  gap: clamp(2rem, 6vw, 5.5rem);
  max-width: calc(var(--wide) + 2 * var(--pad));
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--pad) clamp(4rem, 8vw, 7rem);
  align-items: start;
}
.contents { position: sticky; top: 2rem; display: grid; gap: 0.15rem; font-size: 0.9375rem; }
.contents-title { font: 500 0.8125rem/1 var(--mono); color: var(--muted); margin-bottom: 0.75rem; }
.contents a { display: block; padding: 0.4rem 0 0.4rem 0.9rem; border-left: 2px solid var(--rule); color: var(--muted); text-decoration: none; line-height: 1.35; transition: color 0.2s ease, border-color 0.2s ease; }
.contents a:hover { color: var(--ink); }
.contents a.is-here { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }

.article { display: grid; gap: clamp(2.5rem, 5vw, 3.75rem); font-size: 1.0625rem; line-height: 1.7; }
.article section { display: grid; gap: 1rem; scroll-margin-top: 1.5rem; }
.article h2 { font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem); line-height: 1.1; letter-spacing: -0.03em; }
.article h3 { font: 600 1.1875rem/1.3 var(--display); letter-spacing: -0.015em; margin-top: 0.5rem; }
.article p, .article li { color: var(--ink); max-width: 44em; text-wrap: pretty; }
.article a { color: var(--accent); text-underline-offset: 0.25em; }
.article a:hover { text-decoration-thickness: 2px; }
.article ul, .article ol { display: grid; gap: 0.6rem; padding-left: 1.25rem; }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li::marker { color: var(--accent); }
.article strong { font-weight: 600; }
.article code { font: 0.9em var(--mono); padding: 0.1em 0.35em; border-radius: 6px; background: var(--accent-soft); }

/* The plain-words line that opens each part, and the summary that opens the page. */
.short { padding: 0.9rem 1.1rem; border-radius: 14px; background: var(--accent-soft); font-weight: 500; }
.short b { font-weight: 600; color: var(--accent); }
.summary { padding: clamp(1.4rem, 3vw, 2rem); border-radius: var(--tile); background: var(--card); border: 1px solid var(--rule); }
.summary ul { list-style: none; padding: 0; gap: 0.85rem; }
.summary li { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: start; }
.summary .icon { margin-top: 0.3rem; color: var(--accent); }
.warning { padding: 1.1rem 1.25rem; border-radius: 14px; border: 2px solid var(--accent); font-weight: 500; }
.warning strong { color: var(--accent); }

.doc .footer { background: var(--card); border-top-color: var(--rule); color: var(--ink); }
.doc .fine { color: var(--muted); }
.doc .footer :focus-visible { outline-color: var(--accent); }

.lost { min-height: 55svh; display: grid; align-content: center; justify-items: start; gap: 1.25rem; max-width: calc(var(--wide) + 2 * var(--pad)); margin-inline: auto; padding: 4rem var(--pad); }
.lost .button { background: var(--accent); border-color: var(--accent); color: var(--card); box-shadow: none; }
.lost .button-plain { background: transparent; color: var(--ink); border-color: var(--rule); }

@media (max-width: 860px) {
  .doc-body { grid-template-columns: minmax(0, 1fr); }
  .contents { position: static; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
  .contents-title { grid-column: 1 / -1; }
  .contents a { border-left: 0; padding-left: 0; }
  .contents a.is-here { color: var(--muted); font-weight: 400; }
  .masthead-inner { grid-template-columns: minmax(0, 1fr); }
  .mini-holder { display: none; }
  .masthead .nav-links { gap: 1.1rem; }
}

@media print {
  .masthead { background: none; color: #000; }
  .masthead .nav, .mini-holder, .contents, .footer-links { display: none; }
  .doc-body { display: block; padding: 0; }
  body.doc { background: #fff; color: #000; }
}
