/* ============================================================
   SWS Demo Base — shared styles for all client demo sites.
   The --brand-* variables are user-customizable via demo-customizer.js
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--demo-font, 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif);
  background: #0a0a0c;
  color: #f5f5f7;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, label { font: inherit; }
a { color: inherit; text-decoration: none; }

:root {
  --brand-color: #d2401e;
  --brand-color-dark: #a82e10;
  --brand-color-soft: rgba(210, 64, 30, 0.10);
  --brand-color-line: rgba(210, 64, 30, 0.30);
  --bg:           #0a0a0c;
  --bg-elev:      #131316;
  --bg-elev-2:    #1c1c20;
  --ink:          #f5f5f7;
  --ink-2:        rgba(245, 245, 247, 0.74);
  --ink-3:        rgba(245, 245, 247, 0.52);
  --ink-4:        rgba(245, 245, 247, 0.32);
  --hair:         rgba(245, 245, 247, 0.06);
  --hair-2:       rgba(245, 245, 247, 0.12);
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}
::selection { background: var(--brand-color); color: #fff; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 768px) { .wrap { padding: 0 2rem; } }

/* "DEMO BASELINE" disclosure banner — always visible at top */
.demo-banner {
  background: rgba(var(--brand-color-rgb, 210, 64, 30), 0.12);
  border-bottom: 1px solid var(--brand-color-line);
  padding: 0.625rem 1.5rem;
  font-size: 0.75rem;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.4;
}
.demo-banner strong { color: var(--ink); font-weight: 700; }
.demo-banner a {
  color: var(--brand-color);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Nav — clean, brand-colored */
.demo-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.92);
  border-bottom: 1px solid var(--hair);
  padding: 1rem 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.demo-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1rem;
}
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--brand-color);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: -0.05em;
  overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { color: var(--ink); }
.demo-nav-links {
  display: none;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}
@media (min-width: 768px) { .demo-nav-links { display: inline-flex; } }
.demo-nav-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.15s var(--ease);
}
.demo-nav-links a:hover, .demo-nav-links a.active { color: var(--ink); }
.demo-nav-cta {
  padding: 0.5rem 0.9rem;
  background: var(--brand-color);
  color: #fff;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background 0.15s var(--ease);
}
.demo-nav-cta:hover { background: var(--brand-color-dark); }

/* Hero */
.demo-hero {
  position: relative;
  padding: 4rem 1.5rem 5rem;
  overflow: hidden;
}
@media (min-width: 768px) { .demo-hero { padding: 6rem 1.5rem 7rem; } }
.demo-hero::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 700px;
  background: var(--brand-color-soft);
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  max-width: 90vw;
  max-height: 90vw;
}
.demo-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #ffffff08 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}
.demo-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.demo-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-color);
  margin-bottom: 1.5rem;
}
.demo-hero-eyebrow::before, .demo-hero-eyebrow::after {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--brand-color);
}
.demo-hero h1 {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.0;
  max-width: 22ch;
  margin: 0 auto 1.5rem;
}
.demo-hero h1 .brand-name-accent { color: var(--brand-color); }
.demo-hero p.lead {
  font-size: 1.0625rem;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.demo-hero-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.btn-primary {
  padding: 0.9375rem 1.5rem;
  background: var(--brand-color);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 12px;
  transition: background 0.15s var(--ease), transform 0.05s var(--ease);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover { background: var(--brand-color-dark); }
.btn-primary:active { transform: scale(0.99); }
.btn-ghost {
  padding: 0.9375rem 1.5rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hair-2);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 12px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn-ghost:hover { background: var(--hair); border-color: var(--ink-3); }

/* Trust bar (years in business, certs, etc.) */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 2rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hair);
}
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.trust-item-num {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--brand-color);
  font-variant-numeric: tabular-nums;
}
.trust-item-lbl {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}

