/* ==========================================================================
   Basic Meta — design layer modelled on the Basic Insight visual system.
   Loaded AFTER custom.css. Token-driven; light default, dark via [data-theme="dark"].
   ========================================================================== */

:root {
  --accent: #71bf44;
  --accent-hover: #82cc57;
  --accent-ink: #0b1119;
  --accent-text: #3f7d1e;
  --accent-tint: rgba(113,191,68,0.10);
  --accent-glow: rgba(113,191,68,0.40);
  --accent-glow-soft: rgba(113,191,68,0.16);

  --bg: #ffffff;
  --bg-mist: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --text: #0b0d12;
  --text-2: #4b5563;
  --text-3: #8c8c8c;
  --line: rgba(11,13,18,0.08);
  --line-2: rgba(11,13,18,0.14);
  --header-bg: rgba(255,255,255,0.86);
  --field-bg: #ffffff;
  --shadow: 0 1px 2px rgba(11,13,18,0.04), 0 8px 24px rgba(11,13,18,0.06), 0 24px 56px rgba(11,13,18,0.06);
  --shadow-sm: 0 1px 2px rgba(11,13,18,0.05), 0 6px 18px rgba(11,13,18,0.06);
  --dot: rgba(11,13,18,0.10);
  --grid: rgba(11,13,18,0.04);

  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 12px;
  --container: 1216px;
  --section-y: clamp(72px, 8vw, 112px);
  --header-h: 80px;

  /* re-point legacy tokens so existing rules follow the theme */
  --brand-green: var(--accent);
  --brand-green-dark: var(--accent-hover);
  --brand-green-light: var(--accent-hover);
  --brand-charcoal: var(--text);
  --brand-grey: var(--text-2);
  --brand-grey-dark: var(--text-2);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1119;
  --bg-mist: #0e151f;
  --panel: #111a25;
  --panel-2: #16212e;
  --text: #f2f5f8;
  --text-2: #b7c0cb;
  --text-3: #8c8c8c;
  --accent-text: #8bc94d;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --header-bg: rgba(11,17,25,0.78);
  --field-bg: #0d141d;
  --shadow: 0 2px 6px rgba(0,0,0,0.3), 0 16px 32px rgba(0,0,0,0.32), 0 48px 100px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3), 0 12px 28px rgba(0,0,0,0.35);
  --dot: rgba(180,189,200,0.20);
  --grid: rgba(255,255,255,0.035);
  color-scheme: dark;
}

/* ===== Base ===== */
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px; line-height: 1.6; padding-top: var(--header-h);
  transition: background .25s ease, color .25s ease;
}
::selection { background: var(--accent-glow); }
.container { max-width: var(--container); padding: 0 clamp(20px, 4vw, 40px); }
.container-sm { padding: 0 clamp(20px, 4vw, 40px); }
.site-inner, .entry-content { background: transparent; }

/* ===== Header ===== */
.bi-header {
  height: var(--header-h); background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  padding: 0 max(20px, calc((100% - var(--container)) / 2 + 20px));
}
.bi-header.scrolled { box-shadow: 0 8px 30px rgba(11,13,18,0.08); }
.site-logo img { height: 30px; }
:root[data-theme="dark"] .site-logo img { filter: brightness(0) invert(1); }
.logo-tagline { color: var(--text-3); letter-spacing: .14em; }
.main-nav { gap: 6px; }
.main-nav a {
  color: var(--text); font-size: 15px; font-weight: 500; padding: 8px 14px;
  border-radius: 999px; background: none;
}
.main-nav a:hover { color: var(--accent-text); background: var(--accent-tint); }
.main-nav a.active { color: var(--accent-text); background: var(--accent-tint); }
.nav-cta, .main-nav a.nav-cta {
  margin-left: 10px; padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink) !important; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px var(--accent-glow-soft), 0 2px 6px var(--accent-glow-soft);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.nav-cta:hover, .main-nav a.nav-cta:hover {
  background: var(--accent-hover) !important; color: var(--accent-ink) !important;
  transform: translateY(-1px); box-shadow: 0 12px 30px var(--accent-glow);
}

