/* lock family — one page, no build step. */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --link: #4338ca;
  --focus: #8b5cf6;
  --key: #115e59;
  --term-bg: #0f172a;
  --term-text: #e2e8f0;
  --term-comment: #94a3b8;
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --glow-alpha: 0.18;

  /* product colours: fill (logos) and text (accessible on --bg) */
  --sql: #8b5cf6;  --sql-text: #6d28d9;
  --mq: #f97316;   --mq-text: #c2410c;
  --file: #ec4899; --file-text: #be185d;
  --lea: #1e66f5;  --lea-text: #1e66f5;
  --teal: #14b8a6;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --radius: 14px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #111827;
    --surface-2: #1a2236;
    --text: #e2e8f0;
    --muted: #a3b1c6;
    --border: #273449;
    --link: #a5b4fc;
    --focus: #c4b5fd;
    --key: #5eead4;
    --term-bg: #060a16;
    --header-bg: rgba(11, 16, 32, 0.8);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --glow-alpha: 0.22;
    --sql-text: #c4b5fd;
    --mq-text: #fdba74;
    --file-text: #f9a8d4;
    --lea: #89b4fa;
    --lea-text: #89b4fa;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.92em; }
:not(pre) > code, kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex: none; }
.wordmark { font: 700 1.15rem/1 var(--mono); letter-spacing: -0.03em; }
.wordmark span { color: var(--key); }
.site-header ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem; white-space: nowrap;
}
.site-header nav a:hover { color: var(--text); background: var(--surface-2); }
.nav-wide { display: none; }
@media (min-width: 720px) { .nav-wide { display: block; } }
@media (max-width: 359px) { .site-header nav a { padding: 6px 6px; font-size: 0.9rem; } }

main { position: relative; outline: none; }

/* drifting brand glows behind the hero */
.glow {
  position: absolute; inset: 0 0 auto 0; height: 900px; overflow: hidden; pointer-events: none; z-index: -1;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.glow span {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  filter: blur(70px); opacity: var(--glow-alpha);
  animation: drift 18s ease-in-out infinite alternate;
}
.glow span:nth-child(1) { background: var(--sql); left: -160px; top: -120px; }
.glow span:nth-child(2) { background: var(--mq); right: -180px; top: -60px; animation-delay: -5s; }
.glow span:nth-child(3) { background: var(--file); left: 30%; top: 320px; animation-delay: -9s; }
.glow span:nth-child(4) { background: var(--lea); right: 10%; top: 380px; animation-delay: -13s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

/* hero */
.hero { padding-top: clamp(28px, 6vh, 64px); padding-bottom: 24px; text-align: center; }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 4px 12px;
  font-size: 0.85rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.9rem); font-weight: 800; }
.key {
  display: inline-block;
  background: linear-gradient(90deg, var(--sql), var(--teal) 30%, var(--lea) 55%, var(--file) 78%, var(--mq));
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s ease-in-out infinite alternate;
}
@keyframes shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.lead {
  max-width: 46rem; margin: 14px auto 0;
  font-size: clamp(1.02rem, 0.95rem + 0.45vw, 1.25rem); color: var(--muted);
}