/* Section pattern */
.section {
  padding: 4.5rem 1.5rem;
}
@media (min-width: 768px) { .section { padding: 6rem 1.5rem; } }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-head {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 3rem;
}
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-color);
  margin-bottom: 1rem;
}
.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1rem;
}
.section-head h2 .brand-color { color: var(--brand-color); }
.section-head .sub {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* Service cards */
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) { .service-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }
.service-card {
  padding: 1.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--hair);
  border-radius: 14px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.25s var(--ease);
}
.service-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--brand-color-line);
  transform: translateY(-2px);
}
.service-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-color-soft);
  color: var(--brand-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.service-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.service-card h3 {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.service-card p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.service-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Why us / value cards */
.value-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) { .value-grid { grid-template-columns: 1fr 1fr; } }
.value-card {
  padding: 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--hair);
  border-radius: 12px;
}
.value-card-num {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--brand-color);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.value-card h3 {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.value-card p {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* CTA section */
.cta-section {
  background: var(--bg-elev);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 4rem 1.5rem;
  text-align: center;
}
.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  line-height: 1.1;
}
.cta-section h2 .brand-color { color: var(--brand-color); }
.cta-section p {
  font-size: 1rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}
.cta-section .actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Footer */
.demo-foot {
  padding: 3rem 1.5rem 4rem;
  background: #08080a;
  border-top: 1px solid var(--hair);
}
.demo-foot-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) { .demo-foot-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.demo-foot-col h4 {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.875rem;
}
.demo-foot-col p, .demo-foot-col a {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.7;
}
.demo-foot-col a:hover { color: var(--ink); }
.demo-foot-col ul { list-style: none; padding: 0; }
.demo-foot-col li { margin-bottom: 0.25rem; }
.demo-foot-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--ink-3);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
.reveal[data-visible="true"] { opacity: 1; transform: translateY(0); }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
.reveal-stagger[data-visible="true"] > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-visible="true"] > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-visible="true"] > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-visible="true"] > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-visible="true"] > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-visible="true"] > *:nth-child(6) { transition-delay: 400ms; opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   LIGHT + WARM THEME OVERRIDES
   Activated by [data-theme="light"] on <html> (set by customizer.js).
   ============================================================ */
html[data-theme="light"] {
  --bg:           #f7f3ec;
  --bg-elev:      #ffffff;
  --bg-elev-2:    #f0eadf;
  --ink:          #1a1714;
  --ink-2:        rgba(26, 23, 20, 0.74);
  --ink-3:        rgba(26, 23, 20, 0.52);
  --ink-4:        rgba(26, 23, 20, 0.32);
  --hair:         rgba(26, 23, 20, 0.08);
  --hair-2:       rgba(26, 23, 20, 0.16);
}
html[data-theme="light"] body {
  background: #f7f3ec;
  color: #1a1714;
}
html[data-theme="light"] .demo-nav {
  background: rgba(247, 243, 236, 0.92);
  border-bottom-color: rgba(26, 23, 20, 0.08);
}
html[data-theme="light"] .demo-hero::after {
  background-image: radial-gradient(circle, rgba(26, 23, 20, 0.06) 1px, transparent 1px);
}
html[data-theme="light"] .btn-primary {
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .demo-foot {
  background: #ebe4d6;
  border-top-color: rgba(26, 23, 20, 0.10);
}
/* Override the inline-styled dark "alt" sections that some demos use */
html[data-theme="light"] section[style*="#08080a"] {
  background: #ebe4d6 !important;
}
html[data-theme="light"] section[style*="background: #08080a"] {
  background: #ebe4d6 !important;
}

/* ============================================================
   HERO LAYOUT VARIANTS — left-aligned alternative
   Activated by [data-hero-layout="left"] on <html>
   ============================================================ */
html[data-hero-layout="left"] .demo-hero-inner {
  text-align: left;
  margin: 0 auto;
  padding: 0;
}
html[data-hero-layout="left"] .demo-hero h1 {
  margin-left: 0;
  margin-right: 0;
  max-width: 18ch;
}
html[data-hero-layout="left"] .demo-hero p.lead {
  margin-left: 0;
  margin-right: 0;
}
html[data-hero-layout="left"] .demo-hero-actions {
  justify-content: flex-start;
}
html[data-hero-layout="left"] .trust-bar {
  justify-content: flex-start;
  padding-left: 0;
}
html[data-hero-layout="left"] .demo-hero-eyebrow::before {
  display: none;
}

/* ============================================================
   SERVICES LAYOUT VARIANT — 2-up larger cards
   Activated by [data-services-layout="two"] on <html>
   ============================================================ */
@media (min-width: 1024px) {
  html[data-services-layout="two"] .service-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}
html[data-services-layout="two"] .service-card {
  padding: 2.25rem;
}
html[data-services-layout="two"] .service-card h3 {
  font-size: 1.375rem;
}
html[data-services-layout="two"] .service-card p {
  font-size: 1.0625rem;
  line-height: 1.6;
}
html[data-services-layout="two"] .service-icon {
  width: 56px;
  height: 56px;
}
html[data-services-layout="two"] .service-icon svg {
  width: 30px;
  height: 30px;
}

/* ============================================================
   MOBILE PREVIEW FRAME
   Activated by [data-preview="mobile"] on <html>.
   Visually frames the body to a phone-width viewport so prospects
   see how their site renders on a 414px-wide screen.
   ============================================================ */
html[data-preview="mobile"] body {
  max-width: 414px;
  margin: 0 auto;
  border-left: 1px solid rgba(255,255,255,0.18);
  border-right: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
}
html[data-preview="mobile"][data-theme="light"] body {
  border-left-color: rgba(26,23,20,0.14);
  border-right-color: rgba(26,23,20,0.14);
  box-shadow: 0 0 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(26,23,20,0.06);
}
html[data-preview="mobile"] {
  background: #050507;
}
html[data-preview="mobile"][data-theme="light"] {
  background: #ebe4d6;
}
html[data-preview="mobile"] .demo-nav-links {
  display: none !important;
}
html[data-preview="mobile"] .demo-nav-cta {
  display: none !important;
}
html[data-preview="mobile"] .demo-nav {
  padding: 0.875rem 1rem;
}
html[data-preview="mobile"] .demo-hero {
  padding: 2.5rem 1rem 3rem;
}
html[data-preview="mobile"] .demo-hero h1 {
  font-size: clamp(1.75rem, 8vw, 2.5rem);
}
html[data-preview="mobile"] .section {
  padding: 3rem 1rem;
}
html[data-preview="mobile"] .service-grid,
html[data-preview="mobile"][data-services-layout="two"] .service-grid {
  grid-template-columns: 1fr !important;
}
html[data-preview="mobile"] .value-grid {
  grid-template-columns: 1fr !important;
}

/* Mobile-preview floating "exit" hint */
html[data-preview="mobile"] body::before {
  content: "📱 Mobile preview — tap Customize to exit";
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  background: rgba(26,23,20,0.9);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  border-radius: 100px;
  pointer-events: none;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* ============================================================
   LIGHTHOUSE / PERFORMANCE BADGE (D3)
   Small floating element on demo homepages. Real load time captured
   client-side via PerformanceObserver — verifiable on visitor's machine.
   ============================================================ */
.demo-perf-badge {
  position: fixed;
  bottom: max(5rem, env(safe-area-inset-bottom));
  left: 1rem;
  z-index: 8500;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: rgba(15, 15, 20, 0.85);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 100px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.4);
  transition: opacity 0.3s ease;
}
@media (max-width: 640px) {
  .demo-perf-badge { display: none; }
}
.demo-perf-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
  animation: perf-pulse 2.4s infinite;
}
@keyframes perf-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
  60% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.demo-perf-badge-time {
  font-variant-numeric: tabular-nums;
  color: #34d399;
  font-weight: 700;
}
.demo-perf-badge-meta {
  opacity: 0.7;
  font-weight: 500;
}
html[data-theme="light"] .demo-perf-badge {
  background: rgba(255,255,255,0.92);
  color: #1a1714;
  border-color: rgba(26,23,20,0.10);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.18);
}
html[data-theme="light"] .demo-perf-badge-time { color: #047857; }
html[data-preview="mobile"] .demo-perf-badge { display: none; }

/* ============================================================
   INNER-PAGE DEMO NOTICE
   Appears on demo inner pages when industry != hvac.
   Honest disclosure: "body text is HVAC sample, your real industry
   site would be custom-written."
   ============================================================ */
.demo-inner-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 1.5rem;
  background: rgba(251, 191, 36, 0.10);
  color: var(--ink-2, rgba(245, 245, 247, 0.74));
  border-bottom: 1px solid rgba(251, 191, 36, 0.30);
  font-size: 0.75rem;
  line-height: 1.45;
  font-weight: 500;
}
.demo-inner-notice svg {
  flex-shrink: 0;
  color: #fbbf24;
  margin-top: 1px;
}
.demo-inner-notice-text {
  flex: 1;
}
html[data-theme="light"] .demo-inner-notice {
  background: rgba(180, 83, 9, 0.08);
  border-bottom-color: rgba(180, 83, 9, 0.20);
  color: #1a1714;
}
html[data-theme="light"] .demo-inner-notice svg {
  color: #b45309;
}
