/* Kolzai — the shared kit.
 * nemradar.com's grammar (and polymorphic.codes'), with colour: Space Grotesk for reading, Share Tech Mono
 * for the instrument furniture, JetBrains Mono for numbers and captions; plates with corner ticks; bracketed
 * callouts; a fixed star chart; dot-matrix numerals and a dot-matrix mark.
 * One theme, night. Violet is Kolzai's signal: the primary action, the kicker rule, a plate's ticks, the glint
 * on the mark. The four solutions each own a hue (violet, cyan, mint, amber) and keep it wherever they appear,
 * so colour always says which solution you are looking at. Everything else is ink at some weight.
 * Readability rules, as on the sister sites: running text is never uppercase or tracked; body copy is 17.5px
 * or larger; no text below 11px; the reading measure stays under 68 characters; --faint is never text. */

@font-face { font-family: 'Space Grotesk'; src: url('./fonts/SpaceGrotesk-Variable.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('./fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Share Tech Mono'; src: url('./fonts/ShareTechMono.woff2') format('woff2'); font-weight: 400; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #000; --plate: #05060a; --plate-2: #0a0b11;
  --hi: #fff; --ink: #ecebf1; --ink-2: #bdbcc8; --muted: #8f8e9c; --faint: #5f5e6b;
  --rule: #2a2a33; --rule-2: #18181f; --tick: #a3a2b1;
  /* the signal, and the four solutions' hues (validated as text on --bg and --plate: all above 7:1) */
  --accent: #9a8cff; --accent-ink: #bdb3ff;
  --c1: #9a8cff; --c1-ink: #bdb3ff;   /* 01 strategy: violet */
  --c2: #45c6ee; --c2-ink: #8fdcf6;   /* 02 analytics: cyan */
  --c3: #46d49c; --c3-ink: #8ce7c2;   /* 03 custom solutions: mint */
  --c4: #f0b04a; --c4-ink: #f7ca82;   /* 04 implementation: amber */
  --warn: #ff7b6b;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --hud: 'Share Tech Mono', 'JetBrains Mono', ui-monospace, monospace;
  --bar: 52px;
  --gut: max(24px, calc((100vw - 1240px) / 2));
  --measure: 66ch;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
/* a component that belongs to one solution takes its hue: --c and --c-ink, falling back to the signal */
.c1 { --c: var(--c1); --c-ink: var(--c1-ink); }
.c2 { --c: var(--c2); --c-ink: var(--c2-ink); }
.c3 { --c: var(--c3); --c-ink: var(--c3-ink); }
.c4 { --c: var(--c4); --c-ink: var(--c4-ink); }

html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip;
  font: 400 17.5px/1.66 var(--sans); font-feature-settings: "ss01"; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--hi); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
img, svg, canvas { display: block; }
.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--hi); color: var(--bg); font: 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the star chart behind everything (drawn by site.js; decoration only) */
.stars { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
main, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- type */
.display { margin: 0; font: 600 clamp(2.5rem, 4.3vw, 4.1rem)/1.02 var(--sans); letter-spacing: -0.037em; color: var(--hi); text-wrap: balance; }
.title { margin: 0; font: 600 clamp(1.9rem, 3vw, 2.85rem)/1.06 var(--sans); letter-spacing: -0.03em; color: var(--hi); text-wrap: balance; }
/* the copy marks a phrase in a headline; it is set in the signal colour, as the old site set it in purple */
.display em, .title em { font-style: normal; color: var(--accent-ink); }
.lede { margin: 0; max-width: 36em; font-size: clamp(1.1rem, 1.32vw, 1.24rem); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.intro { margin: 0; max-width: 40em; font-size: 1.1rem; line-height: 1.66; color: var(--ink-2); text-wrap: pretty; }
.kick { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 400 12px/1.4 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); }
.kick::before { content: ''; flex: none; width: 18px; height: 1px; background: var(--c, var(--accent)); }
.kick b { font-weight: 400; color: var(--c-ink, var(--accent-ink)); }
.hud-k { font: 400 11.5px/1.4 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
strong, b { font-weight: 600; color: var(--hi); }
.cap { margin: 0; font: 400 12.5px/1.62 var(--mono); color: var(--muted); }
.cap b { font-weight: 400; color: var(--ink-2); }
.cap .label { display: block; margin-bottom: 9px; font: 400 11.5px/1 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--c-ink, var(--accent-ink)); }

/* ---------------------------------------------------------------- the top bar */
.top { position: fixed; inset: 0 0 auto; z-index: 40; height: var(--bar); display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 2.2vw, 28px); border-bottom: 1px solid transparent;
  font: 400 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent), color-mix(in srgb, var(--bg) 0%, transparent));
  transition: background-color .3s ease, border-color .3s ease; view-transition-name: top-bar; }
