/* ForkLine customer docs.
   Plain CSS, no build step — served verbatim by Vite's publicDir passthrough in dev
   and by Netlify in production. Nothing here requires JavaScript, including the
   layout: the sidebar becomes a section below the article on narrow screens via
   grid order rather than a toggle.

   Palette is the product's own marketing palette (see PricingPage.tsx and
   index.css), not an approximation:
     #faf3ef  blush paper        #1c0d17  plum ink
     #2a1422  deep plum          #71566a  muted plum
     #6d28d9  royal violet       #c4b5fd  light violet
*/

:root {
  --paper: #faf3ef;
  --surface: #fffdfc;
  --ink: #1c0d17;
  --ink-deep: #2a1422;
  --ink-muted: #71566a;
  --ink-faint: #9a7d8c;
  --violet: #6d28d9;
  --violet-bright: #7c3aed;
  --violet-light: #c4b5fd;
  --violet-wash: #f5f3ff;
  --line: #e7dcdf;
  --line-soft: #f0e7e6;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(42, 20, 34, 0.05);
  --shadow-md: 0 6px 22px -10px rgba(42, 20, 34, 0.28);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.docs-page {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--violet);
}

/* ── Skip link ─────────────────────────────────────────────────────────────── */

.docs-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--violet);
  color: #fff;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  font-weight: 600;
}

.docs-skip:focus {
  left: 0;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(250, 243, 239, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}

.docs-brand-mark {
  width: 30px;
  height: 30px;
  color: var(--violet);
  flex: none;
}

.docs-brand-text {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.docs-brand-name {
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.docs-brand-sub {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--violet);
}

.docs-header-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.docs-header-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.docs-header-nav a:hover {
  color: var(--violet);
}

.docs-header-cta {
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* On a phone the header has room for the brand and one action. "All docs" is the
   one to drop: the logo already links home, and the full index sits at the foot of
   every page. Two wrapped two-line links is worse than one clear one. */
@media (max-width: 30rem) {
  .docs-header {
    padding: 0.75rem 1rem;
  }
  .docs-header-nav a:not(.docs-header-cta) {
    display: none;
  }
  .docs-brand-sub {
    display: none;
  }
}

.docs-header-cta:hover {
  border-color: var(--violet-light);
  background: var(--violet-wash);
}

/* ── Layout ────────────────────────────────────────────────────────────────── */

.docs-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 2rem;
}

.docs-main {
  min-width: 0;
  padding: 2.5rem 0 4rem;
}

@media (min-width: 62rem) {
  .docs-layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    gap: 3.5rem;
  }
  /* Placed explicitly rather than by `order`. The sidebar's mobile `order: 2` is
     declared later in this file, so it would otherwise win over an `order` reset
     here at equal specificity and swap the two columns. */
  .docs-sidebar {
    grid-column: 1;
    grid-row: 1;
  }
  .docs-main {
    grid-column: 2;
    grid-row: 1;
  }
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.docs-sidebar {
  /* Below the article on narrow screens — no toggle, so no JavaScript. */
  order: 2;
  padding-bottom: 2.5rem;
}

@media (min-width: 62rem) {
  .docs-sidebar {
    position: sticky;
    top: 4.2rem;
    align-self: start;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    padding: 2.5rem 0.5rem 2rem 0;
    border-right: 1px solid var(--line-soft);
    scrollbar-width: thin;
  }
}

.docs-nav-groups,
.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav-group + .docs-nav-group {
  margin-top: 1.5rem;
}

.docs-nav-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.docs-nav-list a {
  display: block;
  padding: 0.34rem 0.7rem;
  margin-left: -0.7rem;
  border-radius: 8px;
  font-size: 0.925rem;
  line-height: 1.45;
  color: var(--ink-muted);
  text-decoration: none;
}

.docs-nav-list a:hover {
  background: var(--violet-wash);
  color: var(--violet);
}

.docs-nav-list a.is-current {
  background: var(--violet-wash);
  color: var(--violet);
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--violet);
}

/* Narrow screens: the nav reads as a directory at the foot of the page. */
@media (max-width: 61.99rem) {
  .docs-sidebar {
    border-top: 1px solid var(--line);
    padding-top: 2rem;
  }
  .docs-sidebar::before {
    content: "All documentation";
    display: block;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
  }
}

/* ── Article ───────────────────────────────────────────────────────────────── */

/* Capped for a comfortable measure (~70 characters). Without this the article fills
   the whole remaining column on a wide screen and lines run past 110 characters,
   which is where the eye starts losing its place returning to the next line. */
.docs-article,
.docs-pager {
  max-width: 46rem;
}

.docs-breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.docs-breadcrumb a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
}

.docs-breadcrumb a:hover {
  color: var(--violet);
}

.docs-breadcrumb-sep {
  margin: 0 0.4rem;
  color: var(--line);
}

.docs-article h1 {
  font-size: clamp(1.95rem, 1.4rem + 2vw, 2.6rem);
  line-height: 1.14;
  letter-spacing: -0.028em;
  margin: 0 0 1.1rem;
  color: var(--ink-deep);
}

.docs-article h2 {
  font-size: 1.42rem;
  letter-spacing: -0.017em;
  margin: 2.9rem 0 0.85rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-deep);
  scroll-margin-top: 5rem;
}

.docs-article h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.6rem;
  color: var(--ink-deep);
  scroll-margin-top: 5rem;
}

.docs-article p,
.docs-article ul,
.docs-article ol {
  margin: 0 0 1.15rem;
}

.docs-article ul,
.docs-article ol {
  padding-left: 1.35rem;
}

