/* =============================================================================
   KnowledgeBlocks — public landing page
   Self-contained: carries the app's "Boutique Wellness" design tokens (copied
   from blueprint.css :root) so the marketing site matches the app exactly,
   without pulling in the 45 KB app stylesheet. Light-mode only — the cream/sage
   look is the brand.
   ============================================================================= */

:root {
  /* --- Boutique palette (mirrors blueprint.css) --- */
  --color-sage-50:  #e8f4ee;
  --color-sage-100: #d4e9dc;
  --color-sage-200: #a8d5bc;
  --color-sage-400: #6ab893;
  --color-sage-700: #3a7d5c;   /* primary action */
  --color-sage-800: #2f6849;   /* hover */
  --color-sage-900: #1e4a32;   /* active / deep ink */

  --color-mist-50:  #e6f1fb;
  --color-mist-100: #cce3f8;
  --color-mist-200: #b5d4f4;
  --color-mist-700: #185fa5;

  --color-lavender-50:  #f3f0fe;
  --color-lavender-500: #7b72dc;

  --color-warm-bg:   #fdf8f3;  /* page background */
  --color-surface-0: #ffffff;  /* cards */
  --color-surface-1: #f6faf8;  /* soft fills */
  --color-surface-2: #f0f4f2;

  --color-border-subtle: #e8e2d9;
  --color-border-field:  #d4e6da;

  --color-amber-bg:     #fff8f3;
  --color-amber-border: #f0d8c0;
  --color-amber-text:   #a05a1a;

  --color-text-primary:   #1a2e25;
  --color-text-secondary: #4a6158;
  --color-text-muted:     #5d7a6e;
  --color-text-on-dark:   #ffffff;

  /* --- Paint-lane hues ---
     These are `laneColors` in kbApp.js, in order, and the two are a PAIR. The page's
     illustrations are drawn in these hues and sit a few hundred pixels from real
     screenshots of the canvas, so a drift here puts the same ribbon in two different
     colours on one screen. The order is the CVD-safety mechanism in the app — keep it. */
  --lane-1: #0aa0a4;   /* teal    */
  --lane-2: #ad800c;   /* gold    */
  --lane-3: #b93f9c;   /* magenta */
  --lane-4: #7d9a35;   /* lime    */
  --lane-mist:     #2a6fb5;
  --lane-lavender: #8b7bd8;

  /* Logic-chip ink/tint/line — KB_LOGIC_* in kbApp.js, so the AND/OR/NOT chips in
     the legend match the ones inside the screenshots exactly. */
  --color-lavender-200: #c9c3f0;
  --color-lavender-700: #534ab7;

  /* --- Type --- */
  /* NOTE: DM Sans arrives with font-display:swap, so hero text reflows once when it
     lands — measured CLS 0.060 at 375px (Google's "good" band is < 0.1). The images
     contribute none of it. A size-adjust metric-matched fallback would remove it, but
     the adjust ratio has to be measured against the real fallback (Arial/Helvetica),
     which is not installed in the devcontainer — so it is deliberately not guessed here. */
  --font-sans: 'DM Sans', 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;

  --display-1: clamp(2.35rem, 5.2vw, 3.6rem);
  --display-2: clamp(1.75rem, 3.4vw, 2.4rem);
  --display-3: clamp(1.3rem, 2vw, 1.6rem);
  --lead:      clamp(1.05rem, 1.4vw, 1.2rem);

  /* --- Radius / shadow / spacing --- */
  --radius-sm:   8px;
  --radius-md:   10px;
  --radius-lg:   12px;
  --radius-xl:   18px;
  --radius-2xl:  26px;
  --radius-pill: 999px;

  --shadow-sm:  0 2px 6px rgba(30,74,50,0.06);
  --shadow-md:  0 4px 14px rgba(30,74,50,0.08);
  --shadow-lg:  0 8px 24px rgba(30,74,50,0.10);
  --shadow-xl:  0 20px 48px rgba(30,74,50,0.14);

  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-primary);
  background: var(--color-warm-bg);
  overflow-x: hidden;
}

/* height:auto matters now that every <img> carries width/height attributes — without
   it the attribute height wins at narrow viewports and the screenshots squash. */
img { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; font-weight: 600; color: var(--color-text-primary); }

