/* ==========================================================================
   Customer sites — shared foundation (v2, 2026-09-06)
   Five fictional trade shops, five distinct structures, one contract.

   How theming works
   -----------------
   • Each site sets its own default look on <body>: data-trade, data-scheme="light|dark",
     and (optionally) --cs-* overrides in its own site.css.
   • The Demo kit "Looks" panel (css-pro/theme-presets.js) writes --pro-* variables plus
     data-layout / data-surface-mode on <html data-mall-theme>. Section 2 maps those onto
     the --cs-* tokens, so any palette flows through every site without per-site rules.
   • Layout variants from the Looks panel (data-layout) are handled as a few structural
     knobs in section 9. Each site's *default* structure is its own; layouts only nudge.

   Hooks other scripts rely on (do not rename)
   -------------------------------------------
   .cs-topbar .cs-nav .cs-nav-toggle  (motion-ui.js mobile nav + scroll state)
   .ms-reveal / .ms-reveal-stagger     (motion-ui.js scroll reveals)
   form.cs-form #cs-request-form #cs-form-status .cs-shop-handoff  (request-form.js)
   #request  #cs-chat-root .cs-chat-*  (deep-link.js, chat-embed.js)
   .cs-btn .cs-btn--primary .cs-btn--ghost .cs-sticky
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
.cs-body {
  --cs-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cs-font-display: var(--cs-font);
  --cs-r: 10px;
  --cs-r-lg: 18px;
  --cs-r-btn: 999px;
  --cs-wrap: 1120px;
  --cs-gutter: clamp(18px, 4vw, 40px);
  --cs-section: clamp(56px, 5vw + 24px, 104px);
  --cs-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* neutral defaults — every site overrides brand + scheme */
  --cs-brand: #0f766e;
  --cs-brand-dark: #115e59;
  --cs-brand-ink: #ffffff;          /* text on brand */
  --cs-brand-soft: rgba(15, 118, 110, 0.10);
  --cs-accent-2: #d97706;           /* secondary accent, used sparingly */
}

/* Light scheme */
.cs-body[data-scheme="light"] {
  color-scheme: light;
  --cs-bg: #f7f6f2;
  --cs-bg-2: #efede7;
  --cs-surface: #ffffff;
  --cs-surface-2: #f3f2ee;
  --cs-ink: #0f1522;
  --cs-ink-2: #3a4150;
  --cs-muted: #6b7280;
  --cs-line: rgba(15, 21, 34, 0.10);
  --cs-line-strong: rgba(15, 21, 34, 0.22);
  --cs-shadow: 0 1px 2px rgba(15, 21, 34, 0.04), 0 14px 34px -14px rgba(15, 21, 34, 0.18);
  --cs-shadow-lg: 0 2px 4px rgba(15, 21, 34, 0.05), 0 28px 60px -24px rgba(15, 21, 34, 0.28);
}

/* Dark scheme */
.cs-body[data-scheme="dark"] {
  color-scheme: dark;
  --cs-bg: #0c1017;
  --cs-bg-2: #11161f;
  --cs-surface: #141a24;
  --cs-surface-2: #1a212d;
  --cs-ink: #edebe6;
  --cs-ink-2: #b9bcc4;
  --cs-muted: #8a909c;
  --cs-line: rgba(237, 235, 230, 0.10);
  --cs-line-strong: rgba(237, 235, 230, 0.22);
  --cs-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  --cs-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 30px 70px -26px rgba(0, 0, 0, 0.75);
}

