/* kubelatch landing. Tokens follow the kubelatch design system (Tailwind v4
   defaults: gray-50 page, white surface, gray-900 ink, 1px ink hairlines, one
   4px radius, system fonts). The dark theme is a landing-only extension. */

:root {
  --gray-50: oklch(98.5% 0.002 247.839);
  --gray-100: oklch(96.7% 0.003 264.542);
  --gray-300: oklch(87.2% 0.01 258.338);
  --gray-400: oklch(70.7% 0.022 261.325);
  --gray-500: oklch(55.1% 0.027 264.364);
  --gray-600: oklch(44.6% 0.03 256.802);
  --gray-700: oklch(37.3% 0.034 259.733);
  --gray-800: oklch(27.8% 0.033 256.848);
  --gray-900: oklch(21% 0.034 264.665);
  --gray-950: oklch(13% 0.028 261.692);

  --page: var(--gray-50);
  --surface: #fff;
  --ink: var(--gray-900);
  --on-ink: #fff;
  --secondary: var(--gray-600);
  --muted: var(--gray-500);
  --hairline: var(--gray-900);
  --success: oklch(52.7% 0.154 150.069);
  --danger: oklch(50.5% 0.213 27.518);

  /* The ink bands (hero, closing) are dark in both themes. */
  --band: var(--gray-900);
  --band-text: #fff;
  --band-secondary: var(--gray-300);
  --band-muted: var(--gray-400);
  --band-line: oklch(100% 0 0 / 0.22);
  --band-grid: oklch(100% 0 0 / 0.05);
  --band-success: oklch(79.2% 0.209 151.711);
  --band-danger: oklch(70.4% 0.191 22.216);

  --radius: 4px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: var(--gray-950);
    --surface: var(--gray-900);
    --ink: var(--gray-50);
    --on-ink: var(--gray-950);
    --secondary: var(--gray-300);
    --muted: var(--gray-400);
    --hairline: var(--gray-700);
    --success: oklch(79.2% 0.209 151.711);
    --danger: oklch(70.4% 0.191 22.216);
    --band: oklch(9% 0.02 261.692);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code, pre, .mono { font-family: var(--mono); }
img, video, svg { display: block; max-width: 100%; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 2rem; } }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--surface); color: var(--ink); padding: 0.5rem 0.75rem;
  border: 1px solid var(--hairline); border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

/* ---- Logo lockup ---------------------------------------------------------- */

/* The mark is one <symbol> reused with <use>: its shapes are styled by class,
   not as descendants of .mark, and take the colour of the <use> host. */
[hidden] { display: none !important; }
.s { fill: none; stroke: currentColor; stroke-width: 4.2; stroke-linejoin: round; }
.f { fill: currentColor; }

.lockup {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.125rem; line-height: 1.75rem; text-decoration: none;
}
.lockup .mark { width: 1.5rem; height: 1.5rem; }

/* ---- Ink band (hero + closing) -------------------------------------------- */

.band {
  position: relative;
  background: var(--band);
  color: var(--band-text);
  overflow: hidden;
  isolation: isolate;
}
/* A 48px hairline grid (the mark's viewBox), fading out towards the edges. */
.band::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--band-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--band-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 100%);
}
@media (prefers-color-scheme: dark) {
  .band { border-bottom: 1px solid var(--hairline); }
  .band.closing { border-top: 1px solid var(--hairline); }
}

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
}
.nav ul { display: flex; align-items: center; gap: 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.nav a { color: var(--band-secondary); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--band-text); }
.lang { display: inline-flex; gap: 0.375rem; font-family: var(--mono); font-size: 0.8125rem; }
.lang span { color: var(--band-muted); }

.hero { padding-top: 4rem; padding-bottom: 5rem; text-align: center; }
@media (min-width: 768px) { .hero { padding-top: 6rem; padding-bottom: 6rem; } }

.eyebrow {
  display: inline-block; margin: 0 0 1.5rem;
  font: 0.8125rem/1.25rem var(--mono); letter-spacing: 0.02em;
  color: var(--band-secondary);
  border: 1px solid var(--band-line); border-radius: var(--radius);
  padding: 0.25rem 0.625rem;
}

.slogan {
  margin: 0 auto; max-width: 15ch;
  font-size: clamp(2.5rem, 1.2rem + 6.2vw, 5.75rem);
  line-height: 1.02; letter-spacing: -0.04em; font-weight: 800;
  text-wrap: balance;
}
.slogan .strike {
  text-decoration: line-through;
  text-decoration-thickness: 0.07em;
  text-decoration-color: var(--band-muted);
}

.lead {
  margin: 1.75rem auto 0; max-width: 40rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.6;
  color: var(--band-secondary);
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2.25rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.125rem; border-radius: var(--radius);
  font-size: 1rem; line-height: 1.5rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--gray-700); }
.btn-secondary { border-color: var(--hairline); }
.btn-secondary:hover { background: var(--gray-100); }
.band .btn-primary { background: var(--band-text); color: var(--gray-900); }
.band .btn-primary:hover { background: var(--gray-300); }
.band .btn-secondary { border-color: var(--band-line); color: var(--band-text); }
.band .btn-secondary:hover { background: oklch(100% 0 0 / 0.08); }
@media (prefers-color-scheme: dark) {
  .btn-primary:hover { background: var(--gray-300); }
  .btn-secondary:hover { background: var(--gray-800); }
}

/* ---- Video ---------------------------------------------------------------- */

