/* StuxieDev Projects — shared stylesheet
   The bi theme from stuxie.dev (StuxieDev/Website, public/static/css/site.css): its palette, the bi-flag gradient
   (pink, purple, blue) for highlights, IBM Plex Sans for body copy and JetBrains Mono for headings. Dark by
   default, light with the system preference or <html data-theme="light">. */

/* Self-hosted variable fonts (SIL Open Font License, see assets/fonts/OFL-*.txt), so the site makes no
   third-party requests. The same files stuxie.dev serves. */
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/ibm-plex-sans.woff2") format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #120915;
  --bg-raised: #190d1e;
  --bg-card: #1e1124;
  --bg-card-hover: #28172f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f7eff8;
  --text-muted: #bea7c2;
  --text-faint: #8f7a94;
  --accent: #9b4f96;
  --accent-rgb: 155, 79, 150;
  --accent-bright: #d382cd;
  --accent-pink: #d60270;
  --accent-pink-rgb: 214, 2, 112;
  --accent-blue-rgb: 63, 109, 240;
  --accent-soft: rgba(155, 79, 150, 0.16);
  --accent-grad: linear-gradient(100deg, #e0157e 0%, #b45cae 50%, #3f6df0 100%);
  --link-hover: #e6a8e0;
  --header-bg: rgba(18, 9, 21, 0.8);
  --ghost-bg: rgba(255, 255, 255, 0.02);
  --ok: #34d399; --ok-rgb: 52, 211, 153;
  --warn: #f0b429; --warn-rgb: 240, 180, 41;
  --bad: #ff6b61; --bad-rgb: 255, 107, 97;
  --soon: #b98cff; --soon-rgb: 185, 140, 255;
  --maint: #f0883e; --maint-rgb: 240, 136, 62;
  --tmpl: #7cb7ff; --tmpl-rgb: 96, 165, 250;
  --off: #a8a2ad; --off-rgb: 156, 160, 172;
  --radius: 16px;
  --container: 1120px;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fbf7fc;
    --bg-raised: #f4ecf6;
    --bg-card: #ffffff;
    --bg-card-hover: #f6eff8;
    --border: rgba(40, 10, 45, 0.1);
    --border-strong: rgba(40, 10, 45, 0.2);
    --text: #1e0f22;
    --text-muted: #634f68;
    --text-faint: #6e5b73;
    --accent: #8b3d85;
    --accent-rgb: 139, 61, 133;
    --accent-bright: #8b3d85;
    --accent-pink: #b0025c;
    --accent-pink-rgb: 176, 2, 92;
    --accent-soft: rgba(139, 61, 133, 0.1);
    --accent-grad: linear-gradient(100deg, #e0157e 0%, #b45cae 50%, #3f6df0 100%);
    --link-hover: #b0025c;
    --header-bg: rgba(251, 247, 252, 0.84);
    --ghost-bg: rgba(0, 0, 0, 0.02);
    --ok: #0f7a55; --ok-rgb: 15, 122, 85;
    --warn: #9a6a00; --warn-rgb: 154, 106, 0;
    --bad: #c62828; --bad-rgb: 198, 40, 40;
    --soon: #6b3fc4; --soon-rgb: 107, 63, 196;
    --maint: #b8530f; --maint-rgb: 184, 83, 15;
    --tmpl: #1a5fb4; --tmpl-rgb: 26, 95, 180;
    --off: #5f5866; --off-rgb: 95, 88, 102;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf7fc;
  --bg-raised: #f4ecf6;
  --bg-card: #ffffff;
  --bg-card-hover: #f6eff8;
  --border: rgba(40, 10, 45, 0.1);
  --border-strong: rgba(40, 10, 45, 0.2);
  --text: #1e0f22;
  --text-muted: #634f68;
  --text-faint: #6e5b73;
  --accent: #8b3d85;
  --accent-rgb: 139, 61, 133;
  --accent-bright: #8b3d85;
  --accent-pink: #b0025c;
  --accent-pink-rgb: 176, 2, 92;
  --accent-soft: rgba(139, 61, 133, 0.1);
  --accent-grad: linear-gradient(100deg, #e0157e 0%, #b45cae 50%, #3f6df0 100%);
  --link-hover: #b0025c;
  --header-bg: rgba(251, 247, 252, 0.84);
  --ghost-bg: rgba(0, 0, 0, 0.02);
  --ok: #0f7a55; --ok-rgb: 15, 122, 85;
  --warn: #9a6a00; --warn-rgb: 154, 106, 0;
  --bad: #c62828; --bad-rgb: 198, 40, 40;
  --soon: #6b3fc4; --soon-rgb: 107, 63, 196;
  --maint: #b8530f; --maint-rgb: 184, 83, 15;
  --tmpl: #1a5fb4; --tmpl-rgb: 26, 95, 180;
  --off: #5f5866; --off-rgb: 95, 88, 102;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .brand, .btn { font-family: var(--font-display); }
h1, h2, h3 { letter-spacing: -0.03em; }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 6px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Site banners (site-banner.css) and footer brand block (brand-footer.css), mapped to
   the site's colours. The sticky header moves down by the banners' height. Both follow
   the page theme (system preference). */
.site-banners {
  --banner-page-bg: var(--bg);
  --banner-text: var(--text);
  --banner-site: var(--accent-bright);
  --banner-site-light: var(--accent-bright);
}
.site-footer .container.footer-stux { flex-direction: column; justify-content: center; margin-top: 18px; gap: 0; }
.brand-footer { --text-muted: var(--text-muted); --accent: var(--accent-bright); }
.copyright-glyph { vertical-align: -1px; }

/* Header */
.site-header {
  position: sticky;
  top: var(--banner-h, 0px);
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; } /* already round with a transparent background: rounding it would clip the badge */
.brand .brand-sub { font-weight: 600; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links {
  display: flex;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.nav-links a {
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--accent-bright); }
.bc-sep { opacity: 0.5; }
.bc-cur { color: var(--text-muted); }

/* Hero */
.hero {
  position: relative;
  padding: 104px 0 72px;
  text-align: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -120px 0 0;
  z-index: -1;
  background:
    radial-gradient(560px 300px at 24% 18%, rgba(var(--accent-pink-rgb), 0.2), transparent 70%),
    radial-gradient(600px 320px at 50% 30%, rgba(var(--accent-rgb), 0.22), transparent 70%),
    radial-gradient(560px 300px at 78% 38%, rgba(var(--accent-blue-rgb), 0.16), transparent 70%);
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
/* The eyebrow doubles as a live status badge (data-status-eyebrow, filled by main.js): the eyebrow's size and
   shape, a status badge's colours and dot, and only the state as its text. Until the status loads, or if it can't,
   it stays a plain eyebrow. */
.hero .eyebrow[data-status-eyebrow] { display: inline-flex; align-items: center; gap: 8px; transition: color 0.2s, background 0.2s, border-color 0.2s; }
.hero .eyebrow.up { color: var(--ok); background: rgba(var(--ok-rgb), 0.1); border-color: rgba(var(--ok-rgb), 0.3); }
.hero .eyebrow.degraded { color: var(--warn); background: rgba(var(--warn-rgb), 0.1); border-color: rgba(var(--warn-rgb), 0.3); }
.hero .eyebrow.down { color: var(--bad); background: rgba(var(--bad-rgb), 0.1); border-color: rgba(var(--bad-rgb), 0.35); }
.hero .eyebrow.up::before, .hero .eyebrow.degraded::before, .hero .eyebrow.down::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
}
.hero .eyebrow.up::before { animation: badge-pulse 2s ease-out infinite; }
.hero .eyebrow[data-status-eyebrow]:hover { filter: brightness(1.12); }
.eyebrow-state[hidden], .eyebrow-label[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .hero .eyebrow.up::before { animation: none; } }
.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.08rem;
}
.hero .actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero-stats div { text-align: center; }
.hero-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}
.hero-stats span { font-size: 0.82rem; color: var(--text-faint); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px -8px rgba(var(--accent-pink-rgb), 0.5);
}
.btn-primary:hover { box-shadow: 0 10px 28px -6px rgba(var(--accent-pink-rgb), 0.6); }
.btn-ghost { color: var(--text); background: var(--ghost-bg); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-season { font-family: var(--font-display); cursor: pointer; }
.btn-season[hidden] { display: none; }
.hero .season-note { margin-top: 14px; font-size: 0.8rem; color: var(--text-faint); }
.hero .season-note a { color: var(--accent-bright); }

/* Sections */
.section { padding: 72px 0; }
.section-head { margin-bottom: 36px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2rem); font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); margin: 0; }
.subhead {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 56px 0 20px;
}
.subhead::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.subhead:first-of-type { margin-top: 0; }

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -20px rgba(var(--accent-rgb), 0.55);
}
.project-card .project-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Icons: every icon renders into a fixed square box and is scaled with
   object-fit, so non-square or oddly padded source images are never
   stretched or squashed. */