/* ---------- 2. Demo-kit "Looks" bridge ---------- */
/* When the kit applies a palette, --pro-* wins and the scheme follows surface-mode. */
/* specificity beats per-site .cs-body[data-trade][data-scheme] token overrides */
html[data-mall-theme] .cs-body[data-trade][data-scheme], html[data-mall-theme] .cs-body {
  --cs-brand: var(--pro-brand, var(--cs-brand));
  --cs-brand-dark: var(--pro-brand-dark, var(--cs-brand-dark));
  --cs-brand-soft: var(--pro-brand-soft, var(--cs-brand-soft));
  --cs-bg: var(--pro-bg, var(--cs-bg));
  --cs-surface: var(--pro-surface, var(--cs-surface));
  --cs-ink: var(--pro-ink, var(--cs-ink));
  --cs-muted: var(--pro-muted, var(--cs-muted));
  --cs-line: var(--pro-line, var(--cs-line));
  --cs-r: var(--theme-radius, var(--cs-r));
  --cs-r-btn: var(--theme-btn-radius, var(--cs-r-btn));
  --cs-font: var(--theme-font, var(--cs-font));
}
html[data-mall-theme][data-surface-mode="light"] .cs-body[data-trade][data-scheme], html[data-mall-theme][data-surface-mode="light"] .cs-body {
  color-scheme: light;
  --cs-ink-2: color-mix(in srgb, var(--cs-ink) 78%, var(--cs-bg));
  --cs-bg-2: color-mix(in srgb, var(--cs-bg) 92%, var(--cs-ink));
  --cs-surface-2: color-mix(in srgb, var(--cs-surface) 94%, var(--cs-ink));
  --cs-line-strong: color-mix(in srgb, var(--cs-ink) 24%, transparent);
  --cs-brand-ink: #ffffff;
}
html[data-mall-theme][data-surface-mode="dark"] .cs-body[data-trade][data-scheme], html[data-mall-theme][data-surface-mode="dark"] .cs-body {
  color-scheme: dark;
  --cs-ink-2: color-mix(in srgb, var(--cs-ink) 78%, var(--cs-bg));
  --cs-bg-2: color-mix(in srgb, var(--cs-bg) 90%, var(--cs-ink));
  --cs-surface-2: color-mix(in srgb, var(--cs-surface) 92%, var(--cs-ink));
  --cs-line-strong: color-mix(in srgb, var(--cs-ink) 24%, transparent);
  --cs-brand-ink: #ffffff;
}

/* ---------- 3. Base ---------- */
.cs-body {
  margin: 0;
  font-family: var(--cs-font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cs-ink);
  background: var(--cs-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.cs-body *, .cs-body *::before, .cs-body *::after { box-sizing: border-box; }
.cs-body img, .cs-body svg { display: block; max-width: 100%; }
.cs-body a:not(.cs-btn):not(.cs-link) { color: inherit; }
.cs-body h1, .cs-body h2, .cs-body h3, .cs-body h4 { margin: 0; font-family: var(--cs-font-display); letter-spacing: -0.015em; line-height: 1.12; font-weight: 600; }
.cs-body p { margin: 0; }
.cs-body ul, .cs-body ol { margin: 0; padding: 0; }
.cs-body ::selection { background: var(--cs-brand-soft); }

.cs-skip { position: absolute; left: -9999px; top: 0; z-index: 10000; padding: 10px 16px; background: var(--cs-ink); color: var(--cs-bg); font-weight: 600; font-size: 14px; text-decoration: none; border-radius: 0 0 8px 0; }
.cs-skip:focus { left: 0; outline: 2px solid var(--cs-brand); outline-offset: 2px; }
.cs-body :focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }
.cs-body a:focus:not(:focus-visible), .cs-body button:focus:not(:focus-visible) { outline: none; }

.cs-wrap { width: min(100% - var(--cs-gutter) * 2, var(--cs-wrap)); margin-inline: auto; }
.cs-section { padding-block: var(--cs-section); }
.cs-section--tight { padding-block: calc(var(--cs-section) * 0.6); }
.cs-section--band { background: var(--cs-bg-2); border-block: 1px solid var(--cs-line); }
.cs-section--surface { background: var(--cs-surface); border-block: 1px solid var(--cs-line); }

.cs-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; color: var(--cs-brand); margin-bottom: 14px; }
.cs-eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }
.cs-h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 4rem); line-height: 1.04; letter-spacing: -0.025em; }
.cs-h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); }
.cs-h3 { font-size: 1.125rem; }
.cs-lead { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; color: var(--cs-ink-2); max-width: 56ch; }
.cs-muted { color: var(--cs-muted); }
.cs-small { font-size: 0.875rem; }
.cs-head { max-width: 62ch; margin-bottom: clamp(28px, 3vw, 44px); }
.cs-head h2 { margin-bottom: 10px; }
.cs-head p { color: var(--cs-ink-2); font-size: 1.05rem; }
.cs-head--center { margin-inline: auto; text-align: center; }
.cs-head--center .cs-eyebrow::before { display: none; }

