/* ============================================================
 * Claire Lead-Banner stylesheet (cta.css)
 * Loaded once per page by cta.js (and by the dashboard preview), so banners
 * get full CSS power on any CMS: themes, hover, animations, responsive,
 * fluid typography, and the customer's chosen webfont.
 *
 * Look & feel adapted from the Sprad CTA library. Everything is scoped under
 * .clb and driven by per-banner inline custom properties:
 *   --ac  accent colour (from the editor colour picker)
 *   --ac2 darker accent (for gradients)
 *   --bf  headline font stack (from the font dropdown)
 * Themes: .clb--soft (white) · .clb--beige · .clb--dark (standout)
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Instrument+Serif&family=Playfair+Display:wght@500;600&family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

.clb {
  --r-lg: 18px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ac: #6366f1;
  --ac2: #4f46e5;
  --bf: 'Inter', system-ui, sans-serif;
  box-sizing: border-box;
  width: 100%;
  max-width: 640px;
  margin: 26px 0;
  border-radius: var(--r-lg);
  padding: clamp(20px, 2.6vw, 30px) clamp(22px, 2.8vw, 32px);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease-out);
  animation: clbIn .5s var(--ease-out) both;
}
.clb *, .clb *::before, .clb *::after { box-sizing: border-box; }

/* ---------- themes ---------- */
.clb--soft  { background: #fff; border: 1px solid #e2e4ec; box-shadow: 0 1px 3px rgba(20,30,60,.05); color: #14202e; }
.clb--beige { background: #f1ece2; border: 1px solid #e6ddcb; box-shadow: 0 1px 3px rgba(60,50,30,.05); color: #14202e; }
.clb--dark  { background: linear-gradient(168deg, #19202f, #11161f); border: 1px solid color-mix(in srgb, var(--ac) 26%, transparent); color: #fff;
  box-shadow: 0 26px 60px -34px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05); }
.clb--soft:hover, .clb--beige:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ac) 50%, transparent); box-shadow: 0 16px 36px -18px rgba(20,40,80,.25); }
.clb--dark:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ac) 55%, transparent);
  box-shadow: 0 34px 70px -32px rgba(0,30,60,.8), 0 0 40px -16px color-mix(in srgb, var(--ac) 35%, transparent); }

/* ---------- shared atoms ---------- */
.clb-h { font-family: var(--bf); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 7px; font-size: clamp(21px, 2.3vw, 27px); }
.clb--dark .clb-h { color: #fff; }
.clb-p { margin: 0 0 16px; font-size: clamp(13.5px, 1.2vw, 15px); line-height: 1.55; color: #46506a; }
.clb--dark .clb-p { color: rgba(255,255,255,.64); }
.clb-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; background: var(--ac); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 12px 22px; border-radius: 999px; transition: transform .2s var(--ease-out), box-shadow .2s, filter .2s;
  box-shadow: 0 8px 20px -7px color-mix(in srgb, var(--ac) 60%, transparent); }
.clb-cta .clb-arr { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.22); font-size: 12px; transition: transform .25s var(--ease-out); }
.clb:hover .clb-cta { filter: brightness(1.06); box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--ac) 60%, transparent); }
.clb:hover .clb-cta .clb-arr { transform: translateX(2px); }
.clb-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ac);
  background: color-mix(in srgb, var(--ac) 13%, #fff); padding: 5px 10px; border-radius: 999px; margin-bottom: 11px; }
.clb--dark .clb-badge { background: rgba(255,255,255,.16); color: #fff; }
.clb-visual { flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--ac), var(--ac2)); box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--ac) 50%, transparent); }
.clb-visual svg { width: 46%; height: 46%; }
.clb-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clb-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; }

/* ---------- template: split (text + 3D media, Sprad-style) ---------- */
.clb-split { padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr 1.04fr; align-items: stretch; }
.clb-split .clb-body { padding: clamp(26px, 3vw, 34px) clamp(26px, 3vw, 36px); display: flex; flex-direction: column; justify-content: center; gap: 11px; z-index: 2; max-width: 46ch;
  animation: clbFlyL .6s var(--ease-out) both .08s; }
