/* ============================================================
   Caspa AI — Design System (rebuild v1, Cloudflare Pages)
   Conversion-first, evolved brand. No build step.
   ============================================================ */

:root {
  /* Brand */
  --brand: #7bf57b;          /* caspa button green (matches live site) */
  --brand-bright: #3dfb3d;   /* announce bar green */
  --brand-hover: #34cf5e;    /* darker green on hover */
  --brand-dark: #00a04a;     /* readable green for text/links on white */
  --brand-darker: #00803c;
  --brand-ink: #04310f;      /* dark text on bright green fills */
  --brand-tint: #eeffe9;
  --brand-tint-2: #ccffcc;
  --ink: #0b1512;            /* near-black green ink */
  --ink-2: #3d4a45;          /* secondary text */
  --ink-3: #6b7a74;          /* tertiary text */
  --paper: #ffffff;
  --paper-2: #f6faf8;        /* section alt background */
  --line: #e4ece8;
  --warn: #f59e0b;
  --star: #fbbf24;

  /* Type */
  --font: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --h1: clamp(2rem, 4.8vw, 3.3rem);
  --h2: clamp(1.7rem, 3.6vw, 2.5rem);
  --h3: clamp(1.15rem, 2vw, 1.4rem);

  /* Layout */
  --max: 1160px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(11, 21, 18, .07);
  --shadow-lg: 0 12px 48px rgba(11, 21, 18, .13);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.0625rem;
  font-weight: 400;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.01em; font-weight: 500; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--alt { background: var(--paper-2); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head p { color: var(--ink-3); margin-top: 12px; font-size: 1.125rem; font-weight: 400; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-darker); background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 1.0625rem; border-radius: 999px; cursor: pointer;
  padding: 14px 28px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none !important; border: 0; line-height: 1.2;
}
.btn--primary {
  background: var(--brand); color: #0b1512 !important; font-weight: 600;
}
.btn--primary::before {
  content: "→"; width: 1.7em; height: 1.7em; border-radius: 50%;
  background: #0b1512; color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: .85em; font-weight: 600; font-family: var(--font); flex: none;
  transition: transform .28s cubic-bezier(.22,1,.36,1);
}
.btn--primary:hover::before { transform: rotate(-45deg); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--lg { padding: 15px 32px; font-size: 1.1rem; }
.btn--sm { padding: 9px 18px; font-size: .95rem; }
.btn-note { display: block; margin-top: 10px; font-size: .875rem; color: var(--ink-3); }
.btn-note strong { color: var(--brand-darker); }

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--brand-bright);
  color: var(--ink); text-align: center; font-size: .9rem; font-weight: 600; padding: 9px 16px;
}
.announce a { color: var(--ink); text-decoration: underline; }
.announce a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.header .container { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.3rem; color: var(--brand-dark); text-decoration: none !important; white-space: nowrap; }
.logo svg { flex: none; }
.nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink-2); font-weight: 600; font-size: .98rem; text-decoration: none !important; }
.nav a:hover { color: var(--ink); }
.nav .badge {
  font-size: .62rem; font-weight: 700; color: var(--brand-darker); background: var(--brand-tint-2);
  padding: 2px 6px; border-radius: 6px; vertical-align: super; margin-left: 3px;
}
.nav-cta { display: flex; align-items: center; gap: 14px; }
.dropdown { position: relative; }
.dropdown > button {
  background: none; border: 0; font: inherit; font-weight: 600; font-size: .98rem;
  color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.dropdown > button:hover { color: var(--ink); }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: -12px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; min-width: 260px;
  display: none; z-index: 110;
}
.dropdown.open .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 9px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .95rem; text-decoration: none !important; }
.dropdown-menu a:hover { background: var(--brand-tint); color: var(--ink); }
.hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; text-align: center; position: relative; overflow: hidden; }

