/* Boffin Coders brand (boffincoders.com), shared with the other Boffin Coders
   open-source sites: gold #d4a012 on near-black #0d0d0d, Space Grotesk
   headings, Inter body. Light mode uses a darker gold for text so it stays
   readable on white. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --text: #0d0d0d;
  --muted: #525252;
  --faint: #737373;
  --border: #e6e3da;
  --accent: #8a6500;
  --accent-strong: #d4a012;
  --accent-hover: #e4b022;
  --accent-soft: #fbf3d9;
  --code-bg: #fafaf7;
  --code-block-bg: #111111;
  --code-block-text: #f5f5f5;
  --shadow: 0 1px 2px rgb(13 13 13 / 6%), 0 8px 24px rgb(13 13 13 / 6%);
  --radius: 12px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --heading: "Space Grotesk", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --surface: #1a1a1a; --surface-2: #141414; --text: #ffffff;
    --muted: #d4d4d4; --faint: #a3a3a3; --border: #2a2a2a; --accent: #d4a012;
    --accent-soft: #2a2108; --code-bg: #141414;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --surface: #1a1a1a; --surface-2: #141414; --text: #ffffff;
  --muted: #d4d4d4; --faint: #a3a3a3; --border: #2a2a2a; --accent: #d4a012;
  --accent-soft: #2a2108; --code-bg: #141414;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font);
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.2; letter-spacing: -0.02em; }
.container { width: min(1080px, 100% - 40px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; }
.skip-link:focus { left: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; margin-right: auto; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--heading); font-size: 15px; font-weight: 700; }
.brand-by { font-size: 11px; font-weight: 400; color: var(--faint); }
.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav .nav-cta { color: #0d0d0d; background: var(--accent-strong); font-weight: 600; }
.site-nav .nav-cta:hover { color: #0d0d0d; background: var(--accent-hover); }
.theme-toggle, .nav-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 14px; }
.nav-toggle { display: none; }
@media (max-width: 1040px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .site-nav.open { display: flex; }
}
@media (max-width: 420px) { .brand-text { display: none; } }

/* Page headers and the home hero */
.page-header { padding: 48px 0 8px; }
.page-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 12px; }
.eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; margin: 0 0 8px; }
.hero { padding: 72px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0 auto 16px; max-width: 18ch; }
.hero h1 .accent { color: var(--accent-strong); }
.hero .lead { margin: 0 auto; font-size: 1.18rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 700px; margin: 0; }
.content { padding: 24px 0 72px; }
.content > section, .content > article { max-width: 780px; }
.content > section.home { max-width: none; }
.content h2 { font-size: 1.45rem; margin: 2.6rem 0 0.8rem; }
.content h3 { font-size: 1.1rem; margin: 1.8rem 0 0.5rem; }
.content p, .content li { max-width: 72ch; }
.content table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.content th { background: var(--surface-2); font-weight: 600; }

/* Code */
code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.35em; }
pre { position: relative; background: var(--code-block-bg); color: var(--code-block-text); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; line-height: 1.55; font-size: 14px; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.copy-button { position: absolute; top: 8px; right: 8px; border: 1px solid #2a2a2a; background: #1a1a1a; color: #d4d4d4; border-radius: 7px; padding: 2px 10px; font: 12px var(--font); cursor: pointer; }
.copy-button:hover { color: #ffffff; border-color: var(--accent-strong); }

/* Buttons and install box */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.home .actions { justify-content: center; }
.button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; text-decoration: none; font-weight: 600; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.button:hover { text-decoration: none; border-color: var(--accent-strong); }
.button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #0d0d0d; }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.install { display: flex; justify-content: center; }
.install pre { display: inline-block; margin: 0; padding: 10px 84px 10px 16px; background: var(--surface-2); color: var(--text); font-size: 14px; }
.install .copy-button { top: 50%; transform: translateY(-50%); background: var(--surface); color: var(--muted); border-color: var(--border); }
.install pre { max-width: 100%; }
@media (max-width: 480px) { .install pre { font-size: 12px; padding: 10px 70px 10px 12px; } }
.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 18px 0 8px; color: var(--faint); font-size: 0.88rem; }
.badges span { border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; background: var(--surface-2); }

/* Cards and media */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin: 24px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
a.card { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent-strong); text-decoration: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.home > h2 { text-align: center; margin-top: 56px; }
.home > p { margin-inline: auto; text-align: center; }
.media-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; }
.home .media-row { justify-content: center; }
.media-row figure { margin: 0; flex: 1 1 200px; max-width: 260px; }
.media-row img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.media-row figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; text-align: center; }
.home .disambiguation { max-width: 720px; margin: 24px auto 8px; text-align: left; }
.callout { border-left: 4px solid var(--accent-strong); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 12px 12px 0; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 20px; }
.toc ul { margin: 4px 0; padding-left: 18px; }
@media (prefers-reduced-motion: reduce) { a.card { transition: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--faint); font-size: 14px; background: var(--surface-2); }
.footer-inner p { margin: 4px 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--text); font-family: var(--heading); font-weight: 600; text-decoration: none; }
.footer-brand:hover { text-decoration: none; }
.footer-brand img { width: 36px; height: 36px; object-fit: contain; }