/* ---------- 4. Buttons, pills, links ---------- */
.cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: var(--cs-r-btn); font: inherit; font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform 0.25s var(--cs-ease), background-color 0.2s, border-color 0.2s, color 0.2s; white-space: nowrap; }
.cs-btn:active { transform: translateY(1px); }
.cs-btn--primary { background: var(--cs-brand); color: var(--cs-brand-ink); border-color: var(--cs-brand); }
.cs-btn--primary:hover { background: var(--cs-brand-dark); border-color: var(--cs-brand-dark); }
.cs-btn--ghost { background: transparent; color: var(--cs-ink); border-color: var(--cs-line-strong); }
.cs-btn--ghost:hover { border-color: var(--cs-ink); background: var(--cs-surface); }
.cs-btn--soft { background: var(--cs-brand-soft); color: var(--cs-brand-dark); border-color: transparent; }
.cs-btn--soft:hover { background: var(--cs-brand); color: var(--cs-brand-ink); }
.cs-btn--block { width: 100%; }
.cs-btn--lg { padding: 16px 28px; font-size: 16px; }
.cs-btn .ci, .cs-btn svg { width: 16px; height: 16px; flex: none; }
.cs-body[data-scheme="dark"] .cs-btn--ghost { border-color: var(--cs-line-strong); }

.cs-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink-2); }
.cs-pill--brand { background: var(--cs-brand-soft); color: var(--cs-brand-dark); border-color: transparent; }
.cs-trust { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-link { color: var(--cs-brand-dark); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.cs-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.cs-link::after { content: "→"; transition: transform 0.25s var(--cs-ease); }
.cs-link:hover::after { transform: translateX(3px); }
.cs-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- 5. Topbar + nav ---------- */
.cs-utility { background: var(--cs-ink); color: var(--cs-bg); font-size: 13px; text-align: center; padding: 8px var(--cs-gutter); }
.cs-utility a { color: inherit; font-weight: 600; }
.cs-utility--brand { background: var(--cs-brand); color: var(--cs-brand-ink); }
.cs-utility--soft { background: var(--cs-brand-soft); color: var(--cs-brand-dark); border-bottom: 1px solid var(--cs-line); }

.cs-topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--cs-bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color 0.3s, background-color 0.3s; }
.cs-topbar.is-scrolled { border-bottom-color: var(--cs-line); }
.cs-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; width: min(100% - var(--cs-gutter) * 2, var(--cs-wrap)); margin-inline: auto; position: relative; }
.cs-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cs-ink); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.cs-logo-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--cs-brand); color: var(--cs-brand-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.02em; flex: none; }
.cs-logo-mark svg { width: 20px; height: 20px; }
.cs-nav { display: flex; gap: 22px; font-size: 14.5px; font-weight: 500; }
.cs-nav a { color: var(--cs-ink-2); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.cs-nav a:hover { color: var(--cs-ink); border-bottom-color: var(--cs-ink); }
.cs-topbar-actions { display: inline-flex; align-items: center; gap: 8px; }
.cs-topbar-phone { font-weight: 700; text-decoration: none; color: var(--cs-ink); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.cs-topbar-phone svg { width: 16px; height: 16px; color: var(--cs-brand); }
.cs-nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 10px; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink); cursor: pointer; }
.cs-nav-toggle svg { width: 20px; height: 20px; }
.cs-nav-toggle .cs-ico-close { display: none; }
.cs-nav-toggle[aria-expanded="true"] .cs-ico-menu { display: none; }
.cs-nav-toggle[aria-expanded="true"] .cs-ico-close { display: block; }
@media (max-width: 860px) {
  .cs-nav-toggle { display: inline-flex; }
  .cs-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; padding: 6px 0 10px; background: var(--cs-surface); border-bottom: 1px solid var(--cs-line); box-shadow: var(--cs-shadow); z-index: 45; }
  .cs-nav.is-open { display: flex; }
  .cs-nav a { display: block; padding: 12px var(--cs-gutter); font-size: 15px; font-weight: 600; border-bottom: 0; }
  .cs-topbar-phone span { display: none; }
}
@media (max-width: 560px) { .cs-topbar .cs-topbar-cta { display: none; } }