.project-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 14px;
}
/* For icons drawn on a transparent background (no tile of their own). */
.project-card h3 { margin: 0; font-size: 1.12rem; font-weight: 600; line-height: 1.3; }
.project-card .owner { font-size: 0.72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px; }
.project-card .owner a { color: inherit; text-decoration: none; }
.project-card .owner a:hover, .project-card .owner a:focus-visible { text-decoration: underline; }
.project-card .project-tagline { color: var(--text-faint); font-size: 0.84rem; margin-top: 2px; line-height: 1.4; }
.project-card p.desc { color: var(--text-muted); font-size: 0.93rem; margin: 0; flex-grow: 1; }
.project-card .stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pill {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.project-card .project-links {
  display: flex;
  gap: 18px;
  font-size: 0.86rem;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.project-card .project-links a {
  color: var(--accent-bright);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.project-card .project-links a::after { content: "\2197"; font-size: 0.8em; opacity: 0.7; transition: transform 0.15s; }
.project-card .project-links a:hover { color: var(--link-hover); }
.project-card .project-links a:hover::after { transform: translate(2px, -2px); }

/* Two cards per row (Featured, More projects) */
.project-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Featured cards: bigger icon and a soft accent border */
.project-card.featured {
  padding: 28px;
  border-color: rgba(var(--accent-rgb), 0.45);
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(var(--accent-rgb), 0.14), transparent 70%),
    var(--bg-card);
}
.project-card.featured .project-icon { width: 64px; height: 64px; flex-basis: 64px; border-radius: 16px; }
.project-card.featured h3 { font-size: 1.25rem; }

/* Compact cards for smaller scripts/tools */
.project-grid.compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.project-grid.compact .project-card { padding: 20px; gap: 12px; }
.project-grid.compact .project-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
.project-grid.compact h3 { font-size: 1rem; }
.project-grid.compact p.desc { font-size: 0.88rem; }

.badge-status {
  font-family: var(--font-display);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: auto;
}
.badge-status.live { background: rgba(var(--ok-rgb), 0.1); color: var(--ok); border: 1px solid rgba(var(--ok-rgb), 0.3); }
.badge-status.building { background: rgba(var(--warn-rgb), 0.1); color: var(--warn); border: 1px solid rgba(var(--warn-rgb), 0.3); }
.badge-status.archived, .badge-status.discontinued { background: rgba(var(--off-rgb), 0.1); color: var(--off); border: 1px solid rgba(var(--off-rgb), 0.3); }

/* About / skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
}
.skill-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.skill-chip:hover { border-color: var(--accent); color: var(--text); }

/* Contact */
.contact-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 44px 28px;
  border-radius: 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(var(--accent-rgb), 0.22), transparent 70%),
    var(--bg-card);
}
.contact-card h2 { font-size: clamp(1.5rem, 3.5vw, 1.9rem); margin: 0 0 8px; }
.contact-card p { color: var(--text-muted); margin: 0 0 26px; }
.contact-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 40px;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a:hover { color: var(--accent-bright); }

