/* ubique-docs.css — Nodal Studio layer over the deno-doc HTML output.
   Loaded last (after styles.css, page.css, reset.css, comrak.css, prism.css)
   by build_docs.ts, together with nodal.css. Light only: cream and ink. */

/* ---------- generated frame ---------- */
body.ns .ddoc,
body.ns .ddoc:is(.dark *) {
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  padding: 0 var(--pad) clamp(48px, 8vh, 96px);
  gap: 0;
}
body.ns .ddoc > div:not(#categoryPanel) { padding-left: 0; padding-right: 0; min-width: 0; }
body.ns #content,
body.ns #content > main,
body.ns #topnav > div > * { min-width: 0; }
body.ns #content { margin-top: clamp(28px, 5vh, 56px); }

/* deno's top bar = sticky sub-bar under the studio header: breadcrumbs + search */
body.ns #topnav {
  top: var(--nav-h);
  height: 56px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  background: rgba(255, 253, 233, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-08) !important;
  z-index: 110;
}
body.ns #topnav > div { width: 100%; align-items: center; }
body.ns .breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.6em;
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-45);
}
body.ns .breadcrumbs a { color: var(--ink); text-decoration: none; }
body.ns .breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }
body.ns .breadcrumbs li { display: inline-flex; align-items: center; gap: 0.6em; }
body.ns .breadcrumbs li:last-child { color: var(--ink); }
body.ns .breadcrumbs * { font-size: 11px !important; font-weight: 500 !important; }
body.ns #theme-toggle { display: none !important; }
body.ns #searchbar {
  display: block !important;
  height: 40px;
  min-width: min(320px, 50vw);
  margin: 0;
  padding: 0 1.1rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
}
body.ns #searchbar::placeholder { color: var(--ink-45); }
body.ns #searchResults { background: var(--cream); color: var(--ink); }
body.ns #searchResults:not(:empty) { border-bottom: var(--stroke) solid var(--ink); }
body.ns #searchResults a { color: var(--ink); }
body.ns #searchResults ul > li a:hover,
body.ns #searchResults .active { background: var(--ink-03); }

/* sticky table of contents clears both bars */
body.ns .toc {
  top: calc(var(--nav-h) + 56px);
  margin-top: 0;
  padding-top: 24px;
  max-height: calc(100vh - var(--nav-h) - 56px);
}
body.ns .toc h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
body.ns .toc h3::before { content: ""; width: 24px; height: 2px; background: currentColor; flex: none; }
body.ns .toc a,
body.ns .documentNavigation a { color: var(--ink-62); text-decoration: none; }
body.ns .documentNavigation a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
body.ns .documentNavigation > ul > li > a { color: var(--ink); font-weight: 500; }

