/* ============================================================
   PoolDesk marketing site — design tokens + layout shell
   Mobile-first. Breakpoints: 480 / 768 / 1024 / 1440.
   ============================================================ */

:root {
  color-scheme: dark; /* force dark regardless of OS setting — no light mode exists */

  /* Surfaces (darkest to lightest, matches the desktop app's token system) */
  --color-sidebar-bg: #0A0D0B;
  --color-bg: #0E1210;
  --color-surface: #1A211C;
  --color-surface-2: #212A24; /* one step up, for footer separation */

  /* Brand */
  --color-primary: #35A468;
  --color-primary-hover: #3FBD78;
  --color-accent: #CDA24E;
  --color-accent-hover: #DBB669;
  --color-success: #43C17E;
  --color-danger: #E0654A;

  /* Text */
  --color-text-primary: #F2F4F1;
  --color-text-muted: rgba(242, 244, 241, 0.64);
  --color-border: rgba(242, 244, 241, 0.10);

  /* Type */
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --fs-h1: 2.25rem;
  --fs-h2: 1.75rem;
  --fs-h3: 1.375rem;
  --fs-h4: 1.125rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --lh-heading: 1.15;
  --lh-body: 1.6;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 1.25rem;
  --header-height: 72px;
  --radius: 10px;

  /* Motion (subtle tier, from ui-ux-pro-max motion.csv) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* power1.out equivalent */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 200ms;
  --dur-base: 300ms;
  --dur-reveal: 350ms;
}

@media (min-width: 1024px) {
  :root {
    --fs-h1: 3.5rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.625rem;
    --fs-h4: 1.25rem;
    --fs-body: 1.0625rem;
    --container-pad: 2rem;
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  margin: 0 0 0.6em;
  font-weight: 600;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 1em; color: var(--color-text-muted); }
a { color: inherit; }
small { font-size: var(--fs-small); }

/* Visible keyboard focus everywhere — never removed without replacement */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Any anchor-jump target must clear the sticky 72px header, not sit under it */
[id] {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.7em 1em;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn-primary {
  background: var(--color-primary);
  color: #08130D;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-primary);
}
.btn-secondary:hover { border-color: var(--color-accent); background: rgba(205, 162, 78, 0.08); }
.btn-secondary:active { transform: translateY(1px); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-sidebar-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--color-sidebar-bg) 98%, transparent);
  border-bottom-color: var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-height: 44px;
}
.logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.logo-word {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
}

.nav-cta-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .nav-cta-group { gap: 0.75rem; }
  .btn { padding: 0.7em 1.4em; }
}

.main-nav { display: none; }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 0.5em 0.1em;
  transition: color var(--dur-fast) var(--ease-out);
}
.main-nav a:hover { color: var(--color-text-primary); }

.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-primary);
  cursor: pointer;
}
.hamburger svg { width: 22px; height: 22px; }
.hamburger .icon-close { display: none; }
.hamburger[aria-expanded="true"] .icon-menu { display: none; }
.hamburger[aria-expanded="true"] .icon-close { display: block; }

/* Mobile nav panel (slide-in) */
.mobile-nav {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: var(--color-sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 2rem var(--container-pad);
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out),
              visibility 0s linear var(--dur-base);
  z-index: 99;
}
.mobile-nav.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out),
              visibility 0s;
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 56px;
  font-size: 1.25rem;
  font-family: var(--font-heading);
  text-decoration: none;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav .btn { margin-top: 1.5rem; align-self: flex-start; }

@media (min-width: 768px) {
  .main-nav { display: block; }
  .hamburger { display: none; }
  .mobile-nav { display: none; }
}

/* ============================================================
   Trust bar
   ============================================================ */
