/* Labbench — marketing site. Light theme only. Self-contained. */

:root {
  --bg:#f7f8fa; --surface:#ffffff; --surface-2:#f3f4f7; --surface-3:#eceef2;
  --hairline:rgba(17,20,34,0.07); --hairline-strong:rgba(17,20,34,0.12);
  --ink:#16181f; --ink-2:#565c6b; --ink-3:#949aa8;
  --accent:#3a45d6; --accent-ink:#2b33b0; --accent-soft:rgba(58,69,214,0.09); --accent-ring:rgba(58,69,214,0.22);
  --good:#17916a; --good-soft:rgba(23,145,106,0.11);
  --font-sans:-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',system-ui,'Helvetica Neue',Arial,sans-serif;
  --font-mono:'SF Mono',ui-monospace,'JetBrains Mono','Menlo','Consolas',monospace;
  --radius-card:14px; --radius-pill:999px;
  --shadow-card:0 1px 2px rgba(17,20,34,0.04),0 1px 0 rgba(17,20,34,0.02);
  --shadow-lift:0 8px 24px -12px rgba(17,20,34,0.16);
  --ease:cubic-bezier(0.22,1,0.36,1);
  --maxw:1060px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(247,248,250,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.975rem; letter-spacing: -0.01em; color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark svg { display: block; }
.topbar-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 26px); }
.topbar-link {
  font-size: 0.875rem; color: var(--ink-2); font-weight: 500;
}
.topbar-link:hover { color: var(--accent-ink); }
@media (max-width: 560px) {
  .topbar-nav { gap: 14px; }
  .topbar-link { font-size: 0.8125rem; }
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

main > section { padding-block: clamp(72px, 12vw, 148px); }
main > section + section { border-top: 1px solid var(--hairline); }

.eyebrow {
  font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 590; margin: 0 0 18px;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.85rem); font-weight: 620; }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.5rem); font-weight: 610; letter-spacing: -0.018em; }
h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