/* ---------- 6. Cards, lists, media ---------- */
.cs-card { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: var(--cs-r-lg); padding: clamp(20px, 2.5vw, 28px); }
.cs-card--flat { box-shadow: none; }
.cs-card--lift { box-shadow: var(--cs-shadow); }
.cs-grid { display: grid; gap: 16px; }
.cs-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .cs-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cs-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cs-grid--2, .cs-grid--3, .cs-grid--4 { grid-template-columns: 1fr; } }

.cs-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--cs-brand-soft); color: var(--cs-brand-dark); flex: none; }
.cs-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
.cs-body[data-scheme="dark"] .cs-icon { color: var(--cs-brand); }

.cs-feature { display: grid; gap: 12px; }
.cs-feature h3 { font-size: 1.1rem; }
.cs-feature p { color: var(--cs-ink-2); font-size: 0.95rem; }

.cs-svc { list-style: none; display: grid; }
.cs-svc li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--cs-line); }
.cs-svc li:last-child { border-bottom: 0; }
.cs-svc li > span:first-child { font-weight: 600; }

.cs-faq details { border-top: 1px solid var(--cs-line); }
.cs-faq details:last-child { border-bottom: 1px solid var(--cs-line); }
.cs-faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cs-faq summary::-webkit-details-marker { display: none; }
.cs-faq summary::after { content: "+"; font-weight: 400; font-size: 1.4rem; color: var(--cs-muted); transition: transform 0.3s var(--cs-ease); line-height: 1; }
.cs-faq details[open] summary::after { transform: rotate(45deg); }
.cs-faq-body { padding: 0 0 18px; color: var(--cs-ink-2); max-width: 64ch; }

