/* kanukko design system. One file for kanukko.introex.in and docs.kanukko.introex.in.
   Ink on paper, one signal colour, hairlines, mono for anything machine-shaped. */

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #f3f2ee; --surface: #fbfbf9; --raise: #ffffff; --text: #0e0e0d; --muted: #66645e; --faint: #9a978f;
  --line: #dcdad3; --line-strong: #c4c1b8;
  --accent: #e2400e; --accent-ink: #ffffff; --accent-soft: rgba(226, 64, 14, .1);
  --ok: #157a3c; --bad: #b4231c; --warn: #8a5a00; --code: #ebe9e3;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, 0, 1);
  --max: 1160px; --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0a; --surface: #121211; --raise: #181816; --text: #efede7; --muted: #9a978e; --faint: #66645d;
    --line: #262522; --line-strong: #3a3934;
    --accent: #ff5a24; --accent-ink: #0b0b0a; --accent-soft: rgba(255, 90, 36, .12);
    --ok: #4cc27a; --bad: #ff6b5e; --warn: #e3b341; --code: #171715;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0a; --surface: #121211; --raise: #181816; --text: #efede7; --muted: #9a978e; --faint: #66645d;
  --line: #262522; --line-strong: #3a3934;
  --accent: #ff5a24; --accent-ink: #0b0b0a; --accent-soft: rgba(255, 90, 36, .12);
  --ok: #4cc27a; --bad: #ff6b5e; --warn: #e3b341; --code: #171715;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; margin: 0; }
h1 { font-size: clamp(44px, 8.4vw, 116px); }
h2 { font-size: clamp(32px, 5vw, 64px); }
h3 { font-size: 19px; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 6px; }
p { margin: 0 0 12px; }
p.lead { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.45; color: var(--muted); max-width: 40ch; letter-spacing: -0.012em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* Layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
section.block { padding: clamp(80px, 14vh, 160px) 0; border-top: 1px solid var(--line); position: relative; }

/* Micro label: the mono index tag that sits above section titles. */
.tag {
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; gap: 10px; align-items: center; margin-bottom: 28px;
}
.tag b { color: var(--accent); font-weight: 500; }
.tag::after { content: ""; width: 48px; height: 1px; background: var(--line-strong); }

/* Header */
header.top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px var(--gutter); max-width: none; margin: 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
header.top.scrolled { border-bottom-color: var(--line); }
.wrap > header.top { margin: 0 calc(var(--gutter) * -1); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 19px/1 var(--sans); letter-spacing: -0.04em; color: var(--text); text-decoration: none; }
.brand::before { /* the kanu mark: an open eye, the pupil in the signal colour (brand/mark.svg) */
  content: ""; width: 26px; height: 26px; margin: 0 -1px 0 -2px;
  background: radial-gradient(circle, var(--accent) 0 24%, var(--text) 25%);
  -webkit-mask: url("/brand-lid.svg") center / contain no-repeat; mask: url("/brand-lid.svg") center / contain no-repeat;
}
nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
nav a { padding: 6px 10px; color: var(--muted); text-decoration: none; font-size: 15px; border-radius: 8px; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
nav a.btn { margin-left: 6px; padding: 8px 14px; color: var(--text); }
@media (max-width: 640px) { nav a.hide-sm { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  padding: 11px 18px; border-radius: 999px; font: 600 15px/1 var(--sans); letter-spacing: -0.01em; cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Cards and panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }

/* Code */
code, pre, kbd { font-family: var(--mono); font-size: 13.5px; }
code { background: var(--code); padding: 2px 6px; border-radius: 6px; }
pre { background: var(--code); padding: 16px 18px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 10px 0; line-height: 1.6; }
pre code { background: none; padding: 0; }

/* Connector URL pill */
.url-pill {
  display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden;
  font: 500 14px/1 var(--mono); background: var(--surface); max-width: 100%;
}
.url-pill code { background: none; padding: 13px 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.url-pill button {
  border: 0; border-left: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 600 13px/1 var(--sans);
  padding: 13px 16px; cursor: pointer; white-space: nowrap;
}
.url-pill button:hover { background: var(--text); color: var(--bg); }

/* Forms (developer dashboard) */
input[type=text], input[type=password], input[type=email] {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--raise); color: var(--text); font: inherit;
}
input:focus { outline: none; border-color: var(--text); }
label { font-weight: 600; display: block; margin-bottom: 6px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 16px 0; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font: inherit; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.chip { display: inline-block; font: 500 12px/1.6 var(--mono); letter-spacing: .02em; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.s-in_review, .s-approved { color: var(--ok); } .s-checks_failed, .s-rejected { color: var(--bad); } .s-draft { color: var(--muted); }
ul.checks { list-style: none; padding: 0; margin: 8px 0; }
ul.checks li { padding: 10px 0; border-top: 1px solid var(--line); }
ul.checks .ok { color: var(--ok); font-weight: 700; } ul.checks .bad { color: var(--bad); font-weight: 700; }
ul.checks small { display: block; color: var(--muted); }
.error { color: var(--bad); }
[hidden] { display: none !important; }

/* Plain pages (developers, privacy, terms): give the old markup room to breathe. */
body > .wrap > h1 { font-size: clamp(36px, 6vw, 72px); margin: clamp(48px, 10vh, 110px) 0 20px; max-width: 16ch; }
body > .wrap > h2, body > .wrap section > h2 { font-size: clamp(24px, 3vw, 34px); margin: 56px 0 16px; }
body > .wrap > p.lead { margin-bottom: 36px; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 26px; margin: 44px 0 12px; letter-spacing: -0.025em; }
.prose h3 { margin-top: 28px; }
.prose li { margin: 4px 0; }

/* Footer */
footer { margin: 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); padding: 28px 0 36px; }
.wrap > footer { margin-top: 96px; }
.site-foot .row { justify-content: space-between; row-gap: 14px; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }
.wordmark {
  font: 600 clamp(80px, 24vw, 340px)/.8 var(--sans); letter-spacing: -0.075em; color: var(--text);
  margin: 0 0 32px -0.04em; user-select: none; white-space: nowrap;
}
.wordmark span { color: var(--accent); }

/* Reveal on scroll. JS adds .in; without JS everything is visible. */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* Legal and account pages: article.prose inside .wrap. */
article.prose { padding: clamp(40px, 9vh, 96px) 0 24px; font-size: 16.5px; line-height: 1.7; }
article.prose h1 { font-size: clamp(40px, 7vw, 84px); letter-spacing: -0.045em; margin: 0 0 14px; }
article.prose h1 + p.muted { font: 500 12px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
article.prose h2 { padding-top: 28px; border-top: 1px solid var(--line); }
article.prose p, article.prose li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
article.prose strong { color: var(--text); }
article.prose a { text-decoration-color: var(--accent); }
article.prose ul, article.prose ol { padding-left: 22px; }
article.prose li::marker { color: var(--faint); }
article.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 18px 0 22px; font-size: 14.5px; border: 1px solid var(--line); border-radius: 12px; }
article.prose th, article.prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
article.prose th { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
article.prose tr:last-child td { border-bottom: 0; }
article.prose td code { white-space: nowrap; font-size: 12.5px; }
@media (max-width: 640px) {
  article.prose table, article.prose thead, article.prose tbody, article.prose tr, article.prose td { display: block; }
  article.prose thead { display: none; }
  article.prose tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  article.prose tr:last-child { border-bottom: 0; }
  article.prose td { padding: 2px 0; border: 0; }
  article.prose td:first-child { margin-bottom: 4px; }
}
