/*
 * Wire Lang documentation stylesheet.
 * Self-contained, brand-aligned, and intentionally simple so the docs render
 * as plain crawlable HTML with no client-side framework.
 */

:root {
  --ink: #16181d;
  --ink-soft: #1c1f26;
  --ink-line: rgba(255, 255, 255, 0.1);
  --paper: #faf9f7;
  --signal: #00a7cb;
  --graphite: #9a978e;
  --graphite-soft: #6f6c64;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;

  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--signal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout ── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--ink-line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--paper);
}

.brand:hover {
  text-decoration: none;
}

.brand .dot {
  color: var(--signal);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
}

.site-nav a {
  color: var(--graphite);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--paper);
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 40px 0 80px;
}

/* ── Sidebar ── */
.sidebar nav {
  position: sticky;
  top: 32px;
}

.sidebar h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--signal);
  margin: 0 0 12px;
}

.sidebar ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.sidebar li {
  margin: 0;
}

.sidebar a {
  display: block;
  padding: 5px 0;
  color: var(--graphite);
  font-size: 14.5px;
}

.sidebar a:hover,
.sidebar a[aria-current="page"] {
  color: var(--paper);
  text-decoration: none;
}

.sidebar a[aria-current="page"] {
  border-left: 2px solid var(--signal);
  padding-left: 10px;
  margin-left: -12px;
}

/* ── Article ── */
.content {
  max-width: var(--content-width);
  min-width: 0;
}

.content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 8px;
}

.content .lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--paper);
  margin: 0 0 32px;
}

.content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--ink-line);
}

.content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 8px;
}

.content p,
.content li {
  color: #d9d7d1;
}

.content ul,
.content ol {
  padding-left: 22px;
}

.content li {
  margin: 6px 0;
}

.content strong {
  color: var(--paper);
  font-weight: 600;
}

/* ── Code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

p code,
li code,
td code {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 4px;
  padding: 1px 6px;
  color: #e6e4de;
  white-space: nowrap;
}

pre {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.6;
}

pre code {
  font-size: 13.5px;
  color: #e6e4de;
  white-space: pre;
}

/* keyword tint for .wire / shell prompts is applied inline via <b> tokens */
pre .kw {
  color: var(--signal);
}

pre .cm {
  color: var(--graphite-soft);
  font-style: italic;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--ink-line);
  vertical-align: top;
}

th {
  color: var(--paper);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

td {
  color: #cfcdc7;
}

/* ── Callouts ── */
.note {
  border: 1px solid var(--ink-line);
  border-left: 3px solid var(--signal);
  background: rgba(0, 167, 203, 0.06);
  border-radius: 6px;
  padding: 12px 18px;
  margin: 20px 0;
  font-size: 14.5px;
}

.note p {
  margin: 6px 0;
}

/* ── Figures ── */
figure {
  margin: 20px 0;
  background: var(--paper);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
}

figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--graphite-soft);
}

/* ── Cards (docs home) ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  display: block;
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--ink-soft);
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: rgba(0, 167, 203, 0.5);
  text-decoration: none;
}

.card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--paper);
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--graphite);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--ink-line);
  padding: 28px 0;
  font-size: 13.5px;
  color: var(--graphite-soft);
}

.site-footer a {
  color: var(--graphite);
}

.next-prev {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
  font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sidebar nav {
    position: static;
  }
  .sidebar {
    border-bottom: 1px solid var(--ink-line);
    padding-bottom: 16px;
  }
}

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