.trust-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.trust-bar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  padding-block: 0.6rem;
  justify-content: center;
}
.trust-bar span {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.trust-bar strong {
  color: var(--color-accent);
  font-weight: 600;
}

/* ============================================================
   Main content placeholder sections
   ============================================================ */
main { min-height: 40vh; }
.section-stub {
  padding-block: 4rem;
  border-bottom: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  text-align: center;
}
.section-anchor-placeholder { display: block; }

.section { padding-block: 4rem; }
@media (min-width: 1024px) {
  .section { padding-block: 6rem; }
}
.section-header {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}
.section-header p { margin: 0; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: 3rem 3.5rem;
  overflow: clip;
}
@media (min-width: 1024px) {
  .hero { padding-block: 5rem; }
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
  text-align: center;
}
.hero-copy { max-width: 640px; }
.hero-copy h1 { margin-bottom: 0.5em; }
.hero-subhead {
  font-size: 1.0625rem;
  max-width: 52ch;
  margin-inline: auto;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-visual {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(53, 164, 104, 0.35) 0%, rgba(205, 162, 78, 0.18) 45%, transparent 72%);
  filter: blur(6px);
  border-radius: 50%;
}
.hero-icon {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 34px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.hero-orb--1 { width: 26px; height: 26px; top: 6%; right: 8%; background: var(--color-accent); opacity: 0.85; }
.hero-orb--2 { width: 16px; height: 16px; bottom: 10%; left: 2%; background: var(--color-primary); opacity: 0.8; }

@media (min-width: 768px) {
  .hero-inner { flex-direction: row; text-align: left; gap: 3rem; }
  .hero-copy { text-align: left; }
  .hero-subhead { margin-inline: 0; }
  .hero-ctas { justify-content: flex-start; }
  .hero-visual { width: 300px; height: 300px; }
  .hero-icon { width: 210px; height: 210px; }
}
@media (min-width: 1024px) {
  .hero-visual { width: 360px; height: 360px; }
  .hero-icon { width: 250px; height: 250px; }
}

/* Gated by the global prefers-reduced-motion block below, same as every
   other animation on the page — not a separate mechanism. */
.hero-orb { animation: hero-orb-float 6s ease-in-out infinite; }
.hero-orb--2 { animation-duration: 7.5s; animation-delay: -2s; }
@keyframes hero-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ============================================================
   Shared card component — How It Works steps + Product Depth features
   ============================================================ */
.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(205, 162, 78, 0.25) inset;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(53, 164, 104, 0.14);
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3, .card h4 { margin-bottom: 0.4em; }
.card p { margin: 0; font-size: var(--fs-small); }

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .steps-grid { grid-template-columns: repeat(4, 1fr); }
}

.step-card { padding-top: 2.25rem; }
.step-number {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
}

/* ============================================================
   What You Get — feature groups (Operations / Money & Reports / System),
   each holding 2-3 feature items. Every .feature-media box below shares one
   fixed aspect-ratio + padding + radius regardless of whether it holds a
   real cropped screenshot or an icon-only fallback, which is what keeps
   every card the same shape across the whole section.
   ============================================================ */
.feature-groups {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.feature-group-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-width: 640px;
}
.feature-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(53, 164, 104, 0.14);
  color: var(--color-primary);
}
.feature-group-icon svg { width: 26px; height: 26px; }
.feature-group-header h3 { margin-bottom: 0.3em; }
.feature-group-header p { margin: 0; font-size: var(--fs-small); }

.feature-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
@media (min-width: 768px) {
  .feature-items { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .feature-items { grid-template-columns: repeat(3, 1fr); }
}

/* Reveal state driven by the parent .feature-items.reveal-group (not by
   .feature-item having its own .reveal class): the parent supplies
   is-visible + per-child --reveal-index stagger delay via the existing
   generic ".reveal-group.is-visible > *" rule, this pair supplies the
   actual opacity/transform, using the same Subtle-tier values as .reveal
   everywhere else on the page. */
.feature-item {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}
.feature-items.is-visible .feature-item { opacity: 1; transform: none; }
/* Cascade-bug watch: ".feature-items.is-visible .feature-item" above is
   three classes deep (0,3,0) — specificity higher than plain ".card:hover"
   (0,2,0), so once a card is revealed it would silently win over hover's
   transform and cancel the lift, the exact same class of bug documented
   at .card:hover below for .reveal.is-visible. Fixed the same way: a
   same-specificity (0,3,0) companion selector, declared after this rule so
   source order lets hover win. */
.feature-item.card:hover { transform: translateY(-4px); }
.feature-media {
  aspect-ratio: 3 / 2;
  margin-bottom: 1.25rem;
  padding: 0.6rem;
  border-radius: 8px;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.feature-media picture,
.feature-media img { display: block; width: 100%; height: 100%; }
.feature-media img { object-fit: contain; border-radius: 4px; }
.feature-media--icon { background: rgba(53, 164, 104, 0.08); }
.feature-media--icon svg {
  width: 25%;
  height: 25%;
  min-width: 56px;
  min-height: 56px;
  color: var(--color-primary);
}

/* ============================================================
   Trust strip ("Under the hood")
   ============================================================ */
.trust-strip {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}
.trust-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
}
@media (min-width: 768px) {
  .trust-strip ul { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .trust-strip ul { grid-template-columns: repeat(4, 1fr); }
}
.trust-strip li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}
.trust-strip li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.15em;
  color: var(--color-success);
}

