/* /field-guide: the hussh field guide, set like a pocket dictionary.
   Hand-written (no build step). Markup comes from scripts/generate-field-guide.mjs.
   Every rule is scoped under .fg so the shared header, footer and slides keep their own look. */

html, body { margin: 0; overflow-x: clip; }
body[data-glossary-page] { background: #fbf7f0; color: #1d1d1f; font-family: -apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

.fg {
  --paper: #fbf7f0;
  --ink: #1d1d1f;
  --ink-2: #4a4a4f;
  --ink-3: #6e6e73;
  --rule: #e6ddcf;
  --gold: #86868b;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui, system-ui, sans-serif;
  display: block;
  padding-top: calc(64px + env(safe-area-inset-top, 0px));
  font-family: var(--sans);
  color: var(--ink);
}
.fg *, .fg *::before, .fg *::after { box-sizing: border-box; }
.fg a { color: inherit; }

/* Category colours: swatch (--c) and a darker text tone (--ct) that reads on paper. */
.fg [data-cat="products"] { --c: #86868b; --ct: #86868b; }
.fg [data-cat="privacy"]  { --c: #2f8f7a; --ct: #23705f; }
.fg [data-cat="ai"]       { --c: #5b6fd6; --ct: #4254b8; }
.fg [data-cat="business"] { --c: #c4708f; --ct: #9e4b6a; }
.fg [data-cat="hardware"] { --c: #e4573d; --ct: #b83d26; }

/* ---------- Title page ---------- */
.fg-cover { background: #16110c; color: #f6efe4; padding: 56px 20px 40px; border-bottom: 6px double #3a2e22; }
.fg-cover-inner { max-width: 60rem; margin: 0 auto; }
.fg-kicker { margin: 0 0 18px; font: 600 12px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.fg-title { margin: 0; font: 600 clamp(44px, 9vw, 96px)/.95 var(--serif); letter-spacing: -.02em; }
.fg-title em { font-style: italic; font-weight: 400; color: var(--gold); }
.fg-lede { max-width: 36rem; margin: 20px 0 0; font-size: 17px; line-height: 1.6; color: #d9cfc2; }
.fg-search { position: relative; margin: 32px 0 0; max-width: 40rem; }
.fg-search label { display: block; margin-bottom: 8px; font-size: 13px; color: #b9ad9d; }
.fg-search input {
  width: 100%; height: 60px; padding: 0 20px 0 52px;
  border: 1px solid #4a3b2c; border-radius: 14px; background: #221a12; color: #fff;
  font: 500 18px/1 var(--sans); outline: none; -webkit-appearance: none; appearance: none;
}
.fg-search input::placeholder { color: #8d8174; }
.fg-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(134,134,139, .25); }
.fg-search svg { position: absolute; left: 18px; bottom: 19px; width: 22px; height: 22px; color: var(--gold); pointer-events: none; }
.fg-count { margin: 12px 0 0; font-size: 13px; color: #b9ad9d; }
.fg-count strong { color: #f6efe4; font-weight: 600; }

/* Category key: works as a filter. Plain text buttons with a colour dot, not chips. */
.fg-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 24px 0 0; padding: 0; list-style: none; }
.fg-key button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0;
  border: 0; background: none; color: #d9cfc2; font: 500 14px/1 var(--sans); cursor: pointer;
  text-decoration: underline transparent 2px; text-underline-offset: 6px;
}
.fg-key button::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.fg-key button:hover, .fg-key button[aria-pressed="true"] { color: #fff; text-decoration-color: var(--c); }
.fg-key button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }

/* ---------- Thumb index (A-Z) ---------- */
.fg-thumb { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 20; background: rgba(251, 247, 240, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.fg-thumb-scroll { max-width: 60rem; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.fg-thumb-scroll::-webkit-scrollbar { display: none; }
.fg-thumb ol { display: flex; justify-content: space-between; gap: 2px; margin: 0; padding: 6px 12px; list-style: none; min-width: max-content; }
.fg-thumb a, .fg-thumb span { display: flex; align-items: center; justify-content: center; min-width: 30px; height: 36px; border-radius: 6px; font: 600 16px/1 var(--serif); text-decoration: none; }
.fg-thumb a { color: var(--ink); }
.fg-thumb a:hover, .fg-thumb a:focus-visible { background: #efe5d6; outline: none; }
.fg-thumb span { color: #c9bfb1; }
@media (min-width: 60rem) { .fg-thumb ol { min-width: 0; } }

/* ---------- The dictionary ---------- */
.fg-book { max-width: 60rem; margin: 0 auto; padding: 8px 20px 64px; }
.fg-empty { margin: 48px 0; font: 400 22px/1.4 var(--serif); color: var(--ink-2); }
.fg-empty a { color: var(--ink); }

.fg-letter { display: grid; grid-template-columns: 1fr; padding-top: 28px; scroll-margin-top: 120px; }
.fg-letter-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.fg-letter-head h2 { margin: 0; font: 600 56px/1 var(--serif); }
.fg-guide-words { margin: 0; font: italic 400 15px/1.3 var(--serif); color: var(--ink-3); }
.fg-letter dl { margin: 0; }

.fg-entry { padding: 18px 0 20px; border-bottom: 1px solid var(--rule); scroll-margin-top: 130px; }
.fg-entry:target { background: linear-gradient(90deg, rgba(134,134,139, .18), transparent 70%); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.fg-entry dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fg-word { font: 700 22px/1.25 var(--serif); letter-spacing: -.005em; text-decoration: none; }
.fg-word:hover { text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 4px; }
.fg-expand { font: italic 400 16px/1.3 var(--serif); color: var(--ink-2); }
.fg-tag { font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ct); }
.fg-tag::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--c); vertical-align: 1px; }
.fg-status { font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border: 1px solid #d8ccbb; border-radius: 4px; padding: 3px 6px; }
.fg-entry dd { margin: 6px 0 0; max-width: 42rem; }
.fg-def { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); }
.fg-eg { margin: 6px 0 0; font: italic 400 16px/1.55 var(--serif); color: var(--ink-2); }
.fg-eg b { font-style: normal; font-weight: 600; font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-right: 4px; }
.fg-see { margin: 8px 0 0; font-size: 14px; line-height: 1.7; color: var(--ink-3); }
.fg-see b { font-weight: 600; margin-right: 4px; }
.fg-see a { color: var(--ink-2); text-decoration: underline; text-decoration-color: #cdbfa9; text-underline-offset: 3px; }
.fg-see a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.fg-see a.fg-page { color: var(--ink); font-weight: 600; white-space: nowrap; }
.fg-see a.fg-page::after { content: " \2192"; }

@media (min-width: 48rem) {
  .fg-cover { padding: 88px 32px 56px; }
  .fg-book { padding: 8px 32px 80px; }
  .fg-letter { grid-template-columns: 6rem 1fr; column-gap: 24px; padding-top: 40px; }
  .fg-letter-head { grid-column: 1 / -1; }
  .fg-letter-head h2 { font-size: 72px; }
  .fg-letter dl { grid-column: 2; }
}

/* The last line of the book. */
.fg-missing { margin: 40px 0 0; font: italic 400 18px/1.5 var(--serif); color: var(--ink-2); }
.fg-missing a { color: var(--ink); text-underline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) { html:has(body[data-glossary-page]) { scroll-behavior: smooth; } }

/* Phones: the A-Z sits in two rows of 13 so every letter is a real tap target, no sideways scroll. */
@media (max-width: 47.99rem) {
  .fg-thumb ol { display: grid; grid-template-columns: repeat(13, 1fr); min-width: 0; padding: 4px 8px; gap: 0; }
  .fg-thumb a, .fg-thumb span { min-width: 0; height: 34px; font-size: 15px; }
  .fg-letter { scroll-margin-top: 150px; }
  .fg-entry { scroll-margin-top: 160px; }
}
