/* Dmos public pages. Theme: Martian in the DJPi look, light and dark (S-0035; decision
   2026-11-18-site-theme-martian-djpi-look). Colours are tokens from brand/site-theme/martian/theme.css (dark is
   DJPi's palette generator, light our mirror of it); dark mode follows the system unless data-theme is set.
   Abel is self-hosted (fonts/, OFL): no font requests to Google. */
@font-face {
  font-family: "Abel";
  src: url("fonts/abel-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f0ee;
  --surface: #fdfafa;
  --text: #1f1614;
  --muted: #675550;
  --line: #ddcecb;
  --accent: #c95436;
  --accent-text: #000000;
  --link: #9f3419;
  --code-bg: #ebe2e0;
  --highlight-bg: #e9cbc3;
  --on-primary: #000000;
  --primary-rgb: 201, 84, 54;
  --panel-rgb: 253, 250, 250;
  --bg-rgb: 246, 240, 238;
  --warn-bg: #fff4e0;
  --warn-text: #6a4300;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191210;
    --surface: #271d1b;
    --text: #eee9e7;
    --muted: #a89894;
    --line: #473734;
    --accent: #c95436;
    --accent-text: #000000;
    --link: #ea917b;
    --code-bg: #0f0c0b;
    --highlight-bg: #5e2e22;
    --on-primary: #000000;
    --primary-rgb: 201, 84, 54;
    --panel-rgb: 39, 29, 27;
    --bg-rgb: 25, 18, 16;
    --warn-bg: #2e2410;
    --warn-text: #f2cf8a;
  }
}
:root[data-theme="dark"] {
  --bg: #191210;
  --surface: #271d1b;
  --text: #eee9e7;
  --muted: #a89894;
  --line: #473734;
  --accent: #c95436;
  --accent-text: #000000;
  --link: #ea917b;
  --code-bg: #0f0c0b;
  --highlight-bg: #5e2e22;
  --on-primary: #000000;
  --primary-rgb: 201, 84, 54;
  --panel-rgb: 39, 29, 27;
  --bg-rgb: 25, 18, 16;
  --warn-bg: #2e2410;
  --warn-text: #f2cf8a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 "Abel", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: background-color 2s ease, color 2s ease;
}
/* The DJPi background layer: fixed behind the page, a gradient from the palette */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, var(--highlight-bg) 0%, var(--bg) 45%, var(--code-bg) 100%);
}
main, .top, .foot { max-width: 880px; margin: 0 auto; padding: 0 16px; }
a { color: var(--link); }

.top { display: flex; align-items: center; gap: 10px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: block; height: 110px; width: auto; } /* wordmark.svg is cropped to the letters: height = letter height */
/* On the textured background (bg-texture.js, S-0008): in dark mode a halo hugs the letters and a blurred copy
   of the logo (.bloom) glows behind them, as LEDs bloom; light mode keeps the logo plain (Adam, 24 Nov) */
.top > a:first-child { position: relative; isolation: isolate; display: block; }
.bloom { display: none; position: absolute; left: 0; top: 0; height: 100%; width: auto; z-index: -1; pointer-events: none;
  filter: blur(14px) saturate(1.6) brightness(1.4); opacity: 0.35; }
:root[data-theme="dark"] .bloom { display: block; }
:root[data-theme="dark"] .logo { filter: drop-shadow(0 0 2px rgb(var(--bg-rgb))) drop-shadow(0 0 5px rgba(var(--bg-rgb), 0.8)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bloom { display: block; }
  :root:not([data-theme="light"]) .logo { filter: drop-shadow(0 0 2px rgb(var(--bg-rgb))) drop-shadow(0 0 5px rgba(var(--bg-rgb), 0.8)); }
}
@media (max-width: 520px) { .logo { height: 72px; } }
.top nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }
/* Light/dark switch (theme.js): shows the mode it switches to */
.theme-btn {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; cursor: pointer;
  background: rgba(var(--panel-rgb), 0.6); color: var(--muted); border: 1px solid var(--line); border-radius: 5px;
}
.theme-btn[hidden] { display: none; }
.top nav + .theme-btn { margin-left: 0; }
/* Narrow screens (S-0053): the front page's six links would wrap into ragged rows beside the logo, so they
   get their own row under it, spread across the width; the theme button stays top right */
@media (max-width: 680px) {
  .top:has(nav.sections) { flex-wrap: wrap; row-gap: 12px; }
  .top nav.sections { order: 3; flex-basis: 100%; margin-left: 0; justify-content: space-between; gap: 6px 12px; }
  .top nav.sections + .theme-btn { margin-left: auto; }
}
.theme-btn:hover { color: var(--text); }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn[data-next="light"] .moon, .theme-btn[data-next="dark"] .sun { display: none; }

/* The hero panel: filled with the primary colour, text black or white for contrast */
.hero {
  background: rgba(var(--primary-rgb), 0.88);
  color: var(--on-primary);
  border-radius: 10px;
  padding: 28px 24px;
  margin: 8px 0 24px;
}
.hero h1 { margin-top: 0; }
.hero .lead { color: inherit; }
.hero a:not(.cta) { color: inherit; }
.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 0 24px; }

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid rgba(var(--bg-rgb), 0.5);
  border-radius: 5px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.hero .cta { background: var(--on-primary); color: rgb(var(--primary-rgb)); }

/* Panels: see-through over the background layer, so the panel fades but its text doesn't */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding-bottom: 32px; }
.features div, .panel { background: rgba(var(--panel-rgb), 0.85); border: 1px solid var(--line); border-radius: 10px; }
.features div { padding: 16px; }
.features h2 { font-size: 18px; margin: 0 0 6px; }
.features p { margin: 0; color: var(--muted); }

.panel { padding: 20px; margin-bottom: 20px; }
.panel h2 { margin-top: 0; }
.panel h3 { font-size: 17px; margin-bottom: 4px; }
.panel li { margin-bottom: 4px; }
.warn { background: var(--warn-bg); color: var(--warn-text); border-radius: 5px; padding: 10px 12px; }
.note, .small { color: var(--muted); }
.small { font-size: 15px; }
.hero .small { color: inherit; }
code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 0.92em; overflow-wrap: anywhere; }
dt { font-weight: 600; margin-top: 12px; }
dd { margin: 2px 0 0; color: var(--muted); }

table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-top: 1px solid var(--line); }
th { font-weight: 600; }

.foot { color: var(--muted); font-size: 15px; padding-top: 16px; padding-bottom: 32px; }
.foot a { color: inherit; }
