@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500;600&display=swap');
/* Kates marketing site — katesplatform.io
   Theme "Paper": light, editorial; EB Garamond headings, navy ink, sky accent.
   Alternative palettes live in themes/. */

:root {
  --bg: #f7f5ef;
  --bg-alt: #efece3;
  --surface: #ffffff;
  --surface-2: #f1eee6;
  --border: #ddd8cb;
  --border-strong: #c4bdab;
  --text: #2b3350;
  --heading: #102a66;
  --muted: #5d667f;
  --accent: #1a5bcc;
  --accent-strong: #1a5bcc;
  --accent-soft: rgba(26, 91, 204, 0.1);
  --ok: #1f8a5b;
  --warn: #b7791f;
  --no: #8a8f9c;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --wrap: 1180px;
  --gutter: 20px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); }
p code, li code, td code, th code, h2 code {
  font-size: 0.85em;
  background: var(--accent-soft);
  color: #a9cff6;
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
h1, h2, h3, h4 { color: var(--heading); margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #06101f; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 20, 37, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); font-weight: 500; font-size: 1.25rem; }
.brand:hover { text-decoration: none; }
.brand-name b { color: var(--accent-strong); font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--heading); text-decoration: none; }
.nav-links .gh { display: inline-flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--heading); margin: 5px 0; border-radius: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent-strong); color: #06101f; }
.btn-primary:hover { background: #6fb4f4; }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-row.center { justify-content: center; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 88px 0 72px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% -20% auto; height: 120%;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(79, 163, 240, 0.22), transparent 70%),
    radial-gradient(40% 40% at 85% 20%, rgba(16, 42, 102, 0.6), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 600; color: var(--accent); margin: 0 0 14px; }
.accent { color: var(--accent-strong); }
.lead { font-size: 1.15rem; color: var(--text); max-width: 56ch; margin: 18px 0 0; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 0.95rem; }
.hero-points li { padding-left: 22px; position: relative; }
.hero-points li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.terminal {
  background: #0a0f1d; border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(95, 169, 238, 0.08);
  overflow: hidden; font-size: 0.86rem;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #0d1526; }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #2b3a5e; }
.terminal-bar span:nth-child(1) { background: #ff5f57; } .terminal-bar span:nth-child(2) { background: #febc2e; } .terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 0.78rem; font-family: var(--mono); }
.terminal pre { margin: 0; padding: 18px 20px; overflow-x: auto; color: #c9d4ea; line-height: 1.6; }
.terminal .p { color: var(--accent); }
.terminal .ok { color: var(--ok); font-weight: 600; }
.terminal .warn { color: var(--warn); }
.terminal .dim { color: #5f6c8a; }
.terminal .num { color: #e9eefb; font-weight: 500; }
.terminal .grade, .code-block .grade { color: var(--ok); font-weight: 700; background: rgba(94, 211, 155, 0.14); padding: 0 6px; border-radius: 4px; }

/* ---------- strip ---------- */
.strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.strip-inner { display: flex; align-items: center; gap: 28px; padding: 18px 0; flex-wrap: wrap; }
.strip-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; }
.strip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; color: var(--heading); font-weight: 600; font-size: 0.95rem; opacity: 0.85; }
.strip-list li { display: inline-flex; align-items: center; gap: 8px; line-height: 1; white-space: nowrap; }
.strip-list svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.strip-list svg + svg { margin-left: -2px; }

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 760px; margin-bottom: 48px; }
.sub { color: var(--muted); font-size: 1.08rem; margin: 0; }
.cards { display: grid; gap: 20px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card p { margin: 0; color: var(--text); font-size: 0.98rem; }
.card h3 { margin-bottom: 10px; }
.card .meta { margin-top: 14px; color: var(--muted); font-size: 0.88rem; padding-top: 12px; border-top: 1px dashed var(--border); }
.icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 16px; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.features .card { display: flex; flex-direction: column; }
.features .card .meta { margin-top: auto; }
.features .card p:has(+ .meta) { margin-bottom: 14px; }
.card .fig { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 0.9rem; }
.fig b { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--accent-strong); }

/* ---------- how / ci ---------- */
.how-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.how-grid.reverse { grid-template-columns: 1.1fr 1fr; }
.how-code { display: grid; gap: 18px; }
.steps { padding-left: 0; margin: 28px 0 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; color: var(--muted); }
.steps li b { color: var(--heading); font-weight: 600; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 0.85rem; display: grid; place-items: center;
}
.code-block { background: #0a0f1d; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; font-size: 0.86rem; }
.code-title { padding: 9px 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; font-family: var(--mono); background: #0d1526; }
.code-block pre { margin: 0; padding: 18px 20px; overflow-x: auto; color: #c9d4ea; line-height: 1.6; }
.code-block .c { color: #5f6c8a; }
.code-block .k { color: #a9cff6; }
.code-block .ok { color: var(--ok); font-weight: 600; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* ---------- architecture ---------- */
.arch { margin: 0 0 56px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; --fault: #d64545; }
.arch svg { display: block; width: 100%; height: auto; font-family: var(--sans); color: var(--muted); }
.arch .arch-v { display: none; }
/* below this the wide layout's labels get too small, so a vertical layout takes over */
@media (max-width: 820px) {
  .arch { padding: 12px; }
  .arch .arch-h { display: none; }
  .arch .arch-v { display: block; max-width: 420px; margin: 0 auto; }
}
.arch .box rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.arch .box-cli rect, .arch .box-api rect { stroke: var(--accent); fill: var(--accent-soft); }
.arch .cluster { fill: none; stroke: var(--border-strong); stroke-dasharray: 6 6; }
.arch .t-title { fill: var(--heading); font-size: 17px; font-weight: 600; }
.arch .t-sub { fill: var(--muted); font-size: 13px; }
.arch .t-code { fill: var(--accent); font-size: 12px; font-family: var(--mono); }
.arch .t-cluster { fill: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }
.arch .edge { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.arch .fault .edge, .arch .fault .pkt { stroke: var(--fault); }
.arch marker path { fill: var(--accent); }
.arch .mk-fault path { fill: var(--fault); }
.arch .pkt { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 0.01 0.99; stroke-dashoffset: 1; animation: arch-flow var(--t, 2s) linear infinite; filter: drop-shadow(0 0 3px var(--accent)); }
.arch .fault .pkt { filter: drop-shadow(0 0 4px var(--fault)); }
.arch .chip rect { fill: var(--surface); stroke: var(--border-strong); }
.arch .chip text { fill: var(--muted); font-size: 11px; }
.arch .fault .chip text { fill: var(--fault); }
.arch .broker { fill: var(--ok); transition: fill 0.3s, opacity 0.3s; }
.arch .spark { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 1; animation: arch-spark 6s ease-in-out infinite; }
.arch .t-small { font-size: 11px; }
/* the story: site.js sets data-phase 0-4 (baseline, inject, broker down, recovery, graded) on the figure */
.arch [data-ph] { visibility: hidden; }
.arch[data-phase="1"] [data-ph="1"], .arch[data-phase="4"] [data-ph="4"] { visibility: visible; }
.arch .fault .edge { stroke-opacity: 0.3; }
.arch[data-phase="1"] .fault .edge, .arch[data-phase="2"] .fault .edge { stroke-opacity: 1; }
.arch .ok .edge { stroke: var(--ok); stroke-dasharray: 5 4; }
.arch .ok .pkt { stroke: var(--ok); filter: drop-shadow(0 0 4px var(--ok)); }
.arch .mk-ok path { fill: var(--ok); }
.arch[data-phase="1"] .litmus-hit, .arch[data-phase="2"] .kafka-hit { stroke: var(--fault); stroke-width: 2.5; }
.arch[data-phase="3"] .kafka-hit { stroke: var(--warn); }
.arch[data-phase="2"] .broker.hit { fill: var(--fault); opacity: 0.3; }
.arch[data-phase="3"] .broker.hit { fill: var(--warn); animation: arch-blink 0.5s infinite alternate; }
.arch .stamp { transform-box: fill-box; transform-origin: center; transform: scale(2.2) rotate(-14deg); transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.arch[data-phase="4"] .stamp { transform: rotate(-10deg); }
.arch .stamp circle { fill: var(--ok); }
.arch .stamp text { fill: var(--surface); font-weight: 800; font-size: 20px; }
.arch .p99 { font-size: 26px; font-weight: 700; fill: var(--heading); transition: fill 0.3s; }
.arch[data-phase="2"] .p99 { fill: var(--fault); }
.arch[data-phase="3"] .p99 { fill: var(--warn); }
.arch .p99-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.arch .p99-area { fill: var(--accent-soft); }
.arch .p99-head { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.arch .band { fill: var(--fault); fill-opacity: 0.07; }
.arch .grid { stroke: var(--border); stroke-dasharray: 2 4; }
.arch-tl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; padding-top: 10px; position: relative; }
.arch-tl-bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.arch-tl-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.arch-tl button { font: 500 13px var(--sans); color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 4px; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.arch-tl button[aria-pressed="true"] { color: var(--heading); border-color: var(--accent); background: var(--accent-soft); }
.arch-tl button.bad[aria-pressed="true"] { color: var(--fault); border-color: var(--fault); }
.arch-tl button.good[aria-pressed="true"] { color: var(--ok); border-color: var(--ok); }
.arch-step { text-align: center; font-weight: 600; color: var(--heading); margin: 12px 0 0; min-height: 1.65em; }
.arch[data-phase="1"] .arch-step, .arch[data-phase="2"] .arch-step { color: var(--fault); }
.arch[data-phase="3"] .arch-step, .arch[data-phase="4"] .arch-step { color: var(--ok); }
.arch .node { cursor: default; outline: none; transform-box: fill-box; }
.arch .node:focus-visible rect { stroke-width: 3; stroke: var(--accent); }
/* dimming sits on the link group and the box contents, apart from the entrance transitions */
.arch .node > *, .arch .link { transition: opacity 0.2s; }
.arch.focus .node:not(.on) > *, .arch.focus .link:not(.on) { opacity: 0.18; }
/* entrance: site.js adds .anim, then .seen once the figure scrolls into view */
.arch.anim .node { opacity: 0; transform: translateY(10px); transition: opacity 0.6s cubic-bezier(.2, .7, .2, 1), transform 0.6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d) * 110ms); }
.arch.anim.seen .node { opacity: 1; transform: none; }
/* opacity too, or the arrowheads would show before their lines are drawn */
.arch.anim .edge { opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.8s cubic-bezier(.4, 0, .2, 1), opacity 0.1s; transition-delay: calc(600ms + var(--d) * 120ms); }
.arch.anim.seen .edge { opacity: 1; stroke-dashoffset: 0; }
.arch.anim .chip, .arch.anim .pkt { opacity: 0; transition: opacity 0.4s; transition-delay: calc(1100ms + var(--d, 7) * 120ms); }
.arch.anim.seen .chip, .arch.anim.seen .pkt { opacity: 1; }
.arch.paused * { animation-play-state: paused; }
@keyframes arch-flow { to { stroke-dashoffset: 0; } }
@keyframes arch-blink { to { opacity: 0.3; } }
@keyframes arch-spark { 0% { stroke-dashoffset: 1; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@media (prefers-reduced-motion: reduce) {
  .arch .pkt, .kz-lane i { display: none; }
  .arch .broker.hit, .arch .spark, .kz * { animation: none !important; stroke-dashoffset: 0; }
}
.arch figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 14px; text-align: center; }
/* inside Kafka: site.js sets data-phase 0-4 on the figure */
.kz { margin: 0 0 56px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; --fault: #d64545; }
.kz h3 { margin-bottom: 16px; }
.kz-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kz-src { border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 10px 16px; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.kz-src b, .kz-chaos b, .kz-brk-h b { color: var(--heading); }
.kz-src span, .kz-chaos span { color: var(--muted); font: 13px var(--mono); }
.kz-lane { height: 54px; position: relative; }
.kz-lane::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1.5px dashed var(--border-strong); }
.kz-lane i { position: absolute; left: calc(50% - 4px); top: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: kz-drop 1s linear infinite; }
.kz-lane i:nth-child(2) { animation-delay: -0.33s; } .kz-lane i:nth-child(3) { animation-delay: -0.66s; }
.kz-lane.busy i { animation-duration: 0.55s; }
.kz-lane.idle i { visibility: hidden; }
.kz-brk { border: 1.5px solid var(--border-strong); background: var(--surface-2); border-radius: 12px; padding: 12px; transition: opacity 0.4s, filter 0.4s, border-color 0.3s; }
.kz-brk-h { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; margin-bottom: 10px; }
.kz-brk-h b { font: 600 13px var(--mono); }
.kz-brk-h small { color: var(--muted); font-size: 12px; }
.kz-parts { display: flex; gap: 6px; }
.kz-parts span { position: relative; overflow: hidden; flex: 1; text-align: center; font: 500 12px/1.4 var(--mono); padding: 6px 0; border-radius: 7px; border: 1.5px solid var(--accent); color: var(--accent); background: var(--surface); transition: background 0.5s, color 0.5s; }
.kz-parts .ldr { background: var(--accent); color: var(--surface); }
.kz-parts .ldr::before { content: "★ "; font-size: 10px; }
.kz-parts span::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--warn); }
.kz[data-phase="1"] .kz-hit .kz-brk { animation: kz-shake 0.12s 6; border-color: var(--fault); }
.kz[data-phase="2"] .kz-hit .kz-brk { opacity: 0.35; filter: grayscale(1); border-style: dashed; }
.kz[data-phase="2"] .kz-hit .kz-parts span { border-style: dashed; }
.kz[data-phase="3"] .kz-hit .kz-brk { border-color: var(--warn); }
.kz[data-phase="3"] .kz-hit .kz-parts span::after { width: 100%; transition: width 2.4s linear; }
.kz-bolt { height: 36px; position: relative; }
.kz-bolt::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed var(--fault); opacity: 0.25; transition: opacity 0.3s; }
.kz[data-phase="1"] .kz-bolt::before { opacity: 1; animation: kz-up 0.4s linear infinite; }
.kz-chaos { border: 1.5px solid var(--border-strong); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; text-align: center; display: grid; transition: border-color 0.3s; }
.kz[data-phase="1"] .kz-chaos { border-color: var(--fault); }
.kz[data-phase="1"] .kz-chaos span { color: var(--fault); }
.kz-isr { display: flex; justify-content: center; gap: 12px 28px; flex-wrap: wrap; margin-top: 18px; font: 500 13px var(--mono); color: var(--muted); }
.kz-isr span { display: inline-flex; gap: 4px; align-items: center; }
.kz-isr i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--ok); transition: background 0.3s, border-color 0.3s; }
.kz[data-phase="2"] .kz-isr .hit { background: transparent; border-color: var(--fault); }
.kz[data-phase="3"] .kz-isr .hit { background: transparent; border-color: var(--warn); animation: arch-blink 0.5s infinite alternate; }
.kz figcaption { text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 12px; min-height: 3.2em; }
.kz figcaption b { color: var(--heading); }
.kz[data-phase="1"] figcaption, .kz[data-phase="2"] figcaption { color: var(--fault); }
.kz[data-phase="4"] figcaption { color: var(--ok); }
.kz.paused * { animation-play-state: paused; }
@keyframes kz-drop { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(48px); opacity: 0.2; } }
@keyframes kz-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes kz-up { to { transform: translateY(-6px); } }
/* three brokers side by side leave no room for full names or a row of partitions */
@media (max-width: 640px) {
  .kz { padding: 14px; }
  .kz-row { gap: 8px; }
  .kz-brk { padding: 8px; }
  .kz-brk-h b span { display: none; }
  .kz-parts { flex-direction: column; gap: 4px; }
  .kz-parts span { flex: none; }
}
.screens { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.screens figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.screens img { width: 100%; }
.screens figcaption { padding: 12px 16px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); }

/* ---------- compare ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 760px; }
.compare th, .compare td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { color: var(--heading); font-weight: 600; background: var(--surface-2); }
.compare tbody th { color: var(--heading); font-weight: 500; }
.compare tbody tr:last-child td, .compare tbody tr:last-child th { border-bottom: 0; }
.compare .yes { color: var(--ok); font-weight: 600; }
.compare .no { color: var(--no); }
.compare .hl { background: rgba(95, 169, 238, 0.07); }
.compare thead .hl { color: var(--accent-strong); }

/* ---------- cta ---------- */
.cta { text-align: center; background: radial-gradient(60% 80% at 50% 0%, rgba(79, 163, 240, 0.18), transparent 70%); }
.cta-inner { display: flex; flex-direction: column; align-items: center; }
.cta-inner .sub { max-width: 54ch; }
.install { margin-top: 28px; }
.install code { font-size: 1rem; padding: 10px 16px; border-radius: 10px; background: #0a0f1d; border: 1px solid var(--border-strong); color: #c9d4ea; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: #0a0f1d; padding: 56px 0 28px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 2fr; gap: 48px; }
.footer-brand p { color: var(--muted); max-width: 40ch; font-size: 0.95rem; margin-top: 16px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-links h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }
.footer-links a { display: block; color: var(--text); font-size: 0.95rem; margin-bottom: 10px; }
.footer-legal { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .how-grid, .how-grid.reverse { grid-template-columns: 1fr; gap: 40px; }
  .how-grid.reverse .how-code { order: 2; }
  .cards.three { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 48px; }
  .cards.three, .screens, .footer-links { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: 12px; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
}

/* Grid children must be allowed to shrink below their content width, or a
   wide <pre> stretches the column on narrow screens. */
.hero-grid > *, .how-grid > *, .how-code > *, .screens > * { min-width: 0; }

/* ---------- Paper theme rules ---------- */
h1, h2, .brand-name { font-family: "EB Garamond", Georgia, serif; letter-spacing: -0.01em; }
h1 { font-weight: 600; } h2 { font-weight: 600; }
.nav { background: rgba(247, 245, 239, 0.88); }
.hero-glow { background: radial-gradient(60% 50% at 20% 30%, rgba(26, 91, 204, 0.12), transparent 70%); }
.btn-primary { color: #fff; } .btn-primary:hover { background: #2f6fdc; }
p code, li code, td code, th code, h2 code { color: #143f8f; }
.cta { background: radial-gradient(60% 80% at 50% 0%, rgba(26, 91, 204, 0.1), transparent 70%); }
.footer { background: #102a66; border-top-color: #102a66; }
.footer-links a, .footer-brand p, .footer-legal, .footer-links h4 { color: #c3cce0; }
.footer-links a { color: #e6eaf2; }
.footer-legal { border-top-color: #243f7a; }
.compare .hl { background: rgba(26, 91, 204, 0.06); }