.theme-toggle {
  width: 40px; height: 40px; margin-left: 10px; flex: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  box-shadow: var(--shadow-sm); transition: transform .2s ease;
}
.theme-toggle:hover { transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.bi-header-tools { display: flex; align-items: center; }

.mobile-toggle { color: var(--text); }
.mobile-nav {
  top: var(--header-h); background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.mobile-nav a { color: var(--text); border-radius: var(--radius-xs); }
.mobile-nav a:hover { background: var(--accent-tint); }
.admin-bar .mobile-nav { top: calc(var(--header-h) + 32px); }

/* ===== Sections / headings ===== */
.section, .section-lg { padding: var(--section-y) 0; }
.bg-white { background: var(--bg); }
.bg-gray { background: var(--bg-mist); }
.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 18px;
}
.section-label::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow-soft);
}
.text-center .section-label { justify-content: center; }
.section-title {
  font-size: clamp(30px, 3.4vw, 46px); font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.12; color: var(--text); margin-bottom: 18px;
}
.section-title .green { color: var(--accent-text); }
.section-desc { color: var(--text-2); font-size: 1.0625rem; max-width: 44rem; }

/* ===== Buttons (pill, glow) ===== */
.btn {
  padding: 15px 28px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-green {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 28px var(--accent-glow-soft), 0 2px 6px var(--accent-glow-soft);
}
.btn-green:hover { background: var(--accent-hover); box-shadow: 0 14px 34px var(--accent-glow); }
.btn-outline, .btn-white-outline {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
}
.btn-outline:hover, .btn-white-outline:hover { background: var(--panel-2); color: var(--text); border-color: var(--accent-line, var(--accent)); }

/* ===== Hero — light stage with grid + green glow ===== */
.hero { min-height: min(760px, calc(100vh - var(--header-h))); background: var(--bg); isolation: isolate; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 30% 40%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 80% 80% at 30% 40%, #000 30%, transparent 85%);
}
.hero::after {
  content: ''; position: absolute; z-index: 0; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  left: -12vw; top: -18vw; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow-soft), transparent 65%); filter: blur(10px);
}
.hero-bg {
  left: auto; width: 55%; opacity: .9; z-index: 0;
  border-radius: 0 0 0 var(--radius);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%);
          mask-image: linear-gradient(90deg, transparent 0, #000 45%);
}
:root[data-theme="dark"] .hero-bg { opacity: .55; }
.hero-overlay { background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 40%, transparent 75%); z-index: 1; }
.hero-overlay-bottom { background: linear-gradient(to top, var(--bg) 0, transparent 22%); z-index: 1; }
.hero .container { position: relative; z-index: 2; }
.hero-badge {
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  padding: 8px 16px; backdrop-filter: none;
}
.hero-badge .dot { width: 7px; height: 7px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow-soft); }
.hero-badge span { color: var(--accent-text); font-size: 12px; font-weight: 600; letter-spacing: .14em; }
.hero h1 {
  color: var(--text); font-size: clamp(2.5rem, 5.6vw, 4.5rem); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.04;
}
.hero h1 .green { color: var(--accent-text); }
.hero p { color: var(--text-2); font-size: 1.1875rem; }

/* ===== Stats strip — rounded panel with divider lines ===== */
.stats-bar { background: var(--bg); padding: 8px 0 var(--section-y); position: relative; z-index: 3; }
.stats-grid {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); gap: 0; text-align: left; overflow: hidden;
}
.stats-grid > div { padding: 28px 32px; border-left: 1px solid var(--line); }
.stats-grid > div:first-child { border-left: 0; }
.stat-number { color: var(--text); font-size: clamp(2.25rem, 4vw, 3.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px; }
.stat-label { color: var(--text-3); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 639px) {
  .stats-grid > div:nth-child(odd) { border-left: 0; }
  .stats-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}


/* ===== Cards ===== */
.card, .agency-card, .case-card, .team-card, .service-card-lg, .process-step, .milestones,
.contact-sidebar .info-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card, .case-card, .service-card-lg { padding: 28px; }
.card:hover, .agency-card:hover, .case-card:hover, .service-card-lg:hover {
  transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--shadow); background: var(--panel);
}
.bg-gray .card, .bg-gray .case-card, .bg-gray .service-card-lg { background: var(--panel); }
.card-gray { background: var(--panel-2); }
.card h3, .case-card h3, .team-card h3, .service-card-lg h3, .agency-card h3, .process-step h3 { color: var(--text); letter-spacing: -0.01em; }
.card p, .case-card .overview, .team-card .bio, .agency-card p, .process-step p, .milestone-text, .section-desc { color: var(--text-2); }
.card-icon {
  width: 3rem; height: 3rem; border-radius: var(--radius-xs);
  background: var(--accent-tint); color: var(--accent-text); border: 1px solid var(--accent-glow-soft);
}
.service-card-lg:hover .card-icon { background: var(--accent); color: var(--accent-ink); }
.card .tag { background: var(--accent-tint); color: var(--accent-text); font-weight: 500; }
.case-card:hover h3 { color: var(--accent-text); }
.case-card .read-more { border-top: 1px solid var(--line); color: var(--accent-text); font-weight: 600; }
.case-tag-green { background: var(--accent-tint); color: var(--accent-text); }
.case-tag-gray { background: var(--panel-2); color: var(--text-2); }
.team-photo { background: var(--panel-2); border-radius: var(--radius-xs); }
.team-card .role, .milestone-year { color: var(--accent-text); }
.process-step .step-num { color: var(--accent-glow); }
.image-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.image-card-icon { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-xs); }

