/* Bookimatic documentation — static-first resource hub. */

html.page-bookimatic-docs {
  color-scheme: light;
  scroll-behavior: smooth;
}

html.page-bookimatic-docs body {
  background: #f6f4ee;
  color: #13213a;
}

html.page-bookimatic-docs .site-header {
  background: rgba(249, 248, 243, 0.9);
  border-bottom-color: rgba(19, 33, 58, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

html.page-bookimatic-docs .site-header.is-scrolled,
html.page-bookimatic-docs body.nav-open .site-header {
  background: rgba(252, 251, 247, 0.97);
  border-bottom-color: rgba(19, 33, 58, 0.16);
  box-shadow: 0 12px 30px rgba(21, 37, 66, 0.08);
}

html.page-bookimatic-docs .site-header :where(.nav-link, .nav-toggle, .nav-toggle-label, .nav-icon) {
  color: #13213a;
}

html.page-bookimatic-docs .site-header .site-logo-lockup {
  filter: brightness(0);
}

.docs-page {
  --docs-blue: #174eb6;
  --docs-blue-bright: #1d63e7;
  --docs-blue-soft: #e7efff;
  --docs-ink: #13213a;
  --docs-muted: #5d6779;
  --docs-paper: #f6f4ee;
  --docs-surface: #fffefa;
  --docs-line: rgba(19, 33, 58, 0.15);
  --docs-dark: #102340;
  background: var(--docs-paper);
  color: var(--docs-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-width: 0;
  overflow: hidden;
}

.docs-page,
.docs-page *,
.docs-page *::before,
.docs-page *::after {
  box-sizing: border-box;
}

.docs-page :where(h1, h2, h3, p, ol, ul, dl, dd) {
  margin: 0;
}

.docs-page :where(ol, ul) {
  list-style: none;
  padding: 0;
}

.docs-page :where(a) {
  color: inherit;
}

.docs-page :where(section[id]) {
  scroll-margin-top: calc(var(--header-h, 72px) + 24px);
}

.docs-page :where(a, summary):focus-visible {
  outline: 3px solid #1d63e7;
  outline-offset: 4px;
}

.docs-shell {
  margin-inline: auto;
  max-width: 1200px;
  padding-inline: clamp(20px, 4vw, 48px);
  width: 100%;
}

.docs-section {
  padding-block: clamp(76px, 9vw, 128px);
}

.docs-eyebrow {
  color: var(--docs-blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.docs-heading {
  display: grid;
  gap: 16px;
  max-width: 650px;
}

.docs-heading--wide {
  max-width: 790px;
}

.docs-heading h2,
.docs-release h2,
.docs-cta h2 {
  font-size: clamp(2.2rem, 4.8vw, 4.25rem);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-wrap: balance;
}

.docs-heading > p:last-child,
.docs-release__lead,
.docs-cta__panel > div > p:last-child {
  color: var(--docs-muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.72;
}

/* Hero */
.docs-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(64, 120, 236, 0.18), transparent 25rem),
    linear-gradient(180deg, #f9f8f3 0%, #f2f4f7 100%);
  border-bottom: 1px solid var(--docs-line);
  padding-block: calc(var(--header-h, 72px) + clamp(58px, 7vw, 96px)) clamp(72px, 8vw, 112px);
  position: relative;
}

.docs-hero::after {
  background-image: linear-gradient(rgba(23, 78, 182, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 78, 182, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to left, #000, transparent 75%);
  pointer-events: none;
  position: absolute;
}

.docs-hero__grid {
  align-items: center;
  display: grid;
  gap: clamp(48px, 8vw, 100px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  position: relative;
  z-index: 1;
}

.docs-breadcrumb {
  align-items: center;
  color: #667188;
  display: flex;
  font-size: 0.8rem;
  font-weight: 650;
  gap: 9px;
  margin-bottom: 38px;
}

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

.docs-hero h1 {
  font-size: clamp(3.25rem, 6.3vw, 5.75rem);
  font-weight: 730;
  letter-spacing: -0.068em;
  line-height: 0.94;
  margin-top: 18px;
  max-width: 850px;
  text-wrap: balance;
}

.docs-hero__lead {
  color: var(--docs-muted);
  font-size: clamp(1.05rem, 1.6vw, 1.24rem);
  line-height: 1.7;
  margin-top: 26px;
  max-width: 680px;
}

.docs-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.docs-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 750;
  justify-content: center;
  min-height: 50px;
  padding: 13px 19px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.docs-button:hover {
  transform: translateY(-2px);
}

.docs-button--primary {
  background: var(--docs-blue);
  box-shadow: 0 12px 28px rgba(23, 78, 182, 0.2);
  color: #fff;
}

.docs-button--primary:hover {
  background: #0f3f98;
}

.docs-button--secondary {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--docs-line);
}

.docs-button--secondary:hover {
  border-color: rgba(23, 78, 182, 0.4);
  color: var(--docs-blue);
}

.docs-hero__note {
  align-items: flex-start;
  color: #69748a;
  display: flex;
  font-size: 0.84rem;
  gap: 10px;
  line-height: 1.55;
  margin-top: 24px;
  max-width: 620px;
}

.docs-hero__note span {
  background: #e6aa36;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(230, 170, 54, 0.17);
  flex: 0 0 auto;
  height: 7px;
  margin: 6px 4px 0;
  width: 7px;
}

.docs-index {
  background: rgba(255, 254, 250, 0.92);
  border: 1px solid rgba(19, 33, 58, 0.13);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(25, 44, 78, 0.12);
  overflow: hidden;
}

.docs-index__top {
  background: var(--docs-dark);
  color: #fff;
  display: grid;
  gap: 7px;
  padding: 22px 24px;
}

.docs-index__top span {
  color: #a8c5ff;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-index__top strong {
  font-size: 1.1rem;
}

.docs-index li + li {
  border-top: 1px solid var(--docs-line);
}

.docs-index a {
  align-items: flex-start;
  display: grid;
  gap: 16px;
  grid-template-columns: 34px 1fr;
  padding: 20px 24px;
  transition: background-color 160ms ease;
}

.docs-index a:hover {
  background: var(--docs-blue-soft);
}

.docs-index a > span {
  color: var(--docs-blue);
  font: 700 0.73rem/1.4 "JetBrains Mono", monospace;
  padding-top: 2px;
}

.docs-index a div {
  display: grid;
  gap: 3px;
}

.docs-index strong {
  font-size: 0.92rem;
}

.docs-index small {
  color: var(--docs-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

/* Start */
.docs-start {
  background: var(--docs-surface);
}

.docs-start__grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 46px;
}

.docs-start__grid article {
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 285px;
  padding: clamp(24px, 3vw, 34px);
}

.docs-start__grid article > span {
  color: var(--docs-blue);
  font: 700 0.74rem/1.4 "JetBrains Mono", monospace;
}

.docs-start__grid h3 {
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-top: 30px;
}

.docs-start__grid p {
  color: var(--docs-muted);
  font-size: 0.92rem;
  line-height: 1.66;
  margin-top: 14px;
}

.docs-start__grid a {
  color: var(--docs-blue);
  font-size: 0.84rem;
  font-weight: 750;
  margin-top: auto;
  padding-top: 26px;
}

/* Model */
.docs-model {
  background: var(--docs-paper);
}

.docs-model__grid {
  display: grid;
  gap: 36px clamp(34px, 6vw, 76px);
  grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
}

.docs-model__cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-model__cards article {
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  padding: clamp(24px, 3vw, 34px);
}

.docs-chip {
  background: var(--docs-blue-soft);
  border-radius: 999px;
  color: var(--docs-blue);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 6px 9px;
  text-transform: uppercase;
}

.docs-chip--dark {
  background: var(--docs-dark);
  color: #fff;
}

.docs-model__cards h3 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-top: 26px;
}

.docs-model__cards p,
.docs-model__cards li {
  color: var(--docs-muted);
  font-size: 0.89rem;
  line-height: 1.65;
}

.docs-model__cards p {
  margin-top: 13px;
}

.docs-model__cards ul {
  border-top: 1px solid var(--docs-line);
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
}

.docs-model__cards li {
  padding-left: 17px;
  position: relative;
}

.docs-model__cards li::before {
  background: var(--docs-blue);
  border-radius: 50%;
  content: "";
  height: 5px;
  left: 1px;
  position: absolute;
  top: 0.65em;
  width: 5px;
}

.docs-boundary {
  background: var(--docs-blue);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.83);
  grid-column: 2;
  line-height: 1.65;
  padding: 20px 24px;
}

.docs-boundary strong {
  color: #fff;
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* Flow */
.docs-flow {
  background: var(--docs-dark);
  color: #fff;
}

.docs-flow .docs-eyebrow {
  color: #9fbfff;
}

.docs-flow .docs-heading > p:last-child {
  color: rgba(255, 255, 255, 0.66);
}

.docs-flow__steps {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 52px;
}

.docs-flow__steps li {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 260px;
  padding: clamp(24px, 3vw, 32px);
}

.docs-flow__steps li:first-child {
  border-radius: 14px 0 0 14px;
}

.docs-flow__steps li:last-child {
  border-radius: 0 14px 14px 0;
}

.docs-flow__steps span {
  color: #9fbfff;
  font: 700 0.72rem/1.4 "JetBrains Mono", monospace;
}

.docs-flow__steps h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 46px;
}

.docs-flow__steps p {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-top: 12px;
}

.docs-flow__surfaces {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 28px;
  grid-template-columns: 0.7fr 1.3fr;
  margin-top: 52px;
  padding-top: 34px;
}

.docs-flow__surfaces > div p {
  color: #9fbfff;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-flow__surfaces h3 {
  font-size: 1.7rem;
  font-weight: 680;
  letter-spacing: -0.035em;
  margin-top: 7px;
}

.docs-flow__surfaces ul {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-flow__surfaces li {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  padding: 12px 14px;
}

/* Library */
.docs-library {
  background: #eef1f5;
}

.docs-library__grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 48px;
}

.docs-library__grid article {
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  min-height: 240px;
  padding: clamp(24px, 3.2vw, 38px);
}

.docs-library__grid article > span {
  color: var(--docs-blue);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-library__grid h3 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-top: 26px;
}

.docs-library__grid p {
  color: var(--docs-muted);
  line-height: 1.65;
  margin-top: 13px;
}

.docs-library__grid small {
  border-top: 1px solid var(--docs-line);
  color: #69758a;
  display: block;
  font-size: 0.76rem;
  margin-top: 24px;
  padding-top: 16px;
}

.docs-library__note {
  color: #687388;
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 20px;
}

/* Release */
.docs-release {
  background: var(--docs-surface);
}

.docs-release__grid {
  align-items: start;
  display: grid;
  gap: clamp(42px, 8vw, 100px);
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
}

.docs-release h2 {
  margin-top: 16px;
  max-width: 760px;
}

.docs-release__lead {
  margin-top: 22px;
  max-width: 710px;
}

.docs-release dl {
  border-bottom: 1px solid var(--docs-line);
  margin-top: 36px;
}

.docs-release dl div {
  border-top: 1px solid var(--docs-line);
  display: grid;
  gap: 20px;
  grid-template-columns: 150px 1fr;
  padding: 17px 0;
}

.docs-release dt {
  color: #6a7485;
  font-size: 0.78rem;
  font-weight: 650;
}

.docs-release dd {
  font-size: 0.92rem;
  font-weight: 750;
}

.docs-release aside {
  background: var(--docs-dark);
  border-radius: 16px;
  color: #fff;
  padding: clamp(28px, 4vw, 42px);
}

.docs-release aside > p:first-child {
  color: #9fbfff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-release aside h3 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-top: 14px;
}

.docs-release aside ul {
  border-block: 1px solid rgba(255, 255, 255, 0.13);
  display: grid;
  gap: 14px;
  margin-block: 26px 18px;
  padding-block: 24px;
}

.docs-release aside li {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  line-height: 1.5;
  padding-left: 19px;
  position: relative;
}

.docs-release aside li::before {
  background: #81aaff;
  border-radius: 50%;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  top: 0.52em;
  width: 6px;
}

.docs-release aside > p:last-child {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  line-height: 1.62;
}

/* CTA */
.docs-cta {
  background: var(--docs-surface);
  padding: 0 0 clamp(76px, 9vw, 118px);
}

.docs-cta__panel {
  align-items: center;
  background: var(--docs-blue);
  border-radius: 18px;
  color: #fff;
  display: grid;
  gap: 34px;
  grid-template-columns: 1fr auto;
  padding-block: clamp(34px, 5vw, 58px);
}

.docs-cta .docs-eyebrow {
  color: #c8d9ff;
}

.docs-cta h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  margin-top: 12px;
  max-width: 760px;
}

.docs-cta__panel > div > p:last-child {
  color: rgba(255, 255, 255, 0.74);
  margin-top: 15px;
  max-width: 680px;
}

.docs-cta .docs-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.docs-button--light {
  background: #fff;
  color: var(--docs-blue);
}

.docs-button--outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.docs-button--outline:hover {
  background: rgba(255, 255, 255, 0.09);
}

@media (max-width: 980px) {
  .docs-hero__grid,
  .docs-model__grid,
  .docs-release__grid {
    grid-template-columns: 1fr;
  }

  .docs-hero__copy {
    max-width: 780px;
  }

  .docs-index {
    max-width: 720px;
  }

  .docs-boundary {
    grid-column: 1;
  }

  .docs-flow__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-flow__steps li:first-child,
  .docs-flow__steps li:last-child {
    border-radius: 0;
  }

  .docs-flow__steps li:nth-child(1) {
    border-radius: 14px 0 0 0;
  }

  .docs-flow__steps li:nth-child(2) {
    border-radius: 0 14px 0 0;
  }

  .docs-flow__steps li:nth-child(3) {
    border-radius: 0 0 0 14px;
  }

  .docs-flow__steps li:nth-child(4) {
    border-radius: 0 0 14px 0;
  }

  .docs-cta__panel {
    grid-template-columns: 1fr;
  }

  .docs-cta .docs-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .docs-section {
    padding-block: 72px;
  }

  .docs-hero {
    padding-block: calc(var(--header-h, 66px) + 44px) 72px;
  }

  .docs-hero::after {
    display: none;
  }

  .docs-breadcrumb {
    margin-bottom: 28px;
  }

  .docs-hero h1 {
    font-size: clamp(3rem, 14vw, 4.3rem);
  }

  .docs-start__grid,
  .docs-model__cards,
  .docs-library__grid,
  .docs-flow__surfaces {
    grid-template-columns: 1fr;
  }

  .docs-start__grid article {
    min-height: 250px;
  }

  .docs-flow__surfaces ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .docs-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .docs-button {
    width: 100%;
  }

  .docs-index a {
    padding: 18px 20px;
  }

  .docs-flow__steps {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .docs-flow__steps li,
  .docs-flow__steps li:nth-child(n) {
    border-radius: 12px;
    min-height: 220px;
  }

  .docs-release dl div {
    gap: 6px;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.page-bookimatic-docs {
    scroll-behavior: auto;
  }

  .docs-button {
    transition: none;
  }

  .docs-button:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .docs-page :where(.docs-index, article, aside, .docs-boundary, .docs-cta__panel, .docs-button) {
    border: 1px solid CanvasText;
  }

  .docs-hero__note span,
  .docs-model__cards li::before,
  .docs-release aside li::before {
    background: CanvasText;
    box-shadow: none;
  }
}

@media print {
  html.page-bookimatic-docs .site-header,
  html.page-bookimatic-docs .footer,
  .docs-actions {
    display: none !important;
  }

  .docs-page,
  .docs-hero,
  .docs-section,
  .docs-flow,
  .docs-cta {
    background: #fff !important;
    color: #000 !important;
  }

  .docs-hero {
    padding-top: 32px;
  }

  .docs-page :where(p, li, small, .docs-eyebrow) {
    color: #222 !important;
  }

  .docs-page :where(article, aside, .docs-index, .docs-boundary, .docs-cta__panel) {
    background: #fff !important;
    border: 1px solid #777 !important;
    box-shadow: none !important;
    break-inside: avoid;
    color: #000 !important;
  }
}