.clb-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--ac); margin-bottom: -2px; }
.clb-eyebrow::before { content: ""; width: 16px; height: 1.5px; border-radius: 2px; background: currentColor; opacity: .55; flex: 0 0 auto; }
.clb-media { position: relative; min-height: 210px; animation: clbFlyUp .7s var(--ease-out) both .14s; }
.clb-stage { position: absolute; top: 28px; bottom: -28px; left: 26px; right: -64px; border-radius: 14px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 60px -22px rgba(10,20,40,.45); border: 1px solid rgba(255,255,255,.5);
  transform: perspective(1500px) rotateY(-14deg); transform-origin: left center; transition: transform .5s var(--ease-out); }
.clb:hover .clb-stage { transform: perspective(1500px) rotateY(-10deg) translateY(-5px); }
.clb-stage img { width: 100%; height: 100%; object-fit: cover; }
.clb-stage.ph { display: grid; place-items: center; border: 1px dashed color-mix(in srgb, var(--ac) 42%, transparent);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ac) 9%, transparent) 0 14px, transparent 14px 28px), #eef2f7; }
.clb--dark .clb-stage.ph { background: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 14px, transparent 14px 28px), #0c121d; }
.clb-lab { font-family: ui-monospace, 'Roboto Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; text-align: center; line-height: 1.7; color: color-mix(in srgb, var(--ac) 65%, #5a7a96); }

/* ---------- template: stat (count-up, 3-col, Sprad-style) ---------- */
.clb-stat { position: relative; overflow: hidden; padding: clamp(26px,3.4vw,38px) clamp(26px,3.6vw,42px);
  background-image:
    radial-gradient(130% 120% at 88% 12%, color-mix(in srgb, var(--ac) 24%, transparent), transparent 55%),
    radial-gradient(120% 120% at 4% 100%, color-mix(in srgb, var(--ac2) 14%, transparent), transparent 55%); }
.clb-stat .clb-row { position: relative; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(18px, 3vw, 40px); }
.clb-numwrap { display: flex; flex-direction: column; align-items: flex-start; animation: clbPop .6s var(--ease-out) both; }
.clb-num { display: inline-flex; align-items: baseline; gap: .06em; font-family: var(--bf); font-weight: 700; letter-spacing: -.04em; line-height: .9;
  font-size: clamp(54px, 9vw, 104px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ac) 12%, #fff), var(--ac)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.clb--dark .clb-num { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--ac) 55%, #fff)); -webkit-background-clip: text; background-clip: text; }
.clb-suf { font-size: .55em; font-weight: 600; }
.clb-numunit { margin-top: 11px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, currentColor 55%, transparent); }
.clb-stat .clb-mid { min-width: 0; }
.clb-stat .clb-mid .clb-h { font-size: clamp(20px, 2.2vw, 27px); margin: 0; }
.clb-stat .clb-mid .clb-p { margin: 8px 0 0; }
.clb-statbar { margin-top: 14px; width: 140px; max-width: 100%; height: 7px; border-radius: 999px; overflow: hidden; position: relative;
  background: color-mix(in srgb, currentColor 12%, transparent); }
.clb-statbar i { position: absolute; inset: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--ac), var(--ac2)); animation: clbFill 1.1s var(--ease-out) .3s forwards; }
@keyframes clbFill { to { width: var(--fill, 80%); } }

/* ---------- template: download (cover card + bouncing arrow, Sprad-style) ---------- */
.clb-download { padding: 0; overflow: hidden; display: grid; grid-template-columns: clamp(220px, 32%, 340px) 1fr; align-items: center; }
.clb-download .clb-cover { position: relative; padding: clamp(22px,3vw,28px); display: grid; place-items: center; }
.clb-coverpic { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(155deg, var(--ac), var(--ac2)); box-shadow: 0 22px 44px -20px color-mix(in srgb, var(--ac) 55%, transparent);
  animation: clbFloat 5.5s ease-in-out infinite; }
