/* Styles for the plain pages (About, Privacy, Terms, Contact). Same Paper look as the chat page.
   The colours and fonts are copied from index.html, so change them in both places. */

/* Self-hosted fonts (SIL Open Font Licence, see /fonts). Latin subset only; swap so text shows at once. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Stand-ins sized to match the real fonts, so the page does not jump when they arrive. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 107.34%;
  ascent-override: 90.25%;
  descent-override: 22.47%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  font-style: normal;
  src: local("Times New Roman"), local("Times"), local("Liberation Serif");
  size-adjust: 84.3%;
  ascent-override: 117.44%;
  descent-override: 36.77%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  font-style: italic;
  src: local("Times New Roman Italic"), local("Times Italic"), local("Liberation Serif Italic");
  size-adjust: 84.3%;
  ascent-override: 117.44%;
  descent-override: 36.77%;
  line-gap-override: 0%;
}

:root {
  --paper: #F2EFE6;
  --paper-hi: #F7F4EC;
  --surface: #FFFFFF;
  --ink: #0A2E23;
  --muted: #425F54;
  --forest: #0A3D2E;
  --forest-hover: #063024;
  --mint: #7FE0B4;
  --accent: #0F7F5A;
  --accent-text: #0C6E4E;
  --line: rgba(10, 46, 35, 0.14);
  --line-strong: rgba(10, 46, 35, 0.24);
  --hover: rgba(10, 46, 35, 0.06);
  --serif: "Instrument Serif", "Instrument Serif Fallback", Georgia, "Times New Roman", serif;
  --sans: Inter, "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --grain: 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='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.09 -0.03'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

html { background: var(--paper); color-scheme: light; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    var(--grain),
    radial-gradient(80% 30rem at 85% 0, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, var(--paper-hi) 0%, var(--paper) 32rem);
  background-size: 240px 240px, auto, auto;
  background-color: var(--paper);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: 70rem; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--forest);
  color: var(--paper);
  border-radius: 0.5rem;
  z-index: 2;
}
.skip:focus { top: 0.5rem; }

/* Header: the same logo as the chat page, and a way back to the chat */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.25rem 0.25rem; }

.wordmark { margin: 0; font-family: var(--serif); font-style: normal; font-weight: 400; font-size: 2.25rem; line-height: 1; letter-spacing: -0.01em; }
.wordmark a { color: inherit; text-decoration: none; }

.ace-name { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.12em; line-height: 1; letter-spacing: 0; color: var(--accent-text); }
.wordmark .ace-name, .doc h1 .ace-name { font-size: 1em; }

.ask-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  background: var(--forest);
  color: var(--paper);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.ask-link:hover { background: var(--forest-hover); }
.ask-link .ace-name { color: var(--mint); margin-left: 0.25em; }

/* The page itself: one reading column, left aligned */
.doc { flex: 1; padding-block: clamp(2.5rem, 7vw, 4.5rem) 3rem; }
.doc > * { max-width: 40rem; }

.doc h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 1.4rem + 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead { margin: 0 0 0.75rem; font-size: 1.1875rem; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.updated { margin: 0; font-size: 0.875rem; color: var(--muted); }

.doc section { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.doc h2 { margin: 0 0 0.6rem; font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.15; color: var(--ink); text-wrap: balance; }

.doc p, .doc li { color: var(--muted); text-wrap: pretty; }
.doc p { margin: 0 0 0.9rem; }
.doc p:last-child { margin-bottom: 0; }
.doc ul { margin: 0 0 0.9rem; padding-left: 1.15rem; }
.doc li { margin-bottom: 0.45rem; padding-left: 0.2rem; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--ink); font-weight: 600; }

.doc a { color: var(--accent-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.doc a:hover { color: var(--ink); }
.doc ol { margin: 0 0 0.9rem; padding-left: 1.25rem; }
.doc h3 { margin: 1.25rem 0 0.4rem; font-family: var(--serif); font-weight: 400; font-size: 1.375rem; line-height: 1.2; color: var(--ink); text-wrap: balance; }

/* Guides: the list page and the article pages. */
.crumbs { margin: 0 0 1rem; font-size: 0.9375rem; }
.doc .crumbs a { color: var(--muted); }
.byline { margin: 0 0 1.25rem; font-size: 0.9375rem; color: var(--muted); }
/* The list page: each guide is its own white card on the paper, two across on a wide screen, one on a phone.
   The title's link is stretched over the card, so the whole card is the link and there is one tab stop per guide. */
.doc > .guide-list { max-width: none; margin: 2.5rem 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 52rem) { .doc > .guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; } }
.doc .guide-list > li { margin: 0; padding: 0; display: flex; }
.doc .guide-list > li::marker { content: none; }
.guide-card { position: relative; flex: 1; display: flex; flex-direction: column; padding: clamp(1.5rem, 1rem + 2vw, 2rem); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 1rem; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.guide-card:hover, .guide-card:focus-within { border-color: var(--accent); box-shadow: 0 14px 30px -20px rgba(10, 46, 35, 0.45); }
.doc .guide-card h2 { margin: 0 0 0.75rem; font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.125rem); line-height: 1.08; }
.doc .guide-card h2 a { color: var(--ink); text-decoration: none; }
.doc .guide-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 1rem; }
.doc .guide-card h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.18em; }
.doc .guide-card h2 a:focus-visible { outline: none; }
.doc .guide-card h2 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.doc .guide-card .guide-desc { margin: 0 0 1.75rem; }
.guide-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.doc .guide-card .guide-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 0 1rem; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.guide-go { font-size: 0.9375rem; font-weight: 500; color: var(--accent-text); }
.guide-card:hover .guide-go, .guide-card:focus-within .guide-go { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
@media (prefers-reduced-motion: reduce) { .guide-card { transition: none; } }

/* A fact only the team can supply. These must be filled in (or removed) before the page goes live: run scripts/launch-check.mjs. */
.gap { padding: 0.05em 0.35em; background: #FBE9A8; color: #5A4300; border-radius: 3px; font-weight: 500; }

/* Footer */
.site-foot { padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); }
.foot-in { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
/* One line of links (9 Nov, Milo: "line all the footer links up instead of being on top of each other"); the two groups in the markup run on, and wrap only where the screen is too narrow. */
.foot-row { display: contents; }
.site-foot a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--muted); font-size: 0.9375rem; text-underline-offset: 0.2em; }
.site-foot a:hover, .site-foot a[aria-current="page"] { color: var(--ink); }
.site-foot a[aria-current="page"] { text-decoration: none; font-weight: 500; }
.site-foot p { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--muted); }
/* Six links (Guides was added on 11 Nov) must still be one line on a phone, so the gaps and the text are a little smaller there. */
@media (max-width: 480px) {
  .site-foot nav { column-gap: 0.85rem; }
  .site-foot a { font-size: 0.875rem; }
}
