/* Arkna · Developer Docs · v8 sealed-index brand (2026-06-20)
   Schibsted Grotesk + Hanken Grotesk + IBM Plex Mono. One accent: Persian Blue.
   Matches branding-assets/arkna-tokens.css. 1px rules, no shadows. */

:root {
  /* Surfaces */
  --bg:        #F7F8F9;   /* Mist */
  --bg-2:      #ECEDEF;   /* recessed — Hair tone */
  --bg-code:   #0B0B0D;   /* Ink ground for code blocks */

  /* Ink scale */
  --ink:       #0B0B0D;   /* Ink */
  --ink-2:     #34373C;
  --ink-3:     #52575F;   /* Slate */
  --ink-4:     #8A8F98;   /* muted */
  --ink-5:     #A6ABB2;

  /* Brand — one accent: Persian Blue */
  --accent:        #1C39BB;
  --accent-deep:   #142A8C;
  --accent-soft:   #EAEDFB;

  /* Method colours — ink scale; the text label carries the meaning */
  --get:    #52575F;
  --post:   #0B0B0D;
  --patch:  #34373C;
  --delete: #0B0B0D;
  --sse:    #52575F;

  /* Borders */
  --line:       #E3E4E7;   /* Hair 2 */
  --line-soft:  #ECEDEF;   /* Hair */

  /* Type */
  --sans:    'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif:   'Hanken Grotesk', -apple-system, sans-serif;

  /* Layout */
  --sidebar-w: 264px;
  --toc-w:     220px;
  --header-h:  64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  letter-spacing: -0.005em;
}

/* ------------------------------- Sidebar ------------------------------- */
.docs-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--line);
  color: var(--ink);
  overflow-y: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.docs-sidebar .logo {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.docs-sidebar .logo-text {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.docs-sidebar .logo-badge {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  background: transparent;
  padding: 0;
  margin-left: auto;
  font-weight: 400;
  align-self: center;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.sidebar-section { padding: 0 12px; margin-bottom: 4px; }
.sidebar-section-title {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-5);
  padding: 14px 12px 8px;
}

.sidebar-link {
  display: block;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-3);
  text-decoration: none;
  border-radius: 0;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.sidebar-link:hover { color: var(--ink); background: var(--bg-2); }
.sidebar-link.active {
  color: var(--ink);
  background: transparent;
  border-left-color: var(--accent);
  font-weight: 500;
}

/* ----------------------------- Sticky header ----------------------------- */
.docs-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 32px;
  z-index: 30;
  gap: 12px;
}
.docs-header .breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.docs-header .breadcrumb a { color: var(--ink-4); text-decoration: none; }
.docs-header .breadcrumb a:hover { color: var(--ink); }
.docs-header .breadcrumb .sep { margin: 0 8px; color: var(--ink-5); }
.docs-header .breadcrumb .current { color: var(--ink); font-weight: 500; }
.version-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  padding: 4px 10px;
  border-radius: 0;
}

/* Mobile hamburger */
.mobile-toggle {
  display: none;
  position: fixed; top: 14px; left: 12px;
  z-index: 50;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 18px;
  align-items: center; justify-content: center;
}

/* ------------------------------- Main ------------------------------- */
.docs-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}
.docs-content {
  max-width: 760px;
  width: 100%;
  padding: 56px 44px 96px;
}

/* ----------------------------- Right TOC ----------------------------- */
.docs-toc {
  position: fixed;
  top: calc(var(--header-h) + 28px);
  right: 28px;
  width: var(--toc-w);
  max-height: calc(100vh - var(--header-h) - 56px);
  overflow-y: auto;
  display: none;
}
.docs-toc .toc-title {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-5);
  margin-bottom: 10px;
}
.docs-toc a {
  display: block;
  font-size: 13px;
  color: var(--ink-4);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--line);
  transition: color 0.15s, border-color 0.15s;
}
.docs-toc a:hover { color: var(--ink-2); }
.docs-toc a.active {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 500;
}
.docs-toc a.toc-h3 { padding-left: 24px; font-size: 12px; }

@media (min-width: 1280px) {
  .docs-toc { display: block; }
  .docs-main { padding-right: calc(var(--toc-w) + 60px); }
}

