:root {
  /* Keep these tokens aligned with lib/core/colors.dart. */
  --bg: #111111;
  --background-top: #181818;
  --background-bottom: #0d0d0d;
  --surface: #1e1e1e;
  --text-primary: #f4f5f8;
  --text-secondary: #bfbfbf;
  --muted: var(--text-secondary);
  --border: #404040;
  --link: #e69b70;
  --accent-coral: #e98a73;
  --warm-accent: #deb171;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  font-synthesis: none;
  line-height: 1.75;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--background-top), var(--bg), var(--background-bottom));
  background-attachment: fixed;
}

a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { color: var(--text-primary); }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; border-radius: 3px; }

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.site-header, main, .site-footer {
  width: min(100% - 3rem, 54rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--text-primary); font-size: 1.1rem; font-weight: 700; }
.brand-accent { color: var(--warm-accent); }
.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
}

.page-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.page-nav a { display: inline-block; padding-block: 0.5rem; font-size: 0.875rem; }
.page-nav [aria-current="page"] { color: var(--accent-coral); font-weight: 600; text-decoration-thickness: 2px; }

main { padding-block: 3.5rem; overflow-wrap: anywhere; }
.eyebrow { color: var(--warm-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
h1 { margin: 0.5rem 0 1rem; font-size: clamp(2.25rem, 7vw, 3.5rem); line-height: 1.12; letter-spacing: -0.04em; }
.updated { color: var(--muted); font-size: 0.875rem; }
.intro { max-width: 46rem; margin-block: 1.5rem 2rem; font-size: 1.125rem; }

.contents {
  margin-block: 2rem 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}
.contents h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.contents ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 2rem; margin: 0; padding-left: 1.5rem; }
.contents li { padding-left: 0.2rem; font-size: 0.9rem; }

section { padding-block: 1.75rem; border-top: 1px solid var(--border); scroll-margin-top: 1.5rem; }
section h2 { margin: 0 0 0.875rem; font-size: 1.25rem; line-height: 1.4; letter-spacing: -0.015em; }
section p { margin: 0.75rem 0; }
section p, section li { color: var(--text-secondary); }
section strong { color: var(--text-primary); }
section ul { padding-left: 1.4rem; }
section li + li { margin-top: 0.5rem; }
section > :last-child { margin-bottom: 0; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer p { margin: 0; }

@media (max-width: 600px) {
  .site-header, main, .site-footer { width: calc(100% - 2rem); }
  .site-header { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  main { padding-block: 2.5rem; }
  .contents { padding: 1.25rem; }
  .contents ol { grid-template-columns: 1fr; }
}

@media print {
  :root { color-scheme: light; color: #111; background: white; font-size: 11pt; }
  body { min-height: 0; background: none; }
  .site-header, main, .site-footer { width: 100%; }
  .page-nav, .skip-link, .contents, .brand-mark, .back-to-top { display: none; }
  main { padding-block: 1rem; }
  h1 { font-size: 28pt; }
  h2 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  section { padding-block: 1rem; }
  a, section p, section li, section strong, .brand, .brand-accent, .eyebrow, .updated, .site-footer { color: #111; }
  .site-header, section, .site-footer { border-color: #ccc; }
}
