/* Harriet Docs — layout and design system (marketing-site colors & fonts) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

@font-face {
  font-family: "Lazzer"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/docs/assets/fonts/Lazzer-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Lazzer"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/docs/assets/fonts/Lazzer-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/docs/assets/fonts/SourceSansPro-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Source Sans Pro"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/docs/assets/fonts/SourceSansPro-Italic.ttf") format("truetype");
}
@font-face {
  font-family: "Source Sans Pro"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/docs/assets/fonts/SourceSansPro-Bold.ttf") format("truetype");
}

:root {
  /* Harriet brand tokens (website/src/styles/global.css) */
  --deep-blue: #041524;
  --light-purple: #B1A8FF;
  --pale-purple: #EFEEFF;
  --light-blue: #62B2F8;
  --yellow: #F5DA5E;

  --bg: #f9f8fe;
  --bg-content: #ffffff;
  --fg: #040404;
  --fg-heading: #041524;
  --fg-muted: rgba(4, 21, 36, 0.58);
  --fg-faint: rgba(4, 21, 36, 0.42);
  --accent: #041524;            /* active nav items: deep blue, site-style */
  --link: #3f8fd6;              /* site light-blue link token, darkened a touch for body text contrast */
  --accent-soft: #EFEEFF;
  --hover: #EFEEFF;
  --border: rgba(4, 21, 36, 0.10);
  --border-soft: rgba(4, 21, 36, 0.07);
  --topbar-bg: #041524;
  --topbar-fg: #ffffff;
  --topbar-muted: rgba(255, 255, 255, 0.62);
  --topbar-pill: rgba(255, 255, 255, 0.08);
  --topbar-border: rgba(255, 255, 255, 0.16);
  --topbar-accent: #B1A8FF;
  --code-bg: #EFEEFF;
  --code-block-bg: #041524;
  --code-block-fg: #e8ecf1;
  --callout-info-bg: #EFEEFF;
  --callout-info-border: rgba(177, 168, 255, 0.6);
  --callout-warn-bg: #FDF6D8;
  --callout-warn-border: #F5DA5E;
  --shadow: 0 16px 40px -12px rgba(4, 21, 36, 0.22);
  --sans: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Lazzer", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
html[data-theme="dark"] {
  --bg: #041524;
  --bg-content: #081c2e;
  --fg: #e6ebf1;
  --fg-heading: #ffffff;
  --fg-muted: rgba(230, 235, 241, 0.6);
  --fg-faint: rgba(230, 235, 241, 0.4);
  --accent: #B1A8FF;
  --link: #62B2F8;
  --accent-soft: rgba(177, 168, 255, 0.16);
  --hover: rgba(177, 168, 255, 0.12);
  --border: rgba(230, 235, 241, 0.14);
  --border-soft: rgba(230, 235, 241, 0.09);
  --topbar-bg: #020e18;
  --code-bg: rgba(177, 168, 255, 0.14);
  --code-block-bg: #020e18;
  --callout-info-bg: rgba(177, 168, 255, 0.12);
  --callout-info-border: rgba(177, 168, 255, 0.35);
  --callout-warn-bg: rgba(245, 218, 94, 0.10);
  --callout-warn-border: rgba(245, 218, 94, 0.5);
  --shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 135px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }

