/* OppFlow docs — shared shell.
   Deliberately one hand-written stylesheet with no build step: the docs site is
   static HTML served straight out of docs-site/ by Firebase Hosting. Tokens are
   lifted from the marketing site (marcom/) so the two read as one brand. */

:root {
  --ink:        #14161c;
  --ink-2:      #4a5160;
  --ink-3:      #6b7280;   /* >=4.5:1 on white; #8a909e was 3.2:1 */
  --line:       #e3e6ec;
  --line-soft:  #eceef2;
  --bg:         #ffffff;
  --bg-soft:    #f8f9fb;
  --brand:      oklch(0.58 0.2 275);
  --brand-deep: oklch(0.5 0.18 275);
  --brand-wash: oklch(0.965 0.025 275);
  --brand-line: oklch(0.9 0.04 275);
  --sidebar-w:  268px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Links in running prose carry an underline at rest: colour alone is not a
   sufficient distinction (WCAG 1.4.1). Nav, cards and the top bar are
   unambiguously interactive from their layout, so they keep the clean look. */
.content p a, .content li a, .content td a, .note a { text-decoration: underline; text-underline-offset: 2px; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1220px; margin: 0 auto; height: 62px;
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name span { color: var(--brand); }
.brand-tag {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); border-left: 1px solid var(--line);
  padding-left: 12px; margin-left: 4px;
}
.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 14px; }
.topbar-links a { color: var(--ink-2); }
.topbar-cta {
  font-weight: 600; background: var(--ink); color: #fff !important;
  padding: 8px 15px; border-radius: 9px;
}
.topbar-cta:hover { text-decoration: none; }

/* ---------- layout ---------- */

.shell {
  max-width: 1220px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 48px;
  align-items: start;
}

.sidebar {
  position: sticky; top: 62px;
  max-height: calc(100vh - 62px); overflow-y: auto;
  padding: 34px 0 60px;
  border-right: 1px solid var(--line-soft);
}
.nav-group { margin-bottom: 26px; }
.nav-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 10px;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; }
.nav-list a, .nav-list span {
  display: block; padding: 5px 12px 5px 10px; margin-left: -10px;
  border-radius: 7px; font-size: 14.5px; color: var(--ink-2);
  border-left: 2px solid transparent;
}
.nav-list a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav-list a.current {
  color: var(--brand-deep); font-weight: 600;
  background: var(--brand-wash); border-left-color: var(--brand);
}
/* A page that does not exist yet is rendered, not linked. A dead link in the
   nav is worse than an honest "soon". */
.nav-list .soon { color: var(--ink-3); cursor: default; }
.nav-list .soon::after {
  content: 'soon'; float: right;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); padding-top: 3px;
}

.content { padding: 40px 0 100px; max-width: 760px; }

/* ---------- prose ---------- */

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-deep); margin-bottom: 14px;
}
.content h1 {
  font-size: 40px; line-height: 1.08; letter-spacing: -0.03em;
  font-weight: 700; margin: 0 0 16px; text-wrap: pretty;
}
.lede { font-size: 18.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 32px; text-wrap: pretty; }
.content h2 {
  font-size: 25px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700;
  margin: 52px 0 14px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  text-wrap: pretty;
}
.content h3 { font-size: 17.5px; font-weight: 700; margin: 30px 0 8px; letter-spacing: -0.01em; }
.content p { margin: 0 0 16px; color: var(--ink-2); }
.content strong { color: var(--ink); font-weight: 600; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.content li { margin-bottom: 7px; }
.content li::marker { color: var(--ink-3); }

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .87em; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 1.5px 5px; color: var(--ink);
}
pre {
  background: #14161c; color: #e7e9ef; border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.6;
  margin: 0 0 20px;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 13px; }

table { border-collapse: collapse; width: 100%; margin: 0 0 22px; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; font-size: 13px; }
td { color: var(--ink-2); }

/* ---------- callouts ---------- */

.note {
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  background: var(--bg-soft); border-radius: 10px;
  padding: 14px 18px; margin: 0 0 22px; font-size: 15px; color: var(--ink-2);
}
.note.warn { border-left-color: #d99a2b; background: #fdf8ef; }
.note.stop { border-left-color: #cf4a4a; background: #fdf2f2; }
.note-label {
  display: block; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 5px;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- card grid (index pages) ---------- */

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 0 0 28px; }
.card {
  display: block; border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; color: var(--ink); background: #fff;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  text-decoration: none; transform: translateY(-2px); border-color: var(--brand-line);
  box-shadow: 0 16px 32px -20px rgba(20, 22, 28, .3);
}
.card-title { font-size: 16.5px; font-weight: 700; margin-bottom: 5px; letter-spacing: -0.01em; }
.card p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.card.pending {
  background: var(--bg-soft); border-style: dashed; box-shadow: none;
}
.card.pending:hover { transform: none; border-color: var(--line); }
.card.pending .card-title { color: var(--ink-2); font-weight: 600; }
.card.pending .card-title::after {
  content: ' · soon'; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line-soft); margin-top: 60px; padding-top: 22px;
  font-size: 13.5px; color: var(--ink-3);
  display: flex; gap: 18px; flex-wrap: wrap;
}
.foot a { color: var(--ink-3); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  /* minmax(0,...), not a bare 1fr: `1fr` means minmax(auto,1fr), so a wide
     <pre> or <table> sets a min-content floor that widens the whole grid and
     scrolls the page sideways. */
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar {
    position: static; max-height: none; border-right: 0;
    border-bottom: 1px solid var(--line-soft); padding: 14px 0;
  }
  /* Higher specificity than the base `.navbox > summary { display: none }`
     below, which is defined later in the file. */
  .sidebar .navbox > summary { display: flex; }
  .nav-group:last-child { margin-bottom: 6px; }
  .content { padding-top: 28px; }
  .content h1 { font-size: 32px; }
  .cards { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  .topbar-links a:not(.topbar-cta) { display: none; }
}

/* ---------- mobile nav disclosure ---------- */

.navbox > summary {
  display: none;                 /* desktop: the tree is simply always open */
  align-items: center; gap: 9px; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-soft);
}
.navbox > summary::-webkit-details-marker { display: none; }
.navbox > summary::after {
  content: '▾'; margin-left: auto; color: var(--ink-3); font-size: 12px;
  transition: transform .15s;
}
.navbox[open] > summary::after { transform: rotate(180deg); }
.navbox[open] > summary { margin-bottom: 16px; }

/* ---------- skip link ---------- */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 0 0 9px 0; font-size: 14px; font-weight: 600;
}
.skip:focus { left: 0; text-decoration: none; }

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