/* ── HOME-PAGE THEMES ─────────────────────────────────────────────────────
   Default is style.css's :root. A theme re-sets the same tokens under <html data-theme="…">,
   which the inline script at the top of index.html applies before the page paints
   (choice stored per visitor in localStorage 'home_theme'; picker: assets/js/home-theme.js).
   The hero keeps the live sky (main.js) in every theme. */

/* The drone drawings and icons colour themselves with SVG attributes (stroke="#00d4ff" …);
   CSS outranks those, so they follow the theme without touching the markup. */
svg[stroke="#00d4ff"], svg [stroke="#00d4ff"] { stroke: var(--cyan); }
svg[fill="#00d4ff"],   svg [fill="#00d4ff"]   { fill: var(--cyan); }
svg[stroke="#00ff88"], svg [stroke="#00ff88"] { stroke: var(--green); }
svg[fill="#00ff88"],   svg [fill="#00ff88"]   { fill: var(--green); }
svg [fill="#0a0e1a"] { fill: var(--drone-body); }
svg [fill="rgba(0,255,136,0.15)"] { fill: rgba(var(--green-rgb), 0.15); }

/* Daylight: light pages; the hero, its sky and the bars over it stay as they are */
:root[data-theme="light"] {
  --bg:#f4f7fb; --bg2:#e9eff7; --bg3:#dde6f1; --card:#ffffff; --card-border:#d3dce9;
  --cyan:#0069a8; --green:#00784a; --text:#152033; --text-muted:#4b5a70;
  --cyan-rgb:0, 105, 168; --green-rgb:0, 120, 74;
  --cyan-deep:#00507f; --cyan-deep2:#00507f; --cyan-deeper:#003a5e; --green-deep:#005c39;
  --card-2:#eaf2fb; --surface:#f7f9fc; --surface-2:#ffffff; --hover:#e6eef8; --hover-2:#eef3f9; --drone-body:#ffffff;
  --heading:#0b1424; --text-soft:#2b3a50; --text-soft2:#2b3a50; --text-faint:#66758b;
  --on-accent:#fff; --avatar-fg:#fff; --ok:#00784a; --err:#c8243f;
  --ink-rgb:20, 32, 51; --shade-rgb:30, 45, 80; --nav-rgb:255, 255, 255; --muted-rgb:75, 90, 112;
}
/* Jamaica: black, green and gold */
:root[data-theme="jamaica"] {
  --bg:#030603; --bg2:#08100a; --bg3:#0c160e; --card:#0d170f; --card-border:#1f3a24;
  --cyan:#fed100; --green:#1fd65f; --text:#eef3e8; --text-muted:#9aab95;
  --cyan-rgb:254, 209, 0; --green-rgb:31, 214, 95;
  --cyan-deep:#d9b200; --cyan-deep2:#d9b200; --cyan-deeper:#c9a400; --green-deep:#009b3a;
  --card-2:#132512; --surface:#050b06; --surface-2:#060c07; --hover:#142417; --hover-2:#112014; --drone-body:#050b06;
  --heading:#fff; --text-soft:#cdd8c6; --text-soft2:#d6e2cf; --text-faint:#5c6d55;
  --on-accent:#0a0a00; --avatar-fg:#0a0a00; --ok:#1fd65f; --err:#ff5a6e;
  --ink-rgb:255, 255, 255; --shade-rgb:0, 0, 0; --nav-rgb:4, 10, 5; --muted-rgb:154, 171, 149;
}
/* Sunset: deep plum with orange and coral */
:root[data-theme="sunset"] {
  --bg:#0f0811; --bg2:#170c1a; --bg3:#1d1021; --card:#1f1124; --card-border:#3b2142;
  --cyan:#ff9d4d; --green:#ff6b93; --text:#f7ecf1; --text-muted:#b89aae;
  --cyan-rgb:255, 157, 77; --green-rgb:255, 107, 147;
  --cyan-deep:#e8743a; --cyan-deep2:#e8743a; --cyan-deeper:#e06a33; --green-deep:#d93d6b;
  --card-2:#2a1230; --surface:#0c060e; --surface-2:#12081a; --hover:#2a1630; --hover-2:#26142b; --drone-body:#0c060e;
  --heading:#fff; --text-soft:#e3cfd9; --text-soft2:#ead8e1; --text-faint:#86677e;
  --on-accent:#1a0710; --avatar-fg:#1a0710; --ok:#7ee0a1; --err:#ff5a6e;
  --ink-rgb:255, 255, 255; --shade-rgb:0, 0, 0; --nav-rgb:18, 8, 20; --muted-rgb:184, 154, 174;
}
/* Tactical: phosphor green and amber, like the flight tracker's Tactical theme */
:root[data-theme="tactical"] {
  --bg:#040702; --bg2:#080c05; --bg3:#0d130a; --card:#0c110a; --card-border:#223018;
  --cyan:#3dff6e; --green:#ffb000; --text:#d9f2d0; --text-muted:#86a07a;
  --cyan-rgb:61, 255, 110; --green-rgb:255, 176, 0;
  --cyan-deep:#22c94f; --cyan-deep2:#22c94f; --cyan-deeper:#1a9e3e; --green-deep:#d18f00;
  --card-2:#101a0c; --surface:#050904; --surface-2:#060a04; --hover:#142010; --hover-2:#111b0d; --drone-body:#050904;
  --heading:#effde9; --text-soft:#bcd8b2; --text-soft2:#c4e0ba; --text-faint:#53684a;
  --on-accent:#031000; --avatar-fg:#031000; --ok:#3dff6e; --err:#ff5a4e;
  --ink-rgb:255, 255, 255; --shade-rgb:0, 0, 0; --nav-rgb:5, 9, 3; --muted-rgb:134, 160, 122;
}

