/* Cortex Kinematics global styles — ported from the static landing page.
   Minimal inline CSS in components; everything else lives here. */

:root {
  color-scheme: light;
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --ink: #1e1b2e;
  --muted: #6b7280;
  --bg: #ffffff;
  --soft: #f5f5fb;
  --border: #e7e7f0;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(79, 70, 229, 0.08);
  --shadow-hover: 0 16px 40px rgba(79, 70, 229, 0.18);
  /* Semantic tokens layered over the palette above so dark mode can retune them
     in one place (see the [data-theme="dark"] block at the end of this file):
       --surface    raised card / panel background (was hardcoded #fff)
       --surface-2  inset surface (code, blockquote, highlights)
       --text-soft  secondary body text (was the #44445a family)
       --accent     accent *text* — kept separate from --indigo-dark so dark mode
                    can lighten links/headings without dimming solid button fills */
  --surface: #ffffff;
  --surface-2: #f7f7fb;
  --text-soft: #44445a;
  --accent: var(--indigo-dark);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Guard against any sub-pixel element forcing a horizontal scrollbar on phones.
   Use `clip`, not `hidden`: `overflow-x: hidden` forces overflow-y to compute to
   `auto`, which makes <body> its own scroll container and leaves a white gap
   below the footer on iOS Safari. `clip` clips without creating a scroller. */
html, body { overflow-x: clip; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Sticky-footer layout: <main> grows to fill so <Footer> stays at the bottom
     on short pages (e.g. 404) and sits below content on long ones. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Let the main content region absorb the leftover height (sticky footer). */
main { flex: 1 0 auto; }

a { color: inherit; }

/* Media scales fluidly and never overflows its container */
img, svg, video { max-width: 100%; height: auto; }

/* Long words / URLs wrap instead of forcing horizontal scroll on small screens */
h1, h2, h3, p, li, summary { overflow-wrap: break-word; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-nav .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.site-nav .logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem; color: var(--ink);
  text-decoration: none;
}
/* Scoped through .logo-word so the mark's own <svg> children are untouched and
   only the "Kinematics" half of the wordmark takes the accent colour. */
.site-nav .logo .logo-word span { color: var(--accent); }

/* The robot-head mark (components/robot-head-svg.php). It ships at its natural
   120x44 crop; every placement sizes it by width and lets height follow, so the
   eyes never get squashed. */
.brand-mark { display: block; height: auto; flex: none; }
.site-nav .logo .brand-mark { width: 38px; }
/* NOTE: the desktop link list (.nav-desktop) and the link styling
   (.site-nav .navlink) live in the Navigation section further down. A legacy
   `.site-nav ul { display: flex }` rule used to sit here, but because
   `.nav-desktop` is a <ul> inside .site-nav, that selector matched it with
   higher specificity (0,1,1) than the `.nav-desktop { display: none }` mobile
   rule (0,1,0). Media queries add no specificity, so the desktop menu never
   actually collapsed on phones. The redundant rule has been removed. */
.site-nav .nav-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 10px; font-weight: 600;
  background: var(--indigo-dark); color: #fff; text-decoration: none;
  font-size: 0.95rem;
}
.site-nav .nav-cta:hover { transform: translateY(-1px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 30px;
  font-size: 1.05rem; font-weight: 600;
  border-radius: 12px; text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--indigo-dark); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(79, 70, 229, 0.45); }
.btn-ghost {
  background: var(--surface); color: var(--accent);
  border: 2px solid var(--indigo);
}
.btn-ghost:hover { background: var(--soft); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #eef0ff 0%, #f7f5ff 45%, #ffffff 100%);
  text-align: center; padding: 110px 0 96px;
}
.eyebrow {
  display: inline-block;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
  font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 24px;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  max-width: 800px; margin: 0 auto 22px;
}
.hero h1 .accent { color: var(--accent); }
.hero .sub {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 660px; margin: 0 auto 34px;
}
.hero .cta-row { margin-bottom: 48px; }

.trust-label {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 16px;
}
.trust-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  max-width: 760px; margin: 0 auto;
}
.tag {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-weight: 600; font-size: 0.9rem;
  padding: 9px 18px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(30, 27, 46, 0.04);
}

/* ---------- Section heading ---------- */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* ---------- Workflows grid ---------- */
.workflows { background: var(--soft); }
.grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.wf-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex; flex-direction: column;
}
.wf-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.wf-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 18px;
}
.wf-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.wf-flow {
  font-size: 0.9rem; color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  padding: 10px 14px; border-radius: 10px;
  margin-bottom: 18px; font-weight: 500;
}
.wf-card ul { list-style: none; margin-top: auto; }
.wf-card li {
  position: relative; padding-left: 28px; margin-bottom: 10px;
  color: var(--text-soft);
}
.wf-card li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px;
  max-width: 880px; margin: 0 auto; align-items: stretch;
}
.price-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 38px 34px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative;
}
.price-card.featured { border: 2px solid var(--indigo); box-shadow: var(--shadow-hover); }
.badge {
  position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%);
  background: var(--indigo-dark); color: #fff;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 6px 18px; border-radius: 999px; text-transform: uppercase;
}
.price-card h3 { font-size: 1.4rem; margin-bottom: 6px; }
.price-card .plan-desc { color: var(--muted); margin-bottom: 20px; font-size: 0.98rem; }
.price {
  font-size: 2.8rem; font-weight: 800; color: var(--ink);
  margin-bottom: 4px; letter-spacing: -0.03em;
}
.price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.feat-list { list-style: none; margin-bottom: 30px; }
.feat-list li {
  position: relative; padding-left: 30px; margin-bottom: 13px;
  color: var(--text-soft);
}
.feat-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  color: var(--accent); font-weight: 700;
}
.price-card .btn { margin-top: auto; }

/* ---------- FAQ ---------- */
.faq { background: var(--soft); }
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px 24px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(30, 27, 46, 0.03);
}
.faq-item summary {
  font-weight: 600; font-size: 1.1rem;
  padding: 16px 0; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.5rem;
  color: var(--accent); font-weight: 400;
  transition: transform 0.2s ease; flex: 0 0 auto;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 0 18px; color: var(--muted); }

/* ---------- Final CTA ---------- */
.final-cta {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-dark) 100%);
  text-align: center; color: #fff;
}
.final-cta h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 18px; color: #fff; }
.final-cta p { font-size: 1.2rem; opacity: 0.92; max-width: 580px; margin: 0 auto 34px; }
/* White button on the fixed indigo gradient — stays light-on-indigo in both
   themes, so it keeps #fff + the deep indigo text rather than the tokens. */
.final-cta .btn-primary { background: #fff; color: var(--indigo-dark); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.final-cta .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.final-cta .btn-ghost:hover { background: rgba(255,255,255,0.12); }

.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink); color: #c8c8d6; padding: 56px 0 32px;
}
.footer-top {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 28px; margin-bottom: 36px;
}
.footer-brand .logo {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-size: 1.5rem; font-weight: 800; margin-bottom: 8px;
}
.footer-brand .logo .brand-mark { width: 46px; }
.footer-brand a { color: var(--indigo); text-decoration: none; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: #c8c8d6; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px; font-size: 0.9rem; color: #8a8a9c;
}

/* ---------- Blog page ---------- */
.blog-hero {
  background: linear-gradient(160deg, #eef0ff 0%, #f7f5ff 45%, #ffffff 100%);
  text-align: center; padding: 80px 0 56px;
}
.blog-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 14px; }
.blog-hero p { color: var(--muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }
/* The section is also a .container, whose `padding: 0 24px` shorthand would zero
   out the element's vertical padding — so set top/bottom as longhand here. */
.blog-section { padding-top: 64px; padding-bottom: 96px; }
.blog-list { display: grid; gap: 28px; grid-template-columns: repeat(2, 1fr); }
.blog-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.blog-card-link {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
}

/* Uploaded thumbnail fills the same 16:9 art slot as the generated gradient. */
.blog-art-photo { background: #0f172a; }
.blog-art-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.blog-art-category-float { z-index: 1; }

.blog-readmore {
  display: inline-block; margin-top: 6px;
  color: var(--accent); font-weight: 600; font-size: 0.92rem;
}

/* Generated card art: per-category gradient (inline style) + glyph + rings. */
.blog-art {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--border);
}
.blog-art::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 84% 16%, rgba(255,255,255,0.30) 0, transparent 32%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,0.18) 0, transparent 42%),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(255,255,255,0.05) 26px 27px);
}
.blog-art-glyph {
  position: relative; font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1;
  filter: drop-shadow(0 10px 22px rgba(15, 23, 42, 0.35));
}
.blog-art-category {
  position: absolute; left: 16px; bottom: 14px;
  background: rgba(255,255,255,0.92); color: #1e1b2e;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
}

