/* firefly: signature marks for the real site markup. Tokens live in
   design-system.css. Every rule starts with [data-theme="firefly"].

   Firefly (2026-11-26): the night field Firefly launched with, site-wide.
   A deep navy sky with indigo washes (firefly.css classic ground), glowing
   motes that drift and pulse behind the page (two fixed layers, CSS only),
   soft amber halos instead of shadows, Instrument Serif italic headings
   over Inter. Under this theme /firefly shows its Original style. */

/* ---------- Page ---------- */
[data-theme="firefly"] {
  scrollbar-color: #222c5a #03050f;
}
[data-theme="firefly"] body {
  background:
    radial-gradient(circle at 20% 12%, rgba(45, 68, 139, 0.32), transparent 48%),
    radial-gradient(circle at 82% 78%, rgba(30, 41, 84, 0.55), transparent 55%),
    var(--cm-bg);
  background-attachment: fixed;
}
/* The motes: small radial glows on two fixed layers. ::before drifts up
   and pulses; ::after drifts the other way, out of phase. They sit behind
   everything (z-index -1) and never take clicks. */
[data-theme="firefly"] body::before,
[data-theme="firefly"] body::after {
  content: "";
  position: fixed;
  inset: -40px;
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat;
}
[data-theme="firefly"] body::before {
  background-image:
    radial-gradient(circle at 12% 22%, rgba(246, 242, 179, 0.9) 0 1.5px, rgba(255, 214, 132, 0.28) 3px, transparent 12px),
    radial-gradient(circle at 64% 14%, rgba(214, 255, 139, 0.85) 0 1.2px, rgba(214, 255, 139, 0.22) 3px, transparent 10px),
    radial-gradient(circle at 38% 68%, rgba(246, 242, 179, 0.85) 0 1.8px, rgba(255, 214, 132, 0.25) 4px, transparent 14px),
    radial-gradient(circle at 86% 52%, rgba(255, 214, 132, 0.8) 0 1.4px, rgba(255, 193, 111, 0.22) 3px, transparent 11px);
  background-size: 520px 460px;
  animation: firefly-drift 38s linear infinite, firefly-pulse var(--cm-breath) ease-in-out infinite alternate;
}
[data-theme="firefly"] body::after {
  background-image:
    radial-gradient(circle at 24% 80%, rgba(246, 242, 179, 0.8) 0 1.2px, rgba(255, 214, 132, 0.2) 3px, transparent 10px),
    radial-gradient(circle at 72% 36%, rgba(214, 255, 139, 0.75) 0 1.5px, rgba(214, 255, 139, 0.2) 3px, transparent 12px),
    radial-gradient(circle at 50% 8%, rgba(255, 214, 132, 0.75) 0 1px, rgba(255, 193, 111, 0.2) 2px, transparent 9px);
  background-size: 690px 610px;
  animation: firefly-drift-2 52s linear infinite, firefly-pulse calc(var(--cm-breath) * 0.73) ease-in-out infinite alternate-reverse;
}
@keyframes firefly-drift {
  from { background-position: 0 0; }
  to { background-position: 60px -460px; }
}
@keyframes firefly-drift-2 {
  from { background-position: 0 0; }
  to { background-position: -90px -610px; }
}
@keyframes firefly-pulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  [data-theme="firefly"] body::before,
  [data-theme="firefly"] body::after {
    animation: none;
    opacity: 0.7;
  }
}
[data-theme="firefly"] ::selection {
  background: #2d448b;
  color: #fffdf0;
}
[data-theme="firefly"] input[type="checkbox"],
[data-theme="firefly"] input[type="radio"],
[data-theme="firefly"] input[type="range"],
[data-theme="firefly"] progress {
  accent-color: var(--cm-accent-2);
}

/* Headings: the serif italic, with a faint glow. */
[data-theme="firefly"] h1,
[data-theme="firefly"] h2,
[data-theme="firefly"] h3 {
  font-style: italic;
  line-height: 1.12;
  text-shadow: 0 0 22px rgba(255, 214, 132, 0.25);
}