/* Legal pages */
.page-hero { padding: 56px 0 32px; }
.page-title { font-size: 2rem; margin: 8px 0 10px; }
.page-desc { color: var(--text-muted); max-width: 640px; }

.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.legal-card:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.legal-card-name { font-family: var(--font-display); font-weight: 600; margin-bottom: 4px; }
.legal-card-desc { color: var(--text-muted); font-size: 0.85rem; }

.prose-page { max-width: 720px; margin: 0 auto; }
.prose-meta { color: var(--text-faint); font-size: 0.82rem; margin-bottom: 28px; }
.prose-body h2 { font-size: 1.25rem; margin: 36px 0 12px; }
.prose-body h2:first-child { margin-top: 0; }
.prose-body p { color: var(--text-muted); }
.prose-body a { color: var(--accent-bright); }
.prose-body a:hover { text-decoration: underline; }

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 20px;
  margin: 24px 0;
}
.info-card-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.info-card-row.last, .info-card-row:last-child { border-bottom: none; }
.info-card-label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.info-card-value { display: block; color: var(--text-muted); font-size: 0.88rem; }

@media (max-width: 640px) {
  .site-header .container { height: auto; padding: 12px 16px; flex-direction: column; gap: 8px; }
  .nav-links { gap: 2px; flex-wrap: wrap; justify-content: center; }
  .container { padding: 0 16px; }
  .hero { padding: 56px 0 44px; }
  .hero-stats { gap: 28px; }
  .section { padding: 48px 0; }
  .project-grid, .project-grid.compact, .project-grid.two-up { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Discontinued projects: dimmed, with a short note on why */
.project-card.discontinued { background: transparent; border-style: dashed; }
.project-card.discontinued .project-icon { filter: grayscale(0.85); opacity: 0.7; }
.project-card.discontinued h3 { color: var(--text-muted); }
.project-card.discontinued:hover { background: var(--bg-card); }
.project-card.discontinued:hover .project-icon { filter: none; opacity: 1; }
.discontinued-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
  padding-left: 10px;
  border-left: 2px solid var(--border-strong);
}

/* Footer: the StuxieDev icon beside the copyright line. */
.footer-copy { display: inline-flex; align-items: center; gap: 10px; }

/* Footer: "Your kat", the switcher for kat.stuxie.dev's pixel kat (kat.js wires it up and shows it). */
.kat-picker { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.kat-picker[hidden] { display: none; }
.kat-picker select {
  font: inherit; font-size: 0.8rem; color: var(--text); background-color: var(--bg-card);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 26px 4px 12px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.kat-picker select:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* One status badge per card, above the description. Precedence (first wins):
   discontinued, template, maintenance, development, soon, then the live status from main.js. */
.project-card > .badge-status { align-self: flex-start; margin-left: 0; }
.badge-status { display: inline-flex; align-items: center; gap: 6px; }
.badge-status[hidden] { display: none; }
.badge-status.soon { background: rgba(var(--soon-rgb), 0.12); color: var(--soon); border: 1px solid rgba(var(--soon-rgb), 0.35); }
.badge-status.maintenance { background: rgba(var(--maint-rgb), 0.12); color: var(--maint); border: 1px solid rgba(var(--maint-rgb), 0.35); }
.badge-status.template { background: rgba(var(--tmpl-rgb), 0.1); color: var(--tmpl); border: 1px solid rgba(var(--tmpl-rgb), 0.3); }
.badge-status.up { background: rgba(var(--ok-rgb), 0.1); color: var(--ok); border: 1px solid rgba(var(--ok-rgb), 0.3); }
.badge-status.degraded { background: rgba(var(--warn-rgb), 0.1); color: var(--warn); border: 1px solid rgba(var(--warn-rgb), 0.3); }
.badge-status.down { background: rgba(var(--bad-rgb), 0.1); color: var(--bad); border: 1px solid rgba(var(--bad-rgb), 0.35); }
/* Glyphs are the site banner's wrench and rocket, plus code brackets for In development (one each), as masks so they take the badge colour.
   Exactly one icon per badge: a glyph for soon/maintenance/building, the ::before dot for live states, none otherwise. */
.badge-ico { display: none; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
.badge-status.soon .badge-ico, .badge-status.maintenance .badge-ico, .badge-status.building .badge-ico { display: inline-block; }
.badge-status.building .badge-ico { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M5.2 4.2 1.4 8l3.8 3.8M10.8 4.2 14.6 8l-3.8 3.8M9.3 2.6 6.7 13.4'/%3E%3C/svg%3E"); }
.badge-status.soon .badge-ico { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 14 14'%3E%3Cg transform='rotate%2845 6 6%29'%3E%3Cpath fill-rule='evenodd' d='M6 0c2.9 1.9 3.6 5.2 2.6 8.3H3.4C2.4 5.2 3.1 1.9 6 0zM6 2.9a1.25 1.25 0 1 0 0 2.5A1.25 1.25 0 1 0 6 2.9z'/%3E%3Cpath d='M3.2 5.4 1 9.6h2.9zM8.8 5.4 11 9.6H8.1zM4.5 9h3L6 12z'/%3E%3C/g%3E%3C/svg%3E"); }
.badge-status.maintenance .badge-ico { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 14 14'%3E%3Cg transform='rotate%2845 6 6%29'%3E%3Cpath fill-rule='evenodd' d='M6 0a2.9 2.9 0 1 1 0 5.8A2.9 2.9 0 1 1 6 0zM5.05 -0.5h1.9v2.9h-1.9z'/%3E%3Crect x='4.9' y='4.6' width='2.2' height='7.4' rx='1.1'/%3E%3C/g%3E%3C/svg%3E"); }
/* Pulsing dot for live states */
.badge-status.up::before, .badge-status.degraded::before, .badge-status.down::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
}
.badge-status.up::before { animation: badge-pulse 2s ease-out infinite; }
@keyframes badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--ok-rgb), 0.55); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(var(--ok-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) { .badge-status.up::before { animation: none; } }

/* Footer version link (filled from VERSION.md by main.js) */
[data-site-version] { font-family: var(--font-mono, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* Changelogs page (rendered from CHANGELOG.md by changelogs.js) */
.cl-wrap { max-width: 820px; margin: 0 auto; }
.cl-current { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 20px; }
.cl-current:has(#cl-version:empty) { display: none; }
.cl-current #cl-version { font-family: var(--font-mono, Consolas, monospace); color: var(--text); }
.cl-entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px 10px; margin: 0 0 14px; }
.cl-entry:first-child { border-color: var(--accent); }
.cl-entry h2 { margin: 0 0 10px; font-size: 1.2rem; font-family: var(--font-mono, Consolas, monospace); letter-spacing: 0; }
.cl-entry:first-child h2::after { content: "Latest"; margin-left: 10px; vertical-align: 2px; font: 700 0.7rem var(--font-sans, sans-serif); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 999px; padding: 3px 8px; }
.cl-label { display: inline-block; margin: 6px 0 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 5px; color: var(--cl, #8a8a94); background: color-mix(in srgb, var(--cl, #8a8a94) 14%, transparent); border: 1px solid color-mix(in srgb, var(--cl, #8a8a94) 45%, transparent); }
.cl-label-added { --cl: #2ecc71; }
.cl-label-changed { --cl: #3ba7ff; }
.cl-label-fixed { --cl: #ffa64d; }
.cl-label-removed { --cl: #ff4d4d; }
.cl-label-security { --cl: #b06bff; }
.cl-label-deprecated { --cl: #8a8a94; }
:root[data-theme="light"] .cl-label-added, :root.theme-light .cl-label-added { --cl: #1e8449; }
:root[data-theme="light"] .cl-label-changed, :root.theme-light .cl-label-changed { --cl: #1a6fc0; }
:root[data-theme="light"] .cl-label-fixed, :root.theme-light .cl-label-fixed { --cl: #b8650f; }
:root[data-theme="light"] .cl-label-removed, :root.theme-light .cl-label-removed { --cl: #c62828; }
:root[data-theme="light"] .cl-label-security, :root.theme-light .cl-label-security { --cl: #7b3fc4; }
:root[data-theme="light"] .cl-label-deprecated, :root.theme-light .cl-label-deprecated { --cl: #5f5f68; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not(.theme-dark) .cl-label-added { --cl: #1e8449; }
  :root:not([data-theme="dark"]):not(.theme-dark) .cl-label-changed { --cl: #1a6fc0; }
  :root:not([data-theme="dark"]):not(.theme-dark) .cl-label-fixed { --cl: #b8650f; }
  :root:not([data-theme="dark"]):not(.theme-dark) .cl-label-removed { --cl: #c62828; }
  :root:not([data-theme="dark"]):not(.theme-dark) .cl-label-security { --cl: #7b3fc4; }
  :root:not([data-theme="dark"]):not(.theme-dark) .cl-label-deprecated { --cl: #5f5f68; }
}
.cl-list { margin: 0 0 10px; padding-left: 1.2em; color: var(--text-muted); font-size: 0.95rem; }
.cl-list li { margin: 0 0 6px; overflow-wrap: anywhere; }
.cl-list code, .cl-msg code { font-family: var(--font-mono, Consolas, monospace); font-size: 0.88em; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.cl-list a, .cl-msg a { color: var(--accent-bright, var(--text)); text-decoration: underline; }
.cl-list strong { color: var(--text); }
.cl-h4 { margin: 10px 0 6px; font-size: 0.95rem; }
.cl-msg { color: var(--text-muted); }


/* Long names wrap at word boundaries, or anywhere as a last resort */
.project-card h3 { overflow-wrap: anywhere; }
.project-card .project-top > div { min-width: 0; }

/* Light/dark toggle (main.js): shows the theme it switches to, a sun on dark and a moon on light. Until it's used the site follows
   the system theme; after that <html data-theme> holds the choice. */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: 4px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--text-muted);
  cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .ico-moon { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .ico-sun { display: none; }
}
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