.film { margin: 4rem auto 0; max-width: 60rem; }
.film-frame {
  border: 1px solid var(--band-line); border-radius: var(--radius);
  overflow: hidden; background: var(--gray-950);
  aspect-ratio: 16 / 9;
}
.film-frame video { width: 100%; height: 100%; object-fit: cover; }
.film figcaption {
  margin-top: 0.875rem; font: 0.8125rem/1.25rem var(--mono); color: var(--band-muted);
}

/* ---- Sections ------------------------------------------------------------- */

.section { padding-top: 5rem; padding-bottom: 5rem; }
@media (min-width: 768px) { .section { padding-top: 7rem; padding-bottom: 7rem; } }
.section + .section { border-top: 1px solid var(--hairline); }

.kicker { margin: 0; font: 0.8125rem/1.25rem var(--mono); color: var(--muted); }
.section h2 {
  margin: 0.75rem 0 0; max-width: 22ch;
  font-size: clamp(1.875rem, 1.3rem + 2.4vw, 3rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700;
  text-wrap: balance;
}
.section .intro { margin: 1.25rem 0 0; max-width: 40rem; color: var(--secondary); font-size: 1.125rem; line-height: 1.6; }

/* Before / after */
.versus { display: grid; gap: 1.5rem; margin-top: 3rem; }
@media (min-width: 900px) { .versus { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-width: 0;
}
.card-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--hairline);
}
.card-head h3 { margin: 0; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.card-head .mono { font-size: 0.75rem; color: var(--muted); }
.card pre {
  margin: 0; padding: 1.25rem; overflow-x: auto;
  font-size: 0.8125rem; line-height: 1.6;
  border-bottom: 1px solid var(--hairline);
}
.card .dim { color: var(--muted); }
.card .ok { color: var(--success); }
.card ul { margin: 0; padding: 1.25rem 1.25rem 1.5rem 2.5rem; display: grid; gap: 0.5rem; color: var(--secondary); }
.card li::marker { color: var(--muted); }
.card.without pre { text-decoration: none; }
.card.without .card-head h3 { color: var(--secondary); }

/* Features */
.grid {
  display: grid; margin-top: 3rem;
  border-top: 1px solid var(--hairline); border-left: 1px solid var(--hairline);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  padding: 1.75rem 1.5rem 1.5rem;
  border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  display: flex; flex-direction: column; min-width: 0;
}
.feature h3 { margin: 0; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.feature p { margin: 0.5rem 0 0; color: var(--secondary); flex: 1; }
.feature > code {
  display: block; margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px dashed var(--hairline);
  font-size: 0.75rem; line-height: 1.25rem; color: var(--muted);
  overflow-wrap: anywhere;
}
.feature .num { font: 0.75rem/1rem var(--mono); color: var(--muted); margin-bottom: 1.5rem; }

/* How it works */
.steps { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; gap: 2rem; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.steps li { counter-increment: step; border-top: 1px solid var(--hairline); padding-top: 1.25rem; }
.steps li::before {
  content: "0" counter(step);
  display: block; font: 700 2.5rem/1 var(--mono); letter-spacing: -0.04em; color: var(--ink);
}
.steps h3 { margin: 1rem 0 0; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.steps p { margin: 0.5rem 0 0; color: var(--secondary); }

.flow {
  margin-top: 3.5rem; display: grid; gap: 0; align-items: stretch;
  font-size: 0.875rem;
}
@media (min-width: 900px) { .flow { grid-template-columns: 1fr auto 1.3fr auto 1fr; } }
.node {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 1rem 1.25rem; min-width: 0;
}
.node strong { display: block; font-size: 1rem; }
.node span { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; }
.node.core { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.node.core span { color: var(--band-secondary); }
@media (prefers-color-scheme: dark) { .node.core span { color: var(--gray-600); } }
.arrow {
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-align: center;
}
.arrow::after { content: "↓"; margin-left: 0.5rem; font-size: 1rem; color: var(--ink); }
@media (min-width: 900px) {
  .arrow { flex-direction: column; gap: 0.25rem; }
  .arrow::after { content: "→"; margin: 0; }
}

.clusters { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.clusters .kicker { margin-right: 0.5rem; }
.chip {
  font: 0.8125rem/1.25rem var(--mono); padding: 0.25rem 0.625rem;
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface);
}

/* Closing */
.closing .wrap { padding-top: 6rem; padding-bottom: 6rem; text-align: center; }
.closing h2 {
  margin: 0 auto; max-width: 16ch;
  font-size: clamp(2.25rem, 1.3rem + 4vw, 4rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 800;
  text-wrap: balance;
}
.closing .mark { width: 3rem; height: 3rem; margin: 0 auto 2rem; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-top: 2rem; padding-bottom: 2rem;
  font-size: 0.875rem; color: var(--muted);
}
.footer ul { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer .lockup { font-size: 1rem; color: var(--ink); }
.footer .lockup .mark { width: 1.25rem; height: 1.25rem; }

/* 404 */
.notfound { min-height: 100vh; display: flex; flex-direction: column; }
.notfound main { flex: 1; display: flex; align-items: center; }
.notfound h1 { font-size: clamp(2.5rem, 1.5rem + 5vw, 4.5rem); letter-spacing: -0.04em; line-height: 1.05; margin: 0; }
.notfound p { color: var(--band-secondary); font-size: 1.125rem; }
.actions-start { justify-content: flex-start; }
.notfound .wrap { width: 100%; }
/* With reduced motion no <source> matches and the video shows only its
   poster; this link lets those visitors open the video on purpose. */
.film-link { display: none; }
@media (prefers-reduced-motion: reduce) { .film-link { display: inline; color: var(--band-text); } }