.lead { color: var(--ink-2); font-size: clamp(1.05rem, 1.7vw, 1.24rem); line-height: 1.5; max-width: 62ch; }
.oneliner { color: var(--ink-2); font-size: 1.06rem; max-width: 60ch; margin: 14px 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 0.975rem; font-weight: 560;
  padding: 12px 22px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn-primary {
  background: var(--accent); color: #fff; box-shadow: var(--shadow-lift);
}
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; transform: translateY(-1px); }
.btn-lg { font-size: 1.06rem; padding: 15px 30px; }
.quiet-link {
  font-size: 0.975rem; font-weight: 520; color: var(--ink-2);
}
.quiet-link:hover { color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(120% 90% at 78% 12%, #000 0%, transparent 66%);
  mask-image: radial-gradient(120% 90% at 78% 12%, #000 0%, transparent 66%);
}
.hero .wrap { position: relative; z-index: 2; }

/* mesh-gradient blobs */
.hero-mesh { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-mesh .blob {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.5;
}
.blob-a { width: 460px; height: 460px; top: -170px; right: -60px;
  background: radial-gradient(circle at 30% 30%, rgba(58,69,214,0.20), transparent 70%); }
.blob-b { width: 380px; height: 380px; top: 40px; left: -140px;
  background: radial-gradient(circle at 50% 50%, rgba(23,145,106,0.13), transparent 70%); }
.blob-c { width: 340px; height: 340px; bottom: -160px; right: 22%;
  background: radial-gradient(circle at 50% 50%, rgba(58,69,214,0.10), transparent 70%); }

/* floating lab motifs — organic drift on the SVG, scroll parallax on the wrapper */
.hero-motifs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.motif-wrap { position: absolute; will-change: transform; }
.motif { display: block; will-change: transform; }

.motif-flask { width: 46px; height: 46px; opacity: 0.55; animation: drift-a 13s ease-in-out infinite; animation-delay: -0.5s; }
.motif-mol   { width: 62px; height: 62px; opacity: 0.48; animation: drift-b 17s ease-in-out infinite; animation-delay: -4s; }
.motif-tube  { width: 30px; height: 46px; opacity: 0.5;  animation: drift-c 15s ease-in-out infinite; animation-delay: -6s; }
.motif-atom  { width: 56px; height: 56px; opacity: 0.4;  animation: drift-d 19s ease-in-out infinite; animation-delay: -2s; }
.motif-dna   { width: 40px; height: 55px; opacity: 0.42; animation: drift-b 16s ease-in-out infinite; animation-delay: -9s; }
.motif-petri { width: 46px; height: 46px; opacity: 0.36; animation: drift-c 21s ease-in-out infinite; animation-delay: -3s; }
.motif-scope { width: 52px; height: 60px; opacity: 0.32; animation: drift-a 23s ease-in-out infinite; animation-delay: -12s; }

@keyframes drift-a {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  20%     { transform: translate(9px,-10px) rotate(4deg); }
  45%     { transform: translate(-5px,-18px) rotate(-3deg); }
  70%     { transform: translate(-11px,-6px) rotate(2deg); }
}
@keyframes drift-b {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  25%     { transform: translate(-8px,-12px) rotate(-4deg); }
  55%     { transform: translate(7px,-22px) rotate(3deg); }
  80%     { transform: translate(12px,-9px) rotate(-2deg); }
}
@keyframes drift-c {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  30%     { transform: translate(6px,-8px) rotate(3deg); }
  60%     { transform: translate(-9px,-16px) rotate(-4deg); }
  85%     { transform: translate(-4px,-4px) rotate(1deg); }
}
@keyframes drift-d {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  22%     { transform: translate(-6px,-14px) rotate(-2deg); }
  50%     { transform: translate(10px,-20px) rotate(4deg); }
  76%     { transform: translate(5px,-7px) rotate(-3deg); }
}
@media (max-width: 720px) {
  /* hide the heaviest motifs on narrow screens */
  .motif-mol, .motif-atom, .motif-petri, .motif-scope { display: none; }
}

.hero h1 { margin-top: 6px; max-width: 18ch; }
.hero-title { font-size: clamp(2.55rem, 6.2vw, 4.5rem); font-weight: 660; letter-spacing: -0.028em; }
.hero-subhead {
  margin: 16px 0 0; max-width: 30ch;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 560;
  letter-spacing: -0.015em; color: var(--ink);
}
.hero .lead { margin-top: 20px; }
.hero-cta { margin-top: 34px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* soft scroll hint (subtle muted caption) */
.scroll-hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 450; color: var(--ink-2);
  letter-spacing: .01em;
}
.scroll-cue-arrow {
  display: inline-flex; color: var(--accent);
  animation: cue-bob 1.8s ease-in-out infinite;
}
@keyframes cue-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* framed tweet card */
.tweet-card {
  display: block; max-width: 540px; margin: clamp(36px, 5vw, 52px) 0 0;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: 16px;
  box-shadow: var(--shadow-lift);
  padding: 18px 20px 16px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.tweet-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent-ring);
  box-shadow: 0 14px 34px -14px rgba(17,20,34,0.24); }
.tweet-head { display: flex; align-items: center; gap: 12px; }
.tweet-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-3); }
.tweet-monogram {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.2rem;
}
.tweet-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tweet-name { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.975rem; color: var(--ink); }
.tweet-badge { width: 18px; height: 18px; flex: none; }
.tweet-handle { color: var(--ink-3); font-size: 0.9rem; }
.tweet-logo { width: 20px; height: 20px; margin-left: auto; color: var(--ink); flex: none; }
.tweet-text {
  margin: 14px 0 0; font-size: 1.45rem; line-height: 1.34;
  letter-spacing: -0.01em; color: var(--ink); font-weight: 460;
}
.tweet-meta { margin: 16px 0 0; font-size: 0.9rem; color: var(--ink-3); }
.tweet-meta .tweet-views-n { color: var(--ink); font-weight: 600; }
.tweet-stats {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; color: var(--ink-3);
}
.tweet-stats b { color: var(--ink); font-weight: 700; }