.clb-coverpic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clb-coverpic::after { content: ""; position: absolute; top: -20%; left: 0; width: 45%; height: 160%; transform: translateX(-160%) rotate(8deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: clbSheen 4.5s var(--ease-out) 1.2s infinite; }
.clb-badge2 { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255,255,255,.92); color: var(--ac); font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; }
.clb-thumb { position: relative; z-index: 1; width: 64%; background: #fff; border-radius: 9px; padding: 13px 14px; box-shadow: 0 16px 30px -14px rgba(0,0,0,.35); }
.clb-thumb b { display: block; font-size: 11px; font-weight: 700; color: var(--ac2); margin-bottom: 9px; }
.clb-tlines { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.clb-tlines i { height: 8px; border-radius: 3px; background: color-mix(in srgb, var(--ac) 22%, #eef2f8); }
.clb-download .clb-body { padding: clamp(24px,3vw,32px) clamp(26px,3vw,36px) clamp(24px,3vw,32px) 0; }
.clb-dltype { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ac); margin-bottom: 8px; }
.clb-dltype::before { content: ""; width: 16px; height: 1.5px; background: currentColor; opacity: .55; }
.clb-dlarr { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.22); overflow: hidden; }
.clb-dlarr svg { width: 13px; height: 13px; animation: clbBounce 1.8s var(--ease-out) infinite; }
@keyframes clbBounce { 0%,55%,100% { transform: translateY(-1px); } 28% { transform: translateY(2px); } }

/* ---------- sheen sweep + sparks (shared) ---------- */
.clb-sheen { position: absolute; inset: 0; pointer-events: none; z-index: 4; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.12) 48%, transparent 60%); transform: translateX(-120%); animation: clbSweep 1.1s var(--ease-out) .5s; }
.clb:hover .clb-sheen { animation: clbSweep .9s var(--ease-out); }
@keyframes clbSweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
.clb-spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; z-index: 1; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--ac) 80%, #fff); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--ac) 50%, transparent); animation: clbFloatUp 6s linear infinite; }
@keyframes clbFloatUp { 0% { transform: translateY(20px); opacity: 0; } 12% { opacity: 1; } 86% { opacity: 1; } 100% { transform: translateY(-120px); opacity: 0; } }

/* ---------- template: compact ---------- */
.clb-compact { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.clb-compact .clb-body { flex: 1; min-width: 220px; }
.clb-compact .clb-h { margin-bottom: 3px; font-size: clamp(19px, 2vw, 22px); }
.clb-compact .clb-p { margin: 0; }

/* ---------- template: form ---------- */
.clb-form .clb-row { display: flex; gap: 9px; margin-top: 6px; flex-wrap: wrap; }
.clb-form input { flex: 1; min-width: 180px; border: 1px solid color-mix(in srgb, currentColor 16%, transparent); background: rgba(255,255,255,.06);
  border-radius: 11px; padding: 11px 13px; font: 500 14px 'Inter', sans-serif; color: inherit; }
.clb--soft .clb-form input, .clb--beige .clb-form input { background: #fff; }
.clb-form .clb-note { font-size: 11px; opacity: .6; margin: 10px 0 0; }

/* ---------- template: logos (social proof) ---------- */
.clb-logos .clb-body { margin-bottom: 14px; }
.clb-logos-track { position: relative; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.clb-logos-row { display: inline-flex; gap: 38px; align-items: center; padding-right: 38px; animation: clbMarq 18s linear infinite; }
.clb-logos-row span { font-weight: 700; font-size: 15px; letter-spacing: .02em; opacity: .55; white-space: nowrap; }
.clb-logos:hover .clb-logos-row { animation-play-state: paused; }

/* ---------- entrance / motion ---------- */
@keyframes clbIn   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes clbPop  { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes clbShine{ to { transform: translateX(220%); } }
@keyframes clbSheen{ 0% { transform: translateX(-130%) rotate(8deg); } 26%, 100% { transform: translateX(320%) rotate(8deg); } }
@keyframes clbFloat{ 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes clbMarq { to { transform: translateX(-50%); } }
@keyframes clbFlyL { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes clbFlyUp{ from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .clb-stat .clb-row { grid-template-columns: 1fr; gap: 16px; }
  .clb-download { grid-template-columns: 1fr; }
  .clb-download .clb-body { padding: 0 clamp(22px,5vw,28px) clamp(22px,5vw,28px); }
  .clb-split { grid-template-columns: 1fr; }
  .clb-split .clb-body { padding-bottom: 0; }
  .clb-split .clb-media { min-height: 0; }
  .clb-split .clb-stage { position: static; inset: auto; transform: none; height: 180px; margin: 16px clamp(20px,5vw,28px) clamp(20px,5vw,28px);
    box-shadow: 0 16px 30px -16px rgba(10,20,40,.3); }
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .clb, .clb * { animation: none !important; transition: none !important; }
}