.cs-steps { counter-reset: step; list-style: none; display: grid; gap: 16px; }
.cs-step { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.cs-step::before { content: counter(step, decimal-leading-zero); font-family: var(--cs-font-display); font-weight: 600; font-size: 1.15rem; color: var(--cs-brand); border: 1px solid var(--cs-line-strong); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; }
.cs-step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.cs-step p { color: var(--cs-ink-2); font-size: 0.95rem; }

/* Illustrative "photo" blocks — CSS/SVG only, never stock imagery */
.cs-media { position: relative; overflow: hidden; border-radius: var(--cs-r-lg); background: var(--cs-surface-2); border: 1px solid var(--cs-line); aspect-ratio: 4 / 3; }
.cs-media svg { width: 100%; height: 100%; }
.cs-media--wide { aspect-ratio: 16 / 9; }
.cs-media--tall { aspect-ratio: 3 / 4; }

/* ---------- 7. Form ---------- */
.cs-form { display: grid; gap: 14px; }
.cs-form label { font-size: 13px; font-weight: 600; color: var(--cs-ink-2); }
.cs-form label + input, .cs-form label + select, .cs-form label + textarea { margin-top: -8px; }
.cs-form input, .cs-form select, .cs-form textarea { width: 100%; font: inherit; font-size: 15px; padding: 12px 14px; border-radius: var(--cs-r); border: 1px solid var(--cs-line-strong); background: var(--cs-surface); color: var(--cs-ink); transition: border-color 0.2s, box-shadow 0.2s; }
.cs-form input::placeholder, .cs-form textarea::placeholder { color: var(--cs-muted); }
.cs-form input:focus, .cs-form select:focus, .cs-form textarea:focus { outline: none; border-color: var(--cs-brand); box-shadow: 0 0 0 3px var(--cs-brand-soft); }
.cs-form textarea { resize: vertical; min-height: 96px; }
.cs-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cs-form-row > div { display: grid; gap: 6px; }
@media (max-width: 520px) { .cs-form-row { grid-template-columns: 1fr; } }
.cs-form-status { font-size: 14px; color: var(--cs-ink-2); min-height: 1.4em; }
.cs-form-status.is-ok { color: var(--cs-brand-dark); font-weight: 600; }
.cs-body[data-scheme="dark"] .cs-form-status.is-ok { color: var(--cs-brand); }
.cs-shop-handoff { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.cs-form-note { font-size: 13px; color: var(--cs-muted); }

/* ---------- 8. Footer, sticky bar ---------- */
.cs-foot { border-top: 1px solid var(--cs-line); background: var(--cs-bg-2); padding: clamp(36px, 4vw, 56px) 0 24px; font-size: 14.5px; color: var(--cs-ink-2); }
.cs-foot-grid { width: min(100% - var(--cs-gutter) * 2, var(--cs-wrap)); margin-inline: auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.cs-foot strong { color: var(--cs-ink); font-size: 15px; }
.cs-foot a { color: var(--cs-ink-2); text-decoration: none; }
.cs-foot a:hover { color: var(--cs-ink); text-decoration: underline; text-underline-offset: 3px; }
.cs-foot p { margin-top: 8px; line-height: 1.7; }
.cs-foot p.cs-foot-demo { margin: 28px auto 0; }
.cs-foot p.cs-foot-demo, .cs-foot-demo { width: min(100% - var(--cs-gutter) * 2, var(--cs-wrap)); margin: 28px auto 0; padding-top: 16px; border-top: 1px solid var(--cs-line); font-size: 12px; color: var(--cs-muted); }
.cs-foot-demo a { color: var(--cs-muted); }
@media (max-width: 760px) { .cs-foot-grid { grid-template-columns: 1fr 1fr; } .cs-foot-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .cs-foot-grid { grid-template-columns: 1fr; } }

.cs-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: none; gap: 10px; padding: 10px var(--cs-gutter) calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--cs-surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--cs-line); }
.cs-sticky .cs-btn { flex: 1; }
@media (max-width: 860px) { .cs-sticky { display: flex; } .cs-body { padding-bottom: 72px; } }

/* ---------- 9. Demo-kit layouts ---------- */
/* Page structures live in css-pro/layouts.css (injected by theme-presets.js). Hooks used there:
   main#main > sections (#area #faq #request), .cs-hero .cs-hero-grid .cs-hero-aside, .cs-utility, .cs-sticky. */

/* ---------- 10. Motion primitives + reduced motion ---------- */
.ms-reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--cs-ease), transform 0.7s var(--cs-ease); }
.ms-reveal.is-in, .ms-reveal.ms-in { opacity: 1; transform: none; }
.ms-reveal-stagger > .ms-reveal:nth-child(2) { transition-delay: 0.08s; }
.ms-reveal-stagger > .ms-reveal:nth-child(3) { transition-delay: 0.16s; }
.ms-reveal-stagger > .ms-reveal:nth-child(4) { transition-delay: 0.24s; }
.ms-reveal-stagger > .ms-reveal:nth-child(5) { transition-delay: 0.32s; }
.ms-reveal-stagger > .ms-reveal:nth-child(6) { transition-delay: 0.40s; }
@media (prefers-reduced-motion: reduce) {
  .cs-body *, .cs-body *::before, .cs-body *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .ms-reveal { opacity: 1 !important; transform: none !important; }
  .cs-highlight-pulse { animation: none !important; outline: 3px solid var(--cs-brand); }
}
