/* ------------------------------------------------------------------
   Documentation (documentation.html): left page navigation + content.
   Tokens (--blue, --ink, --line ...) come from styles.css.
   ------------------------------------------------------------------ */
.docs {
  width: 85%;
  max-width: 1251px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) var(--gutter) 88px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 72px);
  align-items: start;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---- Left navigation ------------------------------------------------ */
.docs__side {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
}
.docs-nav__group + .docs-nav__group { margin-top: 28px; }
.docs-nav__heading {
  margin: 0 0 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6E6E78;
}
.docs-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  transition: background-color .15s ease, color .15s ease;
}
a.docs-nav__link:hover { background: rgba(17, 7, 164, .05); color: var(--blue); }
.docs-nav__link.is-active {
  background: rgba(17, 7, 164, .08);
  color: var(--blue);
  font-weight: 600;
}
.docs-nav__link.is-parent { color: var(--blue); }
/* a section of the page above it: indented under a guide line */
.docs-nav__sub {
  margin: 2px 0 2px 16px;
  padding: 6px 12px;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.docs-nav__sub.is-active { border-left-color: var(--blue); }
.docs-nav__link.is-soon { color: #6E6E78; cursor: default; }
.docs-nav__soon {
  flex: none;
  padding: 2px 8px;
  border-radius: 100px;
  background: #F0F0F4;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .02em;
  color: #6E6E78;
}

/* ---- Content -------------------------------------------------------- */
/* Text stays at a comfortable measure (760px); a --wide section (one with a
   figure) may use the full column. */
.docs__main { min-width: 0; max-width: 900px; }
.docs-page__lead,
.docs-section { max-width: 760px; }
.docs-section--wide { max-width: none; }
.docs-section--wide > p,
.docs-section--wide > .docs-steps { max-width: 760px; }
.docs-page[hidden] { display: none; }

.docs-page__title {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.docs-page__lead {
  margin: 20px 0 0;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
  text-wrap: pretty;
  color: var(--ink-soft);
}

.docs-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.docs-section h2 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.docs-section p,
.docs-section li {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.docs-section p { margin: 0 0 14px; }
.docs-section ul { margin: 8px 0 18px 24px; padding: 0; }
.docs-section li { margin-bottom: 6px; }
.docs-section strong,
.docs-section b { color: var(--ink); font-weight: 600; }
/* links in running text are underlined: colour alone is too close to the body text */
.docs-section a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.docs-section a:hover { text-decoration-thickness: 2px; }
.docs-section--last { margin-bottom: 0; }

/* Figure: a drawn still of the app */
.docs-figure { margin: 28px 0 32px; }
.docs-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(17, 7, 164, .08);
}
.docs-figure figcaption { margin-top: 10px; font-size: 14px; color: #6E6E78; }
/* Phones: the still is a whole app window, unreadable at 350px wide. Show it
   at a legible 760px inside a strip that scrolls sideways (the numbered
   notes below refer to it). */
@media (max-width: 600px) {
  .docs-figure:not(.docs-figure--anim) {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin-right: calc(-1 * var(--gutter, 16px));
    padding: 2px var(--gutter, 16px) 12px 2px;
  }
  .docs-figure:not(.docs-figure--anim) img { width: 760px; max-width: none; }
  .docs-figure:not(.docs-figure--anim) figcaption { position: sticky; left: 0; max-width: calc(100vw - 2 * var(--gutter, 16px)); }
}
/* animated walkthrough: an iframe at the 1380 x 900 stage proportions (the landing page's 2D replica) */
.docs-figure iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1380 / 900;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(17, 7, 164, .08);
}

/* Numbered notes that match the numbers in the figure */
.docs-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.docs-section .docs-steps li {
  position: relative;
  margin: 0 0 18px;
  padding-left: 46px;
  counter-increment: step;
}
.docs-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

/* Three principles */
/* One joined row, as the pricing cards: a tint that flows down from the top
   and whitens to the bottom, fine grain on top, and hairline gradient
   separators between neighbours that fade out at both ends. */
.docs-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 24px;
}
.docs-point {
  --tint: transparent;
  --tint-hi: transparent;
  position: relative;
  isolation: isolate;
  padding: 22px 22px 26px;
  border-radius: 0;
  background:
    radial-gradient(90% 45% at 22% 0%, var(--tint-hi), transparent 72%),
    linear-gradient(to bottom, var(--tint) 0%, #fff 62%);
}
.docs-point:first-child { border-radius: 18px 0 0 18px; --tint: #E4ECF8; --tint-hi: #D3E0F4; }  /* cool steel blue */
.docs-point:nth-child(2) { --tint: #DFDCFB; --tint-hi: #CBC6F8; }                              /* Nodus lavender */
.docs-point:last-child { border-radius: 0 18px 18px 0; --tint: #F2E8DA; --tint-hi: #EADBC6; }  /* warm sand */

/* Grain: dark speckle, strongest at the top, gone where the card turns white */
.docs-point::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .1  0 0 0 0 .2  -3 0 0 0 1.6'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>") repeat;
  opacity: .22;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
}

/* Vertical separator between neighbours, fading out at both ends */
.docs-point + .docs-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, rgba(17, 17, 24, .14) 18%, rgba(17, 17, 24, .14) 82%, transparent 100%);
}
.docs-point h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--blue); }
.docs-section .docs-point p { margin: 0; font-size: 15px; line-height: 1.6; }

/* ---- Phones / narrow: navigation moves above the content ------------ */
@media (max-width: 980px) {
  /* stacked: back to separate rounded cards */
  .docs-points { grid-template-columns: 1fr; gap: 12px; }
  .docs-point,
  .docs-point:first-child,
  .docs-point:last-child { border-radius: 16px; border: 1px solid var(--line); }
  .docs-point + .docs-point::before { display: none; }
}
@media (max-width: 820px) {
  .docs {
    width: 100%;
    display: block;
    padding-top: 28px;
  }
  .docs__side {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0 0 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
  }
  .docs-nav__group + .docs-nav__group { margin-top: 18px; }
  .docs-nav__heading { padding: 0; }
  .docs-nav { display: block; }
  .docs-nav__group { display: flex; flex-wrap: wrap; gap: 6px; }
  .docs-nav__heading { flex: 0 0 100%; margin-bottom: 2px; }
  .docs-nav__link { padding: 7px 12px; border: 1px solid var(--line); background: var(--bg); }
  .docs-nav__link.is-active { border-color: rgba(17, 7, 164, .25); }
  .docs-nav__sub { margin: 0; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; color: var(--ink); }
}
