/* KorpusTech — one stylesheet for every page.
 *
 * Colours come from the logo, measured from logo2-01.png. Only the deep blue is dark
 * enough to carry text on white (4.6:1); the teal, sky blue and greens are 2.0–2.9:1, so
 * they are used for accents, rules and shapes, never for words.
 *
 * System fonts only: the site makes no request to anyone but its own host, which is what
 * the privacy page promises.
 */

:root {
  --blue: #0f7abf;        /* logo deep blue — links, buttons */
  --blue-dark: #0b5f96;   /* hover, and text on tinted blue */
  --teal: #1aada2;        /* logo teal — accents only */
  --sky: #569ecf;         /* logo sky blue — accents only */
  --green: #61ba48;       /* logo green — accents only */
  --ink: #0e1c26;         /* headings */
  --text: #24323d;        /* body */
  --muted: #56656f;       /* secondary text, 6.0:1 on white, 5.6:1 on --soft */
  --line: #dde6ec;
  --soft: #f3f7f9;        /* alternate section background */
  --white: #ffffff;
  --radius: 14px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 12px; z-index: 10; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* ── header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px; flex-wrap: wrap;
}
.brand img { height: 34px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nav a {
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.97rem;
  padding: 6px 10px; border-radius: 8px;
}
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--blue-dark); background: #e8f2f9; }
/* The one link the site exists for: set apart as a button, in every page's header. */
.nav a.nav-cta { background: var(--blue); color: var(--white); margin-left: 6px; }
.nav a.nav-cta:hover { background: var(--blue-dark); color: var(--white); }
.nav a.nav-cta[aria-current="page"] { background: var(--blue-dark); color: var(--white); }

/* Wrap rather than scroll on a phone: a scrolling nav hid the highlighted "Work with us"
   button off the right edge. */
@media (max-width: 720px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 8px; }
  .nav { width: 100%; }
  .nav a { white-space: nowrap; padding: 6px 8px; }
  .nav a.nav-cta { margin-left: 0; }
}

/* ── sections ───────────────────────────────────────────────────────────── */

section { padding: 72px 0; }
section.soft { background: var(--soft); }
/* The logo blue is 4.6:1 on white and only 4.3:1 on this grey — under the 4.5 text needs. */
/* A card that is a link keeps its own text colours; only its "more" line is link-coloured. */
section.soft a:not(.btn):not(.card) { color: var(--blue-dark); }
section.soft a.card .more { color: var(--blue-dark); }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue-dark); margin-bottom: 10px;
}
.lead { font-size: 1.18rem; color: var(--muted); max-width: 44em; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* The hero's accent: the logo's colours as soft blurred light, no image to load. */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 84px;
  background:
    radial-gradient(40rem 22rem at 92% 8%, rgba(26, 173, 162, 0.13), transparent 70%),
    radial-gradient(32rem 20rem at 4% 100%, rgba(97, 186, 72, 0.12), transparent 70%),
    radial-gradient(30rem 18rem at 60% 110%, rgba(15, 122, 191, 0.10), transparent 70%);
}
.hero h1 { max-width: 15em; }
.hero .lead { font-size: 1.25rem; }

.product-hero { padding: 72px 0 56px; }
.product-hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.product-hero .tile { width: 180px; }
@media (max-width: 760px) {
  .product-hero .wrap { grid-template-columns: 1fr; }
  .product-hero .tile { width: 120px; order: -1; }
}

