/*!
 * Light theme
 * Activated by <html data-theme="light"> (see assets/dist/js/theme-switch.js).
 * Most of the site's utilities read Bootstrap's RGB variables, so flipping
 * "white" and "light" to dark ink turns text, borders and patterns around in one place.
 */
html[data-theme="light"] {
  color-scheme: light;
  --bs-body-color: #0d1b2e;
  --bs-body-color-rgb: 13, 27, 46;
  --bs-body-bg: #f5fffb;
  --bs-body-bg-rgb: 245, 255, 251;
  --bs-emphasis-color: #0d1b2e;
  --bs-emphasis-color-rgb: 13, 27, 46;
  --bs-secondary-color: rgba(13, 27, 46, 0.68);
  --bs-tertiary-color: rgba(13, 27, 46, 0.5);
  --bs-secondary-bg: #e6edf5;
  --bs-tertiary-bg: #edf2f8;
  --bs-border-color: rgba(13, 27, 46, 0.14);
  --bs-heading-color: #0d1b2e;

  /* "white" / "light" utilities become dark ink */
  --bs-white: #0d1b2e;
  --bs-white-rgb: 13, 27, 46;
  --bs-light: #0d1b2e;
  --bs-light-rgb: 13, 27, 46;

  /* deeper brand green so text and lines stay readable on a light page */
  --bs-primary: #00a37a;
  --bs-primary-rgb: 0, 163, 122;
  --bs-primary-text-emphasis: #006b50;
  --bs-link-color: #00875f;
  --bs-link-color-rgb: 0, 135, 95;
  --bs-link-hover-color: #006b50;
  --bs-link-hover-color-rgb: 0, 107, 80;

  --bs-dark: #0d1b2e;
  --bs-dark-rgb: 13, 27, 46;
}

html[data-theme="light"] body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

/* while the theme switches, every transition is paused for a frame so the whole page changes at once
   (animating colours on every element made the switch slow and left it half-way on busy pages) */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