/* Newest post: full-width feature card, art beside the text. */
.blog-card-featured { grid-column: 1 / -1; }
.blog-card-featured .blog-card-link { display: grid; grid-template-columns: 1.05fr 1fr; }
.blog-card-featured .blog-art {
  height: 100%; aspect-ratio: auto; min-height: 260px;
  border-bottom: 0; border-right: 1px solid var(--border);
}
.blog-card-featured .body { padding: 34px 38px; }
.blog-card-featured h2 { font-size: 1.6rem; }
.blog-featured-tag {
  display: inline-block; margin-bottom: 12px;
  background: #eef0ff; color: var(--accent);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
}

.blog-card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.blog-card h2 { font-size: 1.25rem; margin-bottom: 10px; }
.blog-card .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }
/* Intro is a teaser only — clamp to 3 lines so the card stays compact and the
   full post is reached via "Read the full post →". The featured card has more
   room, so it gets a slightly longer clamp. */
.blog-card .intro {
  color: var(--text-soft); margin-bottom: 14px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
}
.blog-card-featured .intro { -webkit-line-clamp: 4; }
/* Read-more link sits at the card's base (the .body is a flex column) so the
   list stays visually even regardless of title/intro length. */
.blog-card .blog-readmore { margin-top: auto; padding-top: 4px; }

/* ---------- Single blog post (/blog/<slug>) ---------- */
.post-hero {
  background: linear-gradient(160deg, #eef0ff 0%, #f7f5ff 45%, #ffffff 100%);
  padding: 56px 0 36px;
}
.post-hero-inner { max-width: 760px; }
.post-back {
  display: inline-block; margin-bottom: 18px;
  color: var(--accent); font-weight: 600; text-decoration: none; font-size: 0.92rem;
}
.post-back:hover { text-decoration: underline; }
.post-category {
  position: static; display: inline-block; margin-bottom: 14px;
  background: rgba(99, 102, 241, 0.12); color: var(--accent);
}
.post-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin-bottom: 14px; }
.post-meta { color: var(--muted); font-size: 0.95rem; }

.post-cover {
  display: block; width: 100%; max-width: 860px; margin: 40px auto 0;
  aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); background: #0f172a;
}
.post-cover-art {
  display: flex; align-items: center; justify-content: center;
}
.post-cover-art .blog-art-glyph { font-size: clamp(3rem, 8vw, 5rem); }

.post-body { max-width: 760px; padding-top: 48px; padding-bottom: 88px; }
.post-lede { font-size: 1.2rem; line-height: 1.7; color: var(--text-soft); margin-bottom: 24px; }
.post-highlights {
  list-style: none; margin: 0 0 32px; padding: 20px 22px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
}
.post-highlights li {
  position: relative; padding-left: 24px; margin-bottom: 8px; color: var(--text-soft);
}
.post-highlights li:last-child { margin-bottom: 0; }
.post-highlights li::before {
  content: "✓"; position: absolute; left: 4px; top: 0;
  color: var(--accent); font-weight: 700;
}

/* Contents. Sits between the highlights and the body, so the reader meets it
   after the lede — long enough to know what the post is, early enough to skip
   to the part they came for. Counters rather than <ol> markers, because the
   numbers have to align with the text column at both indent levels. */
.post-toc {
  margin: 0 0 36px; padding: 18px 22px 20px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 14px; background: var(--surface-2);
}
.post-toc-title {
  margin-bottom: 10px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
.post-toc ol { list-style: none; counter-reset: toc; padding: 0; margin: 0; }
.post-toc li { counter-increment: toc; margin: 0; }
.post-toc li + li { margin-top: 7px; }
.post-toc a {
  display: block; padding-left: 30px; text-indent: -30px;
  color: var(--text-soft); text-decoration: none; line-height: 1.5;
}
.post-toc a::before {
  content: counter(toc) ".";
  display: inline-block; width: 30px; text-indent: 0;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.post-toc a:hover { color: var(--accent); text-decoration: underline; }
/* Sub-sections indent and drop the number: they are context under the entry
   above, not another stop on the list. */
.post-toc-l4 { counter-increment: none; }
.post-toc-l4 a { padding-left: 48px; text-indent: -18px; font-size: 0.95rem; }
.post-toc-l4 a::before { content: "–"; width: 18px; }

/* Markdown body */
.post-content { color: var(--text-soft); font-size: 1.06rem; line-height: 1.75; }
/* The nav is sticky at 64px, so a heading jumped to would otherwise land under
   it. */
.post-content h2, .post-content h3, .post-content h4 { scroll-margin-top: 88px; }
.post-content > * + * { margin-top: 1.05em; }
.post-content h2 { font-size: 1.6rem; margin-top: 1.6em; }
.post-content h3 { font-size: 1.3rem; margin-top: 1.4em; }
.post-content h4 { font-size: 1.1rem; margin-top: 1.3em; }
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li { margin-bottom: 0.4em; }
.post-content blockquote {
  margin: 1.2em 0; padding: 4px 18px; color: var(--text-soft);
  border-left: 3px solid var(--indigo-dark); background: var(--surface-2);
}
.post-content code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px;
  font-size: 0.9em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.post-content pre {
  background: #0f172a; color: #e2e8f0; padding: 16px 18px;
  border-radius: 12px; overflow-x: auto; font-size: 0.9rem;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.md-figure { margin: 1.4em 0; }
/* Figures hold the reading column's own width. They used to break out to a
   1000px band on wide screens, on the theory that diagrams need the room; in
   practice it made every screenshot in a post read as a separate, louder
   element than the prose around it. Same width as a paragraph, same left edge,
   so the column stays one column all the way down. */
.md-figure img,
.post-content img {
  display: block; width: 100%; height: auto;
  border-radius: 14px; border: 1px solid var(--border);
}
.md-figure figcaption {
  margin-top: 8px; text-align: center; color: var(--muted); font-size: 0.9rem;
}

.post-gallery {
  display: grid; gap: 18px; margin-top: 40px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.post-gallery .md-figure { margin: 0; }
.post-foot { margin-top: 44px; }

/* ============================================================
   Navigation — desktop dropdown + mobile panel
   ============================================================ */
.nav-desktop { display: flex; gap: 24px; list-style: none; align-items: center; }
.site-nav .navlink {
  text-decoration: none; color: var(--ink); font-weight: 500;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.site-nav .navlink:hover,
.site-nav .navlink.active { color: var(--accent); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-toggle { display: inline-flex; align-items: center; gap: 4px; }
.caret { font-size: 0.7rem; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-hover); padding: 8px; width: 280px;
  opacity: 0; visibility: hidden; transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 60;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.dropdown-menu::before { /* hover bridge so the menu doesn't close in the gap */
  content: ""; position: absolute; bottom: 100%; left: 0; right: 0; height: 14px;
}
.dropdown-item {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--ink);
}
.dropdown-item:hover { background: var(--soft); }
.dropdown-item.active { background: rgba(99,102,241,0.1); }
.di-glyph {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px;
  display: grid; place-items: center; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
}
.di-logo {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px;
  object-fit: contain; padding: 5px; background: var(--soft);
}
.m-sublink .di-logo {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px; padding: 3px;
  vertical-align: middle;
}
.dropdown-item strong { display: block; font-size: 0.96rem; }
.dropdown-item em { display: block; font-style: normal; font-size: 0.82rem; color: var(--muted); }

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 42px; height: 42px; background: none; border: 0; cursor: pointer; padding: 8px;
}
.hamburger span { height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile panel */
.nav-mobile {
  display: none; flex-direction: column; padding: 8px 24px 20px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
/* .nav-mobile is revealed only inside the <1000px media query (see Responsive
   section) so the panel can never leak onto desktop if the menu was left open
   while the viewport was widened. */
.nav-mobile .m-link {
  text-align: left; background: none; border: 0; font: inherit; cursor: pointer;
  padding: 13px 4px; color: var(--ink); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--border); display: flex; gap: 6px; align-items: center;
}
.nav-mobile .m-link.active { color: var(--accent); }
.m-sub { display: flex; flex-direction: column; padding: 4px 0 4px 14px; }
.m-sublink {
  padding: 11px 4px; color: var(--text-soft); text-decoration: none; font-weight: 500;
}
.m-sublink.active { color: var(--accent); }
.m-cta {
  margin-top: 14px; text-align: center; padding: 13px; border-radius: 10px;
  background: var(--indigo-dark); color: #fff; text-decoration: none; font-weight: 600;
}

/* ============================================================
   GradientThumb — reusable gradient tile
   ============================================================ */
.gthumb {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--from, var(--indigo)), var(--to, var(--indigo-dark)));
  color: #fff;
}
.gthumb-glyph { font-size: 2.4rem; line-height: 1; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.18)); }
.gthumb-logo {
  width: 72%; height: 72%; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.22));
}
.pc-thumb .gthumb-logo, .sc-thumb .gthumb-logo { width: 70%; height: 70%; }