/* ===== Dark feature panels (kept dark in both themes, rounded) ===== */
.info-card-dark, .cta-box, .contact-sidebar .dark-box {
  background: #0f1822; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); color: #f2f5f8;
}
.cta-box {
  background:
    radial-gradient(60% 120% at 85% 0%, rgba(113,191,68,0.22), transparent 60%),
    #0f1822;
  padding: clamp(40px, 6vw, 72px) 28px; box-shadow: var(--shadow);
}
.cta-box h2 { font-weight: 700; letter-spacing: -0.02em; }
.tech-section { background: #0b1119; }
.tech-feature { border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.10); }
.tech-banner { border-radius: var(--radius); }
.tech-section .section-title { color: #f2f5f8; }
.tech-section .section-desc { color: #b7c0cb; }
.tech-section .section-label { color: #8bc94d; }
.page-hero {
  background:
    radial-gradient(50% 120% at 80% 0%, var(--accent-glow-soft), transparent 60%),
    var(--bg-mist);
  border-bottom: 1px solid var(--line);
}
.page-hero .section-title { color: var(--text); font-weight: 800; letter-spacing: -0.03em; }
.page-hero .section-desc { color: var(--text-2); }

/* ===== Marquee / logos ===== */
.marquee-wrap { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.marquee-item { color: var(--text-3); }

/* ===== FAQ ===== */
.faq-filter { background: var(--panel); color: var(--text-2); border: 1px solid var(--line-2); }
.faq-filter:hover { border-color: var(--accent); color: var(--text); }
.faq-filter.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.faq-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question h3 { color: var(--text); font-weight: 600; }
.faq-question:hover h3 { color: var(--accent-text); }
.faq-chevron { color: var(--text-3); }
.faq-answer p { color: var(--text-2); }

/* ===== Contact + Formidable ===== */
.contact-sidebar .info-item { color: var(--text-2); }
.contact-sidebar .info-item strong { color: var(--text); }
.contact-sidebar .info-item svg { color: var(--accent-text); }
.contact-sidebar .dark-box a { color: var(--accent); }
.frm_forms .frm_form_field input[type="text"],
.frm_forms .frm_form_field input[type="email"],
.frm_forms .frm_form_field input[type="tel"],
.frm_forms .frm_form_field textarea,
.frm_forms .frm_form_field select {
  background: var(--field-bg) !important; color: var(--text) !important;
  border: 1px solid var(--line-2) !important; border-radius: var(--radius-xs) !important;
  padding: 14px 16px !important;
}
.frm_forms .frm_form_field input:focus,
.frm_forms .frm_form_field textarea:focus,
.frm_forms .frm_form_field select:focus {
  border-color: var(--accent) !important; box-shadow: 0 0 0 4px var(--accent-glow-soft) !important;
}
.frm_forms .frm_form_field label,
.frm_forms .frm_form_field .frm_primary_label { color: var(--text) !important; }
.frm_forms .frm_submit button,
.frm_forms .frm_submit input[type="submit"] {
  background: var(--accent) !important; color: var(--accent-ink) !important;
  border-radius: 999px !important; padding: 15px 30px !important;
  box-shadow: 0 10px 28px var(--accent-glow-soft);
}
.frm_forms .frm_submit button:hover,
.frm_forms .frm_submit input[type="submit"]:hover { background: var(--accent-hover) !important; }
.frm_forms .frm_message { background: var(--accent-tint) !important; color: var(--text) !important; border-radius: var(--radius) !important; }

/* ===== Case detail ===== */
.case-detail-section h3 { color: var(--text); }
.case-detail-section p, .results-list li { color: var(--text-2); }
.results-list li { border-bottom: 1px solid var(--line); }

/* ===== Footer ===== */
.site-footer, .bi-footer { background: #0b1119; color: #f2f5f8; }
.bi-footer { border-top: 1px solid rgba(255,255,255,0.06); }
.footer-links a:hover, .footer-contact a:hover, .footer-bottom a:hover { color: var(--accent); }

/* ===== Reveal motion ===== */
.reveal { transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .hero-bg { width: 100%; opacity: .25; }
  .hero-overlay { background: linear-gradient(180deg, transparent, var(--bg) 85%); }
  .bi-header-tools .nav-cta { display: none; }
}
@media (max-width: 639px) {
  :root { --header-h: 68px; }
  body { font-size: 16px; }

  .stats-grid > div { padding: 20px; }
}

/* ===== Fixes after first visual pass ===== */
.hero .container { width: 100%; }
.hero-bg {
  width: 48%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 38%, #000 100%);
}
.hero-content { max-width: 620px; }

/* Header fit between 1024 and 1279px */
.main-nav a { white-space: nowrap; }
@media (max-width: 1023px) { .bi-header-tools { margin-left: auto; } .bi-header .mobile-toggle { margin-left: 4px; } }
@media (min-width: 1024px) and (max-width: 1279px) {
  .main-nav a { padding: 8px 10px; font-size: 14px; }
  .main-nav { gap: 2px; }
  .nav-cta, .main-nav a.nav-cta { padding: 10px 16px; margin-left: 4px; }
  .site-logo img { height: 26px; }
  .logo-tagline { display: none; }
}

/* Tags outside .card, and icon slots that have no icon content */
.tag {
  display: inline-block; margin-top: 16px; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-text); font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: capitalize;
}
.card-icon:empty { display: none; }

/* Inline colours baked into shortcode markup (case-study detail hero) */
.page-hero .section-title[style*="color"] { color: var(--text) !important; }
.page-hero a[style*="9ca3af"] { color: var(--text-2) !important; }
.page-hero a[style*="9ca3af"]:hover { color: var(--accent-text) !important; }
:root:not([data-theme="dark"]) .logo-tagline { color: #5f6672; }

/* ===== Theme-aware overrides for inline colours stored in page content ===== */
.entry-content [style*="background:#fff"], .entry-content [style*="background: #fff"] { background: var(--panel) !important; }
.entry-content [style*="#f9fafb"], .entry-content [style*="#f3f4f6"][style*="background"] { background: var(--panel-2) !important; }
.entry-content [style*="solid #e5e7eb"], .entry-content [style*="solid #f3f4f6"] { border-color: var(--line) !important; }
.entry-content [style*="border-radius:1rem"], .entry-content [style*="border-radius: 1rem"] { border-radius: var(--radius) !important; }
.entry-content [style*="#9ca3af"], .entry-content [style*="#d1d5db"] { color: var(--text-2) !important; }
.cta-box [style*="#9ca3af"], .cta-box [style*="#d1d5db"],
.tech-section [style*="#9ca3af"], .tech-section [style*="#d1d5db"],
.info-card-dark [style*="#9ca3af"], .info-card-dark [style*="#d1d5db"],
.dark-box [style*="#9ca3af"], .dark-box [style*="#d1d5db"] { color: #b7c0cb !important; }

/* ===== Contrast fixes found in audit ===== */
:root { --text-3: #666d78; --brand-green: var(--accent-text); }
:root[data-theme="dark"] { --text-3: #8c949e; }
.frm_forms .frm_required { color: #c4281c !important; }
:root[data-theme="dark"] .frm_forms .frm_required { color: #ff8a80 !important; }
.frm_forms .frm_description, .frm_forms .frm_form_field .frm_description { color: var(--text-3) !important; }
.read-more, .case-card .read-more { color: var(--accent-text); }
