/* Databoundly site themes.
   Dark = the original design (each page's own styles).
   Light = brand spec ("Databoundly Website Brand Spec.md", section 2), applied when
   <html data-theme="light">. Dark text on the light page, light text inside navy boxes. */

/* ---------- Theme switch (sun / moon pill in the nav) ---------- */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 0; border-radius: 999px; padding: 0;
  background: transparent; color: #7a8899; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.theme-switch button:hover { color: #ffffff; }
.theme-switch button[aria-pressed="true"] { background: rgba(96,165,250,0.16); color: #ffffff; }
.theme-switch button:focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }
.theme-switch svg { width: 15px; height: 15px; }

html[data-theme="light"] .theme-switch { border-color: rgba(15,23,42,0.14); background: rgba(255,255,255,0.35); }
html[data-theme="light"] .theme-switch button { color: #64748b; }
html[data-theme="light"] .theme-switch button:hover { color: #0b1220; }
html[data-theme="light"] .theme-switch button[aria-pressed="true"] { background: rgba(37,99,235,0.14); color: #2563eb; }
html[data-theme="light"] .theme-switch button:focus-visible { outline-color: #2563eb; }

/* Smooth fade when switching (only during a switch, so page load isn't animated) */
html.theme-fading, html.theme-fading * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ---------- Numbers (both themes) ----------
   Brand spec: stats and metrics use Space Grotesk 700 with lining, equal-width digits,
   so every number sits at the same height. .num wraps numbers inside headlines. */
.stat-val, .metric-val, .case-metric-val, .mini-stat-val, .team-stat-val, .num {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.5px;
}

/* Closed revenue and ROI show in green (brand spec 2d: green means a win). */
.case-metric-val.win, .metric-val.win { color: #34d399; }

/* ---------- Proven Results carousel (both themes) ---------- */
/* Without the script, the case studies simply stack. */
.case-carousel:not(.is-ready) .case-study + .case-study { margin-top: 18px; }

.case-carousel { position: relative; margin-top: 32px; }
.case-carousel.is-ready .case-track { display: grid; }
.case-carousel.is-ready .case-study {
  grid-area: 1 / 1;          /* all slides share one spot; the tallest sets the height */
  margin-top: 0;
  opacity: 0; visibility: hidden;
  transform: translateX(28px);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s linear 0.6s;
}
.case-carousel.is-ready .case-study.is-leaving { transform: translateX(-28px); }
.case-carousel.is-ready .case-study.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .case-carousel.is-ready .case-study { transition: none; transform: none; }
}

.case-controls { display: none; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.case-carousel.is-ready .case-controls { display: flex; }
.case-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; padding: 0; cursor: pointer;
  background: transparent; color: #60a5fa; border: 1px solid rgba(96,165,250,0.35);
  transition: background 0.2s, border-color 0.2s;
}
.case-arrow:hover { background: rgba(96,165,250,0.12); border-color: #60a5fa; }
.case-dots { display: flex; gap: 8px; }
.case-dot {
  width: 8px; height: 8px; border-radius: 999px; padding: 0; border: 0; cursor: pointer;
  background: rgba(96,165,250,0.3); transition: width 0.3s, background 0.3s;
}
.case-dot[aria-current="true"] { width: 26px; background: #60a5fa; }
.case-arrow:focus-visible, .case-dot:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }

/* Light mode: glossy, see-through navy glass over a soft blue glow */
html[data-theme="light"] .case-carousel::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  inset: -40px -60px 10px;
  background:
    radial-gradient(ellipse at 22% 35%, rgba(37,99,235,0.45), transparent 55%),
    radial-gradient(ellipse at 82% 70%, rgba(96,165,250,0.45), transparent 55%);
  filter: blur(30px);
}
html[data-theme="light"] .case-track { position: relative; z-index: 1; }
html[data-theme="light"] .case-carousel .case-study {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 38%, rgba(255,255,255,0) 60%),
    linear-gradient(145deg, rgba(23,35,62,0.86), rgba(11,18,34,0.80));
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 24px 60px rgba(15,23,42,0.28);
}
html[data-theme="light"] .case-carousel .case-study { --muted: #b9c5d6; --body: #dbe3ee; }
html[data-theme="light"] .case-carousel .case-metric {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}
html[data-theme="light"] .case-arrow { color: #2563eb; border-color: rgba(37,99,235,0.4); background: rgba(255,255,255,0.35); }
html[data-theme="light"] .case-arrow:hover { background: rgba(255,255,255,0.6); border-color: #2563eb; }
html[data-theme="light"] .case-dot { background: rgba(37,99,235,0.3); }
html[data-theme="light"] .case-dot[aria-current="true"] { background: #2563eb; }
html[data-theme="light"] .case-arrow:focus-visible, html[data-theme="light"] .case-dot:focus-visible { outline-color: #2563eb; }


/* ---------- How It Works panel (both themes) ---------- */
.bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bar-val {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 12px;
  font-variant-numeric: lining-nums tabular-nums; color: var(--blue-400);
}
.bar-val.win, .mini-stat-val.win { color: #34d399; }
.bar-fill-win { background: linear-gradient(90deg, #059669, #34d399); }
.bar-caption { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; letter-spacing: 0.3px; }
.step-circle { font-family: 'Space Grotesk', sans-serif; font-variant-numeric: lining-nums; }
.step-circle.step-circle-win { color: #34d399; border-color: rgba(52,211,153,0.45); background: rgba(52,211,153,0.10); }

/* =================== Light theme =================== */
/* ---------- Page level: soft blue-gray page, ink text, brand blue accents ---------- */
html[data-theme="light"] {
  --page: #d6e1f1;
  --ink: #0b1220;
  --navy: #131d32;
  --navy-raised: #1a2540;
  --navy-deep: #0a0f1e;
  --divider: rgba(15, 23, 42, 0.10);

  --white: #0b1220;      /* headlines on the page */
  --body: #334155;       /* body text on the page */
  --muted: #475569;      /* secondary text on the page */
  --blue-400: #2563eb;   /* accents on the page */
  --blue-300: #2563eb;
  --surface: #131d32;    /* old dark surfaces become navy boxes */
  --surface2: #131d32;
  --black: #d6e1f1;
}

html[data-theme="light"] body {
  background: radial-gradient(ellipse at 50% 35%, #e4ecf8 0%, #d6e1f1 55%, #c7d4ea 100%) fixed, #d6e1f1;
  color: var(--body);
  font-weight: 400;
}

/* ---------- Navy boxes: restore light text and bright blue inside them ---------- */
html[data-theme="light"] .service-card,
html[data-theme="light"] .deliver-card,
html[data-theme="light"] .case-study,
html[data-theme="light"] .diff-item,
html[data-theme="light"] .mini-stat,
html[data-theme="light"] .cta-deliver-item,
html[data-theme="light"] .proof-section,
html[data-theme="light"] .problem-card,
html[data-theme="light"] .solution-card,
html[data-theme="light"] .team-info,
html[data-theme="light"] .team-photo-badge,
html[data-theme="light"] .value-card,
html[data-theme="light"] .stats-band,
html[data-theme="light"] .case-block,
html[data-theme="light"] .next-up-section {
  --white: #ffffff;
  --body: #cbd5e1;
  --muted: #94a3b8;
  --blue-400: #60a5fa;
  --blue-300: #93c5fd;
}

html[data-theme="light"] .service-card,
html[data-theme="light"] .deliver-card,
html[data-theme="light"] .case-study,
html[data-theme="light"] .diff-item,
html[data-theme="light"] .mini-stat,
html[data-theme="light"] .cta-deliver-item,
html[data-theme="light"] .problem-card,
html[data-theme="light"] .value-card,
html[data-theme="light"] .case-block {
  background: var(--navy);
  border-color: rgba(96, 165, 250, 0.16);
}
html[data-theme="light"] .service-card:hover,
html[data-theme="light"] .deliver-card:hover,
html[data-theme="light"] .diff-item:hover,
html[data-theme="light"] .value-card:hover,
html[data-theme="light"] .case-block:hover {
  border-color: rgba(96, 165, 250, 0.35);
}
html[data-theme="light"] .solution-card { background: var(--navy-raised); border-color: rgba(96, 165, 250, 0.35); }
html[data-theme="light"] .proof-section,
html[data-theme="light"] .stats-band,
html[data-theme="light"] .next-up-section { background: var(--navy-deep); }
html[data-theme="light"] .team-info { background: var(--navy); }
html[data-theme="light"] .team-photo-overlay { background: linear-gradient(0deg, var(--navy) 0%, transparent 100%); }
html[data-theme="light"] .service-num { color: rgba(96, 165, 250, 0.08); }

/* Hero diagram boxes (home page) */
html[data-theme="light"] .hero-visual rect[fill="#0f1318"] { fill: var(--navy); }

/* ---------- Nav ---------- */
html[data-theme="light"] .nav {
  background: rgba(228, 236, 248, 0.88);
  border-bottom: 1px solid var(--divider);
}
html[data-theme="light"] .logo-data { color: var(--ink); }
html[data-theme="light"] .logo-blue { color: #2563eb; }
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active { color: var(--ink); }
@media (max-width: 768px) {
  html[data-theme="light"] .nav-links { background: rgba(228, 236, 248, 0.98); border-bottom: 1px solid var(--divider); }
}

/* ---------- Dividers between sections ---------- */
html[data-theme="light"] .hero,
html[data-theme="light"] .section,
html[data-theme="light"] .story-section,
html[data-theme="light"] .team-section,
html[data-theme="light"] .values-section,
html[data-theme="light"] .cta-section,
html[data-theme="light"] .footer,
html[data-theme="light"] .page-header,
html[data-theme="light"] .step {
  border-color: var(--divider);
}
html[data-theme="light"] .team-card:first-child { border-right-color: var(--divider); }

/* ---------- Buttons ---------- */
html[data-theme="light"] .nav-cta,
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-cta-primary {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}
html[data-theme="light"] .nav-cta:hover,
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .btn-cta-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 8px 26px rgba(37, 99, 235, 0.35);
}
html[data-theme="light"] .btn-ghost { color: #2563eb; border-color: rgba(37, 99, 235, 0.45); }
html[data-theme="light"] .btn-ghost:hover { color: #1d4ed8; border-color: #2563eb; }

/* ---------- Small pieces that sit on the page ---------- */
html[data-theme="light"] .step-circle { background: transparent; border: 2px solid #2563eb; color: #2563eb; }
html[data-theme="light"] .step-line { background: rgba(37, 99, 235, 0.25); }
html[data-theme="light"] .bar-track { background: rgba(15, 23, 42, 0.08); }

/* ---------- Footer wordmark (colors were set inline) ---------- */
html[data-theme="light"] .footer-logo span:first-child { color: var(--ink) !important; }
html[data-theme="light"] .footer-logo span:last-child { color: #2563eb !important; }

/* Green text sitting directly on the light page uses the darker green (brand spec 2d). */
html[data-theme="light"] .bar-val.win { color: #059669; }
html[data-theme="light"] .step-circle.step-circle-win { color: #059669; border-color: #059669; background: transparent; }

/* =================== Light theme: glossy glass on every dark box ===================
   Same treatment as the case study carousel: see-through navy tint, a glossy sheen,
   a bright top edge, and a soft blue glow behind the page so the glass has something
   to show through. The tint stays deep enough to keep white text readable. */
html[data-theme="light"] {
  --glass-bg:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 38%, rgba(255,255,255,0) 60%),
    linear-gradient(145deg, rgba(23,35,62,0.86), rgba(11,18,34,0.80));
  --glass-band:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 45%, rgba(255,255,255,0) 70%),
    linear-gradient(135deg, rgba(15,24,44,0.88), rgba(8,13,26,0.84));
}
html[data-theme="light"] body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 12% 30%, rgba(37,99,235,0.22), transparent 70%),
    radial-gradient(38% 32% at 88% 55%, rgba(96,165,250,0.26), transparent 70%),
    radial-gradient(45% 30% at 50% 100%, rgba(37,99,235,0.16), transparent 70%);
}

html[data-theme="light"] .service-card,
html[data-theme="light"] .deliver-card,
html[data-theme="light"] .diff-item,
html[data-theme="light"] .mini-stat,
html[data-theme="light"] .cta-deliver-item,
html[data-theme="light"] .problem-card,
html[data-theme="light"] .solution-card,
html[data-theme="light"] .value-card,
html[data-theme="light"] .case-block,
html[data-theme="light"] .team-info,
html[data-theme="light"] .case-carousel .case-study {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 18px 44px rgba(15,23,42,0.20);
  --muted: #b9c5d6;
  --body: #dbe3ee;
}
html[data-theme="light"] .service-card:hover,
html[data-theme="light"] .deliver-card:hover,
html[data-theme="light"] .diff-item:hover,
html[data-theme="light"] .value-card:hover,
html[data-theme="light"] .case-block:hover {
  border-color: rgba(147,197,253,0.45);
}
html[data-theme="light"] .team-info { border: 0; box-shadow: none; }

/* Full-width bands: client ticker, stats bar, "More coming" */
html[data-theme="light"] .proof-section,
html[data-theme="light"] .stats-band,
html[data-theme="light"] .next-up-section {
  background: var(--glass-band);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid rgba(255,255,255,0.22);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 14px 40px rgba(15,23,42,0.16);
  --muted: #b9c5d6;
}
/* The ticker's solid fade edges would show as blocks on glass; fade with a mask instead. */
html[data-theme="light"] .ticker-track::before,
html[data-theme="light"] .ticker-track::after { display: none; }
html[data-theme="light"] .ticker-track {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 100px, #000 calc(100% - 100px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 100px, #000 calc(100% - 100px), transparent);
}

/* Small tiles inside glass cards */
html[data-theme="light"] .case-carousel .case-metric,
html[data-theme="light"] .case-how-panel,
html[data-theme="light"] .team-stat {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}
html[data-theme="light"] .ticker-name { color: rgba(255,255,255,0.62); }
html[data-theme="light"] .ticker-item:hover .ticker-name { color: #ffffff; }
html[data-theme="light"] .team-photo-overlay { background: linear-gradient(0deg, rgba(25,37,64,0.92) 0%, transparent 100%); }