.top.solid { background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom-color: var(--rule-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); white-space: nowrap; }
.brand img { width: 34px; height: auto; transition: filter .15s ease, transform .15s ease; }
.brand__word { letter-spacing: .3em; }
.brand:hover img, .brand:focus-visible img { filter: brightness(1.3); transform: translateY(-1px); }
.crumb { padding-left: 16px; border-left: 1px solid var(--rule); white-space: nowrap; }
.spacer { flex: 1; }
.nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 24px); }
.nav a { position: relative; padding: 7px 0; color: var(--muted); white-space: nowrap; transition: color .2s ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]:not(.cta)::after { content: ''; position: absolute; left: 0; right: .16em; bottom: 0; height: 1px; background: var(--accent); }
.nav .cta { margin-left: 4px; padding: 8px 11px 7px; color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.nav .cta:hover, .nav .cta[aria-current="page"] { color: var(--hi); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.menu { display: none; padding: 8px 11px 7px; border: 1px solid var(--rule); background: transparent; color: var(--ink);
  font: 400 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }

/* ---------------------------------------------------------------- the foot */
.foot { width: min(1240px, 100% - 48px); margin: clamp(96px, 12vw, 160px) auto 0; padding: 22px 0 48px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px;
  font: 400 11.5px/1.7 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.foot p { margin: 0; }
.foot .br { color: var(--accent); }
.foot a { color: var(--ink-2); border-bottom: 1px solid var(--rule); transition: color .2s ease, border-color .2s ease; }
.foot a:hover { color: var(--hi); border-color: var(--ink-2); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------------------------------------------------------------- buttons */
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 30px; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 16px;
  font: 400 12px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  color: var(--ink-2); background: transparent; border: 1px solid var(--rule); transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.btn:hover { color: var(--hi); border-color: var(--ink-2); }
.btn--primary { color: var(--c-ink, var(--accent-ink)); border-color: var(--c, var(--accent)); }
.btn--primary:hover { color: var(--hi); border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); }
.btn--lg { min-height: 58px; padding: 0 24px; font-size: 13px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { display: inline-flex; gap: 8px; font: 400 12px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule); padding-bottom: 4px; transition: color .2s ease, border-color .2s ease; }
.link:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------------------------------------------------------------- plates: the corner ticks are the mark of a plate */
.plate { position: relative; background: color-mix(in srgb, var(--plate) 88%, transparent); border: 1px solid var(--rule); }
.plate::before, .plate::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--c, var(--accent)); pointer-events: none; z-index: 3; transition: opacity .2s ease; }
.plate::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.plate::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
/* a plate that is a way in: ticks on hover, the border warms to its hue, it lifts a little */
.plate--go { transition: border-color .2s ease, transform .2s var(--ease); }
.plate--go::before, .plate--go::after { opacity: 0; }
.plate--go:hover, .plate--go:focus-within { border-color: color-mix(in srgb, var(--c, var(--accent)) 45%, var(--rule)); }
.plate--go:hover::before, .plate--go:hover::after, .plate--go:focus-within::before, .plate--go:focus-within::after { opacity: 1; }
/* a bracketed readout: square brackets either side, as the instruments label their findings */
.brk { position: relative; padding: 8px 13px 8px 14px; }
.brk::before, .brk::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; border: 1px solid var(--c, var(--tick)); }
.brk::before { left: 0; border-right: 0; }
.brk::after { right: 0; border-left: 0; }
/* the live dot */
.pulse::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; vertical-align: 1px;
  background: var(--c, var(--accent)); box-shadow: 0 0 6px color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .28; } }

/* ---------------------------------------------------------------- sections: a head that uses the width, then the work */
.sec { padding-top: clamp(96px, 12vw, 168px); }
.head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px clamp(32px, 5vw, 72px); align-items: end; margin-bottom: clamp(30px, 4vw, 52px); }
.head .intro { padding-bottom: 6px; }
.head--solo { grid-template-columns: minmax(0, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 80px); align-items: start; }