/* ---------- style.css overrides ---------- */
html[data-theme="light"] .nav { --bs-nav-link-color: rgba(13, 27, 46, 0.55); }
html[data-theme="light"] .nav-pills { --bs-nav-pills-link-active-color: #fff; }
html[data-theme="light"] .marquee-track { color: rgba(13, 27, 46, 0.55); }
html[data-theme="light"] .mobile-bottom-nav .nav-link.active { color: #fff; }
html[data-theme="light"] .text-white-50 { color: rgba(13, 27, 46, 0.5) !important; }
@media (max-width: 991.98px) {
  html[data-theme="light"] header { border-bottom-color: rgba(13, 27, 46, 0.1); }
}
html[data-theme="light"] .fui-card-graph:hover:not(.active),
html[data-theme="light"] .fui-card-graph.active {
  background: linear-gradient(90deg, rgba(253, 181, 0, 0.22) 0%, #ffffff 100%);
}

/* tooltips: dark chip on a light page */
html[data-theme="light"] .tooltip { --bs-tooltip-bg: #0d1b2e; --bs-tooltip-color: #fff; }

/* text on green or dark fills is white */
/* (solid fills only; tinted fills with bg-opacity-* keep dark text) */
html[data-theme="light"] .bg-primary:not([class*="bg-opacity-"]),
html[data-theme="light"] .bg-primary:not([class*="bg-opacity-"]) .text-dark,
html[data-theme="light"] .bg-primary.text-dark:not([class*="bg-opacity-"]),
html[data-theme="light"] .bg-primary:not([class*="bg-opacity-"]) .text-black,
html[data-theme="light"] .bg-primary:not([class*="bg-opacity-"]) .text-body,
html[data-theme="light"] .bg-dark:not([class*="bg-opacity-"]),
html[data-theme="light"] .bg-dark:not([class*="bg-opacity-"]) .text-dark,
html[data-theme="light"] .bg-dark.text-dark:not([class*="bg-opacity-"]) { color: #fff !important; }

/* light or tinted fills: dark text */
html[data-theme="light"] [class*="bg-opacity-"].bg-primary,
html[data-theme="light"] [class*="bg-opacity-"].bg-white,
html[data-theme="light"] [class*="bg-opacity-"].bg-light { color: var(--bs-body-color); }

/* "secondary" is the page colour (used for the cut-corner brackets on buttons) */
html[data-theme="light"] {
  --bs-secondary: #f5fffb;
  --bs-secondary-rgb: 245, 255, 251;
}

/* dark media stays dark: work-card banners and chips sitting on black glass keep white text */
html[data-theme="light"] .wk-live,
html[data-theme="light"] .bg-black {
  --bs-white: #fff;
  --bs-white-rgb: 255, 255, 255;
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  --bs-body-color: #fff;
  --bs-body-color-rgb: 255, 255, 255;
}

/* active pills / tabs: brand green with dark ink */
html[data-theme="light"] .nav-pills {
  --bs-nav-pills-link-active-bg: var(--bs-primary);
  --bs-nav-pills-link-active-color: #fff;
  --bs-nav-link-hover-color: var(--bs-primary-text-emphasis);
}
html[data-theme="light"] .mobile-bottom-nav .nav-link.active { color: #fff; }
html[data-theme="light"] .btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}
html[data-theme="light"] { --bs-focus-ring-color: rgba(0, 163, 122, 0.3); }

/* page loader: deeper green so the icon, bar and label read on the light page */
html[data-theme="light"] #fui-global-loader {
  --bs-success: #007a5e;
  --bs-success-rgb: 0, 122, 94;
}
html[data-theme="light"] .fui-hud-loader .fui-sci-fi-svg {
  filter: drop-shadow(0 0 6px rgba(0, 122, 94, 0.35));
}
html[data-theme="light"] .fui-hud-loader .fui-small-fill { box-shadow: 0 0 6px rgba(0, 122, 94, 0.45); }
html[data-theme="light"] .fui-hud-loader .fui-status-text { opacity: 1; }

/* swap elements per theme: .theme-dark-only / .theme-light-only */
.theme-light-only { display: none !important; }
html[data-theme="light"] .theme-dark-only { display: none !important; }
html[data-theme="light"] .theme-light-only { display: inline-block !important; }

/* About hero "Open to" badges: a soft green lift instead of the dark-mode black shadow */
html[data-theme="light"] .am-float {
  box-shadow: 0 4px 14px -4px rgba(0, 96, 72, 0.18), 0 1px 2px rgba(0, 96, 72, 0.08);
  background-color: rgba(255, 255, 255, 0.85) !important;
}

/* About awards panel */
html[data-theme="light"] {
  --bs-warning: #a77a12;
  --bs-warning-rgb: 167, 122, 18;
}
html[data-theme="light"] .am-award-title {
  background-image: linear-gradient(90deg, #8a6200, #d9a63a, #8a6200);
}
html[data-theme="light"] .am-award-cert {
  box-shadow: 0 10px 26px -12px rgba(120, 88, 10, 0.45), 0 0 0 1px rgba(167, 122, 18, 0.3);
}

/* particles and animated fields (hero particles, About fields, work-card fields): drawn a little deeper on the light page */
html[data-theme="light"] #particle-canvas,
html[data-theme="light"] .am-field,
html[data-theme="light"] .am-photo-dots {
  filter: brightness(0.7) saturate(1.5) contrast(1.15);
}
html[data-theme="light"] #particle-canvas { filter: brightness(0.5) saturate(1.8) contrast(1.2); }

/* loader label: solid ink with a gentle pulse (the dark-mode glow blink fades it to 30%) */
html[data-theme="light"] .fui-hud-loader .fui-status-text { color: #00664f; font-weight: 700; animation: lp-blink 2.5s infinite; }
html[data-theme="light"] .fui-hud-loader .fui-sci-fi-svg [stroke] { stroke: #00664f !important; }
@keyframes lp-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