/* ---------------------------- Typography ---------------------------- */
.docs-content h1 {
  font-family: var(--sans);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 14px;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.docs-content h1 em,
.docs-content h2 em,
.docs-content h3 em {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}
.docs-content h2 {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 56px;
  margin-bottom: 14px;
  color: var(--ink);
  letter-spacing: -0.018em;
  padding-bottom: 0;
  border-bottom: 0;
}
.docs-content h2::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--ink);
  margin-bottom: 18px;
}
.docs-content h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 10px;
  color: var(--ink);
  letter-spacing: -0.012em;
}
.docs-content p {
  margin-bottom: 16px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}
.docs-content .lead {
  font-size: 18px;
  color: var(--ink-3);
  line-height: 1.55;
  margin-bottom: 32px;
  max-width: 620px;
}
.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 22px;
}
.docs-content li {
  margin-bottom: 6px;
  color: var(--ink-2);
}
.docs-content li::marker { color: var(--ink-5); }
.docs-content a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 17, 17, 0.3);
}
.docs-content a:hover { border-bottom-color: var(--ink); }
.docs-content strong { color: var(--ink); font-weight: 600; }

/* ------------------------------- Code ------------------------------- */
code {
  font-family: var(--mono);
  font-size: 13.5px;
}
:not(pre) > code {
  background: var(--bg-2);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 0;
  border: 1px solid var(--line);
  font-size: 13px;
}

pre {
  background: var(--bg-code) !important;
  border-radius: 0;
  padding: 0 !important;
  margin-bottom: 22px;
  overflow: hidden;
  position: relative;
  border: 1px solid #1a1a1a;
}
pre code {
  display: block;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: #e5e5e3;
  background: transparent;
  border: 0;
}

