/* networking.joeit.net — shared stylesheet */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #dde3ea;
  --accent: #0b6bcb;
  --accent-soft: #e6f0fb;
  --header-bg: #0f1b2d;
  --header-text: #e9eef5;
  --code-bg: #0f1b2d;
  --code-text: #d7e3f4;
  --warn-bg: #fff6e0;
  --warn-border: #e0a800;
  --tip-bg: #e8f7ee;
  --tip-border: #2e9d5b;
  --radius: 10px;
  --max: 1000px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d131c;
    --surface: #151d29;
    --text: #e3e9f1;
    --muted: #9aa7b8;
    --border: #263243;
    --accent: #5aa9f5;
    --accent-soft: #1a2a40;
    --header-bg: #08101a;
    --code-bg: #08101a;
    --warn-bg: #2b2412;
    --tip-bg: #12271b;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logo {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .3px;
}
.logo span { color: #5aa9f5; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: block;
  color: var(--header-text);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: .95rem;
}
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: #0b6bcb; color: #fff; }

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 16px 56px;
}

.hero {
  background: linear-gradient(135deg, #0f1b2d 0%, #0b4f96 100%);
  color: #fff;
  padding: 56px 16px;
  text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: 2.3rem; line-height: 1.2; }
.hero p { margin: 0 auto; max-width: 640px; color: #d4e3f5; font-size: 1.1rem; }

.page-title { margin-bottom: 28px; }
.page-title h1 { margin: 0 0 6px; font-size: 2rem; line-height: 1.25; }
.page-title p { margin: 0; color: var(--muted); }

h2 {
  margin-top: 44px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  font-size: 1.5rem;
}
h3 { margin-top: 28px; font-size: 1.18rem; }

/* ---------- Table of contents ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.card h3 { margin-top: 0; }
.card p { color: var(--muted); flex: 1; }
.card .btn { align-self: flex-start; }

.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: .95rem;
}
.btn:hover { filter: brightness(1.1); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--accent-soft); white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* ---------- Code ---------- */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.5;
}
code {
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
p code, li code, td code {
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .88em;
}
.code-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  margin: 18px 0 -8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Callouts ---------- */
.note, .tip {
  border-left: 4px solid;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 18px 0;
}
.note { background: var(--warn-bg); border-color: var(--warn-border); }
.tip  { background: var(--tip-bg);  border-color: var(--tip-border); }
.note p, .tip p { margin: 0; }

/* ---------- Diagrams (pure CSS) ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 520px;
  margin: 18px auto;
}
.stack div {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
}
.stack small { font-weight: 400; opacity: .9; }
.l7 { background: #6a3fb5; } .l6 { background: #4f52c4; }
.l5 { background: #2f6fd1; } .l4 { background: #1a8ab8; }
.l3 { background: #179a83; } .l2 { background: #4d9a2f; }
.l1 { background: #a07a14; }

/* ---------- Quiz ---------- */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
}
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: .9rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.8rem; }
  .page-title h1 { font-size: 1.6rem; }
  .nav-wrap { justify-content: center; }
}