/* ── buttons & badges ───────────────────────────────────────────────────── */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 2px solid var(--blue); transition: background 0.15s, color 0.15s;
}
.btn.primary { background: var(--blue); color: var(--white); }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.btn.ghost { background: transparent; color: var(--blue-dark); }
.btn.ghost:hover { background: #e8f2f9; }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px; vertical-align: middle;
}
.badge.early { background: #e3f5f3; color: #0b6b63; }   /* teal tint, dark teal text 5.7:1 */
.badge.dev { background: #fdf1dc; color: #7a4b05; }     /* amber tint, dark amber text 6.6:1 */

/* ── grids & cards ──────────────────────────────────────────────────────── */

.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.card h3 { margin-top: 0.2em; }
.card p:last-child { margin-bottom: 0; }

.principle { border-top: 4px solid var(--teal); }
.principle:nth-child(2) { border-top-color: var(--blue); }
.principle:nth-child(3) { border-top-color: var(--green); }
.principle:nth-child(4) { border-top-color: var(--sky); }

.product-card {
  display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.product-card:hover {
  transform: translateY(-2px); border-color: #c5d6e1;
  box-shadow: 0 10px 28px rgba(14, 28, 38, 0.08); color: inherit;
}
.product-card .tile { width: 88px; }
.tiles { display: flex; gap: 12px; }
.reading { padding-left: 1.2em; display: grid; gap: 10px; }
.title-row { display: flex; align-items: center; gap: 18px; margin: 14px 0 22px; }
.title-row h1 { margin: 0; }
.product-hero .title-row .tile { width: 72px; order: 0; }
.product-card .more { margin-top: auto; color: var(--blue); font-weight: 600; }

.featured {
  display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: center;
  padding: 34px;
}
.featured .tile { width: 220px; }
@media (max-width: 760px) {
  .featured { grid-template-columns: 1fr; }
  .featured .tile { width: 120px; }
}

.tile { border-radius: 22%; box-shadow: 0 1px 0 rgba(14, 28, 38, 0.06), 0 0 0 1px var(--line); }

/* ── facts strip ────────────────────────────────────────────────────────── */

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
@media (max-width: 820px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fact { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.fact b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--ink); letter-spacing: -0.01em; }
.fact span { color: var(--muted); font-size: 0.95rem; }

/* A product's standing at a glance: stage, code, tests, record. */
.meta { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 0.95rem; }
.meta li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.meta li span:first-child { color: var(--muted); }
.meta li span:last-child { color: var(--ink); font-weight: 600; text-align: right; }

/* ── lists, steps, quotes ───────────────────────────────────────────────── */

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 12px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 8px;
  border-left: 3px solid var(--teal); border-bottom: 3px solid var(--teal);
  transform: rotate(-45deg);
}

/* minmax(0, 1fr), not the implicit auto column: an auto track is as wide as its widest
   unbreakable content, and one long code snippet in a step pushed the page past a phone's
   edge. */
.steps {
  counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}
.steps li {
  counter-increment: step; position: relative; padding: 16px 18px 16px 62px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #e8f2f9; color: var(--blue-dark); font-weight: 700;
}
.steps strong { color: var(--ink); }

/* A diagram beside the steps it draws: the steps take the room, the figure its own width. */
.split.loop { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .split.loop { grid-template-columns: minmax(0, 1fr); } }
.diagram {
  margin: 0; padding: 20px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: center;
}
.diagram img { max-width: 100%; height: auto; }
.product-hero .hero-art { width: 400px; height: auto; border-radius: 18px; }
@media (max-width: 900px) { .product-hero .hero-art { width: 300px; } }
@media (max-width: 760px) { .product-hero .hero-art { width: 100%; } }
.companion .lead { max-width: 40em; }
.diagram figcaption { color: var(--muted); font-size: 0.93rem; margin-top: 12px; }

blockquote {
  margin: 24px 0; padding: 18px 22px; border-left: 4px solid var(--teal);
  background: var(--soft); border-radius: 0 12px 12px 0; font-size: 1.1rem; color: var(--ink);
}
blockquote p:last-child { margin: 0; }

.note {
  border: 1px solid #f1d9a8; background: #fffaf0; border-radius: 12px; padding: 18px 22px;
}
.note strong { color: #6b4104; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* A comfortable reading width, left-aligned with the sections around it: set on the
   children, because on `.wrap` itself it narrowed the box and `margin: auto` centred it. */
.prose > * { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }

/* ── contact ────────────────────────────────────────────────────────────── */

.contact-card { text-align: center; padding: 44px 28px; }
.contact-card .email { font-size: clamp(1.15rem, 3vw, 1.55rem); font-weight: 700; word-break: break-all; }

/* ── worked examples ────────────────────────────────────────────────────── */
.example + .example { border-top: 1px solid var(--line); }
.example h2 { margin-bottom: 6px; }
.example h3 { margin: 26px 0 10px; font-size: 1.1rem; }
.files { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.files li {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88rem;
  background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px;
}
.asked {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9rem;
  background: #fff8ea; border: 1px solid #f0d9a8; border-radius: 8px; padding: 2px 8px;
  overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* A table wider than a phone scrolls inside its own box rather than widening the page. */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
table.data th, table.data td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: var(--soft); color: var(--ink); font-weight: 600; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.wrap { white-space: normal; min-width: 16em; }
/* A table with many columns wraps its cells instead of scrolling on a desktop. */
table.data.fit th, table.data.fit td { white-space: normal; }
table.data tr.flag td { background: #fff8ea; }
table.data tr.total td { background: var(--soft); color: var(--ink); }
.output-name { color: var(--muted); font-size: 0.93rem; margin: 0 0 8px; }

/* ── contact form ───────────────────────────────────────────────────────── */
/* Links arrive at #form; the sticky header would otherwise sit on top of the first field. */
.form-card { max-width: 760px; margin: 0 auto; padding: 32px; scroll-margin-top: 96px; }
@media (max-width: 720px) { .form-card { scroll-margin-top: 150px; } }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: minmax(0, 1fr); } .form-card { padding: 22px; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; color: var(--ink); font-size: 0.97rem; }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--text); background: var(--white);
  border: 1px solid #b9c7d1; border-radius: 10px; padding: 11px 13px; width: 100%;
}
.field textarea { min-height: 170px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(15, 122, 191, 0.25); outline-offset: 1px; border-color: var(--blue);
}
/* Bots fill every field; people never see this one. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button.btn { font: inherit; font-weight: 600; cursor: pointer; }
.form-note { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ── footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line); padding: 40px 0 30px; color: var(--muted); font-size: 0.95rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer img { height: 28px; width: auto; margin-bottom: 10px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--blue-dark); text-decoration: underline; }
.site-footer .fine { width: 100%; font-size: 0.87rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-card, .btn { transition: none; }
  .product-card:hover { transform: none; }
}
