/* Lynkei site. Plain CSS, no build step. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #0e1018;
  --bg-2: #111421;
  --panel: #151929;
  --code-bg: #0b0d14;
  --line: #222840;
  --line-2: #2e355a;
  --ink: #e8eaf4;
  --ink-2: #c6cbdc;
  --muted: #a3a9be;   /* 7.9:1 on --bg */
  --faint: #8a91aa;   /* 5.9:1 on --bg */
  --accent: #a5b0ff;
  --accent-hi: #c9cfff;
  --mint: #5eeab0;
  --red: #ff8a80;
  --amber: #f5c36b;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 24px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
::selection { background: rgba(165, 176, 255, 0.32); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: #2e355a var(--bg); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a3050; border-radius: 99px; border: 3px solid var(--bg); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hi); }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: #1a1f33; border: 1px solid #262c45; border-radius: 6px;
  padding: 0.08em 0.38em; color: #dfe3f5; white-space: nowrap;
}
kbd {
  border: 1px solid var(--line-2); border-radius: 5px; background: #171b2c;
  padding: 0 0.35em; font-size: 0.82em; color: var(--ink-2);
}

.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 100; background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 16, 24, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand .ver { font: 400 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 8px; }
.brand .brand-sub { font: 400 13px/1 var(--mono); color: var(--muted); }
.nav { display: flex; gap: 22px; flex-grow: 1; }
.nav a { color: #b9bfd3; text-decoration: none; font-size: 15px; padding: 10px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.header-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.gh { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 15px; min-height: 44px; padding: 0 10px; border-radius: 10px; }
.gh:hover { color: var(--ink); background: var(--panel); }
.gh svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; border: 0;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hi); color: var(--bg); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); font-weight: 500; }
.btn-ghost:hover { background: var(--panel); color: var(--ink); border-color: #3c4570; }
.btn-lg { min-height: 52px; padding: 0 24px; border-radius: 12px; font-size: 16px; }

@media (max-width: 820px) {
  .nav { order: 3; width: 100%; gap: 20px; overflow-x: auto; padding-bottom: 4px; }
  .site-header .wrap { gap: 8px 16px; padding-top: 8px; padding-bottom: 4px; }
  .gh span { display: none; }
}

/* ---------- home ---------- */
.hero { padding: clamp(56px, 9vw, 104px) 0 72px; }
.hero h1 {
  margin: 0; max-width: 15ch;
  font-size: clamp(40px, 6.4vw, 80px); line-height: 1.0; letter-spacing: -0.04em; font-weight: 700;
}
.hero .lede { margin: 28px 0 0; font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: #b9bfd3; max-width: 58ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts svg { width: 16px; height: 16px; color: var(--mint); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 36px; }
.cta-note { font-size: 14px; color: var(--muted); }

.shot {
  margin: 0; border: 1px solid #262c42; border-radius: 14px; overflow: hidden; background: #121522;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.shot img { width: 100%; }
.hero .shot { margin-top: 64px; }
.caption { margin-top: 12px; font-size: 14px; color: var(--muted); }

.band { border-top: 1px solid #1d2236; }
.band-alt { background: var(--bg-2); border-bottom: 1px solid #1d2236; }
.split { display: flex; flex-wrap: wrap; gap: clamp(32px, 5vw, 64px); align-items: center; padding-block: clamp(72px, 9vw, 112px); }
.split > .copy { flex: 1 1 360px; min-width: 0; }
.split > .media { flex: 1.3 1 480px; min-width: 0; }
.split h2, .section-head h2 {
  margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 650;
}
.split p.big, .section-head p { margin: 20px 0 0; font-size: 18px; color: #b9bfd3; max-width: 52ch; }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; font-weight: 500; text-decoration: none; }
.more::after { content: ""; width: 14px; height: 14px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform 200ms var(--ease); }
.more:hover::after { transform: translateX(3px); }

.section { padding-block: clamp(80px, 10vw, 120px); }
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 56px; border-top: 1px solid var(--line);
}
.feature {
  display: flex; flex-direction: column; gap: 8px; padding: 28px 28px 32px 0;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.feature:hover { color: var(--ink); }
.feature h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.feature h3 svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.feature p { margin: 0; font-size: 15px; color: #b9bfd3; flex-grow: 1; }
.feature .go { font-size: 14px; color: var(--accent); }
.feature:hover .go { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

.term { margin: 0; border: 1px solid #262c42; border-radius: 14px; background: var(--code-bg); overflow: hidden; }
.term-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid #1d2236; font: 400 12px/1 var(--mono); color: var(--muted); min-height: 44px; }
.term pre { margin: 0; padding: 18px 20px; font-size: 13px; line-height: 1.75; color: var(--ink); overflow-x: auto; }
.t-dim { color: var(--faint); }
.t-red { color: var(--red); }
.t-amber { color: var(--amber); }
.t-mint { color: var(--mint); }
.t-acc { color: var(--accent); }

.copybtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font: 500 12px/1 var(--sans); cursor: pointer;
}
.copybtn:hover { color: var(--ink); border-color: #3c4570; }
.copybtn svg { width: 14px; height: 14px; }
.copybtn[data-done] { color: var(--mint); border-color: rgba(94, 234, 176, 0.45); }

.ai-install { margin-top: 56px; display: flex; flex-wrap: wrap; gap: 28px 56px; align-items: center; padding: 32px 36px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-2); }
.ai-copy { flex: 1 1 380px; min-width: 0; display: flex; gap: 18px; align-items: flex-start; }
.ai-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 11px; background: #1a1f33; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ai-icon svg { width: 22px; height: 22px; }
.ai-install h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.ai-install p { margin: 8px 0 0; font-size: 16px; color: #b9bfd3; max-width: 52ch; }
.ai-ask { flex: 1 1 400px; min-width: 0; }
.ai-prompt { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border: 1px solid #262c42; border-radius: 10px; background: var(--code-bg); }
.ai-prompt code { flex-grow: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 400 14px/1.6 var(--mono); color: var(--ink); }
.ai-link { display: inline-block; margin-top: 14px; font: 400 14px/1.4 var(--mono); }
.ai-install .ai-note { margin: 6px 0 0; font-size: 13px; color: var(--faint); }
@media (max-width: 760px) { .ai-install { padding: 24px 20px; } .ai-prompt code { white-space: normal; } }

.chat { border: 1px solid #262c42; border-radius: 14px; background: #121522; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat .ask { align-self: flex-end; max-width: 85%; background: #1e2440; border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.chat .tools { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font: 400 12.5px/1.5 var(--mono); color: var(--muted); }
.chat .tools svg { width: 14px; height: 14px; color: var(--mint); vertical-align: -2px; margin-right: 6px; }
.chat .answer { font-size: 15px; color: #dadde9; line-height: 1.6; margin: 0; }

.limits { margin: 32px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 32px; }
.limits li { border-top: 1px solid var(--line-2); padding-top: 16px; color: #b9bfd3; }
.limits strong { color: var(--ink); font-weight: 600; display: block; margin-bottom: 4px; }

.site-footer { border-top: 1px solid #1d2236; background: var(--code-bg); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; padding-top: 36px; padding-bottom: 36px; font-size: 14px; color: var(--muted); }
.site-footer a { color: #b9bfd3; text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .brand { font-size: 16px; }
.site-footer .push { margin-left: auto; }

/* ---------- docs ---------- */
.docs { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }
.sidebar { flex: 1 1 220px; max-width: 250px; padding: 36px 0; position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow-y: auto; }
.sidebar h2 { margin: 0 0 6px; padding: 0 12px; font: 500 12px/1.4 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.07em; }
.sidebar ul { margin: 0 0 24px; padding: 0; list-style: none; }
.sidebar a { display: block; padding: 7px 12px; border-radius: 8px; color: #b9bfd3; text-decoration: none; font-size: 14.5px; }
.sidebar a:hover { background: var(--panel); color: var(--ink); }
.sidebar a[aria-current="page"] { background: #1a1f38; color: var(--ink); font-weight: 500; }

.article { flex: 999 1 560px; min-width: 0; max-width: 760px; padding: 44px 0 96px; }
.crumbs { margin: 0; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.article h1 { margin: 14px 0 0; font-size: clamp(34px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.article .lede { margin: 18px 0 0; font-size: 19px; color: #b9bfd3; line-height: 1.55; }
.meta { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: var(--muted); }
.article h2 { margin: 56px 0 0; font-size: 26px; letter-spacing: -0.015em; font-weight: 650; line-height: 1.25; }
.article h3 { margin: 32px 0 0; font-size: 19px; font-weight: 600; }
.article p, .article ul, .article ol { margin: 14px 0 0; color: var(--ink-2); }
.article li + li { margin-top: 6px; }
.article ul, .article ol { padding-left: 22px; }
.article strong { color: var(--ink); font-weight: 600; }
.article figure { margin: 24px 0 0; }
.article figure img { border: 1px solid #262c42; border-radius: 12px; }
.article figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.article .term { margin-top: 18px; }

.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-top: 18px !important; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 600 13px/1 var(--mono); color: var(--bg); background: var(--accent);
}

.box { margin-top: 32px; border: 1px solid #262c42; border-radius: 12px; background: #121522; padding: 18px 22px; }
.box > :first-child { margin-top: 0; }
.box-title { margin: 0 !important; font-weight: 600; color: var(--ink) !important; }
.note { border-color: #4a3f22; background: #17150f; }
.note .box-title { color: var(--amber) !important; }
.note p, .note li { color: #ddd6c3 !important; }

.tabs { margin-top: 18px; }
.tablist { display: flex; gap: 4px; border-bottom: 1px solid #262c42; overflow-x: auto; }
.tablist button {
  min-height: 44px; padding: 0 16px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: 500 14px/1 var(--sans); cursor: pointer; white-space: nowrap;
}
.tablist button:hover { color: var(--ink); }
.tablist button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .term { margin-top: 0; border-top: 0; border-radius: 0 0 12px 12px; }

table.ref { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
.table-scroll { overflow-x: auto; }
table.ref th, table.ref td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
table.ref th { color: var(--ink); font-weight: 600; font-size: 14px; }

.pager { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pager a { display: block; border: 1px solid #262c42; border-radius: 12px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: #3c4570; background: #121522; color: var(--ink); }
.pager small { display: block; color: var(--muted); font-size: 13px; }
.pager .next { text-align: right; }

.toc { flex: 0 0 190px; padding: 52px 0; position: sticky; top: 64px; }
.toc h2 { margin: 0 0 10px; font: 500 12px/1.4 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.07em; }
.toc ul { margin: 0; padding: 0 0 0 14px; list-style: none; border-left: 1px solid #262c42; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.toc a { color: #b9bfd3; text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc .edit { display: block; margin-top: 24px; font-size: 13px; color: var(--muted); }
@media (max-width: 1180px) { .toc { display: none; } }
@media (max-width: 760px) {
  .sidebar { position: static; max-width: none; max-height: none; padding: 20px 0 0; border-bottom: 1px solid var(--line); }
  .sidebar details > summary { list-style: none; }
  .article { padding-top: 24px; }
}
.sidebar details > summary { display: none; }
@media (max-width: 760px) {
  .sidebar details > summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-weight: 500; margin-bottom: 16px;
  }
  .sidebar details:not([open]) > .groups { display: none; }
}

/* docs index */
.doc-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; }
.doc-grid h2 { font-size: 13px !important; font-family: var(--mono); color: var(--faint) !important; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500 !important; margin-top: 32px !important; }
.doc-grid ul { list-style: none; padding: 0 !important; }
.doc-grid a { text-decoration: none; font-weight: 500; }
.doc-grid li span { display: block; font-size: 14px; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lede, .hero .facts, .hero .cta { animation: rise 700ms var(--ease) both; }
  .hero .lede { animation-delay: 60ms; }
  .hero .facts { animation-delay: 110ms; }
  .hero .cta { animation-delay: 150ms; }
  .hero .shot { animation: shot-in 1000ms var(--ease) 200ms both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes shot-in { from { opacity: 0; transform: translateY(28px) scale(0.985); filter: blur(6px); } }

.docs-header .wrap { max-width: 1360px; }
@media (max-width: 760px) { .docs { row-gap: 0; } }
.doc-grid li + li { margin-top: 16px; }