.docs-article li {
  margin-bottom: 0.45rem;
}

.docs-article li::marker {
  color: var(--violet-light);
}

.docs-article strong {
  color: var(--ink-deep);
  font-weight: 680;
}

.docs-article a {
  color: var(--violet);
  text-decoration-color: var(--violet-light);
  text-underline-offset: 2px;
}

.docs-article a:hover {
  text-decoration-color: var(--violet);
}

.docs-article code {
  font-family: var(--mono);
  font-size: 0.855em;
  background: var(--violet-wash);
  color: var(--ink-deep);
  padding: 0.14em 0.42em;
  border-radius: 5px;
  border: 1px solid #eceafe;
}

.docs-article pre {
  background: var(--ink-deep);
  color: #f3ecf1;
  padding: 1.05rem 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.87rem;
  line-height: 1.6;
  box-shadow: var(--shadow-md);
}

.docs-article pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.docs-article blockquote {
  margin: 0 0 1.2rem;
  padding: 0.9rem 1.15rem;
  border-left: 3px solid var(--violet);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--violet-wash);
  color: var(--ink-deep);
}

.docs-article blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables carry real reference material (roles, fees, statuses) — they must stay
   readable on a phone, so they scroll inside their own box rather than forcing the
   page to scroll sideways. */
.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.3rem;
  font-size: 0.94rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.docs-article thead th {
  background: var(--violet-wash);
  color: var(--ink-deep);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.7rem 0.9rem;
}

.docs-article tbody td {
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--line-soft);
  vertical-align: top;
}

.docs-article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.docs-article hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.docs-article .header-anchor {
  color: var(--violet-light);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
}

.docs-article h2:hover .header-anchor,
.docs-article h3:hover .header-anchor,
.docs-article .header-anchor:focus {
  opacity: 1;
}

.docs-updated {
  margin: 2.5rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.86rem;
  color: var(--ink-faint);
}

.docs-updated a {
  color: var(--ink-muted);
}

/* ── Prev / next pager ─────────────────────────────────────────────────────── */

.docs-pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-top: 2.75rem;
}

@media (min-width: 34rem) {
  .docs-pager {
    grid-template-columns: 1fr 1fr;
  }
}

.docs-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.docs-pager-link:hover {
  border-color: var(--violet-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.docs-pager-next {
  text-align: right;
}

.docs-pager-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}

.docs-pager-prev .docs-pager-label::before {
  content: "← ";
}

.docs-pager-next .docs-pager-label::after {
  content: " →";
}

.docs-pager-title {
  font-weight: 660;
  color: var(--ink-deep);
  line-height: 1.35;
}

.docs-pager-category {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.docs-pager-spacer {
  display: none;
}

@media (min-width: 34rem) {
  .docs-pager-spacer {
    display: block;
  }
}

/* ── Home ──────────────────────────────────────────────────────────────────── */

.docs-page-home .docs-main {
  max-width: 60rem;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.docs-hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.docs-hero-mark {
  width: 54px;
  height: 54px;
  color: var(--violet);
  margin-bottom: 1.1rem;
}

.docs-hero h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 0.75rem;
  color: var(--ink-deep);
}

.docs-intro {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.docs-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.docs-button {
  display: inline-block;
  padding: 0.62rem 1.35rem;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--violet);
  box-shadow: var(--shadow-md);
}

.docs-button:hover {
  background: var(--violet-bright);
  border-color: var(--violet-bright);
}

.docs-button-ghost {
  background: var(--surface);
  color: var(--violet);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.docs-button-ghost:hover {
  background: var(--violet-wash);
  border-color: var(--violet-light);
  color: var(--violet);
}

.docs-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.docs-jump a {
  padding: 0.34rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
}

.docs-jump a:hover {
  border-color: var(--violet-light);
  background: var(--violet-wash);
  color: var(--violet);
}

.docs-index-category {
  margin-bottom: 3rem;
  scroll-margin-top: 5rem;
}

.docs-index-category h2 {
  font-size: 1.28rem;
  letter-spacing: -0.018em;
  margin: 0 0 1rem;
  color: var(--ink-deep);
}

.docs-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

@media (min-width: 44rem) {
  .docs-index-list {
    grid-template-columns: 1fr 1fr;
  }
}

.docs-index-list a {
  display: block;
  height: 100%;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.docs-index-list a:hover {
  border-color: var(--violet-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.docs-index-title {
  display: block;
  font-weight: 660;
  color: var(--ink-deep);
  margin-bottom: 0.2rem;
}

.docs-index-desc {
  display: block;
  font-size: 0.895rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ── 404 ───────────────────────────────────────────────────────────────────── */

.docs-404 {
  text-align: center;
  padding: 4rem 1.5rem 5rem;
}

.docs-404 h1 {
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0.6rem;
  color: var(--ink-deep);
}

.docs-404 p {
  color: var(--ink-muted);
}

.docs-404-heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 3rem 0 0.9rem;
}

.docs-404-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 26rem;
  display: grid;
  gap: 0.45rem;
}

.docs-404-list a {
  display: block;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-deep);
}

.docs-404-list a:hover {
  border-color: var(--violet-light);
  background: var(--violet-wash);
  color: var(--violet);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

.docs-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.docs-footer-inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.docs-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--ink-deep);
  text-decoration: none;
}

.docs-footer-mark {
  width: 24px;
  height: 24px;
  color: var(--violet);
}

.docs-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.docs-footer-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.docs-footer-nav a:hover {
  color: var(--violet);
}

.docs-footer-legal {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-faint);
}

/* ── Focus and motion ──────────────────────────────────────────────────────── */

a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
