/* =============================================
   CASE THEMES · light / dark for every case page
   Loaded after each case's own stylesheet.
   D = html:not([data-theme="light"])  (dark is the default)
   L = html[data-theme="light"]
   ============================================= */

/* ── Shared: theme toggle in the case nav ── */
.nav-case-right { display: flex; align-items: center; gap: 18px; }
.nav-case-right .theme-toggle { width: 56px; height: 30px; }
.nav-case-right .toggle-thumb { width: 24px; height: 24px; }
html[data-theme="light"] .nav-case-right .toggle-thumb { transform: translateX(26px); }

/* ── Shared: gallery cases (Ahead, Knobs, Creative Juice, HeliFlite)
   Brand hero stays; page chrome follows the theme ── */
body.case-gallery .project-gallery { background: var(--bg); }
body.case-gallery .project-nav-section { background: var(--bg-alt); border-top-color: var(--border); }
body.case-gallery .project-nav-section .btn-ghost { border-color: var(--border-hover); color: var(--text-muted); }
body.case-gallery .project-nav-section .btn-ghost:hover { border-color: var(--text-subtle); color: var(--text); }
body.case-gallery .footer { background: var(--bg); border-top-color: var(--border); }
body.case-gallery .footer-name,
body.case-gallery .footer-links a { color: var(--text-muted); }
body.case-gallery .footer-links a:hover { color: var(--text); }

