/* Clew website. Colours and type come from the app's themes (app/ui/src/lib/themes.ts):
   Clew Dark for dark bands, Clew Light for the rest. */

@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('assets/fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0b0c;
  --ink-2: #27272a;
  --ink-3: #3f3f46;
  --muted: #52525b;
  --line: #e4e4e7;
  --line-strong: #dcdce0;
  --chrome: #f6f6f7;
  --chrome-2: #ededf0;
  --canvas: #ffffff;
  --canvas-2: #fbfbfc;
  --focus: #5b3df5;
  --focus-dark: #3720b0;
  --focus-ink: #2e1f7a;
  --focus-tint: #f5f3ff;
  --focus-tint-2: #e7e3fd;
  --focus-line: #ddd6fe;

  --d-ink: #ececef;
  --d-muted: #a1a1aa;
  --d-muted-2: #8b8b94;
  --d-line: #2c2c31;
  --d-line-strong: #36363c;
  --d-chrome: #1c1c20;
  --d-canvas: #121214;
  --d-canvas-2: #0e0e10;
  --d-focus: #8b74ff;
  --d-focus-soft: #b3a5ff;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img, video { max-width: 100%; display: block; }
a { color: var(--focus); text-decoration: none; }
a:hover { color: var(--focus-dark); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.dark :focus-visible { outline-color: var(--d-focus); }

.wrap { max-width: var(--wrap); margin: 0 auto; }
.section { padding: 112px 24px; }
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--focus);
}
.dark .eyebrow { color: var(--d-focus-soft); }
.h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--muted); }
.dark .lead { color: var(--d-muted); }
.intro { display: flex; flex-direction: column; gap: 16px; max-width: 700px; }
.mono { font-family: var(--mono); }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--canvas); color: var(--ink); padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 10px;
  font: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { flex: none; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 8px; }
