/*
 * The stylesheet for user-built pages.
 *
 * Loaded in two places that must agree: inside the builder canvas, and on the
 * published page. Tailwind is deliberately absent — its JIT scan cannot see
 * markup that lives in the database, so a utility class a user picks would
 * work in the canvas and vanish once published.
 *
 * Every colour and typeface reads from a --site-* custom property, which is
 * what Site#theme_css emits. The values below are the fallbacks.
 */

/* The one tag selector in this file. The browser gives <body> an 8px margin;
   without this rule, that margin frames the canvas and every published page. */
body { margin: 0; }

.sb-section {
  --sb-accent: var(--site-accent, #4f46e5);
  --sb-background: var(--site-background, #ffffff);
  --sb-text: var(--site-text, #111827);
  --sb-muted: var(--site-muted, #6b7280);
  --sb-radius: var(--site-radius, 12px);

  box-sizing: border-box;
  padding: 72px 24px;
  background: var(--sb-background);
  color: var(--sb-text);
  font-family: var(--site-font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  line-height: 1.6;
}

.sb-section *,
.sb-section *::before,
.sb-section *::after { box-sizing: inherit; }

.sb-container {
  max-width: 1080px;
  margin: 0 auto;
}

/* --- Type ---------------------------------------------------------------- */

.sb-title,
.sb-heading,
.sb-card-title {
  font-family: var(--site-font-heading, var(--site-font-body, ui-sans-serif, system-ui, sans-serif));
  color: var(--sb-text);
  margin: 0 0 16px;
  line-height: 1.15;
  text-wrap: balance;
}

.sb-title { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; }
.sb-heading { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 650; letter-spacing: -0.01em; }
.sb-card-title { font-size: 1.125rem; font-weight: 650; }

.sb-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sb-muted);
}

.sb-text { margin: 0 0 16px; color: var(--sb-muted); font-size: 1.0625rem; }
.sb-prose { max-width: 68ch; }
.sb-fine-print { font-size: 0.875rem; color: var(--sb-muted); margin: 0; }

/* --- Controls ------------------------------------------------------------ */

.sb-button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--sb-radius);
  background: var(--sb-accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.sb-button:hover { filter: brightness(0.92); }

.sb-link { color: var(--sb-accent); font-weight: 600; text-decoration: none; }
.sb-link:hover { text-decoration: underline; }

/* --- Media --------------------------------------------------------------- */

.sb-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--sb-radius);
  background: color-mix(in srgb, var(--sb-muted) 12%, transparent);
  min-height: 120px;
}

.sb-logo { width: auto; max-height: 40px; border-radius: 0; min-height: 0; opacity: 0.7; }

.sb-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

/* --- Layout -------------------------------------------------------------- */

.sb-grid { display: grid; gap: 24px; }
.sb-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sb-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sb-card {
  padding: 24px;
  border-radius: var(--sb-radius);
  border: 1px solid color-mix(in srgb, var(--sb-muted) 22%, transparent);
}

.sb-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: center; }
.sb-split-copy > :last-child { margin-bottom: 0; }

/* --- Individual sections ------------------------------------------------- */

.sb-hero { text-align: center; }
.sb-hero .sb-image { max-width: 900px; margin: 48px auto 0; }
.sb-hero-copy { max-width: 44ch; margin-inline: auto; }

.sb-cta { background: color-mix(in srgb, var(--sb-accent) 8%, var(--sb-background)); text-align: center; }
.sb-cta-copy { max-width: 44ch; margin-inline: auto; }

.sb-testimonial { max-width: 60ch; margin-inline: auto; text-align: center; }
.sb-quote { margin: 0 0 16px; font-size: 1.5rem; font-weight: 500; line-height: 1.4; }
.sb-attribution { font-size: 0.9375rem; margin: 0; }

.sb-price { font-size: 2rem; font-weight: 700; color: var(--sb-text); margin: 0 0 8px; }
.sb-tier > :last-child { margin-bottom: 0; }