/* ---------- Site header (marketing nav + docs tabs) ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
html[data-theme="dark"] .topbar { background: rgba(8, 28, 46, 0.92); border-bottom-color: var(--border); }
.site-row {
  display: flex; align-items: center; gap: 26px; height: 60px; padding: 0 24px;
}
.topbar-logo { display: flex; align-items: center; text-decoration: none; }
.topbar-logo img { height: 28px; width: auto; display: block; }
html[data-theme="dark"] .topbar-logo img { filter: invert(1) hue-rotate(180deg) brightness(1.4); }
.site-links { display: flex; align-items: center; gap: 26px; }
.site-links a {
  font-family: var(--display); font-size: 13.5px; font-weight: 500;
  color: var(--fg-heading); text-decoration: none;
}
.site-links a:hover { opacity: 0.7; }
.topbar-search { flex: 1; display: flex; justify-content: center; }
.search-pill {
  display: flex; align-items: center; gap: 8px;
  width: min(380px, 100%); height: 34px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg-muted); font-size: 13px; cursor: pointer;
  font-family: var(--sans);
}
.search-pill:hover { border-color: var(--fg-faint); }
.search-pill .grow { flex: 1; text-align: left; }
.search-pill kbd {
  font-family: var(--sans); font-size: 11px; color: var(--fg-muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--bg-content);
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--fg-muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { color: var(--fg-heading); border-color: var(--fg-faint); }
.topbar-cta {
  background: var(--deep-blue); color: #fff; text-decoration: none;
  font-family: var(--display); font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 8px; white-space: nowrap;
  transition: opacity 150ms ease;
}
.topbar-cta:hover { opacity: 0.85; }
html[data-theme="dark"] .topbar-cta { background: var(--light-purple); color: var(--deep-blue); }
.login-link {
  font-family: var(--display); font-size: 13.5px; font-weight: 500;
  color: var(--fg-heading); text-decoration: none;
}
.login-link:hover { opacity: 0.7; }

/* docs tab strip */
.docs-tabs {
  display: flex; gap: 30px; padding: 0 24px;
  border-top: 1px solid var(--border-soft);
}
.docs-tabs a {
  display: flex; align-items: center; height: 46px;
  font-family: var(--display); font-size: 14.5px; font-weight: 500;
  color: var(--fg-muted); text-decoration: none;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.docs-tabs a:hover { color: var(--fg-heading); }
.docs-tabs a.active { color: var(--fg-heading); font-weight: 700; border-bottom-color: var(--link); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  padding-top: 107px;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 107px; height: calc(100vh - 107px);
  overflow-y: auto; padding: 22px 14px 40px 22px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar h5 {
  margin: 26px 0 8px; font-family: var(--display); font-size: 10.5px; font-weight: 700;
  color: var(--fg-faint); letter-spacing: .12em; text-transform: uppercase;
}
.sidebar h5:first-child { margin-top: 2px; }
.sidebar a {
  display: block; padding: 4.5px 10px; margin-left: -10px;
  font-size: 13.5px; color: var(--fg); text-decoration: none;
  border-radius: 8px; line-height: 1.45;
}
.sidebar a:hover { background: var(--hover); }
.sidebar a.active { color: var(--accent); font-weight: 700; background: var(--accent-soft); }

/* ---------- Content ---------- */
.content-pane {
  background: var(--bg-content);
  border-left: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 40px;
  padding: 40px 32px 90px 56px;
}
article { max-width: 680px; min-width: 0; }
.eyebrow { font-size: 13px; color: var(--fg-muted); margin: 0 0 10px; }
article h1 {
  font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.18; color: var(--fg-heading); margin: 0 0 14px;
}
p.lead { font-size: 16.5px; color: var(--fg); margin: 0 0 28px; }
article h2 {
  font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--fg-heading); margin: 44px 0 12px; padding-top: 8px;
}
article h3 {
  font-family: var(--display); font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--fg-heading); margin: 30px 0 8px;
}
article p { margin: 0 0 14px; }
article ul, article ol { padding-left: 22px; margin: 0 0 14px; }
article li { margin-bottom: 5px; }
article a { color: var(--link); text-decoration: none; }
article a:hover { text-decoration: underline; }
article hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
h2 .anchor, h3 .anchor { opacity: 0; margin-left: 6px; color: var(--fg-faint); text-decoration: none; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* code */
article code {
  font-family: var(--mono); font-size: 12.8px;
  background: var(--code-bg); border: 1px solid var(--border-soft);
  border-radius: 5px; padding: 1.5px 5px;
}
article pre {
  background: var(--code-block-bg); color: var(--code-block-fg);
  border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  font-size: 12.8px; line-height: 1.6; margin: 0 0 18px;
}
article pre code { background: none; border: none; padding: 0; color: inherit; }

/* tables */
article table {
  width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 13.8px;
  display: block; overflow-x: auto;
}
article th, article td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
article th { font-family: var(--display); font-weight: 700; color: var(--fg-muted); font-size: 12px; letter-spacing: .04em; }

/* kbd */
article kbd {
  font-family: var(--sans); font-size: 12px; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--bg);
}

