/* BizGen engine stylesheet — consumes per-tenant theme tokens only.
   Tokens: --accent --accent-hover --tint --ink --canvas --surface --border
           --font-heading --font-body --radius */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  font-size: 1.0625rem;
  overflow-x: clip; /* belt-and-braces: the page body never scrolls sideways */
}
h1, h2, h3, p { overflow-wrap: break-word; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.375rem); font-weight: 700; }
h3 { font-size: 1.1875rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 46rem; }

.section { padding: 4.5rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-head { text-align: center; max-width: 42rem; margin: 0 auto 3rem; }
.section-sub { color: color-mix(in srgb, var(--ink) 65%, transparent); font-size: 1.125rem; margin: 0; }
.eyebrow {
  display: inline-block;
  color: var(--accent);
  background: var(--tint);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin: 0 0 1.25rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.65rem 1.35rem;
  border-radius: calc(var(--radius) * 0.75);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.0625rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink, #fff); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-inverse { background: var(--canvas); color: var(--accent); }
.btn-inverse:hover { background: var(--surface); }

/* Header / footer */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 0.55rem; padding-bottom: 0.55rem; }
.logo { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: var(--ink); display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.logo-img { height: 3.5rem; width: auto; max-width: 18rem; object-fit: contain; display: block; }
.logo-img-footer { height: 2.25rem; }
.site-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.site-nav a { color: var(--ink); font-weight: 500; font-size: 0.9375rem; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.header-cta { white-space: nowrap; }

/* Mobile nav: <details> hamburger — zero JS */
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { list-style: none; cursor: pointer; padding: 0.5rem; margin: -0.5rem; display: flex; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav-bars { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.mobile-nav-bars span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.mobile-nav[open] .mobile-nav-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav[open] .mobile-nav-bars span:nth-child(2) { opacity: 0; }
.mobile-nav[open] .mobile-nav-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav-panel {
  position: absolute; right: -0.25rem; top: calc(100% + 0.85rem);
  min-width: 13rem; display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.85rem; box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--ink) 35%, transparent);
  z-index: 20;
}
.mobile-nav-panel a { color: var(--ink); font-weight: 500; padding: 0.45rem 0.6rem; border-radius: calc(var(--radius) * 0.5); }
.mobile-nav-panel a:hover { background: var(--surface); text-decoration: none; }
.mobile-nav-panel .btn { color: var(--accent-ink, #fff); text-align: center; margin-top: 0.35rem; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-blurb { color: color-mix(in srgb, var(--ink) 60%, transparent); max-width: 24rem; font-size: 0.9375rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--ink); font-size: 0.9375rem; }
.footer-copyright { margin-top: 2.5rem; font-size: 0.8125rem; color: color-mix(in srgb, var(--ink) 50%, transparent); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.made-with {
  color: color-mix(in srgb, var(--ink) 60%, transparent);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.75rem;
  font-size: 0.75rem; text-decoration: none; white-space: nowrap;
}
.made-with strong { color: var(--ink); }
.made-with:hover { border-color: var(--accent); text-decoration: none; }

/* Hero */
.hero { padding-top: 6rem; }
.hero-center { text-align: center; }
.hero-center .hero-sub, .hero-center .hero-image { margin-left: auto; margin-right: auto; }
.hero-sub { font-size: 1.25rem; color: color-mix(in srgb, var(--ink) 70%, transparent); max-width: 38rem; }
.hero-actions { display: flex; gap: 0.85rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-center .hero-actions { justify-content: center; }
.hero-note { margin: 0.9rem 0 0; font-size: 0.9375rem; color: color-mix(in srgb, var(--ink) 60%, transparent); }
.hero-center .hero-note { margin-left: auto; margin-right: auto; }
.hero-image {
  margin-top: 3rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Cards / grids */
.grid { display: grid; gap: 1.25rem; }
.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: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.card p { margin: 0; color: color-mix(in srgb, var(--ink) 70%, transparent); font-size: 0.9688rem; }
.card-icon { font-size: 1.75rem; margin-bottom: 0.85rem; color: var(--accent); }
.card-icon svg { width: 1.75rem; height: 1.75rem; display: block; }
.card-image { width: 100%; height: 11rem; object-fit: cover; border-radius: calc(var(--radius) * 0.75); margin-bottom: 1rem; }

/* Stats */
.stats { background: var(--tint); }
.stats-row { display: flex; justify-content: space-around; gap: 2rem; flex-wrap: wrap; text-align: center; }
.stat-value { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.9375rem; color: color-mix(in srgb, var(--ink) 65%, transparent); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-num {
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink, #fff);
  font-family: var(--font-heading); font-weight: 700;
  border-radius: 999px; margin-bottom: 1rem;
}
.step p { color: color-mix(in srgb, var(--ink) 70%, transparent); margin: 0; }

/* Testimonials */
.quote blockquote { margin: 0 0 1rem; }
.quote blockquote p { font-size: 1.0625rem; color: var(--ink); }
.quote figcaption { font-size: 0.9375rem; }
.quote-role { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.quote-attribution { display: flex; align-items: center; gap: 0.65rem; }
.quote-avatar { width: 2.5rem; height: 2.5rem; border-radius: 999px; object-fit: cover; }

/* Pricing */
.pricing-grid { align-items: stretch; }
.tier { display: flex; flex-direction: column; }
.tier-highlighted { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); position: relative; }
.tier-price { font-family: var(--font-heading); font-size: 2.25rem; font-weight: 800; margin: 0.25rem 0 1rem; }
.tier-period { font-size: 1rem; font-weight: 500; color: color-mix(in srgb, var(--ink) 55%, transparent); }
.tier-features { list-style: none; margin: 0 0 1.5rem; padding: 0; flex: 1; }
.tier-features li { padding: 0.35rem 0 0.35rem 1.5rem; position: relative; font-size: 0.9375rem; }
.tier-features li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.tier .btn { text-align: center; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.faq-item summary { font-family: var(--font-heading); font-weight: 600; cursor: pointer; }
.faq-item[open] summary { margin-bottom: 0.5rem; }
.faq-item p { margin: 0; color: color-mix(in srgb, var(--ink) 70%, transparent); }

/* Logo strip */
.logo-strip-heading { text-align: center; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; color: color-mix(in srgb, var(--ink) 50%, transparent); margin-bottom: 1.25rem; }
.logo-strip { display: flex; justify-content: center; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.logo-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.125rem; color: color-mix(in srgb, var(--ink) 40%, transparent); white-space: nowrap; }
.logo-strip-img { height: 2rem; width: auto; max-width: 10rem; object-fit: contain; opacity: 0.75; }

/* Marquee mode: two copies of the strip scroll left; seamless because copy 2
   starts where copy 1 ends. Pauses on hover; static for reduced-motion. */
.logo-marquee { display: flex; gap: 2.5rem; overflow: hidden; }
.logo-marquee .logo-strip { flex: 0 0 auto; min-width: 100%; flex-wrap: nowrap; justify-content: space-around; animation: logo-scroll 28s linear infinite; }
.logo-marquee:hover .logo-strip { animation-play-state: paused; }
@keyframes logo-scroll { to { transform: translateX(calc(-100% - 2.5rem)); } }
@media (prefers-reduced-motion: reduce) {
  .logo-marquee { flex-wrap: wrap; }
  .logo-marquee .logo-strip { animation: none; min-width: 0; }
  .logo-marquee .logo-strip[aria-hidden='true'] { display: none; }
}

/* Rich text */
.richtext { overflow-wrap: break-word; }
.richtext ul, .richtext ol { padding-left: 1.5rem; }
.richtext blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding-left: 1.25rem; color: color-mix(in srgb, var(--ink) 75%, transparent); }
.richtext pre { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 0.5); padding: 1rem; overflow-x: auto; }

/* CTA banner */
.cta-banner {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  border-radius: var(--radius);
  padding: 3.5rem 2rem;
  text-align: center;
}
.cta-banner-image {
  background-size: cover;
  background-position: center;
  position: relative;
  isolation: isolate;
}
.cta-banner-image::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--accent) 78%, #000 10%);
  opacity: 0.88;
  border-radius: inherit;
}
.cta-banner h2 { color: var(--accent-ink, #fff); }
.cta-banner-sub { color: color-mix(in srgb, var(--accent-ink, #fff) 85%, transparent); font-size: 1.125rem; max-width: 34rem; margin: 0 auto 1.75rem; }

/* Video (lite embed) */
.video-facade {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; background: #000;
}
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.15s ease; }
.video-facade:hover img { opacity: 1; }
.video-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4.25rem; height: 3rem; background: var(--accent); border-radius: calc(var(--radius) * 0.75);
  display: flex; align-items: center; justify-content: center;
}
.video-play::after { content: ''; border-style: solid; border-width: 0.55rem 0 0.55rem 0.95rem; border-color: transparent transparent transparent var(--accent-ink, #fff); margin-left: 0.15rem; }
.video-player { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #000; }
.video-caption { text-align: center; font-size: 0.9rem; color: color-mix(in srgb, var(--ink) 60%, transparent); margin-top: 0.75rem; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.contact-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; font-size: 0.9375rem; flex: 1; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-form input, .contact-form textarea, .contact-form select {
  font-family: inherit;
  font-size: max(1rem, 16px); /* <16px focused inputs make iOS Safari zoom the page */
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.5);
  padding: 0.6rem 0.85rem;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.contact-form .btn { align-self: flex-start; }
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
/* Pending state while HTMX submits the form */
.contact-form.htmx-request button[type='submit'] { opacity: 0.55; cursor: wait; }
.contact-form.htmx-request button[type='submit']::after { content: ' …'; }

.form-success {
  background: var(--tint);
  border: 1px solid var(--accent);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  font-weight: 500;
}
.form-error {
  border: 1px solid #dc2626;
  color: #dc2626;
  border-radius: calc(var(--radius) * 0.5);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}

/* ===== Style variants — component structure per theme.styleVariant ===== */

/* editorial: left-set oversized type, rules instead of card boxes */
.style-editorial h1 { font-size: clamp(2.8rem, 8vw, 4.75rem); letter-spacing: -0.025em; }
.style-editorial .hero-center { text-align: left; }
.style-editorial .hero-center .hero-actions { justify-content: flex-start; }
.style-editorial .hero-center .hero-sub, .style-editorial .hero-center .hero-image { margin-left: 0; }
.style-editorial .section-head { text-align: left; margin-left: 0; max-width: 46rem; }
.style-editorial main > .section + .section { border-top: 1px solid var(--border); }
.style-editorial .eyebrow { background: transparent; padding: 0 0 0.3rem; border-radius: 0; border-bottom: 2px solid var(--accent); }
.style-editorial .card { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; padding: 1.25rem 0 0; }
.style-editorial .btn { border-radius: 0; }
.style-editorial .stats { background: transparent; }
.style-editorial .stat-value { color: var(--ink); }
.style-editorial .faq-item { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding-left: 0; padding-right: 0; }
.style-editorial .step-num { background: transparent; color: var(--accent); border: 2px solid var(--accent); border-radius: 0; }
.style-editorial .cta-banner { border-radius: 0; }
.style-editorial .hero-image { border-radius: 0; }
.style-editorial .tier-highlighted { box-shadow: none; border: 0; border-top: 4px solid var(--accent); }

/* soft: pills, floating shadows, alternating tinted sections */
.style-soft .btn { border-radius: 999px; }
.style-soft .card { border: 0; box-shadow: 0 14px 36px -18px color-mix(in srgb, var(--ink) 28%, transparent); }
.style-soft main > .section:nth-of-type(even) { background: var(--surface); }
.style-soft .card, .style-soft .faq-item { background: var(--canvas); }
.style-soft .faq-item { border: 0; box-shadow: 0 8px 24px -14px color-mix(in srgb, var(--ink) 25%, transparent); }
.style-soft .hero-image { border: 0; box-shadow: 0 36px 72px -36px color-mix(in srgb, var(--accent) 50%, transparent); }
.style-soft .contact-form input, .style-soft .contact-form textarea { border-radius: 999px; padding-left: 1.1rem; }
.style-soft .contact-form textarea { border-radius: var(--radius); }
.style-soft .tier-highlighted { box-shadow: 0 20px 48px -20px color-mix(in srgb, var(--accent) 55%, transparent); border: 0; }

/* brutalist: thick ink borders, hard offset shadows, uppercase display */
.style-brutalist h1, .style-brutalist h2 { text-transform: uppercase; letter-spacing: 0; }
.style-brutalist .btn { border-radius: 0; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform 0.08s ease, box-shadow 0.08s ease; }
.style-brutalist .btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.style-brutalist .btn-inverse { border-color: var(--canvas); box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 60%, transparent); }
.style-brutalist .card { background: var(--canvas); border: 2px solid var(--ink); border-radius: 0; box-shadow: 6px 6px 0 var(--ink); }
.style-brutalist .eyebrow { background: var(--tint); border: 2px solid var(--ink); border-radius: 0; }
.style-brutalist .faq-item { background: var(--canvas); border: 2px solid var(--ink); border-radius: 0; }
.style-brutalist .site-header { border-bottom: 2px solid var(--ink); }
.style-brutalist .site-footer { border-top: 2px solid var(--ink); }
.style-brutalist .hero-image { border: 2px solid var(--ink); border-radius: 0; box-shadow: 8px 8px 0 var(--ink); }
.style-brutalist .cta-banner { border-radius: 0; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.style-brutalist .step-num { border-radius: 0; }
.style-brutalist .stats { border-block: 2px solid var(--ink); }
.style-brutalist .tier-highlighted { border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--accent); }
.style-brutalist .contact-form input, .style-brutalist .contact-form textarea { border: 2px solid var(--ink); border-radius: 0; }

/* Responsive */
@media (max-width: 56rem) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .site-nav { display: none; }
  .mobile-nav { display: block; }
}
@media (max-width: 40rem) {
  .section { padding: 3rem 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding-top: 3.5rem; }
  .header-cta { padding: 0.5rem 0.9rem; font-size: 0.875rem; }
  .stats-row { gap: 1.25rem 2rem; }
}

/* Site assistant widget ("Ask us anything") */
.assist { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
.assist-toggle {
  border: 0; cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: 0.9375rem;
  background: var(--accent); color: var(--accent-ink, #fff);
  padding: 0.7rem 1.1rem; border-radius: 999px;
  box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--ink) 45%, transparent);
}
.assist-toggle-close { display: none; font-size: 1.05rem; padding: 0 0.25rem; }
.assist-open .assist-toggle-open { display: none; }
.assist-open .assist-toggle-close { display: inline; }
.assist-panel {
  width: min(22rem, calc(100vw - 2.5rem)); height: 26rem; display: flex; flex-direction: column;
  background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 64px -24px color-mix(in srgb, var(--ink) 55%, transparent); overflow: hidden;
}
.assist-panel[hidden] { display: none; }
.assist-head { background: var(--accent); color: var(--accent-ink, #fff); font-family: var(--font-heading); font-weight: 700; padding: 0.75rem 1rem; }
.assist-log { flex: 1; overflow-y: auto; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
.assist-msg { max-width: 85%; padding: 0.5rem 0.75rem; border-radius: calc(var(--radius) * 0.75); font-size: 0.9375rem; line-height: 1.45; }
.assist-them { background: var(--surface); border: 1px solid var(--border); color: var(--ink); align-self: flex-start; }
.assist-you { background: var(--accent); color: var(--accent-ink, #fff); align-self: flex-end; }
.assist-form { display: flex; gap: 0.5rem; padding: 0.65rem; border-top: 1px solid var(--border); }
.assist-form input[name="q"] {
  flex: 1; min-width: 0; font: inherit; font-size: max(1rem, 16px);
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 0.75);
  padding: 0.5rem 0.7rem; background: var(--canvas); color: var(--ink);
}
.assist-form .btn { padding: 0.5rem 0.9rem; }
@media (max-width: 40rem) { .assist { right: 0.75rem; bottom: 0.75rem; } .assist-panel { height: min(24rem, 70vh); } }
@media print { .assist { display: none; } }
