/* ═══════════════════════════════════════════════════════════════
   SADDLE — User guide
   Quiet paper pages for the help content. Shares the marketing
   site's fonts and theme tokens (Saddle Soap light / Greatcoat
   dark) but none of its WebGL machinery — these pages are plain,
   fast, and readable with everything disabled.
   Generated pages: tools/build-guides.mjs. CSP: no inline styles.
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Source Serif 4';
  src: url('../assets/fonts/source-serif-4-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../assets/fonts/source-serif-4-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../assets/fonts/source-serif-4-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../assets/fonts/source-serif-4-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../assets/fonts/source-sans-3-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../assets/fonts/source-sans-3-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../assets/fonts/source-sans-3-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens — mirrored from style3.css (the app's resolved palette
   values). If the marketing tokens change, change these too. ── */
:root {
  color-scheme: light;
  --paper: #F0E8DB;
  --surface: #FDFBF5;
  --ink: #1A1614;
  --muted: #685854;
  --editorial: #4A3E38;
  --line: rgba(196, 146, 122, 0.28);
  --line-2: #DDCFBE;
  --brand: #C4927A;
  --brass: #A8785E;
  --brass-3: #886022;
  --brass-tint: rgba(196, 146, 122, 0.14);
  --nav-bg: rgba(240, 232, 219, 0.84);
  --shadow-sm: 0 4px 20px rgba(74, 62, 56, 0.09);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #12151C;
  --surface: #1C2029;
  --ink: #F3F0E4;
  --muted: #C3BFB0;
  --editorial: #DDD8C6;
  --line: rgba(243, 240, 228, 0.15);
  --line-2: rgba(243, 240, 228, 0.26);
  --brand: #B18C3F;
  --brass: #B18C3F;
  --brass-3: #D4AF37;
  --brass-tint: rgba(177, 140, 63, 0.15);
  --nav-bg: rgba(18, 21, 28, 0.84);
  --shadow-sm: 0 12px 30px -20px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #12151C;
    --surface: #1C2029;
    --ink: #F3F0E4;
    --muted: #C3BFB0;
    --editorial: #DDD8C6;
    --line: rgba(243, 240, 228, 0.15);
    --line-2: rgba(243, 240, 228, 0.26);
    --brand: #B18C3F;
    --brass: #B18C3F;
    --brass-3: #D4AF37;
    --brass-tint: rgba(177, 140, 63, 0.15);
    --nav-bg: rgba(18, 21, 28, 0.84);
    --shadow-sm: 0 12px 30px -20px rgba(0, 0, 0, 0.6);
  }
}

/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
.guide-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-family: 'Source Serif 4', serif;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark { display: block; }
.nav-guide-home {
  margin-left: auto;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.nav-guide-home:hover { color: var(--brass-3); }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--brass-3); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.icon-moon { display: none; }
:root[data-theme='dark'] .icon-moon { display: block; }
:root[data-theme='dark'] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-moon { display: block; }
  :root:not([data-theme='light']) .icon-sun { display: none; }
}

/* ── Article ── */
main { flex: 1; }
.guide {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 4rem;
}

.guide h1 {
  font-family: 'Source Serif 4', serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 0.9rem;
}
.guide h2 {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 2.4rem 0 0.7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.guide h3 {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 1.15rem;
  margin: 1.7rem 0 0.5rem;
}
.guide h2, .guide h3 { scroll-margin-top: 4.5rem; }

.guide p { margin: 0.8rem 0; }
.guide h1 + p {
  font-size: 1.15rem;
  color: var(--editorial);
}

.guide ul, .guide ol {
  margin: 0.8rem 0;
  padding-left: 1.5rem;
}
.guide li { margin: 0.4rem 0; }
.guide li > ul, .guide li > ol { margin: 0.4rem 0 0.4rem 0; }
.guide li::marker { color: var(--brass); }

.guide a {
  color: var(--brass-3);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}
.guide a:hover { text-decoration-color: var(--brass-3); }

.guide strong { font-weight: 600; }

.guide code {
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--brass-tint);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

/* ── Tables ── */
.table-scroll { overflow-x: auto; margin: 1rem 0; }
.guide table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
.guide th, .guide td {
  border: 1px solid var(--line-2);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.guide th {
  font-weight: 600;
  background: var(--brass-tint);
}

/* The "Related guides" tail reads as an index, not prose. */
#related-guides + ul {
  list-style: none;
  padding-left: 0;
}
#related-guides + ul li { margin: 0.3rem 0; }
#related-guides + ul a { font-weight: 600; }

/* ── Footer ── */
.guide-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem 2.5rem;
  max-width: 46rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.guide-footer a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.guide-footer a:hover { color: var(--brass-3); }
.guide-footer p { margin-left: auto; }

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .guide { padding-top: 2rem; }
  .guide-footer p { margin-left: 0; }
}

@media print {
  .guide-nav, .guide-footer, .theme-toggle { display: none; }
}
