/* Hayfork documentation. Shares its tokens with the landing page (index.html). */
:root {
  --bg: #F3F6F7; --surface: #FFFFFF; --surface-2: #E8EEF1; --line: #D8E0E5; --line-strong: #B7C3CB;
  --ink: #0E1A1F; --muted: #586870; --faint: #8A97A0;
  --needle: #F5C400; --needle-soft: #FFF1B8; --needle-ink: #3D2E00;
  --btn: #0E1A1F; --btn-ink: #F3F6F7;
  --good: #1B7F5A; --good-soft: #DFF3EA;
  --code-bg: #0E1A1F; --code-ink: #DCE6EC; --code-dim: #7F93A1; --code-key: #9BB4FF; --code-str: #FFD98A;
  --inline-code-bg: #E8EEF1;
  --display: "Schibsted Grotesk", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1180px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1114; --surface: #111A1F; --surface-2: #182229; --line: #223038; --line-strong: #33434C;
    --ink: #E9EEF1; --muted: #A3B0B8; --faint: #6F7D87;
    --needle: #FFE58A; --needle-soft: #33290C; --needle-ink: #FFE9A6;
    --btn: #E9EEF1; --btn-ink: #0B1114;
    --good: #4CC38F; --good-soft: #12301F;
    --code-bg: #070C0F; --inline-code-bg: #182229;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1114; --surface: #111A1F; --surface-2: #182229; --line: #223038; --line-strong: #33434C;
  --ink: #E9EEF1; --muted: #A3B0B8; --faint: #6F7D87;
  --needle: #FFE58A; --needle-soft: #33290C; --needle-ink: #FFE9A6;
  --btn: #E9EEF1; --btn-ink: #0B1114;
  --good: #4CC38F; --good-soft: #12301F;
  --code-bg: #070C0F; --inline-code-bg: #182229;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(18px, 4vw, 40px); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); white-space: nowrap; transition: background .15s ease, border-color .15s ease; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { filter: brightness(1.12); background: var(--btn); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--needle); outline-offset: 2px; }

/* top nav, same as the landing page */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 30px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.logo i { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-style: normal; overflow: hidden; }
.logo i svg { display: block; width: 26px; height: 26px; }
.logo small { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.nav-links { display: flex; gap: 24px; font-size: 14.5px; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.nav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.nav-cta .btn { height: 38px; padding: 0 14px; font-size: 14px; }
.nav-cta .ghost { border-color: transparent; color: var(--muted); }
.nav-cta .ghost:hover { color: var(--ink); background: transparent; }

/* layout */
.docs { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); padding-block: 40px 96px; align-items: start; }
.side { position: sticky; top: 86px; display: grid; gap: 22px; font-size: 14.5px; }
.side h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; margin-bottom: 8px; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side a { display: block; padding: 6px 10px; margin-left: -10px; border-radius: 8px; color: var(--muted); }
.side a:hover { color: var(--ink); background: var(--surface-2); }
.side a[aria-current] { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: inset 3px 0 0 var(--needle); }
.side .ext { color: var(--faint); font-size: 12px; margin-left: 6px; }
.menu-toggle { display: none; }

article { max-width: 72ch; min-width: 0; }
article .eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 10px; }
article .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--needle); flex: none; }
article h1 { font-size: clamp(34px, 4vw, 46px); line-height: 1.05; font-weight: 800; letter-spacing: -.035em; margin-top: 14px; }
article .lede { margin-top: 18px; font-size: 18px; color: var(--muted); line-height: 1.5; }
article h2 { font-size: 26px; line-height: 1.15; font-weight: 800; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
article .scroll + h2, article table + h2 { border-top: 0; padding-top: 0; margin-top: 48px; }
article h3 { font-size: 18px; font-weight: 700; margin-top: 30px; }
article h2 + p, article h3 + p, article p + p, article ul + p, article ol + p, article pre + p, article table + p, article .callout + p { margin-top: 14px; }
article p a, article li a, article td a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
article p a:hover, article li a:hover, article td a:hover { text-decoration-color: var(--ink); }
article ul, article ol { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 8px; }
article li::marker { color: var(--faint); }
article code { font-size: .88em; background: var(--inline-code-bg); padding: 2px 6px; border-radius: 5px; }
article pre { margin: 18px 0 0; background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 16px 18px; font-size: 13px; line-height: 1.6; overflow-x: auto; }
article pre code { background: none; padding: 0; font-size: inherit; }
article pre .k { color: var(--code-key); } article pre .s { color: var(--code-str); } article pre .d { color: var(--code-dim); }
article table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14.5px; }
article th { text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
article td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
article td:first-child { color: var(--ink); white-space: nowrap; }
article .scroll { overflow-x: auto; }
.callout { margin-top: 18px; padding: 14px 16px 14px 18px; border-left: 2px solid var(--needle); background: var(--surface); border-radius: 0 10px 10px 0; font-size: 15px; color: var(--muted); }
.callout b { color: var(--ink); font-weight: 600; }
.steps { counter-reset: step; list-style: none; padding: 0; margin-top: 28px; display: grid; gap: 26px; }
.steps > li { position: relative; padding-left: 52px; }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 500; display: grid; place-items: center; }
.steps > li:first-child::before { background: var(--needle); color: #1A1400; }
.steps h3 { margin-top: 3px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 22px; display: grid; gap: 8px; align-content: start; transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card h3 { margin: 0; font-size: 17px; }
.card p { font-size: 14.5px; color: var(--muted); }
.card .go { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pager { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 15px; }
.pager a { display: grid; gap: 4px; color: var(--ink); font-weight: 600; }
.pager a small { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.pager .next { text-align: right; margin-left: auto; }

footer { padding-block: 32px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .docs { grid-template-columns: 1fr; gap: 24px; }
  .side { position: static; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .side nav { display: none; }
  .side.open nav { display: grid; gap: 22px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-cta .ghost { display: none; }
  .logo small { display: none; }
}