/* ============================================================
   Comparison table (Why One-Time Purchase)
   ============================================================ */
.compare-table-wrap {
  margin-bottom: 3.5rem;
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--fs-small);
}
.compare-table thead th {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.compare-table thead th:first-child { color: var(--color-text-muted); font-family: var(--font-body); font-weight: 500; }
.compare-table tbody th {
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  white-space: nowrap;
}
.compare-table td { color: var(--color-text-muted); }
.compare-table td.is-pooldesk { color: var(--color-text-primary); font-weight: 600; }
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table .yn-icon { display: inline-flex; vertical-align: -4px; margin-right: 0.4em; }
.compare-table .yn-icon svg { width: 18px; height: 18px; }
.compare-table .yn-icon--yes svg { color: var(--color-success); }
.compare-table .yn-icon--no svg { color: var(--color-text-muted); }

@media (max-width: 767px) {
  .compare-table thead { display: none; }
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table th, .compare-table td {
    display: block;
    width: 100%;
  }
  .compare-table tr {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
  }
  .compare-table tr:last-child { border-bottom: none; }
  .compare-table tbody th {
    padding: 0 0 0.6rem;
    border: none;
    font-size: 1.0625rem;
    /* The base (desktop) rule sets nowrap for short row labels like
       "Monthly Cost" — real bug found here: the tier-compare table's
       longer feature names ("Table billing — start/stop, discounts,
       cash + UPI split") were clipping off the edge on mobile instead
       of wrapping, since nothing had reset nowrap at this width. */
    white-space: normal;
  }
  .compare-table td {
    padding: 0.4rem 0;
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }
  .compare-table td::before {
    content: attr(data-label);
    color: var(--color-text-muted);
    font-weight: 500;
  }
}

/* ============================================================
   Insights proof — the one larger, more prominent chrome-free shot in
   Why-One-Time-Purchase. Same frame language as .feature-media (bg,
   radius, padding) so the whole page uses a single consistent image
   treatment, just sized up since this is the section's single "here's
   the real interface" proof rather than one of several small feature
   crops.
   ============================================================ */
.insights-proof {
  margin-bottom: 3.5rem;
  max-width: 820px;
  margin-inline: auto;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.insights-proof picture,
.insights-proof img { display: block; width: 100%; height: auto; border-radius: 6px; }

/* ============================================================
   Pricing section — Lite vs Full comparison (no price ever displayed;
   see js/main.js for the internal-only reference constants).
   ============================================================ */
.pricing-section .section-header { margin-bottom: 2rem; }
.pricing-cta { width: 100%; }
.pricing-cta-wrap { text-align: center; margin-top: 2rem; }
@media (min-width: 480px) {
  .pricing-cta { width: auto; min-width: 240px; }
}

/* ---- Trial callout ---- */
.trial-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  padding: 1rem 1.25rem;
  background: rgba(205, 162, 78, 0.08);
  border: 1px solid rgba(205, 162, 78, 0.3);
  border-radius: var(--radius);
}
.trial-callout svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--color-accent); margin-top: 0.1em; }
.trial-callout p { margin: 0; font-size: var(--fs-small); color: var(--color-text-primary); }
.trial-callout strong { color: var(--color-accent); font-weight: 600; }

/* ---- Tier summary (also supplies the H3 tier names — kept outside the
   table's <thead> on purpose, since <thead> is display:none on mobile;
   this way the tier names + one-line summaries survive at every width) --- */