/* the spec strip: a few facts in a ruled row */
.spec-strip { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.spec-strip > * { padding: 20px 22px 22px 0; min-width: 0; }
.spec-strip > * + * { padding-left: 22px; border-left: 1px solid var(--rule-2); }
.spec-strip b { display: block; margin: 12px 0 0; font: 600 clamp(1.25rem, 1.7vw, 1.55rem)/1.15 var(--sans); letter-spacing: -0.02em; color: var(--hi); text-wrap: balance; }
.spec-strip p { margin: 10px 0 0; max-width: 30ch; font-size: 0.98rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* ---------------------------------------------------------------- dot-matrix numerals (site.js draws them; the text stays for readers) */
.led { display: inline-block; line-height: 1; color: var(--c, var(--hi)); }
.led .dots { display: inline-block; vertical-align: -0.06em; }
.led .dots svg { display: block; height: 0.8em; width: auto; overflow: visible; }

/* ---------------------------------------------------------------- forms: a rule under each field, the label above in HUD type */
.form { display: grid; gap: 28px; padding: clamp(22px, 2.8vw, 36px); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.field { display: block; }
.field .k { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font: 400 11.5px/1.4 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.field .k i { font-style: normal; color: var(--ink-2); }
.field:focus-within .k { color: var(--accent-ink); }
.field input, .field textarea { width: 100%; padding: 10px 0 11px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--hi);
  font: 400 1.08rem/1.5 var(--sans); resize: vertical; transition: border-color .2s ease; }
.field textarea { min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--hi); -webkit-box-shadow: 0 0 0 40px var(--plate) inset; caret-color: var(--hi); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.status { margin: 0; padding: 14px 16px; border: 1px solid var(--rule); font-size: 1.02rem; line-height: 1.55; color: var(--ink); }
.status[hidden] { display: none; }
.status--ok { border-color: color-mix(in srgb, var(--c3) 55%, var(--rule)); }
.status--ok::before { content: 'Sent'; display: block; margin-bottom: 6px; font: 400 11.5px/1 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--c3-ink); }
.status--err { border-color: color-mix(in srgb, var(--warn) 55%, var(--rule)); }
.status--err::before { content: 'Not sent'; display: block; margin-bottom: 6px; font: 400 11.5px/1 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--warn); }

/* ---------------------------------------------------------------- motion: blocks below the fold rise into place once (site.js adds .rv; without it nothing hides) */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .9s ease, transform 1.1s var(--ease-out); transition-delay: var(--rd, 0ms); }
.rv.in { opacity: 1; transform: none; }
/* the first screen arrives on its own, no script needed */
.enter { animation: enter 1s var(--ease-out) both; animation-delay: var(--ed, 0ms); }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } }
/* page to page, a short cross-fade */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s ease both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1180px) {
  .crumb { display: none; }
}
@media (max-width: 980px) {
  :root { --bar: 54px; }
  .head, .split { grid-template-columns: minmax(0, 1fr); }
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-strip > :nth-child(odd) { border-left: 0; padding-left: 0; }
  .spec-strip > :nth-child(n + 3) { border-top: 1px solid var(--rule-2); }
  .nav { position: fixed; inset: var(--bar) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 20px 18px;
    background: var(--bg); border-bottom: 1px solid var(--rule); transform: translateY(-130%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s; }
  .nav a { padding: 15px 0; border-bottom: 1px solid var(--rule-2); font-size: 13px; }
  .nav a[aria-current="page"]:not(.cta)::after { display: none; }
  .nav a[aria-current="page"] { color: var(--hi); }
  .nav .cta { margin: 14px 0 0; padding: 14px 12px; text-align: center; }
  .top.open .nav { transform: none; visibility: visible; transition: transform .3s var(--ease), visibility 0s; }
  .top.open { background: var(--bg); border-bottom-color: var(--rule-2); }
  .menu { display: inline-block; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap, .foot { width: min(1240px, 100% - 32px); }
  :root { --gut: 16px; }
  .top { gap: 12px; }
  .brand img { width: 30px; }
  .display { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .ctas .btn { flex: 1 1 auto; }
  .spec-strip, .form .row { grid-template-columns: minmax(0, 1fr); }
  .spec-strip > * + * { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-2); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv, .rv.in { opacity: 1; transform: none; transition: none; }
  .enter { animation: none; }
  .pulse::before { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .plate--go { transition: none; }
}
