/* ============================================================
   Tofu Help Center — shared stylesheet
   Current version: v=3   (bump when making changes)

   When you edit CSS, JS, or any logo in /assets/logos/, update
   ?v=N in ALL HTML files so browsers re-download fresh instead
   of using a cached version. Guide screenshots don't need this
   (they rarely change after publish).

   Brand: Space Grotesk (display) + Inter (body)
   Palette rules:
   - Midnight Black #170B21 - primary text & dark backgrounds
   - Spring Green #C5F058 - accents on dark, visual elements on light (never text on white)
   - Lime Green #A8E40F - alternative green accent
   - Orchid Purple #BD41F0 - buttons & links only, NOT backgrounds/text
   - Light Silver Gray #F3F3F3 - soft bg
   ============================================================ */

:root {
  --tofu-dark:       #170B21;
  --tofu-spring:     #C5F058;
  --tofu-lime:       #A8E40F;
  --tofu-orchid:     #BD41F0;
  --tofu-silver:     #F3F3F3;

  --tofu-spring-bg:  #f5fde8;   /* tint of spring for callout backgrounds */
  --tofu-orchid-hover: #a635d6;

  --text-primary:    #170B21;
  --text-secondary:  #4a3a5c;
  --text-muted:      #6b7280;
  --text-faint:      #9ca3af;

  --page-bg:         #fafafa;
  --surface:         #ffffff;
  --border:          #e5e7eb;
  --border-strong:   #d1d5db;

  --radius-sm:       6px;
  --radius:          10px;
  --radius-lg:       16px;
  --radius-pill:     999px;

  --shadow-sm:       0 1px 3px rgba(23, 11, 33, 0.06);
  --shadow:          0 2px 12px rgba(23, 11, 33, 0.08);
  --shadow-lg:       0 8px 32px rgba(23, 11, 33, 0.12);

  --font-display:    'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --header-height:   64px;
  --content-max:     1120px;
  --reading-max:     760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Header — consistent across every page
   ============================================================ */
.site-header {
  background: var(--tofu-dark);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
.site-header-inner {
  max-width: var(--content-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo {
  width: 40px;
  height: 40px;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-link {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.header-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.header-link.is-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-cta {
  color: var(--tofu-dark);
  background: var(--tofu-spring);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  transition: background 0.15s;
}
.header-cta:hover { background: var(--tofu-lime); }

/* ============================================================
   Homepage
   ============================================================ */
.home-hero {
  background: var(--tofu-dark);
  color: #fff;
  padding: 80px 24px 64px;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: "";
  position: absolute;
  top: -120px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--tofu-orchid) 0%, transparent 65%);
  opacity: 0.28;
  pointer-events: none;
}
.home-hero::after {
  content: "";
  position: absolute;
  bottom: -160px; left: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--tofu-spring) 0%, transparent 70%);
  opacity: 0.14;
  pointer-events: none;
}
.home-hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
}
.home-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -0.8px;
  margin: 0 0 16px;
}
.home-hero-sub {
  color: rgba(255,255,255,0.75);
  font-size: 17px;
  max-width: 560px;
  margin: 0 0 32px;
}
.home-search {
  position: relative;
  max-width: 560px;
}
.home-search input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 46px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.home-search input::placeholder { color: rgba(255,255,255,0.5); }
.home-search input:focus {
  border-color: var(--tofu-spring);
  background: rgba(255,255,255,0.12);
}
.home-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}
.home-search-note {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* Main body layout */
main.home-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.category-section { margin-bottom: 64px; }
.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.category-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.3px;
  margin: 0;
}
.category-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-weight: 500;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--tofu-spring);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card:hover::before { transform: scaleX(1); }

.card-logo {
  width: 100%;
  max-width: 140px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 4px;
}
.card-logo img, .card-logo svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: left center;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.2px;
  margin: 0;
}
.card-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-arrow {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--tofu-orchid);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-arrow::after {
  content: "→";
  transition: transform 0.15s;
}
.card:hover .card-arrow::after { transform: translateX(3px); }

/* ============================================================
   Integration overview page (e.g. /integrations/salesforce)
   ============================================================ */
.integration-hero {
  background: var(--tofu-dark);
  color: #fff;
  padding: 56px 24px 48px;
  position: relative;
  overflow: hidden;
}
.integration-hero::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--tofu-orchid) 0%, transparent 65%);
  opacity: 0.25;
}
.integration-hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
}
.integration-hero-logo {
  width: 96px;
  height: 72px;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.integration-hero-logo img, .integration-hero-logo svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.integration-hero-text h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.4px;
  margin: 0 0 6px;
}
.integration-hero-text .breadcrumb {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-bottom: 10px;
}
.integration-hero-text .breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.integration-hero-text .breadcrumb a:hover { color: var(--tofu-spring); }
.integration-hero-text .breadcrumb .sep { margin: 0 8px; opacity: 0.5; }

/* ============================================================
   Guide page with sticky sidebar TOC
   ============================================================ */