.tier-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}
@media (min-width: 640px) {
  .tier-summary { grid-template-columns: 1fr 1fr; }
}
.tier-summary-col {
  position: relative;
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.tier-summary-col h3 { margin-bottom: 0.3em; }
.tier-summary-col p { margin: 0; font-size: var(--fs-small); }
.tier-summary-col--full {
  border-color: var(--color-accent);
  background: linear-gradient(180deg, rgba(205, 162, 78, 0.1), var(--color-surface) 60%);
  box-shadow: 0 0 0 1px rgba(205, 162, 78, 0.15), 0 16px 40px rgba(0, 0, 0, 0.3);
}
.tier-badge {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  background: var(--color-accent);
  color: #2A1F0A;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Lite vs Full table — extends .compare-table (same base component
   as the Why-One-Time-Purchase table above), adding only what's specific
   to the tier grid: grouped section-divider rows, the Full-column tint,
   and the muted (never alarming-red) not-included dash. ---- */
.tier-group-row td {
  padding-top: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  border-bottom-color: transparent;
}
/* Opt this specific cell out of the mobile ".compare-table td" flex/
   space-between treatment (meant for label+value pairs) — a colspan=3
   divider has no data-label counterpart, so under flex it would push
   its own text to the far right instead of reading as a left-aligned
   section heading. */
@media (max-width: 767px) {
  .tier-group-row td { display: block; }
}
.tier-compare-table tbody tr.tier-group-row:first-child td { padding-top: 0.9rem; }
/* .tier-compare-table thead th.tier-col--full is deliberately more specific
   (2 classes + 2 elements) than the existing ".compare-table thead th"
   rule (1 class + 2 elements) — without that, the existing rule's own
   background would silently win regardless of source order and this
   tint would never show. Caught during this phase's own cascade check. */
.tier-compare-table thead th.tier-col--full { background: rgba(205, 162, 78, 0.06); color: var(--color-accent); }
td.tier-col--full { background: rgba(205, 162, 78, 0.06); }
.tier-dash {
  display: inline-block;
  width: 18px;
  text-align: center;
  color: var(--color-text-muted);
  margin-right: 0.4em;
}

.illustrative-caption {
  max-width: 60ch;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--color-text-muted);
}

/* ============================================================
   Contact section
   ============================================================ */
.contact-section .section-header { margin-bottom: 2.5rem; }

.contact-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 420px;
  margin: 0 auto 3rem;
}
.contact-ctas .btn { width: 100%; }
.contact-ctas .btn svg { width: 20px; height: 20px; }

@media (min-width: 1024px) {
  .contact-ctas { flex-direction: row; max-width: none; justify-content: center; }
  .contact-ctas .btn { width: auto; min-width: 220px; }
}

.contact-form-wrap {
  max-width: 520px;
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
}
.contact-form-wrap p.contact-form-intro {
  margin: 0 0 1.5rem;
  text-align: center;
}
.form-field { margin-bottom: 1.25rem; }
.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-text-primary);
}
.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.7em 0.9em;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  min-height: 44px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--color-text-muted); }
.form-field input:hover,
.form-field textarea:hover { border-color: rgba(242, 244, 241, 0.25); }

.form-submit { width: 100%; position: relative; }
.form-submit .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(8, 19, 13, 0.35);
  border-top-color: #08130D;
  border-radius: 50%;
}
.form-submit.is-loading .spinner { display: inline-block; animation: spin 0.7s linear infinite; }
.form-submit.is-loading .form-submit-label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  margin-top: 1rem;
  font-size: var(--fs-small);
  text-align: center;
  min-height: 1.2em;
}
.form-status--loading { color: var(--color-text-muted); }
.form-status--success { color: var(--color-success); }
.form-status--error { color: var(--color-danger); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: 2.5rem;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.footer-logo img { width: 28px; height: 28px; border-radius: 6px; }
.footer-logo span {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text-primary);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}
.footer-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-links a:hover { color: var(--color-text-primary); }
.footer-meta {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}
.footer-meta p { margin: 0.25em 0; }

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* ============================================================
   Scroll-reveal utility (reused by every future section)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  /* Per-element stagger hook: set style="--reveal-index: N" on siblings that
     should animate in sequence (~80ms apart, Phase 1's Standard motion tier). */
  transition-delay: calc(var(--reveal-index, 0) * 80ms);
}
.reveal-group.is-visible > * {
  transition-delay: calc(var(--reveal-index, 0) * 80ms);
}

/* Card hover-lift must be declared AFTER .reveal.is-visible above: both
   set `transform` with identical specificity (two classes), so whichever
   rule is later in source order wins the cascade — placed here so the
   hover lift isn't silently cancelled by a revealed card's resting
   translateY(0) (confirmed as a real, reproducing bug during Phase 2
   verification, not a hypothetical). */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    border-color: rgba(205, 162, 78, 0.4);
  }
  .card:hover::after { opacity: 1; }
}

/* Load-in entrance for header/trust-bar (once, on page load) */
.load-in {
  opacity: 0;
  transform: translateY(-8px);
  animation: load-in var(--dur-reveal) var(--ease-out) forwards;
}
@keyframes load-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Back-to-top button — bottom-left, mirrors the chatbot bubble's
   bottom-right position so neither ever collides with the other.
   Scoped selectors only (.back-to-top / .back-to-top svg) — nothing
   here is a bare-element descendant selector that could unintentionally
   win or lose a cascade fight against a more specific rule elsewhere,
   the same class of bug a bare-element selector caused in an earlier
   phase (fixed by scoping to a dedicated class instead).
   ============================================================ */