/* ---------- How it works ---------- */
.section-head { max-width: 60ch; }
.diagram-scroll {
  margin-top: clamp(40px, 6vw, 64px);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* Tighter, single-unit spacing for the How-it-works section. */
.how { padding-block: clamp(44px, 7vw, 84px); }
.how .diagram-scroll { margin-top: clamp(20px, 3vw, 32px); }
.how .card-row { margin-top: clamp(18px, 2.4vw, 28px); }
.flow-svg { display: block; width: 100%; min-width: 760px; height: auto; }

.card-row {
  margin-top: clamp(32px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stage-card, .view-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 20px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.stage-card:hover, .view-card:hover {
  box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--hairline-strong);
}
.stage-num {
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft);
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stage-card h3 { margin-bottom: 8px; }
.stage-card p, .view-card p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.46; }

/* retainer note — subtle "gets better over time" line under the stage cards */
.retainer-note {
  display: flex; align-items: flex-start; gap: 10px;
  margin: clamp(16px, 2.2vw, 22px) 0 0;
  padding: 12px 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-ring);
  border-radius: var(--radius-pill);
  color: var(--ink-2); font-size: 0.875rem; line-height: 1.5;
}
.retainer-note strong { color: var(--accent-ink); font-weight: 600; }
.retainer-icon { flex: none; display: inline-flex; margin-top: 1px; }
.retainer-icon svg { display: block; }
@media (max-width: 560px) {
  .retainer-note { border-radius: var(--radius-card); }
}