.hero h1 { max-width: 880px; margin: 0 auto 20px; }
.hero h1 em { font-style: normal; color: var(--brand-dark); }
.hero .sub { max-width: 680px; margin: 0 auto 30px; color: var(--ink-3); font-size: 1.25rem; font-weight: 300; line-height: 1.6; }
.hero-proof {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin: 26px 0 6px; font-size: .95rem; color: var(--ink-2); font-weight: 600;
}
.stars { color: var(--star); letter-spacing: 2px; font-size: 1.05rem; }

/* ---------- Marquee / logo strip ---------- */
.marquee { overflow: hidden; position: relative; }
.marquee-track { display: flex; gap: 24px; width: max-content; animation: scroll 17s linear infinite; }
@keyframes scroll { to { transform: translateX(-50%); } }
.marquee--gallery img {
  height: 300px; width: auto; border-radius: var(--radius); box-shadow: var(--shadow);
}
.logostrip { padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.logostrip p { text-align: center; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.logostrip .marquee-track { align-items: center; gap: 56px; animation-duration: 22s; }
.logostrip img { height: 26px; width: auto; opacity: .55; filter: grayscale(1); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 28px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 1rem; }
.card--media { padding: 0; overflow: hidden; }
.card--media .card-body { padding: 22px 24px 26px; }
.card--media img, .card--media video { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ---------- Feature split rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split + .split { margin-top: 80px; }
.split.rev > .split-media { order: 2; }
.split h2 { margin-bottom: 14px; }
.split p { color: var(--ink-2); font-size: 1.1rem; margin-bottom: 18px; }
.split ul { list-style: none; margin: 0 0 22px; }
.split li { padding-left: 30px; position: relative; margin-bottom: 10px; color: var(--ink-2); font-weight: 500; }
.split li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-tint-2); color: var(--brand-darker); font-size: .75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 3px;
}
.split-media img, .split-media video { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; box-shadow: 0 4px 14px rgba(0,200,80,.35);
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; text-align: center; }
.stat .num { font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 800; color: var(--brand-dark); letter-spacing: -0.03em; }
.stat .lbl { color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.stat .src { display: block; color: var(--ink-3); font-size: .8rem; margin-top: 4px; font-weight: 500; }

/* ---------- Before / After ---------- */
.ba { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.ba img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.ba-tag {
  position: absolute; top: 14px; left: 14px; background: rgba(11,21,18,.78); color: #fff;
  font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em;
}
.ba-tag--after { background: var(--brand); }

/* ---------- Testimonials ---------- */
/* testimonial-only grids stretch so cards in a row match height */
.tcard { display: flex; flex-direction: column; gap: 14px; }
.tcard blockquote { color: var(--ink-2); font-size: 1rem; flex: 1; }
.tcard .who { display: flex; align-items: center; gap: 12px; }
.tcard .who img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.tcard .who .name { font-weight: 700; font-size: .95rem; }
.tcard .who .role { color: var(--ink-3); font-size: .85rem; }

/* ---------- Pricing ---------- */
.toggle { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 40px; font-weight: 700; }
.toggle .save { color: var(--brand-darker); background: var(--brand-tint); border: 1px solid var(--brand-tint-2); font-size: .8rem; padding: 3px 10px; border-radius: 999px; }
.switch { position: relative; width: 52px; height: 28px; background: var(--line); border-radius: 999px; border: 0; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { left: 27px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: stretch; }
.plan { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 34px 30px; display: flex; flex-direction: column; }
.plan--hot { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.plan-flag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--brand-ink); font-size: .78rem; font-weight: 800;
  padding: 5px 16px; border-radius: 999px; white-space: nowrap;
}
.plan h3 { font-size: 1.25rem; }
.plan .price { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em; margin: 14px 0 2px; }
.plan .price small { font-size: 1rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.plan .was { color: var(--ink-3); text-decoration: line-through; font-weight: 600; font-size: .95rem; }
.plan .per { color: var(--ink-3); font-size: .9rem; margin-bottom: 20px; }
.plan ul { list-style: none; margin: 0 0 26px; }
.plan li { padding-left: 28px; position: relative; margin-bottom: 10px; color: var(--ink-2); font-size: .98rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-dark); font-weight: 800; }
.plan .btn { margin-top: auto; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: 1.08rem; padding: 20px 40px 20px 0;
  list-style: none; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--brand-dark); transition: transform .15s;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a { padding: 0 0 22px; color: var(--ink-2); }
.faq-group-title { margin: 40px 0 8px; font-size: 1.2rem; color: var(--ink-3); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink);
  border-radius: var(--radius-lg); color: #fff; text-align: center; padding: 72px 32px;
}
.cta-band h2 { color: #fff; margin-bottom: 14px; }
.cta-band p { color: #c8e6d9; max-width: 560px; margin: 0 auto 30px; font-size: 1.15rem; }
.cta-band .btn-note { color: #9fd8c0; }
.cta-band .btn-note strong { color: var(--brand); }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: none; transform: translateY(110%); transition: transform .25s ease;
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .btn { width: 100%; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #b7c6c0; padding: 64px 0 32px; margin-top: 0; }
.footer a { color: #b7c6c0; text-decoration: none; font-size: .95rem; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer h5 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer .logo { color: var(--brand); margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 26px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .875rem; color: #86988f; }

/* ---------- Blog cards ---------- */
.blog-card { text-decoration: none !important; color: inherit; display: block; }
.blog-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.blog-card .date { color: var(--ink-3); font-size: .85rem; margin-top: 6px; }

/* ---------- Legal ---------- */
.legal { max-width: 800px; margin: 0 auto; }
.legal h1 { margin-bottom: 8px; }
.legal .updated { color: var(--ink-3); margin-bottom: 36px; }
.legal h2 { font-size: 1.35rem; margin: 36px 0 12px; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 12px; }
.legal ul, .legal ol { padding-left: 24px; margin-bottom: 16px; }

/* ---------- Tool embed ---------- */
.tool-frame { width: 100%; height: 780px; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.rev > .split-media { order: 0; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 760px) {
  .section { padding: 52px 0; }
  .nav, .nav-cta .btn--ghost { display: none; }
  .hamburger { display: block; }
  .header.menu-open .nav {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 68px; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 16px 24px 24px; box-shadow: var(--shadow-lg);
  }
  .header.menu-open .nav a, .header.menu-open .dropdown { padding: 8px 0; width: 100%; }
  .dropdown-menu { position: static; box-shadow: none; border: 0; padding-left: 12px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .marquee--gallery img { height: 210px; }
  .sticky-cta { display: block; }
  .hero { padding-top: 44px; }
}

/* ============ v3: motion & modern layer (cerebric-inspired, caspa colours) ============ */

/* Morphing pill header */
.header { max-width: 100%; margin: 0 auto;
  transition: max-width .5s cubic-bezier(.22,1,.36,1), border-radius .5s cubic-bezier(.22,1,.36,1),
              box-shadow .4s, background .4s, border-color .4s, top .4s; }
.header.pill {
  top: 10px; max-width: 1120px; border-radius: 999px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(11,21,18,.12);
}
.header.pill .container { height: 56px; }
@media (max-width: 760px) {
  .header.pill { max-width: none; margin: 0 14px; }
  .header.menu-open .nav { top: 56px; border-radius: 0 0 20px 20px; }
}

/* Scroll reveal */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.rv.in { opacity: 1; transform: none; }

/* Hero ambient motion */


/* Typing cursor */
.type-cursor { display: inline-block; width: 3px; height: .95em; background: var(--brand-dark); margin-left: 3px; vertical-align: -0.12em; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }



/* Card lift */
.card, .plan { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.plan:hover { transform: translateY(-5px); }

/* Bento grid */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.tile { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.tile video, .tile > img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper-2); }
.tile--4 { display: grid; grid-template-columns: 1.05fr 1fr; align-items: stretch; }
.tile--4 video, .tile--4 > img { height: 100%; aspect-ratio: auto; min-height: 280px; }
.tile .tile-body { padding: 20px 22px 24px; }
.tile h3 { font-size: 1.15rem; margin-bottom: 6px; }
.tile p { color: var(--ink-2); font-size: .95rem; }
.tile--2 { grid-column: span 2; }
.tile--3 { grid-column: span 3; }
.tile--4 { grid-column: span 4; }
.tile--dark { background: var(--ink); border: 0; color: #fff; justify-content: center; padding: 34px; }
.tile--dark h3 { color: #fff; font-size: 1.5rem; }
.tile--dark p { color: #c8e6d9; }
.tile--dark .big { font-size: clamp(2.4rem, 4vw, 3.4rem); font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1; margin-bottom: 10px; }
@media (max-width: 960px) { .bento { grid-template-columns: 1fr 1fr; } .tile--2, .tile--3, .tile--4 { grid-column: span 2; } .tile--4 { display: flex; flex-direction: column; } }

/* Giant footer wordmark */
.mega { overflow: hidden; background: var(--ink); padding: 30px 0 0; line-height: .8; }
.mega .mega-track { display: flex; gap: 40px; width: max-content; animation: scroll 19s linear infinite; }
.mega span {
  font-size: clamp(90px, 16vw, 210px); font-weight: 900; letter-spacing: -.04em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(0,255,0,.28);
}

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .hero::after, .marquee-track, .mega .mega-track, .type-cursor { animation: none; }
}

/* ============ v4: dark mode + hero demo + logo ============ */

.logo-img { width: 30px; height: 30px; flex: none; }
.logo img { display: inline-block; }

/* Theme toggle */
.theme-toggle {
  background: none; border: 1.5px solid var(--line); border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
  transition: border-color .15s, color .15s, transform .3s;
}
.theme-toggle:hover { border-color: var(--ink-3); color: var(--ink); }

/* Dark theme */
html[data-theme="dark"] {
  --paper: #0a0f0d; --paper-2: #101713;
  --ink: #f2f7f4; --ink-2: #b9c6c0; --ink-3: #8fa39a;
  --line: #21302a;
  --brand-dark: #00e070; --brand-darker: #00d060;
  --brand-tint: #0f2417; --brand-tint-2: #1a3d28;
  --shadow: 0 4px 24px rgba(0,0,0,.45); --shadow-lg: 0 12px 48px rgba(0,0,0,.6);
}
html[data-theme="dark"] body { background: var(--paper); }
html[data-theme="dark"] .header { background: rgba(10,15,13,.9); }
html[data-theme="dark"] .header.pill { background: rgba(16,23,19,.76); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .plan,
html[data-theme="dark"] .tile:not(.tile--dark),
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .logostrip,
html[data-theme="dark"] .btn--ghost { background: var(--paper-2); }
html[data-theme="dark"] .btn--ghost { color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .sticky-cta { background: rgba(10,15,13,.94); }
html[data-theme="dark"] .switch { background: var(--line); }
html[data-theme="dark"] .logostrip img { filter: grayscale(1) invert(1); opacity: .6; }
html[data-theme="dark"] .footer { background: #060a08; }
html[data-theme="dark"] .mega { background: #060a08; }

/* Split hero with live demo */
.hero-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; text-align: left; }
.hero-split h1 { margin-left: 0; }
.hero-split .sub { margin-left: 0; }
.hero-split .hero-proof { justify-content: flex-start; }
@media (max-width: 960px) {
  .hero-split { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-split .hero-proof { justify-content: center; }
}

/* Before/after slider (shared) */
.baslider { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); touch-action: none; user-select: none; aspect-ratio: 1; max-width: 520px; margin: 0 auto; }
.baslider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.baslider .after-wrap { position: absolute; inset: 0; overflow: hidden; }
.baslider .handle { position: absolute; top: 0; bottom: 0; width: 4px; background: #fff; box-shadow: 0 0 14px rgba(0,0,0,.4); cursor: ew-resize; }
.baslider.easing .after-wrap { transition: clip-path .55s cubic-bezier(.22,1,.36,1); }
.baslider.easing .handle { transition: left .55s cubic-bezier(.22,1,.36,1); }
.baslider .handle::after { content: "◂ ▸"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: var(--brand); color: var(--brand-ink); font-size: .8rem; font-weight: 800; padding: 8px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.ba-tagl { position: absolute; top: 14px; font-size: .75rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; z-index: 2; }
.ba-tagl.b { left: 14px; background: rgba(11,21,18,.8); color: #fff; }
.ba-tagl.a { right: 14px; background: var(--brand); color: var(--brand-ink); }

/* Floating proof chip on the demo */
.float-chip {
  position: absolute; bottom: 18px; left: 18px; z-index: 3;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); color: var(--brand-ink);
  border-radius: 14px; padding: 10px 16px; font-weight: 800; font-size: .9rem;
  box-shadow: 0 8px 30px rgba(11,21,18,.25); animation: floaty 4s ease-in-out infinite alternate;
}
.float-chip b { color: #00803c; }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .float-chip { animation: none; } }

/* ============ v5: scrollytelling + progress bar ============ */

.progressbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); z-index: 200; transition: width .08s linear; }

.scrolly { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.scrolly-media {
  position: sticky; top: 110px; height: min(54vh, 440px); max-width: 460px;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
}
.scrolly-media { background: var(--paper-2); }
.scrolly-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform .8s ease;
}
.scrolly-media img.active { opacity: 1; transform: scale(1); }
.scrolly-media .stage {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  background: rgba(11,21,18,.8); color: #fff; font-size: .78rem; font-weight: 800;
  padding: 5px 13px; border-radius: 999px; backdrop-filter: blur(6px);
}
.sstep { min-height: 74vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity .4s ease; }
.sstep.active { opacity: 1; }
.sstep .snum { font-size: .82rem; font-weight: 800; letter-spacing: .1em; color: var(--brand-dark); text-transform: uppercase; margin-bottom: 10px; }
.sstep h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 12px; }
.sstep p { color: var(--ink-2); font-size: 1.1rem; }
.sstep .btn { align-self: flex-start; margin-top: 22px; }
@media (max-width: 860px) {
  .scrolly { grid-template-columns: 1fr; gap: 0; }
  .scrolly-media { top: 76px; height: 38vh; max-width: 100%; z-index: 5; }
  .sstep { min-height: 60vh; justify-content: flex-end; padding-bottom: 8vh; }
}


/* v6: modern how-it-works steps */
.step { position: relative; }
.step-ico {
  width: 58px; height: 58px; border-radius: 18px; margin-bottom: 18px; position: relative;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.step-ico svg { width: 28px; height: 28px; color: var(--brand-ink); }
.step-ico .n {
  position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: var(--brand); font-size: .74rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--paper);
}
.step { border-top: 3px solid transparent; }
.card.step:hover { border-color: var(--line); }
.steps-line { position: relative; }
html[data-theme="dark"] .step-ico { box-shadow: 0 8px 22px rgba(0,255,0,.15); }


/* v7: sequential step animation (grey -> brand as you scroll) */
.steps .step { opacity: 0; transform: translateY(26px); filter: grayscale(1); }
.steps .step.go {
  opacity: 1; transform: none; filter: grayscale(0);
  transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1), filter .9s ease;
}
.steps .step.go .step-ico { animation: stepPop .55s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes stepPop { 0% { transform: scale(.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.steps .step.go .step-ico::after {
  content: ""; position: absolute; inset: -6px; border-radius: 22px;
  border: 2px solid rgba(0,255,0,.5); animation: stepRing 1s ease-out .3s both;
}
@keyframes stepRing { from { opacity: 1; transform: scale(.85); } to { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .steps .step { opacity: 1; transform: none; filter: none; }
  .steps .step.go .step-ico, .steps .step.go .step-ico::after { animation: none; }
}


/* v8: mobile refinement */
@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .header .container { gap: 12px; height: 60px; }
  .logo { font-size: 1.12rem; gap: 6px; }
  .logo-img { width: 26px; height: 26px; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn--sm { padding: 8px 14px; font-size: .88rem; }
  .theme-toggle { width: 34px; height: 34px; }
  .announce { font-size: .78rem; padding: 7px 12px; line-height: 1.4; }
  .btn--lg { padding: 14px 26px; font-size: 1.02rem; width: auto; }
  .hero { padding: 36px 0 28px; }
  .hero .sub { font-size: 1.06rem; }
  .section { padding: 44px 0; }
  .section-head { margin-bottom: 32px; }
  .cta-band { padding: 48px 20px; border-radius: 18px; }
  .footer { padding: 44px 0 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; margin-bottom: 32px; }
  .footer ul[style] { flex-wrap: wrap; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .mega span { font-size: clamp(56px, 18vw, 90px); -webkit-text-stroke-width: 1px; }
  .mega .mega-track { gap: 22px; }
  main { padding-bottom: 4px; }
  body { padding-bottom: 64px; }   /* room for sticky CTA so footer isn't covered */
  .marquee--gallery img { height: 170px; }
  .plan { padding: 26px 20px; }
  .stats { gap: 14px; }
  .baslider { max-width: 100%; }
}
@media (max-width: 380px) {
  .logo { font-size: 1rem; }
  .nav-cta .btn--ghost { display: none; }
}


/* v9: dark mode legibility */
html[data-theme="dark"] {
  --brand-dark: #7bf57b;      /* links & accents readable on dark */
  --brand-darker: #58e26b;
}
html[data-theme="dark"] .eyebrow { color: #7bf57b; background: #12271a; border-color: #1e4a2c; }
html[data-theme="dark"] .announce { background: #2fd94f; color: #06130b; }
html[data-theme="dark"] .announce a { color: #06130b; }
html[data-theme="dark"] .nav .badge { color: #06130b; background: #7bf57b; }
html[data-theme="dark"] .plan-flag, html[data-theme="dark"] .step-ico { color: #06130b; }
html[data-theme="dark"] .step-ico svg { color: #06130b; }
html[data-theme="dark"] .step-ico .n { border-color: var(--paper-2); }
html[data-theme="dark"] .btn--ghost:hover { border-color: #52655c; }
html[data-theme="dark"] .float-chip b { color: #0a7a3c; }
html[data-theme="dark"] .qopt.sel { background: #12271a; }
html[data-theme="dark"] .qresult .save { color: #7bf57b; }
.theme-toggle:focus { outline: none; }
.theme-toggle:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }


/* v10: newsletter popup */
.nl-ov { position: fixed; inset: 0; z-index: 300; background: rgba(6,12,9,.62); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px; }
.nl-ov.on { display: flex; animation: nlfade .3s ease; }
@keyframes nlfade { from { opacity: 0; } }
.nl-modal { background: var(--paper); border-radius: 28px; max-width: 780px; width: 100%; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.35); position: relative; animation: nlpop .35s cubic-bezier(.22,1,.36,1); }

@keyframes nlpop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.nl-x { position: absolute; top: 10px; right: 14px; background: rgba(11,21,18,.55); color: #fff; border: 0;
  width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; line-height: 1; z-index: 2; }
.nl-imgs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; }
.nl-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.nl-body { padding: 22px 26px 20px; text-align: center; }
.nl-body h3 { font-size: 1.35rem; margin-bottom: 8px; }
.nl-sub { color: var(--ink-2); font-size: .95rem; margin-bottom: 12px; }
.nl-quote { font-size: .85rem; color: var(--ink-3); margin-bottom: 16px; }
.nl-quote .stars { font-size: .85rem; }
.nl-form { display: flex; gap: 8px; margin-bottom: 10px; }
.nl-form input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 12px 18px;
  font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink); min-width: 0; }
.nl-form input:focus { outline: none; border-color: var(--brand-hover); }
.nl-form .btn { padding: 12px 20px; font-size: .95rem; white-space: nowrap; }
.nl-consent { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: .78rem;
  color: var(--ink-3); margin-bottom: 12px; cursor: pointer; }
.nl-consent input { margin-top: 3px; accent-color: var(--brand-hover); }
.nl-consent.nl-err { color: #d33; }
.nl-no { background: none; border: 0; color: var(--ink-3); font: inherit; font-size: .82rem;
  cursor: pointer; text-decoration: underline; }
html[data-theme="dark"] .nl-modal { background: var(--paper-2); }
@media (max-width: 480px) { .nl-form { flex-direction: column; } .nl-body { padding: 18px 18px 16px; } }


/* v11: popup layout, final cascade */
.nl-ov .nl-body h3 { padding: 0 24px; }                    /* keep clear of the close chip on mobile */
.nl-ov .nl-x { background: rgba(11,21,18,.12); color: var(--ink); }
.nl-ov .nl-x:hover { background: rgba(11,21,18,.22); }
@media (min-width: 721px) {
  .nl-ov .nl-modal { display: grid; grid-template-columns: 320px 1fr; }
  .nl-ov .nl-imgs { display: block; height: 100%; min-height: 440px; }
  .nl-ov .nl-imgs img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; display: none; }
  .nl-ov .nl-imgs img:first-child { display: block; }
  .nl-ov .nl-body { padding: 46px 44px 38px; text-align: left; display: flex; flex-direction: column; justify-content: center; }
  .nl-ov .nl-body h3 { font-size: 1.65rem; line-height: 1.22; margin-bottom: 12px; padding: 0 30px 0 0; }
  .nl-ov .nl-sub { font-size: 1rem; margin-bottom: 18px; line-height: 1.6; }
  .nl-ov .nl-quote { text-align: left; margin-bottom: 20px; padding: 11px 15px; background: var(--paper-2); border-radius: 12px; }
  .nl-ov .nl-consent { margin: 14px 0; }
  .nl-ov .nl-no { text-align: left; align-self: flex-start; }
}
html[data-theme="dark"] .nl-ov .nl-x { background: rgba(255,255,255,.14); color: var(--ink); }
html[data-theme="dark"] .nl-ov .nl-quote { background: rgba(255,255,255,.06); }


/* v12: popup overflow fix — grid children must be allowed to shrink */
.nl-ov .nl-modal { max-width: 760px; }
.nl-ov .nl-body { min-width: 0; }
.nl-ov .nl-imgs { min-width: 0; }
.nl-ov .nl-form { flex-wrap: wrap; }
.nl-ov .nl-form input { flex: 1 1 180px; }
.nl-ov .nl-form .btn { flex: 1 1 auto; }
.nl-ov .nl-sub, .nl-ov .nl-quote, .nl-ov .nl-consent { overflow-wrap: break-word; }


/* v13: popup image slideshow — slow crossfade + gentle zoom */
@media (min-width: 721px) {
  .nl-ov .nl-imgs { position: relative; overflow: hidden; }
  .nl-ov .nl-imgs img,
  .nl-ov .nl-imgs img:first-child,
  .nl-ov .nl-imgs img:nth-child(n+2) {
    display: block; position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover; object-position: center 22%;
    opacity: 0; transform: scale(var(--z, 1.02));
    transition: opacity .8s ease, transform 6s ease-out;
  }
  .nl-ov .nl-imgs img.cur { opacity: 1; transform: scale(calc(var(--z, 1.02) * 1.07)); }
}
@media (prefers-reduced-motion: reduce) {
  .nl-ov .nl-imgs img, .nl-ov .nl-imgs img.cur { transform: none; transition: opacity .8s ease; }
}


/* ============ v14: dark-mode legibility pass + sizing consistency ============ */

/* Logo always bright green in dark mode */
html[data-theme="dark"] .logo { color: var(--brand); }

/* Panels that are dark-on-light in light mode must stay dark in dark mode
   (they use var(--ink) as background, which flips to near-white) */
html[data-theme="dark"] .cta-band,
html[data-theme="dark"] .tile--dark { background: #121a15; border: 1px solid var(--line); }

/* Step number badge: keep dark chip w/ green number */
html[data-theme="dark"] .step-ico .n { background: #06130b; }

/* Standalone demo videos (food, furniture, etc.): modest, centered */
.container > video[data-autoplay] { display: block; width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }

/* Results pairs: cap card image height so boxes stay balanced, no giant empty testimonials */
.grid--2 > .card > img { width: 100%; max-height: 340px; object-fit: cover; object-position: center 30%; }


/* ============ v15: success stories — case card wide + review band below ============ */
.case-wide { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; padding: 0; overflow: hidden; align-items: stretch; }
.case-wide > img { width: 100%; height: 100%; min-height: 240px; max-height: 320px; object-fit: cover; }
.case-wide .case-body { padding: 26px 30px; align-self: center; }
.case-solo { max-width: 780px; margin: 0 auto; text-align: center; }
.review-band {
  display: flex; gap: 20px; align-items: flex-start; margin: 24px auto 0; max-width: 880px;
  background: var(--brand-tint); border: 1px solid var(--brand-tint-2);
  border-radius: var(--radius-lg); padding: 26px 32px;
}
.review-band .rb-mark { font-family: Georgia, 'Times New Roman', serif; font-size: 3.6rem; line-height: .9; color: var(--brand-dark); flex: none; }
.review-band blockquote { margin: 6px 0 10px; color: var(--ink-2); font-size: 1.06rem; }
.review-band figcaption { font-size: .92rem; color: var(--ink-3); }
.review-band figcaption b { color: var(--ink); font-weight: 700; }
@media (max-width: 720px) {
  .case-wide { grid-template-columns: 1fr; }
  .case-wide > img { max-height: 220px; min-height: 0; }
  .review-band { padding: 20px; gap: 12px; }
  .review-band .rb-mark { font-size: 2.6rem; }
}


/* ============ v16: sizing consistency pass ============ */
/* Case study + review band: identical width, centered */
.case-wide, .case-solo { max-width: 880px; margin-left: auto; margin-right: auto; }
.review-band { max-width: 880px; }

/* Image pairs/quads inside split sections: uniform squares so heights always match */
.split-media .grid img { aspect-ratio: 1; object-fit: cover; width: 100%; }


/* ============ v17: wide scrolly variant (before/after strips) + equal review cards ============ */
.scrolly--wide { grid-template-columns: 1.22fr .78fr; }
.scrolly--wide .scrolly-media { max-width: 640px; height: auto; aspect-ratio: 2 / 1; }
@media (max-width: 860px) {
  .scrolly--wide { grid-template-columns: 1fr; }
  .scrolly--wide .scrolly-media { height: auto; aspect-ratio: 2 / 1; max-height: 38vh; }
}


/* ============ v18: wide scrolly polish ============ */
/* Strip images carry their own baked BEFORE/AFTER labels — hide our stage pill so bubbles don't collide */
.scrolly--wide .scrolly-media .stage { display: none; }
/* Level the chapter text with the (shorter) wide media instead of centering it far below */
@media (min-width: 861px) {
  .scrolly--wide .sstep:last-child { padding-bottom: 12vh; }
}

/* v19: exact strip ratio (3042x1344) so baked BEFORE/AFTER bubbles are never cropped,
   and chapter 1 text starts level with the top of the image on every use-case page */
.scrolly--wide .scrolly-media { aspect-ratio: 3042 / 1344; }
@media (max-width: 860px) {
  .scrolly--wide .scrolly-media { aspect-ratio: 3042 / 1344; max-height: none; }
}
@media (min-width: 861px) {
  .sstep:first-child { justify-content: flex-start; padding-top: 6px; min-height: 60vh; }
}