/* ---------- Components ---------- */
.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px;
  background: var(--callout-info-bg); border: 1px solid var(--callout-info-border);
  margin: 0 0 18px; font-size: 14.5px;
}
.callout .icon { flex-shrink: 0; margin-top: 1px; }
.callout p { margin: 0 0 6px; } .callout p:last-child { margin: 0; }
.callout.warn { background: var(--callout-warn-bg); border-color: var(--callout-warn-border); }

/* Section index — one catalog well, numbered rows, not a grid of competing boxes */
.cards {
  --card-in: .42s cubic-bezier(.2, .7, .2, 1);
  counter-reset: section-card;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 0 28px;
  padding: 5px;
  background:
    linear-gradient(180deg, rgba(177, 168, 255, 0.07), transparent 42%),
    var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}
html[data-theme="dark"] .cards {
  background:
    linear-gradient(180deg, rgba(177, 168, 255, 0.08), transparent 48%),
    rgba(2, 14, 24, 0.45);
}
.cards a.card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 1.15em;
  grid-template-areas:
    "num title arrow"
    "num desc  arrow";
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  padding: 13px 14px 13px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  counter-increment: section-card;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
  animation: card-in var(--card-in) both;
}
.cards a.card:nth-child(1) { animation-delay: .02s; }
.cards a.card:nth-child(2) { animation-delay: .06s; }
.cards a.card:nth-child(3) { animation-delay: .10s; }
.cards a.card:nth-child(4) { animation-delay: .14s; }
.cards a.card:nth-child(5) { animation-delay: .18s; }
.cards a.card:nth-child(6) { animation-delay: .22s; }
.cards a.card::before {
  content: counter(section-card, decimal-leading-zero);
  grid-area: num;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(177, 168, 255, 0.22);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--deep-blue);
  line-height: 1;
  transition: background-color .18s ease, color .18s ease;
}
html[data-theme="dark"] .cards a.card::before {
  background: rgba(177, 168, 255, 0.16);
  color: var(--light-purple);
}
.cards a.card::after {
  content: "";
  grid-area: arrow;
  width: 14px;
  height: 14px;
  justify-self: end;
  background: currentColor;
  color: rgba(4, 21, 36, 0.38);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8h9.2M8.4 4.2 12.8 8 8.4 11.8' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8h9.2M8.4 4.2 12.8 8 8.4 11.8' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), color .18s ease;
}
html[data-theme="dark"] .cards a.card::after { color: rgba(230, 235, 241, 0.42); }
.cards a.card:hover,
.cards a.card:focus-visible {
  background: var(--bg-content);
  border-color: rgba(177, 168, 255, 0.45);
  text-decoration: none;
  box-shadow: 0 8px 22px -14px rgba(4, 21, 36, 0.35);
}
html[data-theme="dark"] .cards a.card:hover,
html[data-theme="dark"] .cards a.card:focus-visible {
  background: rgba(177, 168, 255, 0.10);
  border-color: rgba(177, 168, 255, 0.32);
  box-shadow: none;
}
.cards a.card:hover::before,
.cards a.card:focus-visible::before {
  background: var(--light-purple);
  color: var(--deep-blue);
}
.cards a.card:hover::after,
.cards a.card:focus-visible::after {
  color: var(--fg-heading);
  transform: translateX(3px);
}
.cards a.card:focus-visible {
  outline: 2px solid var(--light-purple);
  outline-offset: 2px;
}
.card .card-title {
  grid-area: title;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--fg-heading);
  margin: 0;
}
.card .card-title .ico { display: none; }
.card p {
  grid-area: desc;
  margin: 0;
  font-size: 13.2px;
  color: var(--fg-muted);
  line-height: 1.45;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cards a.card { animation: none; }
  .cards a.card,
  .cards a.card::before,
  .cards a.card::after { transition: none; }
}

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 22px; }
.steps > li {
  counter-increment: step; position: relative; padding: 0 0 22px 44px; margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--pale-purple); border: 1px solid var(--callout-info-border);
  color: var(--deep-blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 12.5px; font-weight: 700;
}
html[data-theme="dark"] .steps > li::before { background: var(--accent-soft); color: var(--light-purple); }
.steps > li::after {
  content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px;
  width: 1px; background: var(--border);
}
.steps > li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; margin-bottom: 3px; font-weight: 700; }