/* --- Layout helpers --- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; position: relative; }
.section--tight { padding: 52px 0; }
.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-sage-700);
  background: var(--color-sage-50);
  border: 0.5px solid var(--color-sage-200);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.section-title { font-size: var(--display-2); max-width: 22ch; }
.section-lead {
  font-size: var(--lead);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin-top: 16px;
}
.center .section-title, .center .section-lead { margin-left: auto; margin-right: auto; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--ease) 0.16s, background 0.16s, box-shadow 0.16s, border-color 0.16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-sage-700); color: var(--color-text-on-dark); border-color: var(--color-sage-700); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-sage-800); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-subtle); }
.btn-ghost:hover { background: var(--color-sage-50); border-color: var(--color-sage-200); }
.btn-on-dark { background: #ffffff; color: var(--color-sage-900); border-color: #ffffff; }
.btn-on-dark:hover { background: var(--color-sage-50); }
.btn-outline-dark { background: transparent; color: #ffffff; border-color: rgba(255,255,255,0.5); }
.btn-outline-dark:hover { background: rgba(255,255,255,0.12); border-color: #ffffff; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* =========================================================================
   NAV
   ========================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 248, 243, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav__links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav__links a.navlink { color: var(--color-text-secondary); font-weight: 500; font-size: 0.95rem; transition: color 0.16s; }
.nav__links a.navlink:hover { color: var(--color-sage-800); }
.nav__cta { display: flex; align-items: center; gap: 10px; margin-left: 8px; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; padding: 64px 0 56px; overflow: hidden; }
/* Two columns again. Round 1 stacked the hero full-width because a *screenshot* of the
   canvas was illegible at half width — its text is sized in world units. The hero art is
   an illustration now, so its type size is a design decision rather than a consequence of
   the crop, and the column layout comes back (and takes ~1,500px of page height with it). */
.hero__grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: 40px; align-items: center; }
.hero h1 { font-size: var(--display-1); font-weight: 700; }
.hero h1 .accent { color: var(--color-sage-700); }
.hero__lead { font-size: var(--lead); color: var(--color-text-secondary); margin-top: 22px; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero__note { margin-top: 18px; font-size: 0.9rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 8px; }
.hero__art { position: relative; }
.hero__art svg { width: 100%; height: auto; }

/* decorative blobs */
.blob { position: absolute; z-index: -1; filter: blur(8px); opacity: 0.32; pointer-events: none; }
.blob--1 { top: -40px; right: -110px; width: 280px; }
.blob--2 { bottom: -70px; left: -110px; width: 260px; }

/* =========================================================================
   VALUE STRIP
   ========================================================================= */
.value { background: var(--color-surface-1); border-top: 1px solid var(--color-border-subtle); border-bottom: 1px solid var(--color-border-subtle); }
.value__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value__tile { text-align: center; padding: 12px; }
.value__tile .big { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; color: var(--color-sage-700); letter-spacing: -0.03em; line-height: 1; }
.value__tile .lbl { margin-top: 10px; font-weight: 600; }
.value__tile .sub { color: var(--color-text-secondary); font-size: 0.95rem; margin-top: 4px; }

/* =========================================================================
   HOW IT WORKS
   ========================================================================= */
.how__diagram { margin: 40px auto 8px; max-width: 860px; }
.how__diagram svg { width: 100%; height: auto; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 32px; }
.step { background: var(--color-surface-0); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-xl); padding: 28px; box-shadow: var(--shadow-sm); }
.step__num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-pill); background: var(--color-sage-50); color: var(--color-sage-700); font-weight: 700; border: 0.5px solid var(--color-sage-200); }
.step__icon { width: 40px; height: 40px; margin-bottom: 14px; }
.step h3 { font-size: 1.2rem; margin: 14px 0 8px; }
.step p { color: var(--color-text-secondary); font-size: 0.98rem; }

/* =========================================================================
   FEATURES
   ========================================================================= */
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.feature {
  background: var(--color-surface-0);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease) 0.2s, box-shadow 0.2s;
  position: relative;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature__icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-sage-50);
  border: 0.5px solid var(--color-sage-200);
  margin-bottom: 18px;
}
.feature__icon svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1.18rem; margin-bottom: 8px; }
.feature p { color: var(--color-text-secondary); font-size: 0.97rem; }
.badge-new {
  position: absolute; top: 22px; right: 22px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--color-mist-700); background: var(--color-mist-50);
  border: 0.5px solid var(--color-mist-200);
  padding: 4px 9px; border-radius: var(--radius-pill);
}

/* =========================================================================
   SHOTS — real crops of the application canvas
   Regenerate with: venv/bin/python tools/capture-marketing-shots.py
   ========================================================================= */

/* Canvas crops are composited onto KB_GROUND (#fdf8f3), which IS --color-warm-bg —
   the picture is continuous with the page, so a border or a card would draw a frame
   around nothing. */
/* --- Block-kit illustrations ---------------------------------------------
   Drawn in canvas pixel units against #fdf8f3, so they sit directly on the page
   with no card, border or shadow. See the comment block at the top of index.html
   for which renderer constants they mirror. */
.kit { width: 100%; height: auto; display: block; }
.kit--wide { max-width: 920px; margin: 36px auto 0; }

/* On a phone these drawings would otherwise shrink to ~340px and the block labels
   stop being readable — which is the one thing the illustrations exist to do. The
   figure scrolls inside itself instead, so the page never scrolls sideways. */
/* A grid item defaults to min-width:auto, so a drawing with a min-width inside one would
   make the whole track — and the copy beside it — refuse to shrink. Only the art columns
   need this; putting it on the copy columns as well destabilises the fr distribution while
   the webfont is still loading, which shows up directly as layout shift. */
