/* docs.openapps.network — the openapps.network chrome, with a docs column in the middle. */

@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  /* Brand palette, verbatim from the OpenApps token system (as openapps.network). */
  --green: #00c896;
  --green-lift: #4fdcb8;
  --blue: #15b9eb;
  --ink: #0b0b0b;
  --surface: #141516;
  --card: #101010;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --fg: #ffffff;
  --fg-2: rgba(255,255,255,0.66);
  --fg-3: rgba(255,255,255,0.5);
  --font: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: 48px;
  --wrap: 1200px;
  --header-height: 64px;
  --radius: 12px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
@media (max-width: 900px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); color: var(--fg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure, pre { margin: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ---- type */
.eyebrow { font: 400 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }

/* ---- brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-tile { width: 26px; height: 26px; flex: none; }
.brand-word { font: 500 19px/1 var(--font); letter-spacing: -0.04em; }
.brand-word .o { color: var(--fg-3); }
.brand-word .dot { color: var(--green); }
.brand-sub { font: 400 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line-strong); }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 10px; font: 500 15px/1 var(--font); border: 1px solid transparent; cursor: pointer; transition: background 160ms var(--ease), border-color 160ms var(--ease); white-space: nowrap; }
.btn-primary { background: var(--green); color: #04130e; }
.btn-primary:hover { background: var(--green-lift); }
.btn-secondary { border-color: var(--line-strong); color: var(--fg); }
.btn-secondary:hover { border-color: rgba(255,255,255,0.3); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 8px; }

/* ---- header: three zones, 64px, sticky */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in oklab, var(--ink) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 32px; height: var(--header-height); }
.site-nav { display: flex; gap: 24px; flex: 1; }
.site-nav a, .header-actions > a:not(.btn) { font: 400 13px/1 var(--font); color: var(--fg-2); transition: color 120ms var(--ease); }
.site-nav a:hover, .header-actions > a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.header-actions { display: flex; align-items: center; gap: 20px; }
@media (max-width: 760px) {
  .site-header .container { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 0 16px; }
  .site-nav { order: 3; flex-basis: 100%; gap: 18px; padding-block: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 430px) { .header-actions > a:not(.btn) { display: none; } .header-actions { gap: 12px; } .brand-sub { display: none; } }

/* ---- docs layout: sidebar + article */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-height) + 32px); padding-block: 48px; display: grid; gap: 22px; max-height: calc(100vh - var(--header-height) - 32px); overflow-y: auto; scrollbar-width: thin; }
.sidebar .group { display: grid; gap: 8px; }
.sidebar .group > .eyebrow::before { display: none; }
.sidebar a { font-size: 14px; color: var(--fg-2); line-height: 1.35; }
.sidebar a:hover { color: var(--fg); }
.sidebar a[aria-current="page"] { color: var(--fg); }
.sidebar a.sub { padding-left: 12px; font-size: 13px; color: var(--fg-3); border-left: 1px solid var(--line); }
.sidebar a.sub:hover { color: var(--fg); }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { position: static; max-height: none; padding-block: 28px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .on-page { display: none; }
}

/* ---- the article */
.doc { padding-block: 48px 96px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 46rem; min-width: 0; }
.doc h1 { font: 500 clamp(34px, 4.6vw, 52px)/1.06 var(--font); letter-spacing: -0.035em; }
.doc h2 { font: 500 clamp(22px, 2.2vw, 28px)/1.2 var(--font); letter-spacing: -0.02em; margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--line); }
.doc h3 { font: 500 18px/1.3 var(--font); letter-spacing: -0.01em; margin-top: 14px; }
.doc h2, .doc h3 { scroll-margin-top: 5.5rem; }
@media (max-width: 760px) { .doc h2, .doc h3 { scroll-margin-top: 7.5rem; } }
.doc p, .doc li { color: var(--fg-2); font-size: 16px; line-height: 1.65; }
.doc .lede { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; }
.doc ul, .doc ol { display: grid; gap: 8px; padding-left: 22px; }
.doc ul { list-style: disc; }
.doc a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.doc a:hover { text-decoration-color: var(--fg); }
.doc strong { color: var(--fg); font-weight: 500; }
.doc .updated { font: 400 13px/1.4 var(--mono); color: var(--fg-3); }
.doc code { font: 400 0.9em/1 var(--mono); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0.12em 0.36em; overflow-wrap: anywhere; }
.doc pre { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font: 400 13px/1.6 var(--mono); color: var(--fg-2); }
.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; line-height: inherit; color: inherit; overflow-wrap: normal; }
.doc pre .c { color: var(--fg-3); }
.doc pre .k { color: var(--fg); }
.doc .table { overflow-x: auto; }
.doc table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--line); color: var(--fg-2); line-height: 1.5; }
.doc th { font-weight: 500; color: var(--fg); }
.doc td code { white-space: nowrap; }

/* Status chips: the accent only ever as a tint behind text, or a dot. */
.status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font: 400 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; vertical-align: 2px; border: 1px solid var(--line-strong); color: var(--fg-2); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.live { background: color-mix(in oklab, var(--green) 16%, transparent); border-color: transparent; color: var(--green-lift); }
.status.building { background: color-mix(in oklab, var(--blue) 16%, transparent); border-color: transparent; color: #7fd6f2; }
.status.planned { color: var(--fg-3); }

.note { border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; }
.note p { font-size: 15px; }
.note .eyebrow { font-size: 11px; }

/* Card grid for "where next" and "the pieces". */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 6px; }
.card { display: grid; gap: 8px; align-content: start; padding: 20px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none !important; transition: background 160ms var(--ease); }
a.card:hover { background: var(--surface); }
.card h3 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card p { font-size: 14.5px; line-height: 1.55; }
.card small { font: 400 12px/1.3 var(--mono); color: var(--fg-3); overflow-wrap: anywhere; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

/* Numbered steps. */
.steps { counter-reset: step; list-style: none !important; padding-left: 0 !important; gap: 0 !important; border-top: 1px solid var(--line); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.steps > li::before { content: counter(step, decimal-leading-zero); font: 400 13px/1.9 var(--mono); color: var(--fg-3); grid-row: span 3; }
.steps > li > strong { display: block; color: var(--fg); }
.steps > li > span { display: block; }
.steps > li > pre { margin-top: 8px; }

/* The flow diagram. */
.diagram { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 18px; margin-top: 6px; }
.diagram .scroll { overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 620px; height: auto; }
.diagram figcaption { margin-top: 12px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }

/* ---- footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer > .container { padding-block: 56px 32px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer-about { display: grid; gap: 14px; align-content: start; }
.footer-about p { color: var(--fg-2); max-width: 340px; font-size: 14px; }
.footer-group { display: flex; flex-direction: column; gap: 10px; }
.footer-group .eyebrow::before { display: none; }
.footer-group a { color: var(--fg-2); font-size: 13px; }
.footer-group a:hover { color: var(--fg); }
.footer-base { border-top: 1px solid var(--line); }
.footer-base a { text-decoration: underline; text-underline-offset: 3px; }
.footer-base .container { padding-block: 20px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--fg-3); }
@media (max-width: 900px) { .site-footer > .container { grid-template-columns: repeat(2, 1fr); } }

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