.btn-primary { background: var(--focus); color: #fff; }
.btn-primary:hover { background: var(--focus-dark); color: #fff; }
.dark .btn-primary { background: var(--d-focus); color: var(--d-canvas-2); }
.dark .btn-primary:hover { background: var(--d-focus-soft); color: var(--d-canvas-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.dark .btn-ghost { border-color: var(--d-line-strong); color: var(--d-ink); font-weight: 500; }
.dark .btn-ghost:hover { border-color: var(--d-muted-2); color: var(--d-ink); }
.btn-white { background: #fff; color: var(--focus-ink); }
.btn-white:hover { background: var(--focus-tint-2); color: var(--focus-ink); }

/* Nav */
.nav { padding: 0 24px; border-bottom: 1px solid var(--line); }
.dark .nav, .nav.dark { border-bottom-color: transparent; }
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.dark .brand, .dark .brand:hover { color: var(--d-ink); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; flex-wrap: wrap; }
.nav-links a:not(.btn) { color: var(--muted); }
.nav-links a:not(.btn):hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 600; }
.dark .nav-links a:not(.btn) { color: var(--d-muted); }
.dark .nav-links a:not(.btn):hover { color: var(--d-ink); }

/* Dark band */
.dark { background: var(--d-canvas-2); color: var(--d-ink); }

/* Hero */
.hero { overflow: hidden; }
.hero-body {
  max-width: var(--wrap); margin: 0 auto; padding: 88px 24px 0;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px;
}
.hero h1 {
  margin: 0; max-width: 900px;
  font-size: clamp(40px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600;
}
.hero .sub { margin: 0; max-width: 680px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--d-muted); }
.cta-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.fine { margin: 0; font-size: 14px; color: var(--d-muted-2); }
.window {
  margin: 48px 24px 0; width: 100%; max-width: var(--wrap);
  border: 1px solid var(--d-line); border-bottom: none; border-radius: 14px 14px 0 0;
  background: var(--d-chrome); padding: 10px 10px 0;
  box-shadow: 0 -20px 120px rgba(139, 116, 255, 0.18);
}
.window-dots { display: flex; gap: 7px; padding: 4px 6px 10px; }
.window-dots span { width: 11px; height: 11px; border-radius: 50%; background: #3a3a40; }
.window img { width: 100%; height: auto; border-radius: 6px 6px 0 0; }

/* Languages strip */
.strip { border-bottom: 1px solid var(--line); padding: 32px 24px; }
.langs {
  max-width: var(--wrap); margin: 0 auto; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 32px;
}
.langs li { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 2px solid var(--focus-line); }
.langs b { font-size: 17px; font-weight: 600; }
.langs span { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Steps */
.stack { display: flex; flex-direction: column; gap: 56px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: var(--canvas-2);
  display: flex; flex-direction: column; gap: 14px;
}
.card h3 { margin: 0; font-size: 22px; letter-spacing: -0.015em; font-weight: 600; }
.card p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.card .num { font-family: var(--mono); font-size: 14px; color: var(--focus); }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.card-foot .ok { color: #0f7a55; }
.kind { display: inline-block; width: 64px; font-weight: 600; }
.k-post { color: #15803d; } .k-kafka { color: #1e40af; } .k-cron { color: #b45309; }
.tags { flex-direction: row; flex-wrap: wrap; font-family: var(--sans); font-weight: 600; }
.tag { padding: 4px 10px; border-radius: 6px; font-size: 13px; }
.t-db { background: #fef3c7; color: #92400e; }
.t-http { background: #ccfbf1; color: #115e59; }
.t-kafka { background: #dbeafe; color: #1e40af; }

/* Code | Map */
.views { background: var(--chrome); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.views-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; border-radius: 10px; background: var(--chrome-2); border: 1px solid var(--line-strong); }
.seg button {
  height: 40px; padding: 0 22px; border: none; border-radius: 7px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 500; background: transparent; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.shot {
  border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; padding: 10px;
  box-shadow: 0 30px 80px rgba(11, 11, 12, 0.10);
}
.shot img { width: 100%; height: auto; border-radius: 6px; }
.shot img[hidden] { display: none; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.feat h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.feat p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }

/* Boundaries */
.split { display: flex; gap: 64px; align-items: center; flex-wrap: wrap; }
.split > .intro { flex: 1 1 380px; }
.dots { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; color: var(--ink-2); }
.dots li { display: flex; gap: 12px; align-items: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.flow {
  flex: 1 1 520px; margin: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas-2);
  padding: 36px 28px; display: flex; flex-direction: column; align-items: center;
  font-family: var(--mono); font-size: 13px; min-width: 0;
}
.node { border-radius: 10px; padding: 10px 14px; text-align: center; border: 1px solid; width: 100%; }
.node b { display: block; font-weight: 600; font-size: 12px; }
.node span { display: block; margin-top: 2px; color: var(--ink); overflow-wrap: anywhere; }
.n-entry { border-color: #a7f3d0; background: #ecfdf5; width: auto; } .n-entry b { color: #15803d; }
.n-main { border: 2px solid var(--focus); background: var(--focus-tint); width: auto; max-width: 300px; }
.n-main span:first-child { margin: 0; font-weight: 600; }
.n-main small { display: block; margin-top: 4px; font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--muted); }
.n-db { border-color: #f59e0b; background: #fffbeb; } .n-db b { color: #92400e; }
.n-http { border-color: #14b8a6; background: #f0fdfa; } .n-http b { color: #115e59; }
.n-kafka { border-color: #3b82f6; background: #eff6ff; } .n-kafka b { color: #1e40af; }
.n-next { border: 1px dashed #c4c4cc; background: #fff; } .n-next b { color: var(--muted); font-weight: 400; }
.vline { width: 2px; height: 24px; background: #c4c4cc; }
.vline.async { width: 0; height: 28px; background: none; border-left: 2px dashed #3b82f6; }
.hline { width: 70%; height: 2px; background: #c4c4cc; }
.branches { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.branch { display: flex; flex-direction: column; align-items: center; }
.branch .vline { height: 20px; }

/* Themes */
.themes { background: var(--d-canvas); color: var(--d-ink); }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.swatch { display: flex; flex-direction: column; gap: 12px; }
.mini { height: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--d-line-strong); background: var(--bg); }
.mini .bar { height: 18px; background: var(--chrome); border-bottom: 1px solid var(--rule); }
.mini .lines { display: flex; flex-direction: column; gap: 7px; padding: 14px; }
.mini .lines i { height: 8px; border-radius: 4px; background: var(--fg); }
.mini .lines i:nth-child(1) { width: 70%; background: var(--accent); }
.mini .lines i:nth-child(2) { width: 90%; opacity: .85; }
.mini .lines i:nth-child(3) { width: 55%; opacity: .5; }
.mini .lines i:nth-child(4) { width: 78%; opacity: .3; }
.swatch-name { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 500; }
.swatch-name small { font-size: 13px; color: var(--d-muted-2); font-weight: 400; }

/* Promises */
.promise svg { color: var(--focus); }
.promise h3 { margin: 12px 0; font-size: 22px; letter-spacing: -0.015em; font-weight: 600; }
.promise p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }

/* Final CTA */
.final { padding: 0 24px 112px; }
.final-box {
  max-width: var(--wrap); margin: 0 auto; border-radius: 20px; background: var(--focus); color: #fff;
  padding: 72px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
}
.final-box h2 { margin: 0; max-width: 760px; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
.final-box p { margin: 0; font-size: 18px; color: var(--focus-tint-2); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 24px 40px; }
.footer-inner {
  max-width: var(--wrap); margin: 0 auto; display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted);
}
.footer-inner .brand { font-size: 15px; gap: 10px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* Demo dialog */
.demo { padding: 0; border: none; border-radius: 14px; background: #000; width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.demo::backdrop { background: rgba(8, 8, 10, 0.8); }
.demo video { width: 100%; height: auto; }
.demo-close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: grid; place-items: center;
}

/* Download page */
.page-head { padding: 96px 24px 64px; text-align: center; }
.page-head h1 { margin: 0 0 16px; font-size: clamp(40px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; }
.page-head p { margin: 0 auto; max-width: 600px; font-size: 19px; line-height: 1.55; color: var(--muted); }
.dl { padding: 0 24px 96px; }
.dl-row { max-width: var(--wrap); margin: 0 auto; display: flex; gap: 24px; flex-wrap: wrap; }
.dl-mac {
  flex: 2 1 520px; border: 1px solid var(--focus-line); background: #faf9ff; border-radius: 18px; padding: 40px;
  display: flex; flex-direction: column; gap: 24px; min-width: 0;
}
.dl-title { display: flex; align-items: center; gap: 16px; }
.dl-title h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; font-weight: 600; }
.dl-title .mono { font-size: 14px; color: var(--muted); }
.dl-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.trust { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #0f5e43; margin: 0; }
.steps { border-top: 1px solid var(--focus-line); padding-top: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin: 0; list-style: none; padding-left: 0; }
.steps .num { font-family: var(--mono); font-size: 13px; color: var(--focus); }
.steps h3 { margin: 8px 0; font-size: 17px; font-weight: 600; }
.steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.dl-side { flex: 1 1 320px; display: flex; flex-direction: column; gap: 24px; }
.box { border: 1px solid var(--line); border-radius: 18px; padding: 32px; }
.box h2 { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
.box ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.box ul li::marker { color: var(--focus); }
.box-soon { border-style: dashed; border-color: #c4c4cc; background: var(--canvas-2); }
.box-soon h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.box-soon p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.notes { background: var(--chrome); border-top: 1px solid var(--line); padding: 88px 24px; }
.notes-row { max-width: var(--wrap); margin: 0 auto; display: flex; gap: 56px; flex-wrap: wrap; align-items: flex-start; }
.notes-row > div { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.notes-row h2 { margin: 0; font-size: 34px; letter-spacing: -0.025em; font-weight: 600; }
.notes-row ul { flex: 2 1 520px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.notes-row li { padding: 18px 0; border-bottom: 1px solid var(--line-strong); display: flex; gap: 8px 20px; font-size: 16px; line-height: 1.5; flex-wrap: wrap; }
.notes-row li b { flex: 0 0 130px; font-weight: 600; }
.notes-row li span { flex: 1 1 280px; color: var(--ink-3); }

@media (max-width: 640px) {
  .section { padding: 80px 20px; }
  .nav-links { gap: 18px; }
  .nav-links .hide-sm { display: none; }
  .hero-body { padding-top: 56px; }
  .cta-row .btn { width: 100%; }
  .window { margin-top: 32px; }
  .flow { padding: 24px 14px; }
  .branches { gap: 6px; font-size: 11px; }
  .node { padding: 8px 6px; }
  .dl-mac { padding: 28px 22px; }
  .final-box { padding: 56px 22px; }
}