/* Daylight keeps the page behind the hero dark (the night sky shows through it), so every section
   that was see-through gets a solid light background instead. */
:root[data-theme="light"] body { background: #040612; }
:root[data-theme="light"] :is(#about, #fleet, #tools, #why, #community, footer) { background-color: var(--bg); }
:root[data-theme="light"] .tools-banner { background-color: var(--bg); }
/* …and the hero itself keeps the dark palette: white text over the live sky */
:root[data-theme="light"] #hero {
  --cyan:#00d4ff; --green:#00ff88; --cyan-rgb:0, 212, 255; --green-rgb:0, 255, 136; --cyan-deep:#0099cc;
  --text:#e8ecf4; --text-muted:#8892aa; --card-border:#1e2340; --heading:#fff; --on-accent:#000;
  --ink-rgb:255, 255, 255; --shade-rgb:0, 0, 0;
}
/* softer shadows on light cards */
:root[data-theme="light"] :is(.service-card, .fleet-card, .tool-card, .tbcard, .why-feature, .comment-card, .comment-form-wrap) {
  box-shadow: 0 1px 2px rgba(30, 45, 80, .06);
}
:root[data-theme="light"] :is(.service-card, .fleet-card, .tool-card, .tbcard):hover {
  box-shadow: 0 14px 34px rgba(30, 45, 80, .14), 0 0 0 1px rgba(var(--cyan-rgb), .18);
}

/* ── THEME PICKER (nav) ────────────────────────────────────────────────── */
.nav-theme { position: relative; }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 34px; min-width: 34px; padding: 0 .5rem; border-radius: 7px;
  background: transparent; border: 1px solid var(--card-border); color: var(--text-muted);
  font: inherit; font-size: .85rem; cursor: pointer; transition: color .2s, border-color .2s;
}
.theme-btn:hover, .theme-btn[aria-expanded="true"] { color: var(--cyan); border-color: var(--cyan); }
.theme-btn svg { width: 18px; height: 18px; flex: none; }
.theme-btn-label { display: none; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 3000; min-width: 210px;
  padding: .35rem; background: var(--surface-2); border: 1px solid var(--card-border); border-radius: 10px;
  box-shadow: 0 10px 34px rgba(var(--shade-rgb), .45);
}
.theme-menu[hidden] { display: none; }
.theme-menu-title {
  padding: .45rem .6rem .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
}
.theme-opt {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .6rem;
  background: none; border: 0; border-radius: 7px; color: var(--text); font: inherit; font-size: .88rem;
  text-align: left; cursor: pointer;
}
.theme-opt:hover { background: var(--hover); }
.theme-opt[aria-pressed="true"] { color: var(--heading); font-weight: 600; }
.theme-opt[aria-pressed="true"]::after { content: '✓'; margin-left: auto; color: var(--cyan); font-weight: 700; }
.theme-sw {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
  box-shadow: 0 0 0 3px var(--sw-bg), 0 0 0 4px rgba(var(--ink-rgb), .28);
  margin: 4px;
}
.theme-btn:focus-visible, .theme-opt:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* inside the phone menu: a labelled button, and the list opens in place */
@media (max-width: 960px) {
  .nav-links li.nav-theme { display: flex; flex-direction: column; align-items: center; }
  .theme-btn { height: 40px; padding: 0 1rem; font-size: 1rem; }
  .theme-btn-label { display: inline; }
  .theme-menu { position: static; margin-top: .7rem; width: min(280px, calc(100vw - 4rem)); box-shadow: none; }
  .theme-menu-title { display: none; }   /* the button above already says Theme */
  .theme-opt { padding: .7rem .8rem; font-size: .98rem; }
}