/* ---------- Header: a dark strip with one row of tiny lights ---------- */
[data-theme="firefly"] .app-header {
  background: var(--cm-surface);
  border-bottom: 1px solid #222c5a;
  box-shadow: 0 12px 30px -18px rgba(255, 214, 132, 0.35);
}
[data-theme="firefly"] .logo,
[data-theme="firefly"] .logo span {
  color: var(--cm-brand);
  text-shadow: 0 0 16px rgba(255, 214, 132, 0.5);
}
[data-theme="firefly"] .mobile-nav-menu {
  background: var(--cm-bg-2);
  border-bottom: 1px solid #222c5a;
}
[data-theme="firefly"] .theme-menu__button {
  background: var(--cm-bg-2);
  border-color: #2d448b;
  box-shadow: 0 0 16px -6px rgba(246, 242, 179, 0.6);
}
[data-theme="firefly"] .theme-menu__button:focus-visible {
  box-shadow: var(--cm-focus);
}
[data-theme="firefly"] .theme-switch--compact {
  border: 1px solid #222c5a;
  background: var(--cm-bg-2);
}
[data-theme="firefly"] .theme-switch input:checked + label {
  box-shadow: 0 0 16px -4px rgba(214, 255, 139, 0.7);
}
[data-theme="firefly"] .theme-switch__swatch {
  box-shadow: inset 0 0 0 1px rgba(246, 242, 179, 0.25);
}

/* ---------- Buttons: lit from inside ---------- */
[data-theme="firefly"] .btn {
  box-shadow: 0 0 22px -6px rgba(246, 242, 179, 0.75);
}
[data-theme="firefly"] .btn:hover {
  background: #fffbd0;
  box-shadow: 0 0 30px -4px rgba(246, 242, 179, 0.9);
}
[data-theme="firefly"] .btn.secondary,
[data-theme="firefly"] .home-page .btn.secondary,
[data-theme="firefly"] .btn-secondary {
  background: transparent;
  color: var(--cm-link);
  border: 1px solid rgba(214, 255, 139, 0.55);
  box-shadow: 0 0 18px -8px rgba(214, 255, 139, 0.7);
}
[data-theme="firefly"] .btn.secondary:hover,
[data-theme="firefly"] .home-page .btn.secondary:hover,
[data-theme="firefly"] .btn-secondary:hover {
  background: rgba(214, 255, 139, 0.1);
  color: var(--cm-link-hover);
}
[data-theme="firefly"] .btn:focus-visible {
  box-shadow: var(--cm-focus);
}

/* ---------- Chips ---------- */
[data-theme="firefly"] .chip:not(.active) {
  background: rgba(14, 20, 48, 0.7);
  border-color: #222c5a;
}
[data-theme="firefly"] .chip.active,
[data-theme="firefly"] .filter-button.active {
  box-shadow: 0 0 16px -4px rgba(214, 255, 139, 0.7);
}

