/* ================================================
   BRIVITY — SHARED LIGHT / DARK THEME
   ================================================ */

/* === LIGHT THEME VARIABLES === */
html.light {
  /* index.html vars */
  --bg: #f5f7ff;
  --surface: #eaedfa;
  --card: #ffffff;
  --card-hover: #f0f3ff;
  --border: rgba(0,0,0,0.07);
  --border-light: rgba(0,0,0,0.13);
  --text: #0a0d1a;
  --text-dim: #4a5068;
  --text-mid: #2a3060;
  --accent2: #1228a6;
  --cyan: #4a9fe8;
  --glow: rgba(26,56,212,0.18);
  /* services / work / process / contact vars */
  --bg-card: #ffffff;
  --bg-elevated: #edf0fc;
  --text-secondary: #4a5068;
  --accent-glow: rgba(26,56,212,0.2);
  --gradient-text: linear-gradient(135deg, #080c1a 0%, #1a38d4 50%, #1228a6 100%);
}

/* === COMMON ELEMENT OVERRIDES (all pages) === */
html.light body { background: var(--bg); color: var(--text); }
html.light body::after, html.light body::before { opacity: 0.004; }
/* Header — transparent by default, frosted on scroll */
html.light .site-header { background: transparent !important; border-color: transparent !important; }
html.light .site-header.scrolled { background: rgba(247,246,255,0.9) !important; border-color: var(--border) !important; backdrop-filter: saturate(180%) blur(20px) !important; -webkit-backdrop-filter: saturate(180%) blur(20px) !important; }
html.light .brand-logo { filter: none; }
html.light .logo-item { color: #0d0d1a; opacity: 0.14; }

html.light .nav a { color: var(--text-dim); }
html.light .nav a:hover, html.light .nav a.active { color: var(--text); }
html.light .btn-nav:hover { color: var(--text); }

html.light .btn-fill { background: var(--text); color: var(--bg); box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 10px 40px rgba(0,0,0,0.1); }
html.light .btn-fill:hover { box-shadow: 0 0 0 1px rgba(0,0,0,0.12), 0 20px 60px rgba(26,56,212,0.18); }
html.light .btn-outline { color: var(--text); border-color: var(--border-light); }
html.light .btn-outline:hover { color: var(--text); border-color: rgba(26,56,212,0.5); }
html.light .btn-pill { box-shadow: 0 0 20px var(--glow); }

html.light .cta-orb { background: var(--text); color: var(--bg); box-shadow: 0 0 60px rgba(0,0,0,0.06); }
html.light .cta-orb:hover { box-shadow: 0 0 100px rgba(0,0,0,0.1); }

html.light .scroll-hint span { color: var(--text-dim); }

html.light .mobile-panel { background: rgba(247,246,255,0.98); }
html.light .mobile-link { color: var(--text); }

html.light ::-webkit-scrollbar-thumb { background: rgba(26,56,212,0.18); }

html.light .sticky-bg-line { opacity: 0; }

/* Sections & cards */
html.light .section-header h2 { color: var(--text); }
html.light .section-header a { color: var(--text-dim); }

html.light .sticky-text h2 { color: var(--text); }
html.light .sticky-text p { color: var(--text-dim); }
html.light .sticky-text .eyebrow { color: var(--accent); }

html.light .tilt-info h3 { color: var(--text); }

html.light .glow-card-inner h2 { color: var(--text); }
html.light .glow-card-inner p { color: var(--text-dim); }
html.light .cap-d { color: var(--text-dim); }

html.light .cta-card h2 { color: var(--text); }
html.light .cta-card .sub { color: var(--text-dim); }

/* Stats strip */
html.light .stat-num { color: var(--text); }
html.light .stat-label { color: var(--text-dim); }

/* Footer */
html.light .footer-link { color: var(--text-dim); }
html.light .footer-link:hover { color: var(--accent); }
html.light .footer-bottom { color: var(--text-dim); }

/* === SERVICES / WORK / PROCESS / CONTACT PAGE FIXES === */

/* Hero gradient text — covers .gradient spans and var(--gradient-text) h1s */
html.light .gradient {
  background: linear-gradient(135deg, #080c1a 0%, #1a38d4 50%, #1228a6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
html.light .hero h1 {
  background: var(--gradient-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Marquee ticker */
html.light .marquee { background: var(--bg-card); border-color: var(--border); }
html.light .marquee-item { color: rgba(0,0,0,0.35); }
html.light .marquee-item::after { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* Service / work cards */
html.light .service-card { background: var(--bg-card); border-color: var(--border); }
html.light .service-card h2, html.light .service-card h3 { color: var(--text); }

/* CTA panel & circle button */
html.light .cta-panel { background: var(--bg-card); border-color: var(--border); color: var(--text); }
html.light .cta-panel h2 { color: var(--text); }
html.light .cta-panel .sub { color: var(--text-secondary); }
html.light .cta-circle { background: var(--text) !important; color: var(--bg) !important; box-shadow: 0 0 40px rgba(0,0,0,0.08); }
html.light .cta-circle:hover { box-shadow: 0 0 60px rgba(0,0,0,0.12); }

/* Buttons on inner pages */
html.light .btn-ghost { color: var(--text-secondary); border-color: var(--border); }
html.light .btn-ghost:hover { color: var(--text); border-color: var(--accent); background: rgba(26,56,212,0.05); }
html.light .btn-primary { color: #fff; } /* keep white text on purple */

/* Form elements (contact page) */
html.light .form-box { background: var(--bg-card); border-color: var(--border); }
html.light .form-input,
html.light .form-textarea,
html.light .form-select { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
html.light .form-input:focus,
html.light .form-textarea:focus,
html.light .form-select:focus { background: var(--bg); }
html.light .form-label { color: var(--text); }
html.light .tile-label { color: var(--text-secondary); }
html.light .tile-label:hover { background: var(--bg-elevated); color: var(--text); }

/* Process / work section text */
html.light .hero-sub, html.light .hero .hero-sub { color: var(--text-secondary); }
html.light section h2, html.light section h3 { color: var(--text); }
html.light .section-label, html.light .eyebrow, html.light .tag { color: var(--accent); }

/* About page hero gradient specifically */
html.light .hero h1 .gradient {
  background: linear-gradient(135deg, #080c1a 0%, #1a38d4 50%, #1228a6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* About page: plain (non-gradient) hero word text — reset fill set by the h1 rule above */
html.light .hero h1 .word-inner {
  -webkit-text-fill-color: var(--text);
  color: var(--text);
  background: none;
}
/* Gradient word-inners: restore full gradient (bg: none above stripped it) */
html.light .hero h1 .word-inner.gradient {
  background: linear-gradient(135deg, #080c1a 0%, #1a38d4 50%, #1228a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Case study stat boxes (ivital / oaks) */
html.light .stat-box { background: var(--bg-card); }
html.light .stat-val { color: var(--text) !important; }
html.light .stat-val span { color: var(--accent) !important; }
html.light .stat-val.blue { color: var(--accent) !important; }
html.light .stat-val.green { color: #2d7a4f !important; }
html.light .stat-lbl { color: var(--text-secondary); }

/* About page: animated counter numbers */
html.light .counter-num {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Index-specific hero overrides (no-ops on other pages) */
html.light .hero { background: #f0f3ff; }
html.light .hero-grid {
  background-image:
    linear-gradient(rgba(0,0,0,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.07) 1px, transparent 1px);
}
html.light .hero-spotlight {
  background: radial-gradient(560px circle at var(--mx, -999px) var(--my, -999px),
    rgba(26, 56, 212, 0.14) 0%, rgba(20, 40, 160, 0.07) 35%, transparent 70%);
}
html.light .hero-bubble {
  background: rgba(255,255,255,0.72);
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
html.light .bubble-metric, html.light .bubble-mini-val { color: var(--text); }
html.light .bubble-divider { background: rgba(0,0,0,0.07); }
html.light .hero-title .gradient {
  background: linear-gradient(135deg, #080c1a 0%, var(--accent) 45%, #1228a6 75%, #4a9fe8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* === SMOOTH THEME TRANSITION === */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, box-shadow 0.35s ease !important;
}

/* === THEME TOGGLE BUTTON === */
.theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.3s, box-shadow 0.3s,
              transform 0.4s cubic-bezier(0.16,1,0.3,1),
              background-color 0.35s ease, color 0.35s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 28px rgba(26,56,212,0.22);
  transform: rotate(28deg) scale(1.06);
}