.guide-hero {
  background: var(--tofu-dark);
  color: #fff;
  padding: 48px 24px 40px;
  position: relative;
  overflow: hidden;
}
.guide-hero::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, var(--tofu-orchid) 0%, transparent 65%);
  opacity: 0.22;
}
.guide-hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
}
.guide-hero .breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 14px;
}
.guide-hero .breadcrumb a {
  color: inherit;
  text-decoration: none;
}
.guide-hero .breadcrumb a:hover { color: var(--tofu-spring); }
.guide-hero .breadcrumb .sep { margin: 0 8px; opacity: 0.5; }
.guide-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.4px;
  margin: 0 0 10px;
  max-width: 820px;
}
.guide-hero .guide-meta {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.guide-hero .guide-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* Two-column layout: sidebar TOC + content */
.guide-layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* Sidebar */
.toc-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  font-size: 13px;
  padding-right: 8px;
}
.toc-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.toc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}
.toc-sidebar li { margin: 0; }
.toc-sidebar a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.toc-sidebar a:hover {
  color: var(--text-primary);
}
.toc-sidebar a.is-active {
  color: var(--tofu-dark);
  font-weight: 600;
  border-left-color: var(--tofu-lime);
}
.toc-sidebar ul ul a { padding-left: 28px; font-size: 12px; }

/* Content */
.guide-content {
  max-width: var(--reading-max);
  min-width: 0;
}
.guide-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.3px;
  margin: 48px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tofu-spring);
  display: inline-block;
  padding-right: 20px;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.guide-content h2:first-child { margin-top: 0; }
.guide-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.2px;
  margin: 32px 0 12px;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.guide-content h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  margin: 24px 0 10px;
}
.guide-content p {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.65;
}
.guide-content strong { font-weight: 700; }
.guide-content em { font-style: italic; color: var(--text-secondary); }

/* Links: orchid (brand rule - orchid is for buttons & links only) */
.guide-content a, .integration-hero-text a:not(.breadcrumb-inner),
.card-list a {
  color: var(--tofu-orchid);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.guide-content a:hover { color: var(--tofu-orchid-hover); }

/* Lists */
.guide-content ol, .guide-content ul {
  padding-left: 24px;
  margin: 0 0 16px;
}
.guide-content ol li, .guide-content ul li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.guide-content ol ol, .guide-content ul ul,
.guide-content ol ul, .guide-content ul ol { margin-top: 8px; }

.guide-content ol { list-style-type: decimal; }
.guide-content ol ol { list-style-type: lower-alpha; }
.guide-content ol ol ol { list-style-type: lower-roman; }

/* Callouts */
.callout, .callout-note, .callout-tip {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 16px 0 20px;
  font-size: 14px;
  line-height: 1.55;
}
.callout {
  background: var(--tofu-spring-bg);
  border-left: 4px solid var(--tofu-spring);
}
.callout-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tofu-dark);
}
.callout-tip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tofu-dark);
}
.callout strong:first-child,
.callout-note strong:first-child,
.callout-tip strong:first-child {
  display: inline-block;
  margin-right: 8px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
  background: var(--tofu-spring);
  color: var(--tofu-dark);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  vertical-align: 2px;
}
.callout-note strong:first-child,
.callout-tip strong:first-child {
  background: var(--tofu-dark);
  color: var(--tofu-spring);
}

/* Error list */
.error-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px 14px 36px;
  margin: 12px 0 18px;
  list-style-position: outside;
}
.error-list li {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--tofu-dark);
  background: var(--tofu-spring-bg);
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 6px;
}

/* Figures */
figure {
  margin: 16px 0 24px;
  padding: 0;
  text-align: center;
}
figure img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 24px;
  justify-content: center;
}
.img-row figure {
  flex: 0 1 auto;
  margin: 0;
  max-width: 100%;
}

/* Salesloft overlay (reused from the original guide) */
.img-overlay-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}
.img-overlay-wrap > img.base {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.img-overlay-wrap > img.overlay {
  position: absolute;
  top: 42.10%;
  left: 67.00%;
  width: 27.00%;
  height: auto;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* ============================================================
   Card list (sub-guides list on integration page)
   ============================================================ */
.integration-body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.integration-intro {
  max-width: var(--reading-max);
  margin: 0 0 40px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
}
.sub-guide-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 20px;
}
.sub-guide-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sub-guide-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.sub-guide-item:hover {
  transform: translateX(2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.sub-guide-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-guide-logo img, .sub-guide-logo svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.sub-guide-info { flex: 1; min-width: 0; }
.sub-guide-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 2px;
}
.sub-guide-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.sub-guide-arrow {
  color: var(--tofu-orchid);
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.sub-guide-item:hover .sub-guide-arrow { transform: translateX(3px); }

/* ============================================================
   Coming Soon card variant
   ============================================================ */
.card.is-placeholder { opacity: 0.6; cursor: default; pointer-events: none; }
.card.is-placeholder .card-arrow { color: var(--text-muted); }
.coming-soon-badge {
  display: inline-block;
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .toc-sidebar {
    position: static;
    max-height: none;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .integration-hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .integration-hero-text h1 { font-size: 28px; }
  .home-hero h1 { font-size: 36px; }
  .home-hero { padding: 56px 24px 48px; }
  .guide-hero h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .site-header-inner { padding: 0 16px; }
  .header-nav { gap: 6px; }
  .header-link { font-size: 12px; padding: 6px 8px; }
  .home-main, .integration-body { padding-left: 16px; padding-right: 16px; }
  .guide-layout { padding: 24px 16px 60px; }
  .guide-content h2 { font-size: 22px; }
  .card-grid { grid-template-columns: 1fr; }
}