/* ---------- symbol pages ---------- */
body.ns .symbolTitle { padding-bottom: clamp(20px, 3vh, 32px); border-bottom: var(--stroke) solid var(--ink); }
body.ns .symbolTitle .text-2xl {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  word-break: break-word;
}
body.ns .symbolTitle .text-2xl > [class^="text-"] {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
body.ns .symbolTitle .text-2xl > [class^="text-"]::before { content: ""; width: 34px; height: 2px; background: currentColor; }
body.ns .symbolTitle .font-bold { font-weight: 800; }
body.ns .sourceButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 1.1em;
  border: var(--stroke) solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
body.ns .sourceButton::before { content: "Source"; font-size: inherit; line-height: 1; }
body.ns .sourceButton:hover { background: var(--ink); color: var(--cream); }

/* signatures: mono, in a cream-2 tile */
body.ns code.anchorable {
  display: block;
  padding: 16px 20px;
  border-radius: var(--r-tile);
  background: var(--cream-2);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
body.ns code.anchorable .font-bold { font-weight: 700; }
body.ns code.anchorable a,
body.ns code.anchorable span { color: inherit; }
body.ns code.anchorable a:not(.anchor) { text-decoration: underline; text-decoration-color: var(--ink-45); text-underline-offset: 0.2em; }
body.ns [class*="text-Type"],
body.ns [class*="text-TypeParam"],
body.ns .text-stone-500,
body.ns .dark\:text-stone-200:is(.dark *) { color: var(--ink-62); }
body.ns .space-y-8 > .scroll-mt-16 + .scroll-mt-16,
body.ns .mt-3.space-y-8 > div + div { padding-top: 2.5rem; border-top: var(--stroke) solid var(--ink-14); }

body.ns .ddoc .section > div > h2,
body.ns .ddoc main h2.anchorable {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2.6rem 0 1rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: 0;
}
body.ns .section > div > h2::after { content: ""; flex: 1; height: 1px; background: var(--ink-14); }
body.ns h3.example-header,
body.ns h3.example-header p {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
body.ns .anchor { color: var(--ink-45); }
body.ns .border-gray-300,
body.ns .dark\:border-gray-700:is(.dark *) { border-color: var(--ink-08); }
body.ns .text-optional {
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  background: transparent;
  border-radius: var(--r-chip);
  font-family: var(--display);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* prose */
body.ns .markdown { font-family: var(--body); color: var(--ink); line-height: 1.6; }
body.ns .markdown a,
body.ns .link,
body.ns .contextLink { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
body.ns .markdown :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--ink-08);
  color: var(--ink);
}

/* code blocks: ink ground, cream text, the studio blog palette (≥ 7:1 on ink) */
body.ns .markdown pre,
body.ns pre.highlight {
  position: relative;
  background: var(--ink) !important;
  color: #fffde9;
  border: 0;
  border-radius: var(--r-tile);
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
}
body.ns pre code,
body.ns pre code[class*="language-"] { color: #fffde9; background: none; font-family: var(--mono); text-shadow: none; }
body.ns .token.comment, body.ns .token.prolog, body.ns .token.doctype, body.ns .token.cdata { color: #b5b3a4; }
body.ns .token.keyword, body.ns .token.boolean, body.ns .token.number, body.ns .token.constant,
body.ns .token.builtin, body.ns .token.class-name, body.ns .token.url { color: #7fc4cf; }
body.ns .token.string, body.ns .token.char, body.ns .token.template-string, body.ns .token.regex { color: #e8e2b0; }
body.ns .token.function, body.ns .token.property, body.ns .token.parameter { color: #fffde9; }
body.ns .token.punctuation, body.ns .token.operator { color: #d9d6c3; background: none; }
body.ns pre.highlight > code:empty { display: none; }
body.ns .usageContent pre,
body.ns .usageContent pre code { white-space: pre-wrap; word-break: break-all; }
body.ns .copyButton { color: rgba(255, 253, 233, 0.6); border: 0; background: none; min-height: 0; padding: 4px; }
body.ns .copyButton:hover { color: #fffde9; background: none; }

/* ---------- API home (built by landing_script.js) ---------- */
body.ns-api-home #topnav { margin-bottom: 0; }
body.ns-api-home .breadcrumbs { visibility: hidden; }
body.ns-api-home #content { margin-top: 0; }
body.ns-api-home #content > main { gap: 0; }
.api-hero { margin: clamp(12px, 1.6vw, 22px) 0 0; }
.api-hero .ns-frame { min-height: clamp(460px, 70vh, 720px); }
.api-hero .ns-wordmark { font-size: clamp(72px, 15vw, 232px); }
.api-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.api-install {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 10px 10px 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 14px;
  max-width: 100%;
  overflow-x: auto;
}
.api-install .prompt { color: var(--cream-55); }
.api-install button.copy-install {
  min-height: 34px;
  border-color: var(--cream);
  color: var(--cream);
  font-size: 10.5px;
}
.api-install button.copy-install:hover { background: var(--cream); color: var(--ink); }

.api-intro { margin: clamp(48px, 9vh, 112px) 0 0; }
.api-intro .ns-block-head h2 { font-size: clamp(38px, 6vw, 96px); }
.api-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(24px, 4vh, 40px); }
.api-filters a.chip { font-size: 10.5px; }
.api-filters a.chip .n { margin-left: 0.7em; opacity: 0.55; font-variant-numeric: tabular-nums; }

.api-cat {
  padding: clamp(36px, 6vh, 64px) 0;
  border-top: var(--stroke) solid var(--ink);
  scroll-margin-top: calc(var(--nav-h) + 56px);
}
.api-cat-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: clamp(16px, 2.2vw, 32px);
  margin-bottom: clamp(18px, 3vh, 30px);
}
.api-cat-head .idx-num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-45);
}
.api-cat-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.95;
  font-size: clamp(28px, 3.6vw, 56px);
}
.api-cat-head .count {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.api-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  column-gap: clamp(16px, 2.2vw, 32px);
}
.api-list li { border-bottom: var(--stroke) solid var(--ink-08); min-width: 0; }
.api-list a {
  display: block;
  height: 100%;
  padding: 14px 10px 14px 0;
  color: inherit;
  text-decoration: none;
  transition: background 0.3s var(--ease-draw), padding-left 0.3s var(--ease-draw);
}
.api-list a:hover { background: var(--ink-03); padding-left: 10px; }
.api-list .fn {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
}
.api-list .fn::after { content: " →"; opacity: 0; transition: opacity 0.3s; }
.api-list a:hover .fn::after { opacity: 1; }
.api-list .desc {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-62);
}
@media (max-width: 760px) {
  .api-hero { padding: 0; }
  .api-hero .ns-mesh { display: none; }
  .api-install { flex-wrap: wrap; border-radius: 22px; padding: 12px 16px; }
  .api-install .prompt { display: none; }
  body.ns #topnav > div { gap: 12px; }
  body.ns .breadcrumbs { display: none; }
  body.ns #searchbar { min-width: 0; width: 100%; }
  .api-cat-head { grid-template-columns: minmax(0, 1fr) auto; }
  .api-cat-head .idx-num { display: none; }
}