/* ============================================================
   Welcome (home) page
   ============================================================ */
.welcome-hero {
  background:
    radial-gradient(1100px 500px at 50% -10%, #e9ebff 0%, rgba(233,235,255,0) 60%),
    linear-gradient(160deg, #eef0ff 0%, #f7f5ff 45%, #ffffff 100%);
  text-align: center; padding: 104px 0 84px;
}
.welcome-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); max-width: 900px; margin: 0 auto 22px; }
.welcome-hero h1 .accent { color: var(--accent); }
.welcome-hero .sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 720px; margin: 0 auto 34px; }
.welcome-hero .cta-row { margin-bottom: 56px; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  max-width: 820px; margin: 0 auto;
}
.stat {
  background: rgba(255,255,255,0.7); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 14px; box-shadow: 0 2px 10px rgba(30,27,46,0.04);
}
.stat-num { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.mission { background: var(--surface); }
.mission .section-head { margin-bottom: 0; max-width: 760px; }

.products { background: var(--soft); }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.pc-thumb { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 20px; }
.pc-thumb .gthumb-glyph { font-size: 2rem; }
.product-card h3 { font-size: 1.35rem; margin-bottom: 8px; }
.pc-tagline { color: var(--muted); margin-bottom: 16px; }
.pc-bullets { list-style: none; margin-bottom: 22px; }
.pc-bullets li { position: relative; padding-left: 26px; margin-bottom: 9px; color: var(--text-soft); font-size: 0.95rem; }
.pc-bullets li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pc-cta { margin-top: auto; font-weight: 700; color: var(--accent); }

/* The use-case section's own layout lives in home.css — it is the only page
   that renders it, and the treatment there is specific to the home design. */
.stories { background: var(--surface); }

/* ============================================================
   n8n page — store link
   ============================================================ */
.store-link-row { text-align: center; margin-top: 44px; }

/* ============================================================
   Product pages (Hermes / OpenClaw)
   ============================================================ */
.product-hero { padding: 96px 0; }
.hermes-hero { background: linear-gradient(160deg, #e6f4ff 0%, #f2f9ff 50%, #ffffff 100%); }
.openclaw-hero { background: linear-gradient(160deg, #e6fbf2 0%, #f1fdf8 50%, #ffffff 100%); }
.product-hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.product-hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin-bottom: 20px; }
.product-hero h1 .accent { color: var(--accent); }
.product-hero .sub { font-size: clamp(1.02rem, 2vw, 1.2rem); color: var(--muted); margin-bottom: 30px; }
.product-hero-art {
  font-size: clamp(6rem, 16vw, 11rem); text-align: center; line-height: 1;
  filter: drop-shadow(0 18px 36px rgba(79,70,229,0.22));
}

/* OpenClaw hero terminal — an animated mock of one task being executed.
   Lines fade in on a staggered delay; reduced-motion users see them static. */
.oc-terminal {
  background: #101426; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 60px rgba(13, 148, 136, 0.20), 0 8px 24px rgba(15, 23, 42, 0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88rem; width: 100%; max-width: 480px; justify-self: center;
  text-align: left;
}
.oc-terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.oc-dot { width: 11px; height: 11px; border-radius: 50%; }
.oc-dot:nth-child(1) { background: #f87171; }
.oc-dot:nth-child(2) { background: #fbbf24; }
.oc-dot:nth-child(3) { background: #34d399; }
.oc-terminal-title {
  margin-left: 8px; color: rgba(255,255,255,0.45);
  font-size: 0.78rem; letter-spacing: 0.08em;
}
.oc-terminal-body { padding: 18px 18px 20px; display: grid; gap: 9px; }
.oc-line { color: #cbd5e1; opacity: 0; animation: oc-line-in 0.45s ease forwards; line-height: 1.5; }
.oc-line-user { color: #e2e8f0; }
.oc-line-plan { color: #94a3b8; font-style: italic; }
.oc-line-done { color: #a7f3d0; }
.oc-prefix { color: #5eead4; font-weight: 700; }
.oc-check { color: #34d399; font-weight: 700; }
.oc-line:nth-child(1) { animation-delay: 0.3s; }
.oc-line:nth-child(2) { animation-delay: 1.2s; }
.oc-line:nth-child(3) { animation-delay: 2.0s; }
.oc-line:nth-child(4) { animation-delay: 2.7s; }
.oc-line:nth-child(5) { animation-delay: 3.4s; }
.oc-line:nth-child(6) { animation-delay: 4.1s; }
.oc-line:nth-child(7) { animation-delay: 5.0s; }
@keyframes oc-line-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .oc-line { animation: none; opacity: 1; }
}

.features { background: var(--surface); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 920px; margin: 0 auto; }
.feature-card {
  background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.feature-glyph {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-soft); }

.steps-section { background: var(--soft); }
.step-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.step-num {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  margin-bottom: 16px;
}
.step-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step-card p { color: var(--text-soft); }

.usecases { background: var(--surface); }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 760px; margin: 0 auto; }
.use-chip {
  background: var(--soft); border: 1px solid var(--border); color: var(--text-soft);
  font-weight: 600; padding: 11px 20px; border-radius: 999px;
}

/* ============================================================
   Workflow Store (Amazon-style)
   ============================================================ */
.store-hero {
  background: linear-gradient(160deg, #eef0ff 0%, #f7f5ff 45%, #ffffff 100%);
  padding: 72px 0 48px;
}
.store-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 12px; }
.store-hero .sub { color: var(--muted); font-size: 1.12rem; max-width: 640px; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.store-section { padding: 48px 0 96px; }
.store-layout { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }

.store-sidebar {
  position: sticky; top: 88px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.sidebar-title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }
.cat-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cat-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
  padding: 9px 12px; border-radius: 9px; color: var(--text-soft);
}
.cat-btn:hover { background: var(--soft); }
.cat-btn.is-active { background: rgba(99,102,241,0.12); color: var(--accent); font-weight: 700; }
.cat-count {
  font-size: 0.78rem; color: var(--muted); background: var(--soft);
  border-radius: 999px; padding: 2px 9px; min-width: 26px; text-align: center;
}
.cat-btn.is-active .cat-count { background: #fff; color: var(--indigo-dark); }

.store-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.result-count { color: var(--muted); font-size: 0.95rem; }
.result-count strong { color: var(--ink); }
.sort-control { font-size: 0.9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.sort-control select {
  font: inherit; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); cursor: pointer;
}

.store-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.store-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.store-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.sc-media { position: relative; }
.sc-thumb { width: 100%; aspect-ratio: 16 / 10; }
.sc-thumb .gthumb-glyph { font-size: 3rem; }
.sc-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: #1e1b2e; color: #fff; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
}
.sc-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.sc-category { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.sc-title { font-size: 1.1rem; margin-bottom: 8px; line-height: 1.3; }
.sc-blurb { color: var(--text-soft); font-size: 0.9rem; margin: 10px 0 16px; flex: 1; }
.sc-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.sc-price { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.sc-old { color: var(--muted); text-decoration: line-through; font-size: 1rem; }
.sc-save { font-size: 0.78rem; font-weight: 700; color: #047857; background: #e6fbf2; padding: 3px 9px; border-radius: 999px; }

/* What's-included feature list */
.sc-features { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-features li { font-size: 0.84rem; color: var(--text-soft); padding-left: 22px; position: relative; line-height: 1.45; }
.sc-features li::before { content: '✓'; position: absolute; left: 0; top: 0; color: #047857; font-weight: 800; }
.sc-once { font-size: 0.82rem; color: var(--muted); }

/* Buy button */
.btn-cart {
  margin-top: auto; min-height: 44px; padding: 11px 20px; font-size: 0.98rem;
  width: 100%; background: #ffd814; color: #1e1b2e; border: 1px solid #e6c200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-align: center;
}
.btn-cart:hover { background: #f7ca00; transform: translateY(-1px); }
.sc-trust { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); text-align: center; }

/* Free-sample band + custom-work cross-sell */
.sample-band {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #f3f1ff; border: 1px solid #ddd6fe; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 18px; font-size: 0.92rem; color: var(--text-soft);
}
.store-custom-cta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px dashed #c7c4e0; border-radius: 12px; padding: 16px 18px; margin-top: 26px;
  color: var(--text-soft); font-size: 0.95rem;
}
.store-custom-cta p { margin: 0; }
.btn-sm { min-height: 42px; padding: 10px 20px; font-size: 0.95rem; }

/* ============================================================
   Footer additions
   ============================================================ */
.footer-tag { color: #9a9aae; margin: 4px 0 10px; font-size: 0.95rem; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 4px; }
.footer-col a { color: #c8c8d6; text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }

/* ============================================================
   Responsive
   ============================================================ */
/* Tablets / small laptops */
/* Swap the desktop nav for the hamburger panel below 1000px.
   999.98px rather than 999px: a viewport can land on a fractional width (a
   zoomed page, a scaled display), and an integer cutoff leaves the sliver
   between 999 and 1000 matching neither this block nor a `min-width: 1000px`
   one — for that fraction of a pixel the nav would show neither menu. */
@media (max-width: 999.98px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
  .nav-mobile.is-open { display: flex; }
  /* On short/landscape phones the open panel can exceed the viewport — let it
     scroll internally instead of trapping links off-screen, and lift it off the
     page with a soft shadow so it reads as an overlay over the content below. */
  .nav-mobile { max-height: calc(100vh - 64px); overflow-y: auto; box-shadow: 0 12px 24px rgba(30, 27, 46, 0.10); }
}

@media (max-width: 980px) {
  .store-layout { grid-template-columns: 1fr; }
  .store-sidebar { position: static; }
  .cat-list { flex-direction: row; flex-wrap: wrap; }
  .cat-btn { width: auto; }
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .product-hero-grid { grid-template-columns: 1fr; text-align: center; }
  .product-hero-art { order: -1; }
  .product-hero .cta-row { justify-content: center; }
}

/* Portrait tablets / large phones */
@media (max-width: 768px) {
  section { padding: 64px 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 440px; }
  .blog-list { grid-template-columns: 1fr; }
  .blog-card-featured .blog-card-link { grid-template-columns: 1fr; }
  .blog-card-featured .blog-art {
    aspect-ratio: 16 / 9; min-height: 0; height: auto;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .blog-card-featured .body { padding: 24px 26px 28px; }
  .store-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  /* Stacked, the brand block and the link columns are each narrower than the
     page, so left-aligning them leaves the footer hanging off one edge. Centre
     the whole thing instead — it is the one part of the page with no adjacent
     column to align to. */
  .footer-top { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { gap: 16px 24px; justify-content: center; }
  .footer-cols { gap: 36px; justify-content: center; }
  .footer-col { align-items: center; }
  .footer-bottom { text-align: center; }
  .hero, .welcome-hero { padding: 84px 0 64px; }
  .product-hero { padding: 72px 0; }
  .store-hero { padding: 56px 0 40px; }
  .section-head { margin-bottom: 40px; }
}

/* Small phones */
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  section { padding: 52px 0; }
  /* Class beats the element rule above, so scale the blog spacing explicitly. */
  .blog-section { padding-top: 44px; padding-bottom: 60px; }
  .post-body { padding-top: 32px; padding-bottom: 56px; }
  .post-cover { margin-top: 24px; }
  .hero, .welcome-hero { padding: 64px 0 52px; }
  .welcome-hero .cta-row { margin-bottom: 40px; }

  /* Stack CTA buttons full-width so they're easy to tap */
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; }

  .eyebrow { font-size: 0.78rem; }
  .tag, .use-chip { font-size: 0.82rem; }
  .price { font-size: 2.4rem; }
  .wf-card, .price-card, .feature-card, .step-card,
  .product-card { padding: 24px 22px; }
  .product-hero-art { font-size: clamp(5rem, 30vw, 8rem); }

  /* Store toolbar: label over the sort control */
  .store-toolbar { align-items: flex-start; }

  /* Free-sample band: stack text above a full-width button */
  .sample-band { flex-direction: column; align-items: stretch; }
  .sample-band .btn { text-align: center; }
}

/* Very small phones */
@media (max-width: 400px) {
  .stat-strip { grid-template-columns: 1fr; }
  .store-grid { grid-template-columns: 1fr; }
  .cat-list { flex-direction: column; }
  .cat-btn { width: 100%; }
}

/* Empty-state message for DB-driven lists (store / blog) when no rows exist. */
.store-empty {
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
  font-size: 1.05rem;
}

/* ============================================================
   Welcome bot — floating chat-style launcher (components/WelcomeBot)
   ============================================================ */

/* Root wrapper: pinned bottom-right, non-blocking. Only the launcher / panel /
   hint capture clicks — the page underneath stays fully interactive. */
.ckw-root {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.ckw-root > * { pointer-events: auto; }

/* SVG sub-animations (shared with the 404 page's robot). */
.wb-svg .wb-lens { transform-box: fill-box; transform-origin: center; animation: wb-blink 4.2s ease-in-out 2s infinite; }
@keyframes wb-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.08); } }
.wb-svg .wb-led { animation: wb-led 1.8s ease-in-out 1.8s infinite; }
@keyframes wb-led { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---- launcher button ---- */
.ckw-launcher {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.42);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}
.ckw-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 38px rgba(99, 102, 241, 0.5); }
.ckw-launcher:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
.ckw-launcher.is-open { transform: scale(0.95); }
.ckw-launcher-bot { display: block; width: 46px; height: 46px; }
.ckw-launcher-bot .wb-svg { width: 100%; height: 100%; }

/* ---- "Hi" hint bubble ---- */
.ckw-hint {
  position: relative;
  max-width: 250px;
  padding: 12px 30px 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 36px rgba(20, 18, 50, 0.28);
  border: 1px solid var(--border, rgba(120, 120, 150, 0.18));
  animation: ckw-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ckw-hint-text { margin: 0; font-size: 0.95rem; font-weight: 500; line-height: 1.4; }
.ckw-hint-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--muted, #888);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.ckw-hint-x:hover { background: rgba(120, 120, 150, 0.15); }

/* ---- chat panel ---- */
.ckw-panel {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 40px));
  max-height: min(560px, calc(100vh - 120px));
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(20, 18, 50, 0.4);
  border: 1px solid var(--border, rgba(120, 120, 150, 0.18));
  transform-origin: bottom right;
  animation: ckw-panel-in 0.32s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.ckw-panel:focus { outline: none; }
@keyframes ckw-panel-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }

.ckw-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: #fff;
}
.ckw-head-bot { display: block; width: 38px; height: 38px; flex: none; }
.ckw-head-bot .wb-svg { width: 100%; height: 100%; }
.ckw-head-meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.ckw-head-name { font-weight: 700; font-size: 1rem; }
.ckw-head-status { font-size: 0.78rem; opacity: 0.85; display: flex; align-items: center; gap: 6px; }
.ckw-head-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: ckw-online 2s ease-out infinite;
}
@keyframes ckw-online { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); } }
.ckw-close {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.ckw-close:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }
.ckw-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.ckw-body {
  padding: 18px 16px;
  overflow-y: auto;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(99, 102, 241, 0.06), transparent 60%);
}

/* greeting message (chat bubble from the bot) */
.ckw-msg {
  background: var(--surface-2, rgba(120, 120, 150, 0.1));
  border-radius: 4px 16px 16px 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.ckw-text { margin: 0; font-size: 0.98rem; line-height: 1.55; font-weight: 500; min-height: 1.55em; }

/* option chips */
.ckw-options { display: flex; flex-direction: column; gap: 10px; }
.ckw-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(120, 120, 150, 0.2));
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  opacity: 0;
  animation: ckw-opt-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) calc(0.1s + var(--i) * 0.07s) both;
}
.ckw-opt:hover {
  transform: translateX(3px);
  border-color: var(--indigo);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.22);
}
.ckw-opt:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.ckw-opt-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  font-size: 1.1rem;
}
.ckw-opt-label { flex: 1; }
.ckw-opt-arrow { color: var(--indigo); font-weight: 700; }
@keyframes ckw-opt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@keyframes ckw-pop { from { opacity: 0; transform: scale(0.85) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }

@media (max-width: 520px) {
  .ckw-launcher { width: 58px; height: 58px; }
  .ckw-launcher-bot { width: 42px; height: 42px; }
}

/* Respect reduced-motion: collapse the choreography to simple fades. */
@media (prefers-reduced-motion: reduce) {
  .ckw-panel, .ckw-hint, .ckw-opt, .ckw-launcher, .ckw-close,
  .ckw-head-status::before, .wb-svg .wb-lens, .wb-svg .wb-led {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  .ckw-opt { opacity: 1; }
}

/* ============================================================
   Services page (/services)
   ============================================================ */
.pricing-grid-3 { grid-template-columns: repeat(3, 1fr); max-width: 1100px; }

.inquiry { padding: 72px 0 96px; background: var(--soft, #f7f7fb); }
.inquiry-inner { max-width: 760px; }

.form-banner { border-radius: 12px; padding: 16px 20px; margin-bottom: 22px; font-size: 0.96rem; }
.form-banner.ok { background: #e6fbf2; border: 1px solid #10b981; color: #065f46; }
.form-banner.err { background: #fef2f2; border: 1px solid #f87171; color: #991b1b; }

.inquiry-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; font-size: 0.9rem; font-weight: 600; color: var(--text-soft); }
.form-field input, .form-field select, .form-field textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); width: 100%;
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--indigo); outline-offset: 1px; border-color: var(--indigo);
}
.form-privacy { font-size: 0.8rem; color: var(--muted); margin: 0; }

/* Honeypot: visually removed but still in the DOM for bots to fill. */
.hp-field {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

@media (max-width: 1024px) {
  .pricing-grid-3 { grid-template-columns: 1fr; max-width: 440px; }
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Order request modal (see components/OrderRequestModal) ---------- */
.or-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  background: radial-gradient(120% 120% at 50% 30%, rgba(30, 27, 56, 0.45), rgba(15, 14, 30, 0.62));
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  backdrop-filter: blur(9px) saturate(115%);
  animation: or-overlay-in 0.3s ease both;
}
@keyframes or-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.or-modal {
  position: relative;
  width: min(560px, 100%);
  margin: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius, 18px);
  box-shadow: var(--shadow, 0 24px 60px rgba(20, 18, 50, 0.4));
  padding: 30px 30px 26px;
  animation: or-modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes or-modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

.or-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.or-close:hover { background: #ececf4; transform: rotate(90deg); }
.or-close:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.or-title { font-size: 1.3rem; margin: 0 32px 6px 0; }
.or-context { color: var(--muted); margin: 0 0 20px; }
.or-form { display: flex; flex-direction: column; gap: 16px; }

.or-success { text-align: center; padding: 18px 8px 8px; }
.or-success-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%;
  background: #e6fbf2; color: #10b981; font-size: 1.8rem;
}
.or-success h3 { font-size: 1.25rem; margin: 0 0 6px; }
.or-success p { color: var(--muted); margin: 0 0 18px; }

@media (max-width: 520px) {
  .or-modal { padding: 26px 20px 22px; }
}

/* Respect reduced-motion: collapse the open animation to a simple fade. */
@media (prefers-reduced-motion: reduce) {
  .or-overlay, .or-modal { animation-duration: 0.01ms !important; }
  .or-modal { transform: none !important; }
  .or-close { transition: none; }
}

/* ---------- 404 / not-found ---------- */
.nf { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 24px 96px; }

/* The big "4 0 4" — the middle "0" is the robot peeking through. */
.nf-digits { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 2vw, 20px); line-height: 1; }
.nf-num {
  font-size: clamp(5rem, 22vw, 12rem); font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: var(--shadow);
}
.nf-bot {
  position: relative; display: inline-flex; align-items: flex-end; justify-content: center;
  width: clamp(5rem, 22vw, 12rem); height: clamp(5rem, 22vw, 12rem);
  animation: nf-bob 3.4s ease-in-out infinite;
}
.nf-bot .wb-svg { width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(20, 18, 50, 0.28)); }
@keyframes nf-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* Speech bubble floating above the robot. */
.nf-bubble {
  position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 8px 14px; border-radius: 14px;
  background: var(--surface); color: var(--ink); font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: nf-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
.nf-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #fff;
}
@keyframes nf-pop { from { opacity: 0; transform: translateX(-50%) scale(0.8) translateY(6px); } to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); } }

.nf-title { margin-top: 28px; }
.nf-copy { color: var(--muted); max-width: 440px; margin: 12px 0 26px; }

@media (max-width: 520px) {
  .nf-bubble { font-size: 0.75rem; white-space: normal; max-width: 160px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .nf-bot { animation: none; }
  .nf-bubble { animation: none; }
}

/* ============================================================
   Dark mode
   ------------------------------------------------------------
   Activated by data-theme="dark" on <html> (set pre-paint by the inline
   script in app/layout.jsx, toggled by components/ThemeToggle). Most of the
   work is done by retuning the design tokens below; the rules that follow only
   override the handful of values that were hardcoded light (hero gradients,
   translucent whites, the footer's fixed dark, a few coloured chips).
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9e9f2;
  --muted: #9a9aac;
  --text-soft: #c3c3d2;
  --bg: #0e0d16;
  --soft: #15141f;
  --surface: #1b1a26;
  --surface-2: #232231;
  --border: #2c2b3a;
  /* Lighten accent *text* for contrast on dark; solid CTA fills keep using the
     deeper --indigo-dark, so this only affects links/headings/icons-as-text. */
  --accent: #a5b4fc;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Translucent nav bar: swap the white wash for a dark one. */
[data-theme="dark"] .site-nav { background: rgba(14, 13, 22, 0.8); }

/* Hero / banner gradients — the light lavender washes become deep indigo. */
[data-theme="dark"] .hero,
[data-theme="dark"] .blog-hero,
[data-theme="dark"] .post-hero,
[data-theme="dark"] .store-hero {
  background: linear-gradient(160deg, #1a1830 0%, #14131f 45%, #0e0d16 100%);
}
[data-theme="dark"] .welcome-hero {
  background:
    radial-gradient(1100px 500px at 50% -10%, #221f3d 0%, rgba(34, 31, 61, 0) 60%),
    linear-gradient(160deg, #1a1830 0%, #14131f 45%, #0e0d16 100%);
}
[data-theme="dark"] .hermes-hero {
  background: linear-gradient(160deg, #0e2233 0%, #0f1a26 50%, #0e0d16 100%);
}
[data-theme="dark"] .openclaw-hero {
  background: linear-gradient(160deg, #0c2a22 0%, #0d1c1a 50%, #0e0d16 100%);
}

/* Translucent-white surfaces sitting on the page. */
[data-theme="dark"] .stat { background: rgba(255, 255, 255, 0.04); }

/* Footer is dark in both themes; pin it to a deep near-black so retuning
   --ink (now light) doesn't flip it. Its text colours are already hardcoded. */
[data-theme="dark"] footer { background: #08070f; }

/* Solid light-indigo chips → translucent indigo tint that reads on dark. */
[data-theme="dark"] .blog-featured-tag { background: rgba(99, 102, 241, 0.15); }
[data-theme="dark"] .sample-band {
  background: rgba(99, 102, 241, 0.1); border-color: var(--border);
}
[data-theme="dark"] .store-custom-cta { border-color: var(--border); }

/* Coloured status chips (success / error / savings) — darken the tinted fills. */
[data-theme="dark"] .sc-save,
[data-theme="dark"] .form-banner.ok,
[data-theme="dark"] .or-success-glyph {
  background: rgba(16, 185, 129, 0.16); color: #6ee7b7;
}
[data-theme="dark"] .form-banner.ok { border-color: rgba(16, 185, 129, 0.5); }
[data-theme="dark"] .form-banner.err {
  background: rgba(248, 113, 113, 0.14); color: #fca5a5; border-color: rgba(248, 113, 113, 0.5);
}

/* ---------- Theme toggle button (nav) ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
  cursor: pointer; padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { background: var(--soft); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
/* Desktop toggle sits in the link row; the mobile one lives in the panel. */
.theme-toggle-mobile { width: 100%; justify-content: flex-start; gap: 10px; margin-top: 14px; padding: 0 14px; height: 46px; }
.theme-toggle-mobile .tt-label { font-weight: 600; }

/* ============================================================
   Design elevation (2026)
   ------------------------------------------------------------
   Appended last so it layers over the base rules: a distinctive
   typeface, atmospheric heroes (masked dot-grid + soft aurora),
   accent-glow card depth, a photo-led use-case treatment, and a
   tasteful scroll-reveal. All motion is reduced-motion gated and
   the reveal start-state is gated on [data-reveal] (JS-only) so
   content always ships visible in the SSR HTML.
   ============================================================ */

/* ---- Typeface (CSS vars provided by next/font in layout.jsx) ---- */
body {
  font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
h1, h2, h3 {
  font-family: var(--font-display), var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.welcome-hero h1, .hero h1, .product-hero h1, .final-cta h2, .section-head h2 { font-weight: 700; }
.eyebrow, .trust-label, .sidebar-title, .sc-category { letter-spacing: 0.12em; }

/* ---- Atmosphere tokens (retuned per theme) ---- */
:root {
  --grid-dot: rgba(99, 102, 241, 0.16);
  --glow-1: rgba(99, 102, 241, 0.20);
  --glow-2: rgba(14, 165, 233, 0.13);
}
[data-theme="dark"] {
  --grid-dot: rgba(165, 180, 252, 0.10);
  --glow-1: rgba(99, 102, 241, 0.30);
  --glow-2: rgba(14, 165, 233, 0.18);
}

/* ---- Hero atmosphere: masked dot-grid (::before) + aurora glow (::after) ---- */
.welcome-hero, .hero, .product-hero, .store-hero, .blog-hero, .post-hero {
  position: relative; overflow: hidden; isolation: isolate;
}
.welcome-hero::before, .hero::before, .product-hero::before,
.store-hero::before, .blog-hero::before, .post-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at center, var(--grid-dot) 1px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 0%, #000 32%, transparent 78%);
  mask-image: radial-gradient(ellipse 78% 68% at 50% 0%, #000 32%, transparent 78%);
}
.welcome-hero::after, .hero::after, .product-hero::after,
.store-hero::after, .blog-hero::after, .post-hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -30%; left: -10%; right: -10%; height: 95%;
  background:
    radial-gradient(38% 60% at 22% 28%, var(--glow-1), transparent 70%),
    radial-gradient(38% 58% at 80% 16%, var(--glow-2), transparent 72%);
  filter: blur(52px);
}
/* Per-product aurora tints (sky for Hermes, emerald for OpenClaw) */
.hermes-hero::after {
  background:
    radial-gradient(40% 60% at 24% 26%, rgba(14, 165, 233, 0.32), transparent 70%),
    radial-gradient(38% 56% at 80% 15%, rgba(2, 132, 199, 0.20), transparent 72%);
}
.openclaw-hero::after {
  background:
    radial-gradient(40% 60% at 24% 26%, rgba(16, 185, 129, 0.30), transparent 70%),
    radial-gradient(38% 56% at 80% 15%, rgba(5, 150, 105, 0.20), transparent 72%);
}

/* ---- Card depth: brighten border + accent glow on hover ---- */
.product-card, .feature-card, .wf-card, .price-card, .store-card, .blog-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.product-card:hover, .feature-card:hover, .wf-card:hover,
.store-card:hover, .blog-card:hover, .price-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: var(--shadow-hover), 0 0 0 1px rgba(99, 102, 241, 0.18),
    0 22px 50px -18px rgba(99, 102, 241, 0.40);
}

/* ---- Icons ---- */
.ck-icon { display: block; }
.gthumb-icon { color: #fff; }

/* ---- Scroll reveal (start-state gated on [data-reveal]; JS adds .in-view) ---- */
[data-reveal] .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal] .reveal.in-view { opacity: 1; transform: none; }
[data-reveal] .reveal-group .reveal:nth-child(2) { transition-delay: 0.08s; }
[data-reveal] .reveal-group .reveal:nth-child(3) { transition-delay: 0.16s; }
[data-reveal] .reveal-group .reveal:nth-child(4) { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---- Icon color inside existing glyph tiles ---- */
.wf-icon { color: #fff; }
.feature-glyph { color: var(--accent); }
.feature-glyph .ck-icon { stroke-width: 1.75; }

/* ---- Numbered step tiles (services "how it works") ---- */
.wf-icon-num { color: #fff; font-weight: 800; font-size: 1.5rem; }

/* ---- Reusable framed media (photos embedded in marketing pages) ---- */
.media-frame {
  display: block; width: 100%; max-width: 940px; margin: 48px auto 0;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-hover);
}
.media-frame img { display: block; width: 100%; height: auto; }

/* ---- Blog generated-art emblem now renders a white SVG icon ---- */
.blog-art-glyph { color: #fff; }


/* ============================================================
   Home hero — the running workflow canvas
   ------------------------------------------------------------
   Appended last so it layers over the centred hero rules further
   up the file. Two changes live here:

     1. .welcome-hero becomes an asymmetric two-column layout —
        the claim on the left, components/hero-flow.php on the
        right — with the stat strip demoted to a hairline rail
        spanning both underneath.
     2. the canvas animation: a 7s master cycle carries one packet
        from trigger to agent, and three of those passes make a 21s
        super-cycle in which each run ends at a different tool. The
        result line and the destination that lights are always the
        same pass, so the pairing is never arbitrary.

   The motion is deliberately quiet at the point of arrival: the
   packet lands, the status dot pings, the result and its
   destination fade up. Nothing jumps, and no border changes
   colour — those beats read as noise at this size.

   Because these rules sit after the responsive blocks near line
   860, any hero padding they set has to be restated in the media
   queries at the bottom of this section — a plain rule here would
   otherwise outrank the earlier @media ones at equal specificity.
   ============================================================ */

.welcome-hero { text-align: left; padding: 72px 0 22px; }

.wh-grid {
  display: grid;
  /* Even halves. The copy column's floor is the two CTAs sitting on one line
     (~442px at the largest step) — anything narrower wraps them, which is why
     the canvas doesn't get the larger share despite carrying five nodes. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.welcome-hero .cta-row { gap: 14px; }
.welcome-hero .cta-row .btn { padding: 14px 24px; }

/* ---- Left column: type ---- */
/* The eyebrow drops the site-wide pill here and becomes a ruled label, so the
   canvas is the only thing in the hero asking for attention. */
.welcome-hero .eyebrow {
  display: flex; align-items: center; gap: 12px;
  background: none; padding: 0; border-radius: 0;
  margin-bottom: 26px; font-size: 0.76rem; font-weight: 600;
}
.welcome-hero .eyebrow::before {
  content: ""; width: 28px; height: 1px; flex: none;
  background: currentColor; opacity: 0.55;
}

.welcome-hero h1 {
  display: flex; flex-direction: column;
  max-width: none; margin: 0 0 28px;
  font-size: clamp(2.8rem, 5.6vw, 4.4rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.wh-greet {
  font-family: var(--font-sans), sans-serif;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 500; letter-spacing: 0.02em; line-height: 1;
  color: var(--muted); margin-bottom: 16px;
}
.wh-name { display: block; }

.welcome-hero .sub {
  max-width: 46ch; margin: 0 0 34px;
  font-size: clamp(1.02rem, 1.4vw, 1.12rem);
}
.welcome-hero .cta-row { justify-content: flex-start; margin-bottom: 0; }

/* ---- Stat rail: hairline dividers instead of four floating cards ---- */
.welcome-hero .stat-strip {
  max-width: none; margin: 64px 0 0; gap: 0;
  border-top: 1px solid var(--border);
}
.welcome-hero .stat {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  padding: 26px 26px 30px;
  border-left: 1px solid var(--border);
}
.welcome-hero .stat:first-child { border-left: 0; padding-left: 0; }
.welcome-hero .stat-num {
  font-family: var(--font-display), sans-serif;
  font-weight: 600; letter-spacing: -0.03em;
}
.welcome-hero .stat-label { font-size: 0.82rem; max-width: 20ch; }

/* ============================================================
   The canvas
   ============================================================ */
.ck-flow {
  position: relative;
  width: 100%; max-width: 620px; margin-left: auto;
  aspect-ratio: 620 / 500;   /* matches the viewBox, so the mascot's percentage
                                position maps onto SVG user units */
}
.ck-flow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ---- Wires ---- */
.fx-wire {
  fill: none; stroke: var(--fx-wire); stroke-width: 1.5;
  stroke-dasharray: 4 5; stroke-linecap: round;
}
.fx-pulse {
  fill: none; stroke: var(--fx-packet); stroke-width: 3.5; stroke-linecap: round;
  stroke-dasharray: 14 100;
  stroke-dashoffset: -100;   /* parked past the end until its window opens */
  opacity: 0;
  filter: drop-shadow(0 0 5px var(--fx-packet));
}
/* Work leaving the agent is finished work, so it travels in the result colour. */
.fx-pulse-out { stroke: var(--fx-emerald); filter: drop-shadow(0 0 5px var(--fx-emerald)); }

/* ---- Nodes ---- */
.fx-node rect { fill: var(--fx-node-bg); stroke: var(--fx-slate); stroke-opacity: 0.4; stroke-width: 1.25; }
.fx-node .fx-dot { fill: var(--fx-slate); }
.fx-node .fx-halo { fill: var(--fx-slate); opacity: 0; transform-box: fill-box; transform-origin: center; }
.fx-label {
  font-family: var(--font-display), sans-serif;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  fill: var(--fx-label);
}

.n-ai rect { stroke: var(--fx-sky); stroke-opacity: 0.7; }
.n-ai .fx-dot, .n-ai .fx-halo { fill: var(--fx-sky); }
.n-agent .fx-frame { stroke: var(--indigo); stroke-opacity: 0.55; fill: var(--fx-frame-bg); }
.n-agent .fx-dot, .n-agent .fx-halo { fill: var(--indigo); }

.fx-eyebrow {
  font-family: var(--font-display), sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  fill: var(--accent);
}
.fx-shadow { fill: var(--fx-shadow); }

/* ---- Result line, inside the agent frame ---- */
.fx-chip { fill: var(--fx-chip-bg); stroke: var(--fx-emerald); stroke-opacity: 0.4; stroke-width: 1.25; }
.fx-result {
  font-family: var(--font-display), sans-serif;
  font-size: 14.5px; font-weight: 500; text-anchor: middle;
  fill: var(--fx-emerald); opacity: 0;
}

/* ---- Destinations: where the finished work lands ---- */
.fx-dest { opacity: 0.45; }
.fx-dest rect {
  fill: var(--fx-node-bg); stroke: var(--fx-slate);
  stroke-opacity: 0.35; stroke-width: 1.25;
}
.fx-dest-label {
  font-family: var(--font-display), sans-serif;
  font-size: 15px; font-weight: 500; fill: var(--fx-label);
}

/* ---- The mascot, layered over the canvas as the agent node ---- */
.ck-flow-bot {
  position: absolute;
  left: 45.48%; top: 59.2%;    /* SVG centre 282,296 over the 620x500 viewBox */
  width: 30.65%;               /* 190 user units */
  transform: translate(-50%, -50%);
  display: block;
}
.ck-flow-bot .wb-svg {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 12px 26px rgba(20, 18, 50, 0.35));
}

/* ============================================================
   Motion
   ------------------------------------------------------------
   Read the 7s keyframes as a timeline: the packet leaves the
   trigger at 0 and reaches the agent at ~45%. The 21s keyframes
   are the three passes — same shape, offset by 7s each via
   animation-delay, so run N's result and run N's destination are
   always lit together.
   ============================================================ */
.fx-pulse-a { animation: fx-travel-a 7s linear infinite; }
.fx-pulse-b { animation: fx-travel-b 7s linear infinite; }
.fx-pulse-c { animation: fx-travel-c 7s linear infinite; }

@keyframes fx-travel-a {
  0%        { stroke-dashoffset: 14; opacity: 0; }
  2%        { stroke-dashoffset: 14; opacity: 1; }
  17%       { stroke-dashoffset: -100; opacity: 1; }
  18%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes fx-travel-b {
  0%, 6%    { stroke-dashoffset: 14; opacity: 0; }
  8%        { stroke-dashoffset: 14; opacity: 1; }
  23%       { stroke-dashoffset: -100; opacity: 1; }
  24%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes fx-travel-c {
  0%, 27%   { stroke-dashoffset: 14; opacity: 0; }
  29%       { stroke-dashoffset: 14; opacity: 1; }
  44%       { stroke-dashoffset: -100; opacity: 1; }
  45%, 100% { stroke-dashoffset: -100; opacity: 0; }
}

/* Node arrival: the halo is a copy of the status dot that scales out and
   fades. It is the only marker of arrival — no border colour shifts. */
.fx-halo-a { animation: fx-ping 7s ease-out infinite; }
.fx-halo-b { animation: fx-ping 7s ease-out 0.42s infinite; }
.fx-halo-c { animation: fx-ping 7s ease-out 1.26s infinite; }
.fx-halo-d { animation: fx-ping 7s ease-out 3.15s infinite; }
@keyframes fx-ping {
  0%       { opacity: 0.85; transform: scale(1); }
  9%, 100% { opacity: 0; transform: scale(3.4); }
}

/* The mascot keeps a slow ambient float and nothing else — it is the one
   element on screen the eye rests on, so it must not twitch. */
.ck-flow-bot { animation: fx-float 6.4s ease-in-out infinite; }
@keyframes fx-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 10px)); }
}

/* --- the three passes --- */
.fx-result, .fx-out-1, .fx-out-2, .fx-out-3, .fx-dest { animation-duration: 21s; animation-iteration-count: infinite; }
.fx-result-2, .fx-out-2, .fx-dest-2 { animation-delay: 7s; }
.fx-result-3, .fx-out-3, .fx-dest-3 { animation-delay: 14s; }

.fx-result { animation-name: fx-result; animation-timing-function: ease-out; }
@keyframes fx-result {
  0%, 15%   { opacity: 0; }
  18%, 30%  { opacity: 1; }
  32%, 100% { opacity: 0; }
}

.fx-pulse-out { animation-name: fx-dispatch; animation-timing-function: linear; }
@keyframes fx-dispatch {
  0%, 18.5%   { stroke-dashoffset: 14; opacity: 0; }
  19%         { stroke-dashoffset: 14; opacity: 1; }
  23%         { stroke-dashoffset: -100; opacity: 1; }
  23.5%, 100% { stroke-dashoffset: -100; opacity: 0; }
}

.fx-dest { animation-name: fx-dest-lit; animation-timing-function: ease-out; }
@keyframes fx-dest-lit {
  0%, 22%   { opacity: 0.45; }
  24%, 31%  { opacity: 1; }
  34%, 100% { opacity: 0.45; }
}

/* ---- Canvas palette (retuned per theme) ---- */
:root {
  --fx-wire: rgba(79, 70, 229, 0.35);
  --fx-packet: #6366f1;
  --fx-slate: #94a3b8;
  --fx-sky: #0284c7;
  --fx-emerald: #059669;
  --fx-label: #3f3f56;
  --fx-node-bg: rgba(255, 255, 255, 0.86);
  --fx-frame-bg: rgba(99, 102, 241, 0.05);
  --fx-chip-bg: rgba(16, 185, 129, 0.09);
  --fx-shadow: rgba(30, 27, 46, 0.10);
}
[data-theme="dark"] {
  --fx-wire: rgba(165, 180, 252, 0.38);
  --fx-packet: #c7d2fe;
  --fx-slate: #8b93a8;
  --fx-sky: #38bdf8;
  --fx-emerald: #34d399;
  --fx-label: #cbd0e0;
  --fx-node-bg: rgba(255, 255, 255, 0.045);
  --fx-frame-bg: rgba(99, 102, 241, 0.07);
  --fx-chip-bg: rgba(16, 185, 129, 0.08);
  --fx-shadow: rgba(0, 0, 0, 0.45);
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .welcome-hero { padding: 64px 0 18px; }
  .wh-grid { grid-template-columns: 1fr; gap: 40px; justify-items: center; text-align: center; }
  .welcome-hero .eyebrow { justify-content: center; }
  .welcome-hero h1 { align-items: center; }
  .welcome-hero .sub { margin-left: auto; margin-right: auto; }
  .welcome-hero .cta-row { justify-content: center; }
  .wh-art { width: 100%; max-width: 560px; }
  .ck-flow { margin: 0 auto; }
  .welcome-hero .stat-strip { margin-top: 52px; }
}

@media (max-width: 768px) {
  .welcome-hero { padding: 56px 0 14px; }
  /* Two per row, and the vertical divider goes. Keeping it meant the right-hand
     cell had to clear the rule with 18px of padding while the left-hand one sat
     flush against the page margin, so the pair read lopsided. A column gap
     separates them instead and both columns start at their own left edge. */
  .welcome-hero .stat-strip { column-gap: 30px; }
  .welcome-hero .stat { padding: 20px 0 24px; border-left: 0; }
  .welcome-hero .stat:nth-child(3),
  .welcome-hero .stat:nth-child(4) { border-top: 1px solid var(--border); }
  .welcome-hero .stat-label { max-width: none; }
}

@media (max-width: 600px) {
  .welcome-hero { padding: 44px 0 10px; }
  .welcome-hero .cta-row { margin-bottom: 0; }
  .welcome-hero .stat-strip { margin-top: 44px; }
  /* The canvas is the full width of a phone here, so lift the type a step to
     hold it above the point where the labels stop being readable. */
  .fx-label { font-size: 18px; }
  .fx-dest-label { font-size: 16px; }
  .fx-eyebrow { font-size: 12px; }
  .fx-result { font-size: 15.5px; }
}

@media (max-width: 400px) {
  .welcome-hero .stat { border-left: 0; padding-left: 0; }
  .welcome-hero .stat:not(:first-child) { border-top: 1px solid var(--border); }
}

/* ---- Reduced motion: freeze the canvas on a settled first pass ---- */
@media (prefers-reduced-motion: reduce) {
  .ck-flow *, .ck-flow-bot { animation: none !important; }
  .fx-pulse { display: none; }
  .fx-halo { opacity: 0; }
  .fx-result-1 { opacity: 1; }
  .fx-dest-1 { opacity: 1; }
}

/* ============================================================
   The Journal newsletter — signup panel (/blog and every post) and the
   confirm/unsubscribe outcome pages.

   The panel is a surface card rather than a full-bleed gradient band: on the
   blog index it sits directly under a grid of cards that are already carrying
   category gradients, and a second gradient there turns the page into a
   competition. The indigo wash in the corner is what keeps it from reading as
   just another post card.
   ============================================================ */

/* Visually hidden, still read aloud. For labels a compact form cannot show. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.journal-signup {
  position: relative;
  overflow: hidden;
  margin-top: 64px;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* The wash. Sized in % so it scales with the panel instead of dominating it
   on a phone, and pointer-events:none so it never eats a click on the form. */
.journal-signup::before {
  content: '';
  position: absolute;
  top: -60%; right: -20%;
  width: 70%; height: 220%;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.16), transparent);
  pointer-events: none;
}

.journal-signup-inner { position: relative; max-width: 620px; }

.journal-signup-eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}

.journal-signup h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.25; letter-spacing: -0.4px; margin-bottom: 10px;
}

.journal-signup-sub { color: var(--text-soft); margin-bottom: 22px; }

.journal-signup-form { display: flex; gap: 12px; flex-wrap: wrap; }
.journal-signup-field { flex: 1 1 260px; display: block; }

.journal-signup-field input {
  width: 100%; padding: 13px 16px; font: inherit;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
}
.journal-signup-field input:focus-visible {
  outline: 2px solid var(--indigo); outline-offset: 1px; border-color: transparent;
}

.journal-signup-form .btn { flex: 0 0 auto; padding: 13px 28px; }

.journal-signup-note {
  margin-top: 16px; font-size: 0.85rem; color: var(--muted); max-width: 46ch;
}

/* The banner is already spaced by .form-banner's own margin-bottom. */
.journal-signup-banner { margin-bottom: 20px; }

@media (max-width: 560px) {
  .journal-signup { padding: 30px 22px; }
  .journal-signup-form .btn { width: 100%; }
}

/* ---- /newsletter/confirm and /newsletter/unsubscribe ---- */

.newsletter-outcome { padding: 90px 0 110px; display: flex; justify-content: center; }

.newsletter-outcome-card {
  max-width: 560px; width: 100%; text-align: center;
  padding: 44px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.newsletter-outcome-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; margin-bottom: 20px;
  font-size: 1.6rem; color: #fff; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
}

.newsletter-outcome-card h1 {
  font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25;
  letter-spacing: -0.5px; margin-bottom: 12px;
}

.newsletter-outcome-lead { color: var(--text-soft); margin-bottom: 26px; }

.newsletter-outcome-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}

.newsletter-outcome-note {
  margin-top: 22px; font-size: 0.88rem; color: var(--muted);
}

@media (max-width: 560px) {
  .newsletter-outcome { padding: 56px 0 72px; }
  .newsletter-outcome-card { padding: 32px 22px; }
  .newsletter-outcome-actions .btn { width: 100%; }
}

/* Dark mode: the wash needs more presence against #1b1a26 than it does against
   white, and the input sits on --surface-2 so it reads as inset rather than
   as a hole punched through the card. */
[data-theme="dark"] .journal-signup::before {
  background: radial-gradient(closest-side, rgba(129, 140, 248, 0.22), transparent);
}
[data-theme="dark"] .journal-signup-field input { background: var(--surface-2); }