/* Prism token overrides — grayscale on near-black, no colour */
pre code .token.keyword     { color: #ffffff; font-weight: 500; }
pre code .token.string      { color: #c9c9c5; }
pre code .token.comment     { color: #8a8a86; font-style: italic; }
pre code .token.function    { color: #f0f0ec; }
pre code .token.number      { color: #c9c9c5; }
pre code .token.operator    { color: #e5e5e3; }
pre code .token.punctuation { color: rgba(229, 229, 227, 0.55); }
pre code .token.property    { color: #f0f0ec; }
pre code .token.boolean     { color: #ffffff; font-weight: 500; }
pre code .token.class-name,
pre code .token.builtin,
pre code .token.constant,
pre code .token.symbol      { color: #f0f0ec; }
pre code .token.tag,
pre code .token.attr-name,
pre code .token.selector    { color: #e5e5e3; }
pre code .token.attr-value,
pre code .token.char,
pre code .token.regex,
pre code .token.url         { color: #c9c9c5; }
pre code .token.variable    { color: #e5e5e3; }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: rgba(255, 255, 255, 0.85); }
.copy-btn.copied { color: #ffffff; border-color: rgba(255, 255, 255, 0.4); }

/* ---------------------------- Language tabs ---------------------------- */
.code-tabs { margin-bottom: 22px; }

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-code);
  border: 1px solid #1a1a1a;
  border-bottom: none;
  border-radius: 0;
  overflow: hidden;
}
.tab-btn {
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: rgba(255, 255, 255, 0.85); }
.tab-btn.active { color: #fff; border-bottom-color: #ffffff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel pre { border-radius: 0; margin-bottom: 0; border-top: none; }
.tab-panel pre + pre { border-radius: 0; margin-top: 10px; border-top: 1px solid #1a1a1a; }
.tab-file-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  margin: 0.5rem 0 0.25rem;
  letter-spacing: 0.04em;
}
.tab-file-hint code { font-size: 11px; }

/* ------------------------------- Cards ------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  border-color: var(--ink-5);
  transform: translateY(-1px);
  text-decoration: none;
}
.card-icon {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--accent);
}
.card-icon svg { width: 18px; height: 18px; }
.card h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 0;
  border: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card h3::before { display: none; }
.card p {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-bottom: 0;
  line-height: 1.55;
}

a.card { text-decoration: none; color: inherit; border-bottom: 0; }
a.card:hover { text-decoration: none; border-bottom: 0; }

/* ------------------------------ Tables ------------------------------ */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
  font-size: 14px;
}
.docs-content th, .docs-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.docs-content th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  background: transparent;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ------------------------------ Badges ------------------------------ */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid currentColor;
  background: transparent;
}
.badge-get    { color: var(--get); }
.badge-post   { color: var(--post); }
.badge-patch  { color: var(--patch); }
.badge-delete { color: var(--delete); }
.badge-sse    { color: var(--sse); }

/* --------------------------- Endpoint blocks --------------------------- */
.endpoint {
  border: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--bg);
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.endpoint-header .path {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.endpoint-header .scope {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.endpoint-body { padding: 18px; }

/* ------------------------------ Callouts ------------------------------ */
.callout {
  padding: 14px 16px;
  border-radius: 0;
  margin-bottom: 22px;
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-left: 2px solid;
  background: var(--bg-2);
  color: var(--ink-2);
  line-height: 1.55;
}
.callout-icon { flex-shrink: 0; margin-top: 1px; color: inherit; }
.callout-icon svg { width: 16px; height: 16px; }
.callout-info    { border-left-color: var(--ink); }
.callout-info .callout-icon { color: var(--ink); }
.callout-warn    { border-left-color: var(--ink-2); }
.callout-warn .callout-icon { color: var(--ink-2); }
.callout-success { border-left-color: var(--ink-3); }
.callout-success .callout-icon { color: var(--ink-3); }

/* ------------------------------- Hero ------------------------------- */
.hero {
  padding: 24px 0 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 44px;
}
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(36px, 4.5vw, 48px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  color: var(--ink);
}
.hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
}
.hero h1::before { display: none; }
.hero .lead {
  font-size: 18px;
  max-width: 620px;
  color: var(--ink-3);
}
.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Buttons — square, unfilled inverts on hover, per the mono register */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: -0.005em;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--ink);
  color: var(--bg) !important;
  border-color: var(--ink);
}
.btn-primary:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink) !important;
}
.btn-secondary {
  background: transparent;
  color: var(--ink) !important;
  border-color: var(--line);
}
.btn-secondary:hover {
  background: var(--bg-2);
  border-color: var(--ink-5);
}

/* --------------------------- Architecture diagram --------------------------- */
.arch-diagram {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 28px 20px;
  margin: 28px 0;
}
.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.arch-node {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  text-align: center;
  min-width: 0;
  flex: 1 1 0;
  max-width: 140px;
}
.arch-node.highlight {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.arch-node .node-label {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.arch-node .node-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.arch-arrow {
  width: 28px;
  text-align: center;
  color: var(--ink-5);
  font-size: 16px;
  flex-shrink: 0;
}

/* -------------------------------- Steps -------------------------------- */
.step {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
}
.step-number {
  width: 28px; height: 28px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content { flex: 1; min-width: 0; }
.step-content h3 { margin-top: 0; font-size: 15.5px; }
.step-content h3::before { display: none; }

/* ----------------------------- Lifecycle ----------------------------- */
.lifecycle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
  font-size: 13px;
}
.lifecycle-node {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 0;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.lifecycle-node.green { color: var(--ink-3); border-color: var(--line); }
.lifecycle-node.amber { color: var(--ink-2); border-color: var(--ink-5); }
.lifecycle-node.red   { color: var(--ink); border-color: var(--ink); }
.lifecycle-arrow { color: var(--ink-5); }

/* ------------------------------- Footer ------------------------------- */
.docs-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  margin-top: 56px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}
.docs-footer a { color: var(--ink-4); text-decoration: none; border-bottom: 0; }
.docs-footer a:hover { color: var(--ink); }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 768px) {
  .docs-sidebar { transform: translateX(-100%); }
  .docs-sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: flex; }
  .docs-header { left: 0; padding-left: 56px; }
  .docs-main { margin-left: 0; }
  .docs-content { padding: 36px 18px 64px; }
  .hero h1 { font-size: 30px; }
  .card-grid { grid-template-columns: 1fr; }
  .arch-diagram { padding: 18px; }
  .tab-btn { padding: 8px 12px; font-size: 11.5px; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  z-index: 35;
}
.sidebar-overlay.open { display: block; }