.hero__art, .split__art { min-width: 0; overflow: hidden; }
.kit-scroll { width: 100%; min-width: 0; }
@media (max-width: 760px) {
  .kit-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: -24px;
    padding: 0 24px 8px;
    scrollbar-width: thin;
  }
  .kit-scroll .kit { min-width: 560px; }
  .kit-scroll .kit--wide { min-width: 720px; margin-top: 28px; }
}

.shot { margin: 40px auto 0; max-width: 920px; }
.shot img { width: 100%; height: auto; }

/* The AI panel is a different surface from the page — application chrome, not
   canvas — so this one does get a frame, or its edge dissolves into the band. */
.shot--chrome img {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  background: var(--color-surface-0);
}

.shot figcaption {
  margin: 16px auto 0;
  max-width: 64ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  text-align: center;
}

/* Reserve the intrinsic ratio before the bytes land. Belt and braces with the
   width/height attributes on every <img>, because a cached stylesheet and an
   uncached image is the common case. */
.shot img          { aspect-ratio: 2184 / 964; }
.shot--chrome img  { aspect-ratio: 2360 / 1040; }

/* AND / OR / NOT legend — the chips wear the same lavender as the real ones. */
.legend {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px; margin-top: 30px; text-align: left;
}
.legend__item {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 0.95rem; color: var(--color-text-secondary);
}
.legend__chip {
  flex: none;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 5px;
  background: var(--color-lavender-50);
  border: 0.5px solid var(--color-lavender-200);
  color: var(--color-lavender-700);
}
.legend__tie {
  flex: none;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 5px;
  background: var(--color-sage-50);
  border: 0.5px solid var(--color-sage-200);
  color: var(--color-sage-700);
}
.legend__tie--having {
  background: var(--color-mist-50);
  border-color: var(--color-mist-200);
  color: var(--color-mist-700);
}

/* Compact three-up used by the collaboration and hosting bands (no art). */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.trio__tile {
  background: var(--color-surface-0);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.trio__tile h3 { font-size: 1.1rem; margin-bottom: 8px; }
.trio__tile p { color: var(--color-text-secondary); font-size: 0.96rem; }

/* =========================================================================
   SPLIT BANDS (AI + storytelling)
   ========================================================================= */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split--reverse .split__art { order: -1; }
.split__art svg { width: 100%; height: auto; }
.split h2 { font-size: var(--display-2); }
.split p { color: var(--color-text-secondary); font-size: var(--lead); margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  font-size: 0.85rem; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--color-surface-1); border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}
.ai-band { background: var(--color-surface-1); border-top: 1px solid var(--color-border-subtle); border-bottom: 1px solid var(--color-border-subtle); }


/* =========================================================================
   FINAL CTA
   ========================================================================= */
.cta {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--color-sage-800), var(--color-sage-700) 60%, var(--color-sage-900));
  color: var(--color-text-on-dark);
  border-radius: var(--radius-2xl);
  padding: 72px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta h2 { color: #fff; font-size: var(--display-2); max-width: 20ch; margin: 0 auto; }
.cta p { color: rgba(255,255,255,0.85); font-size: var(--lead); margin: 16px auto 32px; max-width: 46ch; }
.cta__btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta .blob { opacity: 0.18; filter: blur(2px); }
.cta .blob--a { top: -90px; left: -60px; width: 340px; }
.cta .blob--b { bottom: -120px; right: -50px; width: 360px; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { padding: 64px 0 40px; border-top: 1px solid var(--color-border-subtle); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer__brand p { color: var(--color-text-secondary); font-size: 0.95rem; margin-top: 14px; max-width: 34ch; }
.footer__col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); margin-bottom: 14px; }
.footer__col a { display: block; color: var(--color-text-secondary); font-size: 0.95rem; padding: 5px 0; transition: color 0.16s; }
.footer__col a:hover { color: var(--color-sage-800); }
.footer__bar { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--color-border-subtle); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--color-text-muted); font-size: 0.88rem; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__art { max-width: 560px; margin: 0 auto; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split--reverse .split__art { order: 0; }
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .legend { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .section { padding: 68px 0; }
  .shot { margin-top: 30px; }
  .nav__links { gap: 16px; }
  .nav__links .navlink { display: none; }        /* keep it clean on phones — CTAs remain */
  .nav__cta { gap: 8px; }
  .nav__cta .btn { padding: 10px 16px; font-size: 0.9rem; }
  .brand { font-size: 1rem; }
  .steps { grid-template-columns: 1fr; }
  .value__grid { grid-template-columns: 1fr; gap: 32px; }
  .cta { padding: 56px 24px; }
}
@media (max-width: 460px) {
  .nav__cta .btn-ghost { display: none; }         /* keep only "Start free" — log in stays in the footer & CTA band */
}
@media (max-width: 520px) {
  .features__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .hero__cta .btn, .cta__btns .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