/* product cards */
.products {
  list-style: none; margin: clamp(24px, 4vh, 40px) 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 12px; text-align: left;
}
@media (min-width: 600px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product {
  --c: var(--sql); --ct: var(--sql-text);
  position: relative; min-width: 0;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i) * 110ms + 150ms);
}
.product::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--c);
}
@media (min-width: 1024px) { .product { flex-direction: column; padding: 20px; } }
.p-mq { --c: var(--mq); --ct: var(--mq-text); }
.p-file { --c: var(--file); --ct: var(--file-text); }
.p-lea { --c: var(--lea); --ct: var(--lea-text); }
.product:hover, .product:focus-within {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: var(--shadow), 0 18px 40px -18px var(--c);
}
.product .logo { width: 48px; height: 48px; flex: none; overflow: visible; }
@media (min-width: 1024px) { .product .logo { width: 56px; height: 56px; } }
.product-text { min-width: 0; }
.kind { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ct); }
.product h2 { font: 700 1.35rem/1.2 var(--mono); letter-spacing: -0.03em; margin: 2px 0 4px; }
.product h2 a { color: var(--text); text-decoration: none; }
/* the whole card is the link */
.product h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.product h2 a:focus-visible { outline: none; }
.product:has(h2 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.benefit { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.go { margin: 8px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--ct); }
.go span { display: inline-block; transition: transform 0.2s ease; }
.product:hover .go span { transform: translateX(4px); }

@media (max-width: 599px) {
  .eyebrow { display: none; }
  .product { padding: 12px 14px; gap: 12px; }
  .product .logo { width: 40px; height: 40px; }
  .product h2 { font-size: 1.2rem; }
  .benefit { font-size: 0.9rem; }
  .go { display: none; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* logo animations: the shackle clicks shut, the queue flows, the deck blinks */
.logo .shackle { transform-box: fill-box; animation: click 0.9s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(var(--i) * 110ms + 550ms); }
@keyframes click { from { transform: translateY(-14px); } to { transform: translateY(0); } }
.product:hover .logo .shackle { animation: jiggle 0.5s ease; }
@keyframes jiggle { 30% { transform: translateY(-6px); } 60% { transform: translateY(1px); } }
.logo .queue { animation: flow 2.4s ease-in-out infinite; }
@keyframes flow { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
.logo .dot { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-in-out infinite; }
.logo .d2 { animation-delay: 0.8s; }
.logo .d3 { animation-delay: 1.6s; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* sections */
.section { padding-top: clamp(56px, 9vw, 104px); }
.section-kicker { margin: 0 0 8px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--key); }
.section h2 { font-size: clamp(1.6rem, 1.15rem + 2vw, 2.5rem); font-weight: 800; max-width: 26ch; }
.section-lead { max-width: 46rem; color: var(--muted); font-size: 1.08rem; margin: 12px 0 0; }

/* the flow demo */
.flow { margin-top: 28px; }
.flow-tabs, .qs-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.flow-tabs button, .qs-tabs button {
  font: 600 0.92rem var(--mono); cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.flow-tabs button:hover, .qs-tabs button:hover { color: var(--text); }
.t-sql { --c: var(--sql); --ct: var(--sql-text); }
.t-mq { --c: var(--mq); --ct: var(--mq-text); }
.t-file { --c: var(--file); --ct: var(--file-text); }
.t-lea { --c: var(--lea); --ct: var(--lea-text); }
[role="tab"][aria-selected="true"], .flow-tabs [data-product][aria-pressed="true"] { color: var(--ct); border-color: var(--c); background: var(--surface-2); }
.flow-pause { margin-left: auto; font-family: var(--sans) !important; }
.flow-pause[aria-pressed="true"] { color: var(--text); }

.flow-stage {
  --c: var(--sql);
  display: grid; grid-template-columns: 1fr; gap: 0;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.flow-stage[data-product="mq"] { --c: var(--mq); }
.flow-stage[data-product="file"] { --c: var(--file); }
@media (min-width: 900px) {
  .flow-stage { grid-template-columns: minmax(0, 1.2fr) 72px minmax(0, 1.2fr) 72px minmax(0, 0.8fr); align-items: stretch; padding: 22px; }
}
.node { min-width: 0; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.node-console { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }
.node-title { margin: 0; font-weight: 700; }
.node-sub { margin: 2px 0 10px; font-size: 0.85rem; color: var(--muted); }
.bubble {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--term-bg); color: var(--term-text);
  font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  border-left: 3px solid var(--c);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.bubble b { color: #5eead4; }
.b-answer { border-left-color: var(--teal); }
/* step reveal: 1 ask, 2 approve, 3 answer */
.flow-stage[data-step="0"] .b-ask,
.flow-stage[data-step="0"] .b-approve, .flow-stage[data-step="1"] .b-approve,
.flow-stage[data-step="0"] .b-answer, .flow-stage[data-step="1"] .b-answer, .flow-stage[data-step="2"] .b-answer {
  opacity: 0; transform: translateY(8px);
}

.wire { position: relative; height: 36px; }
.wire::before {
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, var(--border) 0 6px, transparent 6px 12px);
}
.packet {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 12px var(--c); opacity: 0;
}
@media (min-width: 900px) {
  .wire { height: auto; }
  .wire::before { left: 6px; right: 6px; top: 50%; bottom: auto; width: auto; height: 2px; transform: translateY(-50%);
    background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px); }
}
.wire.out .packet { animation: out-v 0.7s ease-in-out; }
.wire.back .packet { animation: back-v 0.7s ease-in-out; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
@keyframes out-v { 0% { opacity: 1; transform: translateY(-14px); } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes back-v { 0% { opacity: 1; transform: translateY(14px); } 100% { opacity: 0; transform: translateY(-14px); } }
@media (min-width: 900px) {
  .wire.out .packet { animation-name: out-h; }
  .wire.back .packet { animation-name: back-h; }
}
@keyframes out-h { 0% { opacity: 1; transform: translateX(-26px); } 100% { opacity: 0; transform: translateX(26px); } }
@keyframes back-h { 0% { opacity: 1; transform: translateX(26px); } 100% { opacity: 0; transform: translateX(-26px); } }

.steps { list-style: none; counter-reset: s; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 42px; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 700 0.9rem var(--mono); color: var(--key); border: 2px solid var(--key);
}
.steps strong { color: var(--text); }

/* how they fit */
.layers { margin-top: 28px; display: grid; gap: 0; }
.layer { padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.layer-lea { border-color: var(--lea); }
.layer-kit { border-style: dashed; }
.layer-label { margin: 0 0 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.layer-body { display: flex; gap: 14px; align-items: flex-start; }
.layer-body img { flex: none; }
.layer h3 { font: 700 1.1rem/1.3 var(--mono); }
.layer h3 a { color: var(--text); }
.layer p { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.layer .layer-label { color: var(--muted); }
.kit-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 1.5rem; border-radius: 10px; background: var(--surface-2); color: var(--key); }
.consoles { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .consoles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.console { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); min-width: 0; }
.console img { flex: none; }
.c-sql { border-left: 3px solid var(--sql); }
.c-mq { border-left: 3px solid var(--mq); }
.c-file { border-left: 3px solid var(--file); }
.layer-arrow { height: 26px; position: relative; }
.layer-arrow::before { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 2px; background: var(--border); }
.layer-arrow::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 8px; height: 8px; margin-left: -3px; border-radius: 50%;
  background: var(--teal); animation: drip 2s ease-in infinite;
}
@keyframes drip { from { transform: translateY(0); opacity: 1; } to { transform: translateY(14px); opacity: 0; } }

.fit-notes { margin-top: 24px; display: grid; gap: 20px; align-items: center; }
@media (min-width: 900px) { .fit-notes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
.fit-notes > p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.fit-notes strong { color: var(--text); }
.lea-demo { margin: 0; }
.lea-demo img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #11111b; }
.lea-demo figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }

/* quick start */
.qs { margin-top: 24px; }
.qs-panel { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.qs-panel + .qs-panel { margin-top: 12px; }
.js .qs-panel + .qs-panel { margin-top: 0; }
.qs-panel[hidden] { display: none; }
.qs-panel > p { margin: 10px 0 0; color: var(--muted); }
.qs-meta { margin: 0 0 10px !important; font-size: 0.88rem; }
.term {
  margin: 0; padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  background: var(--term-bg); color: var(--term-text); font-size: 0.85rem; line-height: 1.6;
}
.term .c { color: var(--term-comment); }
.qs-panel.enter { animation: rise 0.35s ease both; }

.limits { padding-bottom: 8px; }
.limits h2 { font-size: 1.25rem; }
.limits p { max-width: 52rem; color: var(--muted); }

/* footer */
.site-footer { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--border); background: var(--surface); font-size: 0.94rem; }
.footer-grid { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 32px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } .footer-about { grid-column: auto; } }
.footer-about p { margin: 12px 0 0; color: var(--muted); max-width: 30rem; }
.site-footer h2 { margin: 0 0 12px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--text); text-decoration: none; font-family: var(--mono); }
.site-footer ul a:hover { color: var(--link); text-decoration: underline; }
.footer-projects li { display: flex; align-items: baseline; gap: 10px; }
.footer-projects .p-sql { --c: var(--sql); }
.footer-projects li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); transform: translateY(-1px); }
.footer-projects span { color: var(--muted); font-size: 0.85rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.86rem; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: inherit; }
.footer-bottom a:hover { color: var(--text); }

/* reduced motion: everything still, all content visible */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .flow-stage .bubble { opacity: 1 !important; transform: none !important; }
}