figure.screenshot { margin: 6px 0 24px; }
figure.screenshot img {
  max-width: 100%; border-radius: 10px; border: 1px solid var(--border);
  display: block; box-shadow: 0 2px 12px rgba(4, 21, 36, .07);
}
figure.screenshot figcaption { font-size: 12.5px; color: var(--fg-muted); margin-top: 8px; }
.placeholder {
  border: 1.5px dashed var(--callout-info-border); border-radius: 10px;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(177, 168, 255, .06) 14px 28px);
  padding: 44px 24px; text-align: center; color: var(--fg-muted); font-size: 13px;
  margin: 6px 0 24px;
}
.placeholder .ph-label { font-family: var(--display); font-weight: 700; color: var(--fg-heading); display: block; margin-bottom: 4px; font-size: 13px; }

/* prev/next footer */
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 56px; }
.pager a {
  flex: 1; max-width: 48%; border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; text-decoration: none; color: var(--fg);
  transition: background-color .12s ease;
}
.pager a:hover { background: var(--accent-soft); text-decoration: none; }
.pager .dir { font-size: 12px; color: var(--fg-muted); display: block; }
.pager .pt { font-family: var(--display); font-size: 13.5px; font-weight: 700; color: var(--fg-heading); }
.pager a.next { text-align: right; margin-left: auto; }

/* ---------- Right TOC ---------- */
.toc {
  position: sticky; top: 147px; align-self: start;
  font-size: 13px; max-height: calc(100vh - 130px); overflow-y: auto;
}
.toc .toc-title {
  font-family: var(--display); font-weight: 700; font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 10px; color: var(--fg-faint);
}
.toc a {
  display: block; color: var(--fg-muted); text-decoration: none; padding: 3.5px 0; line-height: 1.4;
}
.toc a.h3 { padding-left: 14px; }
.toc a:hover { color: var(--fg-heading); }
.toc a.active { color: var(--accent); font-weight: 700; }
.toc .toc-sep { border-top: 1px solid var(--border); margin: 14px 0; }
.copy-page {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--fg-muted); background: none;
  border: none; padding: 3px 0; cursor: pointer; font-family: var(--sans);
}
.copy-page:hover { color: var(--fg-heading); }

/* ---------- Search modal ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 21, 36, .5);
  display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
  backdrop-filter: blur(2px);
}
.search-overlay.open { display: flex; }
.search-modal {
  width: min(620px, 92vw); background: var(--bg-content); border-radius: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden;
}
.search-modal .search-input-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.search-modal input {
  flex: 1; border: none; outline: none; background: none; color: var(--fg);
  font-size: 15.5px; font-family: var(--sans);
}
.search-modal input::placeholder { color: var(--fg-faint); }
.search-modal .esc {
  font-size: 11px; color: var(--fg-muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
}
.search-results { max-height: 46vh; overflow-y: auto; padding: 8px; }
.search-results .group-label {
  font-family: var(--display); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-faint); padding: 10px 12px 4px; font-weight: 700;
}
.search-results a.result {
  display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--fg);
}
.search-results a.result .r-title { font-family: var(--display); font-size: 13.5px; font-weight: 700; color: var(--fg-heading); }
.search-results a.result .r-crumb { font-size: 12px; color: var(--fg-muted); }
.search-results a.result .r-snip { font-size: 12.5px; color: var(--fg-muted); margin-top: 2px; }
.search-results a.result:hover, .search-results a.result.selected { background: var(--accent-soft); }
.search-results a.result.selected .r-title { color: var(--accent); }
.search-empty { padding: 26px 16px; text-align: center; color: var(--fg-muted); font-size: 13.5px; }
mark { background: var(--light-purple); color: var(--deep-blue); border-radius: 3px; padding: 0 1px; }
html[data-theme="dark"] mark { background: rgba(177, 168, 255, .35); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .content-pane { grid-template-columns: minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { display: none; }
  .content-pane { border-left: none; padding: 30px 22px 70px; }
  .site-links { display: none; }
  .cards a.card { padding: 12px 12px 12px 6px; }
}