/* ---------- Home hero ---------- */
[data-theme="firefly"] .home-eyebrow {
  color: var(--cm-link);
}
[data-theme="firefly"] .home-eyebrow::before {
  content: "\2022\00a0";
  color: #f6f2b3;
  text-shadow: 0 0 8px #f6f2b3, 0 0 16px #ffd684;
}
[data-theme="firefly"] .home-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
}
[data-theme="firefly"] .art-garden {
  display: none;
}
/* A night meadow with a handful of fireflies under a crescent moon. */
[data-theme="firefly"] .home-hero__art {
  aspect-ratio: 420 / 340;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 340'%3E%3Cdefs%3E%3CradialGradient id='f'%3E%3Cstop offset='0' stop-color='%23fffde0'/%3E%3Cstop offset='.18' stop-color='%23f6f2b3' stop-opacity='.95'/%3E%3Cstop offset='.45' stop-color='%23ffd684' stop-opacity='.35'/%3E%3Cstop offset='1' stop-color='%23ffd684' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='l'%3E%3Cstop offset='0' stop-color='%23f4ffd9'/%3E%3Cstop offset='.2' stop-color='%23d6ff8b' stop-opacity='.9'/%3E%3Cstop offset='.5' stop-color='%23d6ff8b' stop-opacity='.25'/%3E%3Cstop offset='1' stop-color='%23d6ff8b' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='w' cx='.3' cy='.25'%3E%3Cstop offset='0' stop-color='%232d448b' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%232d448b' stop-opacity='0'/%3E%3C/radialGradient%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23040615'/%3E%3Cstop offset='1' stop-color='%231e2954'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='10' y='10' width='400' height='320' rx='26' fill='url(%23s)'/%3E%3Crect x='10' y='10' width='400' height='320' rx='26' fill='url(%23w)'/%3E%3Ccircle cx='318' cy='70' r='22' fill='%23f6f2dc' opacity='.85'/%3E%3Ccircle cx='330' cy='64' r='20' fill='%230b1029'/%3E%3Cpath d='M10 270c40-18 70-10 100 4s70 14 110-6 80-20 120-4 60 12 70 6v60H10z' fill='%2303050f'/%3E%3Cpath d='M40 286l6-40 4 40M70 280l-4-34 10 34M300 282l8-46 2 46M330 280l-6-30 10 30M360 284l4-38 4 38' stroke='%2303050f' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='120' cy='120' r='30' fill='url(%23f)'/%3E%3Ccircle cx='210' cy='170' r='40' fill='url(%23f)'/%3E%3Ccircle cx='290' cy='130' r='22' fill='url(%23l)'/%3E%3Ccircle cx='90' cy='210' r='20' fill='url(%23l)'/%3E%3Ccircle cx='250' cy='230' r='26' fill='url(%23f)'/%3E%3Ccircle cx='170' cy='80' r='14' fill='url(%23l)'/%3E%3Ccircle cx='350' cy='200' r='18' fill='url(%23f)'/%3E%3Ccircle cx='60' cy='70' r='10' fill='url(%23f)'/%3E%3Cpath d='M120 120q40 30 90 50t80-40' stroke='%23ffd684' stroke-opacity='.25' stroke-dasharray='2 6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Home app cards: lanterns in the dark ---------- */
[data-theme="firefly"] .app-card {
  background: linear-gradient(180deg, var(--cm-surface), #0b1029);
  border: 1px solid #222c5a;
  box-shadow: 0 30px 60px -36px rgba(255, 214, 132, 0.45);
}
[data-theme="firefly"] .app-card:hover {
  border-color: #3a4a8c;
  box-shadow: 0 0 0 1px rgba(246, 242, 179, 0.25), 0 30px 70px -28px rgba(255, 214, 132, 0.6);
}
/* Card art: the pre-rebrand gold-on-black set, whose gold already glows
   like a firefly. Wired like Night's --nt (pages/index.astro). */
[data-theme="firefly"] .app-image-link {
  margin: 12px 12px 0;
  border-radius: var(--cm-radius-sm);
  background: #040615 var(--cl) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px #222c5a;
}
[data-theme="firefly"] .app-image-link picture {
  display: none;
}
[data-theme="firefly"] .app-chip {
  color: var(--cm-brand);
  letter-spacing: 0.04em;
}
[data-theme="firefly"] .app-pips {
  display: flex;
  gap: 5px;
}
[data-theme="firefly"] .app-pips i {
  width: 6px;
  height: 6px;
  display: block;
  border-radius: 50%;
  background: #1e2954;
}
[data-theme="firefly"] .app-pips i.on {
  background: #f6f2b3;
  box-shadow: 0 0 6px #f6f2b3, 0 0 12px #ffd684;
}
[data-theme="firefly"] .app-content h2 {
  font-size: 1.45rem;
}

/* ---------- Generic cards and panels ---------- */
[data-theme="firefly"] .card,
[data-theme="firefly"] .container {
  border-color: #222c5a;
}
[data-theme="firefly"] details > summary::marker {
  color: var(--cm-brand);
}

/* ---------- Footer: the meadow at the edge of the field ---------- */
[data-theme="firefly"] .page-footer {
  background: linear-gradient(transparent 0 5rem, var(--cm-bg-2) 5rem);
}
[data-theme="firefly"] .footer-clouds {
  top: calc(5rem - 18px);
  height: 19px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='19'%3E%3Cpath d='M0 19V12l4-9 3 9 5-11 4 11 6-8 3 8 7-10 3 10 5-7 4 7 6-11 3 11 5-6 4 6 6-10 3 10 5-8 4 8 6-9 3 9 5-7 4 7 7-11 3 11 5-6 4 6V19z' fill='%2303050f'/%3E%3C/svg%3E") 0 0 / 120px 19px repeat-x;
}
[data-theme="firefly"] .footer-ad {
  background: var(--cm-surface);
}