.sb-faq-list { display: grid; gap: 24px; }
.sb-faq > :last-child { margin-bottom: 0; }

.sb-contact { max-width: 52ch; }

.sb-footer { padding: 32px 24px; border-top: 1px solid color-mix(in srgb, var(--sb-muted) 22%, transparent); }
.sb-footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

/* --- Navigation bar ------------------------------------------------------ */

/*
 * A published page runs no JavaScript, so <details> holds the open state of the
 * phone menu and CSS does the rest.
 *
 * On a wide screen the links have to show while that <details> is still closed.
 * Only ::details-content can do that: the browser hides the closed content in a
 * shadow slot no author rule can reach.
 */

.sb-navbar {
  padding: 14px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--sb-muted) 18%, transparent);
}

.sb-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.sb-nav-brand {
  color: var(--sb-text);
  font-family: var(--site-font-heading, inherit);
  font-size: 1.125rem;
  font-weight: 650;
  text-decoration: none;
}

.sb-nav-links { display: flex; align-items: center; gap: 4px; }

.sb-nav-link {
  padding: 8px 12px;
  border-radius: calc(var(--sb-radius) / 2);
  color: var(--sb-text);
  font-weight: 500;
  text-decoration: none;
}

.sb-nav-link:hover { color: var(--sb-accent); }
.sb-nav-cta { margin-left: 8px; }

@media (min-width: 768px) {
  .sb-nav-disclosure::details-content { content-visibility: visible; block-size: auto; }
}

/* Three bars drawn from the text colour, so the markup stays a bare <summary>
   and the page fetches nothing to show a menu. */
.sb-nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: calc(var(--sb-radius) / 2);
  color: var(--sb-text);
  cursor: pointer;
  list-style: none;
}

.sb-nav-toggle::-webkit-details-marker { display: none; }

.sb-nav-toggle::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 10px;
  width: 20px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

/* --- Numbers, team and steps --------------------------------------------- */

.sb-stat { text-align: center; }
.sb-stat-value { margin: 0 0 4px; font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; color: var(--sb-text); letter-spacing: -0.02em; }
.sb-stat-label { margin: 0; font-size: 0.9375rem; }

.sb-member { text-align: center; }
.sb-member > :last-child { margin-bottom: 0; }
.sb-portrait { aspect-ratio: 1; object-fit: cover; border-radius: 999px; max-width: 160px; margin: 0 auto 16px; }
.sb-member-role { margin: 0; font-size: 0.9375rem; }

.sb-step > :last-child { margin-bottom: 0; }

.sb-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 0 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sb-accent) 12%, transparent);
  color: var(--sb-accent);
  font-weight: 700;
}

/* --- Footer with columns -------------------------------------------------- */

.sb-footer-columns { padding: 56px 24px 32px; border-top: 1px solid color-mix(in srgb, var(--sb-muted) 22%, transparent); }
.sb-footer-column { display: grid; justify-items: start; gap: 8px; }
.sb-footer-column .sb-eyebrow { margin: 0 0 4px; }
.sb-footer-link { font-weight: 500; }

.sb-footer-columns .sb-fine-print {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--sb-muted) 22%, transparent);
}

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 767px) {
  .sb-section { padding: 48px 20px; }
  .sb-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .sb-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-split { grid-template-columns: minmax(0, 1fr); gap: 24px; }

  /* The menu becomes a card under the burger, in normal flow. It must not be
     positioned against anything outside the <details>: an absolutely placed
     panel escapes the subtree the browser skips while the menu is closed, and
     then the closed menu stays on screen. */
  .sb-nav-bar { align-items: flex-start; }
  .sb-nav-toggle { display: block; }

  .sb-nav-links {
    flex-direction: column;
    align-items: stretch;
    min-width: 190px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--sb-muted) 22%, transparent);
    border-radius: var(--sb-radius);
    background: var(--sb-background);
  }

  .sb-nav-cta { margin: 4px 0 0; text-align: center; }

  .sb-footer-columns .sb-grid-3 { gap: 32px; }
}