/* ---------- Five views ---------- */
.view-row {
  margin-top: clamp(32px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.view-card { display: flex; flex-direction: column; }
.view-icon {
  color: var(--accent); margin-bottom: 14px;
}
.view-icon svg { display: block; }
.view-card h3 { margin-bottom: 7px; }

/* ---------- Context (Vending-Bench explainer) ---------- */
.context .oneliner { max-width: 68ch; }
.context .oneliner + .oneliner { margin-top: 16px; }
.context-fig {
  margin-top: clamp(28px, 4vw, 40px);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: clamp(18px, 2.4vw, 26px);
}
.context-fig svg { display: block; width: 100%; height: auto; }
.context-legend {
  display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 14px;
  font-size: 0.8125rem; color: var(--ink-2);
}
.context-legend .lg-item { display: inline-flex; align-items: center; gap: 8px; }
.lg-swatch { width: 18px; height: 3px; border-radius: 2px; flex: none; }
.lg-swatch.lg-accent { background: #3a45d6; }
.lg-swatch.lg-base { background: #b6bcc8; }

/* ---------- Proof ---------- */
.proof-card {
  margin-top: clamp(36px, 5vw, 52px);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden;
}
.proof-figure { padding: clamp(24px, 3vw, 34px); border-right: 1px solid var(--hairline); }
.proof-figure .fig-title { font-size: 0.9375rem; font-weight: 600; margin: 0 0 4px; }
.proof-figure .fig-sub { font-size: 0.8125rem; color: var(--ink-3); margin: 0 0 20px; }
.proof-chart { display: block; width: 100%; height: auto; }
.fig-caption { font-size: 0.75rem; color: var(--ink-3); margin: 16px 0 0; }

.proof-pr { padding: clamp(24px, 3vw, 34px); display: flex; flex-direction: column; justify-content: center; }
.pr-eyebrow { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 590; margin: 0 0 14px; }
.pr-ref {
  position: relative;
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.55; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 16px 18px; margin: 0 0 18px; cursor: default;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.pr-ref:hover, .pr-ref:focus, .pr-ref:focus-within { border-color: var(--accent-ring); outline: none; }
.pr-ref-win { border-color: var(--accent-ring); background: var(--accent-soft); }
.pr-result {
  display: inline-block; margin-top: 8px; font-size: 0.9375rem; color: var(--ink-2);
}
.pr-result .mono { color: var(--ink); }
/* hypothesis reveal — hover or keyboard focus */
.pr-hint {
  display: block; overflow: hidden; max-height: 0; opacity: 0;
  margin-top: 0; font-family: var(--font-sans); font-size: 0.8125rem;
  line-height: 1.5; color: var(--ink-2);
  transition: max-height .35s var(--ease), opacity .3s var(--ease), margin-top .35s var(--ease);
}
.pr-hint strong { color: var(--accent-ink); font-weight: 600; }
.pr-ref:hover .pr-hint, .pr-ref:focus .pr-hint, .pr-ref:focus-within .pr-hint {
  max-height: 160px; opacity: 1; margin-top: 12px;
}
.pr-ref .pr-id { color: var(--accent-ink); font-weight: 600; }
.pr-ref .pr-repo { color: var(--ink-2); }
.pr-ref .pr-tag {
  color: var(--good); font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.delta { color: var(--good); font-weight: 600; font-family: var(--font-mono); }

/* ---------- Built on ---------- */
.arch-diagram { margin-top: clamp(36px, 5vw, 52px); }
.arch-svg { display: block; width: 100%; min-width: 820px; height: auto; }
.chips {
  margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 6px 13px;
}

/* ---------- Final CTA ---------- */
.final { text-align: center; }
.final .wrap { display: flex; flex-direction: column; align-items: center; }
.final h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
.final .oneliner { margin: 16px auto 32px; text-align: center; }
.pr-links {
  margin: 18px 0 0; font-size: 0.8125rem; color: var(--ink-3);
  display: flex; gap: 10px; align-items: center; justify-content: center;
}
.pr-links a { color: var(--ink-2); font-weight: 500; }
.pr-links a:hover { color: var(--accent-ink); }
.footer-line {
  margin-top: 44px; font-size: 0.8125rem; color: var(--ink-3);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
}
.footer-line a { color: var(--ink-2); }

/* ---------- Technologies marquee ---------- */
.tech { overflow: hidden; padding-block: clamp(36px, 6vw, 74px); }
.tech-kicker { text-align: center; margin: 0 0 clamp(30px, 4vw, 46px); }

.marquee {
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 46s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

.logo-list {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin: 0;
  padding: 0 1.25rem;
  list-style: none;
}
.logo-list li { flex: none; display: inline-flex; align-items: center; }

.logo {
  display: block;
  height: 38px;
  width: auto;
  color: var(--ink-3);
  opacity: 0.92;
  transition: color .25s var(--ease), opacity .25s var(--ease);
}
.logo text { font-family: var(--font-sans); fill: currentColor; }
.logo:hover { color: var(--ink); opacity: 1; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- SVG shared ---------- */
.svg-node-fill { fill: var(--surface); }
.svg-hairline { stroke: var(--hairline-strong); }
.svg-label { font-family: var(--font-sans); fill: var(--ink); }
.svg-mono { font-family: var(--font-mono); fill: var(--ink-2); }
.svg-mono-accent { font-family: var(--font-mono); fill: var(--accent-ink); }
.svg-caption { font-family: var(--font-mono); fill: var(--ink-3); }
.connector { stroke: var(--ink-3); stroke-width: 1.4; fill: none; }
.connector-dotted { stroke: var(--accent); stroke-width: 1; fill: none; stroke-dasharray: 2 4; opacity: 0.5; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* connector draw-in for flow diagram */
.draw { stroke-dasharray: var(--len, 300); stroke-dashoffset: var(--len, 300); transition: stroke-dashoffset .9s var(--ease); }
.diagram-scroll.in .draw { stroke-dashoffset: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .card-row { grid-template-columns: repeat(2, 1fr); }
  .view-row { grid-template-columns: repeat(2, 1fr); }
  .proof-card { grid-template-columns: 1fr; }
  .proof-figure { border-right: none; border-bottom: 1px solid var(--hairline); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .card-row { grid-template-columns: 1fr; }
  .view-row { grid-template-columns: 1fr; }
  .hero-cta { gap: 16px; }
  .btn { width: 100%; justify-content: center; }
  .quiet-link { width: 100%; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .draw { stroke-dashoffset: 0; }

  /* Marquee: render logos static and wrapped instead of scrolling. */
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none !important; width: auto; flex-wrap: wrap; justify-content: center; }
  .logo-list[aria-hidden="true"] { display: none; }
  .logo-list { flex-wrap: wrap; justify-content: center; row-gap: 26px; }
}