.back-to-top {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 140;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility 0s linear var(--dur-base),
              border-color var(--dur-fast) var(--ease-out);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility 0s,
              border-color var(--dur-fast) var(--ease-out);
}
.back-to-top:hover { border-color: var(--color-accent); }
.back-to-top svg { width: 18px; height: 18px; }

@media (max-width: 767px) {
  .back-to-top { left: 1rem; bottom: 1rem; }
}

/* ============================================================
   Chatbot widget — floating bubble + panel
   z-index note: .site-header is 100, .mobile-nav is 99. The chatbot
   sits at 150 so its bubble/panel are never covered by either — and
   chatbot.js explicitly closes the mobile nav when the bot opens (and
   vice versa) so the two full-viewport-ish overlays can never be open
   at the same time regardless of z-index.
   ============================================================ */
.chatbot { position: fixed; z-index: 150; }

.chatbot-bubble {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #08130D;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.chatbot-bubble:hover { background: var(--color-primary-hover); transform: scale(1.05); }
.chatbot-bubble svg { width: 28px; height: 28px; }
.chatbot-bubble .chatbot-bubble-icon-close { display: none; }
.chatbot-bubble[aria-expanded="true"] .chatbot-bubble-icon-chat { display: none; }
.chatbot-bubble[aria-expanded="true"] .chatbot-bubble-icon-close { display: block; }
.chatbot.is-open .chatbot-bubble { display: none; }

.chatbot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  /* Darker than --color-danger specifically for this small (12px) text —
     white on the plain danger token measured only 3.43:1, below AA's
     4.5:1; this mix measures 5.05:1. */
  background: #B3513B;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badge-pulse 1.8s ease-in-out infinite;
}
.chatbot-badge[hidden] { display: none; }
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.chatbot-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 380px;
  max-width: calc(100vw - 2.5rem);
  height: min(600px, calc(100vh - 2.5rem));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.chatbot-panel[hidden] { display: none; }
.chatbot-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--color-sidebar-bg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.chatbot-avatar { width: 32px; height: 32px; border-radius: 8px; }
.chatbot-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.0625rem; flex: 1; }
.chatbot-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-primary);
  cursor: pointer;
}
.chatbot-close svg { width: 18px; height: 18px; }

.chatbot-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.chatbot-msg {
  max-width: 85%;
  padding: 0.6em 0.85em;
  border-radius: 12px;
  font-size: var(--fs-small);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  animation: msg-in var(--dur-base) var(--ease-out) forwards;
}
@keyframes msg-in {
  to { opacity: 1; transform: translateY(0); }
}
.chatbot-msg--bot {
  align-self: flex-start;
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}
.chatbot-msg--user {
  align-self: flex-end;
  background: var(--color-primary);
  color: #08130D;
  border-bottom-right-radius: 4px;
}

.chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.7em 0.9em;
  background: var(--color-surface-2);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: typing-bounce 1s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chatbot-quick-replies {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  max-height: 40%;
  overflow-y: auto;
}
.chatbot-reply-btn {
  min-height: 44px;
  padding: 0.5em 0.9em;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-primary);
  font-size: 0.8125rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.chatbot-reply-btn:hover { border-color: var(--color-accent); background: rgba(205, 162, 78, 0.08); }
.chatbot-reply-btn--cta { border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }

.chatbot-input-row {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
}
.chatbot-input-row input {
  flex: 1;
  min-height: 44px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 0.85em;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-small);
}
.chatbot-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #08130D;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.chatbot-send svg { width: 20px; height: 20px; }

@media (max-width: 767px) {
  .chatbot-bubble { right: 1rem; bottom: 1rem; }
  .chatbot-panel {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .chatbot-quick-replies { max-height: 45%; }
}

/* ============================================================
   Reduced motion — every animation added above gets a hard stop
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .load-in { opacity: 1; transform: none; animation: none; }
  .hero-orb { animation: none; }
  .card:hover { transform: none; }
  .spinner { animation: none; }
  .chatbot-badge { animation: none; }
  .chatbot-panel { transform: none; }
  .back-to-top { transform: none; }
  .chatbot-msg { opacity: 1; transform: none; animation: none; }
  .chatbot-typing span { animation: none; opacity: 1; transform: none; }
}