html:not([data-theme="light"]) body.case-gallery .nav {
  background: rgba(12, 11, 18, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html:not([data-theme="light"]) body.case-gallery .nav-logo { color: #FFFFFF; }
html:not([data-theme="light"]) body.case-gallery .nav-back { color: rgba(255, 255, 255, 0.65); }
html:not([data-theme="light"]) body.case-gallery .nav-back:hover { color: #FFFFFF; }

html[data-theme="light"] body.case-gallery .nav {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(0, 0, 0, 0.07);
}
html[data-theme="light"] body.case-gallery .nav-logo { color: var(--text); }
html[data-theme="light"] body.case-gallery .nav-back { color: rgba(0, 0, 0, 0.58); }
html[data-theme="light"] body.case-gallery .nav-back:hover { color: var(--text); }

/* Dark-branded cases: keep a solid brand button in light mode */
html[data-theme="light"] body.case--heliflite .project-nav-section .btn-primary { background: #1E2154; border: none; color: #FFFFFF; }
html[data-theme="light"] body.case--heliflite .project-nav-section .btn-primary:hover { background: #252970; }

/* =============================================
   PROPELUS · dark (deep plum)
   ============================================= */
html:not([data-theme="light"]) body.case--propelus {
  --accent: #FF4DAA;
  --accent-bg: rgba(255, 77, 170, 0.10);
  --accent-border: rgba(255, 77, 170, 0.30);
  --bg:           #120A11;
  --bg-alt:       #1A0F18;
  --surface:      #22141F;
  --surface-2:    #2A1927;
  --text:         #F7F2F5;
  --text-muted:   rgba(247, 242, 245, 0.68);
  --text-subtle:  rgba(247, 242, 245, 0.44);
  --border:       rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.20);
  background: #120A11;
}
html:not([data-theme="light"]) body.case--propelus .project-nav-section { border-top-color: var(--border); }
html:not([data-theme="light"]) body.case--propelus .project-nav-section .btn-ghost { border-color: var(--border-hover); }
html:not([data-theme="light"]) body.case--propelus .footer { border-top-color: var(--border); }
html:not([data-theme="light"]) body.case--propelus .pr-finding-card,
html:not([data-theme="light"]) body.case--propelus .pr-rec,
html:not([data-theme="light"]) body.case--propelus .pr-stat-card,
html:not([data-theme="light"]) body.case--propelus .pr-takeaway { box-shadow: none; }

/* =============================================
   ABITAB · dark (deep navy)
   ============================================= */
html:not([data-theme="light"]) body.case--abitab {
  --ab-blue-pale:   #142033;
  --ab-blue-faint:  #0E1726;
  --ab-blue-light:  #9FB4D1;
  --cs-text:        #EEF2F8;
  --cs-muted:       rgba(238, 242, 248, 0.68);
  --cs-subtle:      rgba(238, 242, 248, 0.52);
  --cs-border:      rgba(255, 255, 255, 0.09);
  --ab-text-blue:   #8FB8FF;
  background: #0A111C;
}
html:not([data-theme="light"]) body.case--abitab .nav { background: rgba(10, 17, 28, 0.6); border-bottom-color: rgba(255, 255, 255, 0.08); }
html:not([data-theme="light"]) body.case--abitab .nav-logo { color: #FFFFFF; }
html:not([data-theme="light"]) body.case--abitab .nav-back { color: rgba(255, 255, 255, 0.65); }
html:not([data-theme="light"]) body.case--abitab .nav-back:hover { color: #FFFFFF; }

html:not([data-theme="light"]) body.case--abitab .project-hero--abitab {
  background: linear-gradient(150deg, #0E2140 0%, #0C1A33 40%, #0A1426 75%, #0A111C 100%);
}
html:not([data-theme="light"]) body.case--abitab .project-hero--abitab .project-hero-year,
html:not([data-theme="light"]) body.case--abitab .project-hero--abitab .project-hero-tags span { color: rgba(255, 255, 255, 0.62); border-color: rgba(255, 255, 255, 0.18); }
html:not([data-theme="light"]) body.case--abitab .project-hero--abitab .project-hero-title { color: #FFFFFF; }
html:not([data-theme="light"]) body.case--abitab .project-hero--abitab .project-hero-subtitle { color: var(--ab-text-blue); }
html:not([data-theme="light"]) body.case--abitab .project-hero--abitab .project-hero-desc { color: rgba(255, 255, 255, 0.70); }

html:not([data-theme="light"]) body.case--abitab .cs-section { background: #0A111C; }
html:not([data-theme="light"]) body.case--abitab .cs-section--alt { background: var(--ab-blue-faint); }
html:not([data-theme="light"]) body.case--abitab .cs-section--dark { background: #08254D; }
html:not([data-theme="light"]) body.case--abitab .ab-finding-card,
html:not([data-theme="light"]) body.case--abitab .cs-step:not(.cs-step--active),
html:not([data-theme="light"]) body.case--abitab .ab-ds-element-card,
html:not([data-theme="light"]) body.case--abitab .ab-steps-data-card,
html:not([data-theme="light"]) body.case--abitab .ab-critical-card { background: #131F31; }
html:not([data-theme="light"]) body.case--abitab .ab-figma-embed { background: #131F31; }
html:not([data-theme="light"]) body.case--abitab .cs-problem-card,
html:not([data-theme="light"]) body.case--abitab .ab-stat-card,
html:not([data-theme="light"]) body.case--abitab .cs-step--active { background: #0B3166; }

/* --ab-blue used as text on dark → lighter blue */
html:not([data-theme="light"]) body.case--abitab .ab-ds-element-icon,
html:not([data-theme="light"]) body.case--abitab .ab-proto-title,
html:not([data-theme="light"]) body.case--abitab .ab-steps-data-pct,
html:not([data-theme="light"]) body.case--abitab .ab-quote-card::before { color: var(--ab-text-blue); }
html:not([data-theme="light"]) body.case--abitab .cs-role-callout,
html:not([data-theme="light"]) body.case--abitab .cs-outcome-reflection,
html:not([data-theme="light"]) body.case--abitab .cs-outcome-quote { border-left-color: var(--ab-text-blue); }

html:not([data-theme="light"]) body.case--abitab .project-nav-section { background: var(--ab-blue-faint); border-top-color: var(--cs-border); }
html:not([data-theme="light"]) body.case--abitab .project-nav-section .btn-ghost { border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.65); }
html:not([data-theme="light"]) body.case--abitab .project-nav-section .btn-ghost:hover { border-color: rgba(255, 255, 255, 0.35); color: #FFFFFF; }
html:not([data-theme="light"]) body.case--abitab .project-nav-section .btn-primary { background: #2D8DFF; }
html:not([data-theme="light"]) body.case--abitab .project-nav-section .btn-primary:hover { background: #5AA6FF; }

/* =============================================
   FLEX · dark (deep green)
   ============================================= */
html:not([data-theme="light"]) body.case--flex {
  --flex-green:       #6CB54A;
  --flex-green-light: #17250F;
  --flex-green-mid:   #0F180B;
  --cs-text:          #EEF4EA;
  --cs-muted:         rgba(238, 244, 234, 0.68);
  --cs-subtle:        rgba(238, 244, 234, 0.50);
  --cs-border:        rgba(255, 255, 255, 0.09);
  background: #0A1007;
}
html:not([data-theme="light"]) body.case--flex .nav { background: rgba(10, 16, 7, 0.6); border-bottom-color: rgba(255, 255, 255, 0.08); }
html:not([data-theme="light"]) body.case--flex .nav-logo { color: #FFFFFF; }
html:not([data-theme="light"]) body.case--flex .nav-back { color: rgba(255, 255, 255, 0.65); }
html:not([data-theme="light"]) body.case--flex .nav-back:hover { color: #FFFFFF; }

html:not([data-theme="light"]) body.case--flex .project-hero--flex {
  background: linear-gradient(155deg, #1B3410 0%, #132509 40%, #0E1A08 75%, #0A1007 100%);
}
html:not([data-theme="light"]) body.case--flex .project-hero--flex .project-hero-year,
html:not([data-theme="light"]) body.case--flex .project-hero--flex .project-hero-tags span { color: rgba(255, 255, 255, 0.62); border-color: rgba(255, 255, 255, 0.18); }
html:not([data-theme="light"]) body.case--flex .project-hero--flex .project-hero-title { color: #FFFFFF; }
html:not([data-theme="light"]) body.case--flex .project-hero--flex .project-hero-desc { color: rgba(255, 255, 255, 0.70); }

html:not([data-theme="light"]) body.case--flex .cs-section { background: #0A1007; }
html:not([data-theme="light"]) body.case--flex .cs-section--alt { background: var(--flex-green-mid); }
html:not([data-theme="light"]) body.case--flex .cs-section--dark { background: #050904; }
html:not([data-theme="light"]) body.case--flex .cs-step:not(.cs-step--active) { background: #142010; }
html:not([data-theme="light"]) body.case--flex .cs-solution-card .cs-card-title { color: var(--cs-text); }
html:not([data-theme="light"]) body.case--flex .cs-solution-card .cs-card-body { color: var(--cs-muted); }
html:not([data-theme="light"]) body.case--flex .cs-step--active .cs-step-title,
html:not([data-theme="light"]) body.case--flex .cs-step--active .cs-step-body { color: #0A1007; }
html:not([data-theme="light"]) body.case--flex .cs-step--active .cs-step-num { color: rgba(10, 16, 7, 0.45); }

html:not([data-theme="light"]) body.case--flex .project-nav-section { background: var(--flex-green-mid); border-top-color: var(--cs-border); }
html:not([data-theme="light"]) body.case--flex .project-nav-section .btn-ghost { border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.65); }
html:not([data-theme="light"]) body.case--flex .project-nav-section .btn-ghost:hover { border-color: rgba(255, 255, 255, 0.35); color: #FFFFFF; }
html:not([data-theme="light"]) body.case--flex .project-nav-section .btn-primary { color: #0A1007; }

/* =============================================
   PEDIDOSYA · dark (page around the email client)
   ============================================= */
html:not([data-theme="light"]) body.case--pedidosya { background: var(--bg); color: var(--text); }
html:not([data-theme="light"]) body.case--pedidosya .nav { background: rgba(12, 11, 18, 0.6); border-bottom-color: rgba(255, 255, 255, 0.08); }
html:not([data-theme="light"]) body.case--pedidosya .nav-logo { color: #FFFFFF; }
html:not([data-theme="light"]) body.case--pedidosya .nav-back { color: rgba(255, 255, 255, 0.65); }
html:not([data-theme="light"]) body.case--pedidosya .nav-back:hover { color: #FFFFFF; }
html:not([data-theme="light"]) body.case--pedidosya .project-nav-section { background: var(--bg-alt); border-top-color: var(--border); }
html:not([data-theme="light"]) body.case--pedidosya .btn-ghost,
html:not([data-theme="light"]) body.case--pedidosya .project-nav-section .btn-ghost { border-color: var(--border-hover); color: var(--text-muted); }
html:not([data-theme="light"]) body.case--pedidosya .btn-ghost:hover,
html:not([data-theme="light"]) body.case--pedidosya .project-nav-section .btn-ghost:hover { border-color: var(--text-subtle); color: var(--text); }
html:not([data-theme="light"]) body.case--pedidosya .footer { background: var(--bg); border-top-color: var(--border); }
html:not([data-theme="light"]) body.case--pedidosya .footer-name,
html:not([data-theme="light"]) body.case--pedidosya .footer-links a { color: var(--text-muted); }
html:not([data-theme="light"]) body.case--pedidosya .footer-links a:hover { color: var(--text); }
html:not([data-theme="light"]) body.case--pedidosya .gd-client { border-color: rgba(255, 255, 255, 0.10); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7); }

/* =============================================
   THEME TOGGLE · brand color per case
   ============================================= */
body.case { --case-accent: var(--accent); }
body.case--propelus      { --case-accent: #E00089; }
body.case--abitab        { --case-accent: #2D8DFF; }
body.case--flex          { --case-accent: #4D9030; }
body.case--pedidosya     { --case-accent: #FA1932; }
body.case--ahead         { --case-accent: #17A84E; }
body.case--knobs-research{ --case-accent: #4B8F96; }
body.case--creative-juice{ --case-accent: #7B3FE4; }
body.case--heliflite     { --case-accent: #1E2154; }
body.case--10pearls      { --case-accent: #6366F1; }
html:not([data-theme="light"]) body.case--propelus  { --case-accent: #FF4DAA; }
html:not([data-theme="light"]) body.case--flex      { --case-accent: #6CB54A; }
html:not([data-theme="light"]) body.case--heliflite { --case-accent: #6C72E0; }

.nav-case-right .toggle-thumb { background: var(--case-accent); }
.nav-case-right .theme-toggle:hover { border-color: var(--case-accent); }
/* Icon sitting on the thumb is always white on brand colors */
html:not([data-theme="light"]) .nav-case-right .toggle-slot .icon-moon { color: #FFFFFF; }
html[data-theme="light"] .nav-case-right .toggle-slot .icon-sun { color: #FFFFFF; }

/* Track: translucent so it sits well on any nav color */
html:not([data-theme="light"]) .nav-case-right .theme-toggle,
html[data-theme="light"] body.case--propelus .nav-case-right .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
html:not([data-theme="light"]) .nav-case-right .toggle-slot .icon-sun,
html[data-theme="light"] body.case--propelus .nav-case-right .toggle-slot .icon-moon { color: rgba(255, 255, 255, 0.6); }
html[data-theme="light"] .nav-case-right .theme-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.10);
}

/* Propelus keeps its plum nav in light mode too */
html[data-theme="light"] body.case--propelus .nav {
  background: rgba(46, 14, 44, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.10);
  box-shadow: none;
}

/* Floating "Next case" pill: never inherit the bottom bar's background/border */
html body.case .project-nav-section.next-case-float {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* =============================================
   CASE NAV · floating pill (same as home)
   ============================================= */
body.case {
  --case-pill-bg: rgba(20, 19, 28, 0.86);
  --case-pill-border: rgba(207, 202, 236, 0.12);
  --case-pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 40px -16px rgba(0, 0, 0, 0.65);
}
html[data-theme="light"] body.case {
  --case-pill-bg: rgba(255, 255, 255, 0.92);
  --case-pill-border: rgba(44, 39, 72, 0.10);
  --case-pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 36px -18px rgba(44, 39, 72, 0.30);
}
body.case--propelus,
html[data-theme="light"] body.case--propelus {
  --case-pill-bg: rgba(46, 14, 44, 0.92);
  --case-pill-border: rgba(255, 255, 255, 0.12);
  --case-pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 40px -16px rgba(20, 4, 18, 0.6);
}

html body.case .nav {
  top: 14px;
  height: auto;
  padding: 0 16px;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none;
}
html body.case .nav .nav-inner {
  pointer-events: auto;
  max-width: 1000px;
  height: 58px;
  margin: 0 auto;
  padding: 0 8px 0 24px;
  border-radius: 999px;
  background: var(--case-pill-bg);
  border: 1px solid var(--case-pill-border);
  box-shadow: var(--case-pill-shadow);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}
html body.case .nav .nav-logo { font-size: 20px; }
html body.case .nav-case-right { gap: 6px; }
html body.case .nav-case-right .nav-back {
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
html body.case .nav-case-right .nav-back:hover { background: rgba(127, 127, 127, 0.12); }
html body.case .nav-case-right .theme-toggle { margin-right: 4px; }

@media (max-width: 680px) {
  html body.case .nav { top: 10px; padding: 0 10px; }
  html body.case .nav .nav-inner { height: 52px; padding: 0 6px 0 18px; }
  html body.case .nav-case-right .nav-back { padding: 7px 10px; font-size: 13.5px; }
}

/* =============================================
   10PEARLS · light mode with more contrast
   Product screens are dark UI, so their showcase stays dark.
   ============================================= */
html[data-theme="light"] body.case--10pearls {
  --accent: #4F46E5;
  --accent-bg: rgba(79, 70, 229, 0.08);
  --accent-border: rgba(79, 70, 229, 0.24);
  --bg-alt: #EEEDFA;
  --text-muted: rgba(20, 19, 28, 0.66);
  --border: rgba(44, 39, 72, 0.12);
  --case-accent: #4F46E5;
}
html[data-theme="light"] body.case--10pearls .tp-hero-composite {
  background:
    radial-gradient(ellipse 70% 55% at 22% 25%, rgba(99, 102, 241, 0.22), transparent 60%),
    #14131C;
  border-color: rgba(44, 39, 72, 0.18);
  box-shadow: 0 30px 70px -36px rgba(44, 39, 72, 0.55);
}
html[data-theme="light"] body.case--10pearls .tp-card {
  background: #1C1B26;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
html[data-theme="light"] body.case--10pearls .tp-meta-stat { color: rgba(255, 255, 255, 0.82); }
html[data-theme="light"] body.case--10pearls .tp-wc-stack-img { background: #14131C; border-color: rgba(44, 39, 72, 0.18); }
html[data-theme="light"] body.case--10pearls .cs-section--alt { background: var(--bg-alt); }
html[data-theme="light"] body.case--10pearls .cs-problem-card,
html[data-theme="light"] body.case--10pearls .cs-step,
html[data-theme="light"] body.case--10pearls .tp-takeaway {
  box-shadow: 0 1px 2px rgba(44, 39, 72, 0.06), 0 12px 30px -20px rgba(44, 39, 72, 0.25);
}
