@font-face { font-family: Inter; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #ffffff; --bg-soft: #f7f7fb; --panel: #ffffff; --line: #e6e6ef; --text: #1d1d2b; --muted: #6b6b80;
  --accent: #662C91; --accent-soft: #f3ebf9; --accent-text: #4e1f71; --code: #f3f3f8; --shadow: 0 1px 2px rgba(20,20,40,.05), 0 4px 16px rgba(20,20,40,.05);
  --topbar: 60px; --side: 280px; --toc: 230px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1017; --bg-soft: #151722; --panel: #171925; --line: #262938; --text: #e7e7f0; --muted: #9a9cb1;
    --accent: #19e3c6; --accent-soft: #123a3a; --accent-text: #7ff3e2; --code: #1d2030; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1017; --bg-soft: #151722; --panel: #171925; --line: #262938; --text: #e7e7f0; --muted: #9a9cb1;
  --accent: #19e3c6; --accent-soft: #123a3a; --accent-text: #7ff3e2; --code: #1d2030; --shadow: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.logo.big { width: 72px; height: 72px; font-size: 28px; border-radius: 18px; }
.menu-btn { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; min-width: 0; }
.search:focus-within { border-color: var(--accent); }
.results { position: absolute; top: 44px; left: 0; right: 0; max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 6px; }
.results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.results a:hover, .results a.active { background: var(--accent-soft); text-decoration: none; }
.results small { display: block; color: var(--muted); font-size: 12px; }
.results .snip { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.results mark { background: transparent; color: var(--accent-text); font-weight: 600; }
.results .empty { padding: 10px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 500 14px/1 Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* layout */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); max-width: 1440px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 20px 14px 40px; border-right: 1px solid var(--line); font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree li a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--muted); line-height: 1.4; }
.tree li a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.tree a[aria-current="page"] { color: var(--accent-text) !important; background: var(--accent-soft) !important; font-weight: 600; }
.tree .top { color: var(--text); font-weight: 600; }
.tree details { margin-top: 10px; }
.tree summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding-left: 4px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
.tree details[open] > summary::before { transform: rotate(45deg); }
.tree summary a { flex: 1; display: block; padding: 5px 6px; border-radius: 7px; }
.tree summary a:hover { text-decoration: none; background: var(--bg-soft); }
.tree .count { font-size: 11px; color: var(--muted); padding-right: 8px; }
.tree details > ul { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 6px; }
.tree .group { margin: 12px 0 4px 20px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.content { min-width: 0; padding: 28px 48px 80px; }
.toc { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 28px 18px; font-size: 13px; }
.toc-title { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 12px; color: var(--muted); line-height: 1.4; margin-left: -1px; border-left: 2px solid transparent; }
.toc li.l3 a { padding-left: 24px; }
.toc li a:hover, .toc li a.active { color: var(--accent); text-decoration: none; }
.toc li a.active { border-left-color: var(--accent); }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: .5; }

/* article */
.doc { max-width: 820px; }
.doc h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
.byline { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.props { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg-soft); border: 1px solid var(--line); }
.chip b { font-weight: 600; color: var(--text); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.prose { margin-top: 18px; }
.prose h2 { font-size: 22px; letter-spacing: -.01em; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.prose > h2:first-child { border-top: 0; margin-top: 8px; }
.prose h3 { font-size: 17px; margin: 28px 0 8px; }
.prose h4 { font-size: 15px; margin: 22px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose code { background: var(--code); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.prose pre { background: var(--code); padding: 14px; border-radius: 10px; overflow: auto; }
.prose blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.lead { font-size: 17px; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.smartlink { margin: 0 0 8px; }
.smartlink a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 500; background: var(--panel); box-shadow: var(--shadow); }
.smartlink a::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
.smartlink a:hover { border-color: var(--accent); text-decoration: none; }
.video { margin: 18px 0 22px; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-soft); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.card, .tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--panel); box-shadow: var(--shadow); }
.card span, .tile span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.card:hover, .tile:hover { border-color: var(--accent); text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 12px; max-width: 820px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 500; max-width: 48%; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { text-align: right; margin-left: auto; }
.pager small { color: var(--muted); font-weight: 400; font-size: 12px; }

/* home */
.home .hero { padding: 20px 0 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.home h1 { font-size: 40px; margin-top: 6px; }
.home h2 { font-size: 20px; margin: 40px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.tile strong { font-size: 16px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 28px; }
.home-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 6px; }
.home-sec ul { list-style: none; margin: 0; padding: 0; }
.home-sec li { padding: 3px 0; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); font-size: 14px; }
.pill-list a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.scrim { display: none; }

/* responsive */
@media (max-width: 1180px) { .layout { grid-template-columns: var(--side) minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout { display: block; }
  .menu-btn { display: inline-flex; }
  .hide-sm { display: none; }
  .brand span:last-child { display: none; }
  .search { max-width: none; }
  .sidebar { position: fixed; z-index: 40; top: var(--topbar); left: 0; width: min(86vw, 320px); background: var(--bg); transform: translateX(-102%); transition: transform .2s; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(0,0,0,.35); z-index: 35; }
  .content { padding: 20px 16px 60px; }
  .doc h1 { font-size: 26px; } .home h1 { font-size: 30px; }
  .tiles { grid-template-columns: 1fr; }
}

/* print / PDF */
@page { size: A4; margin: 18mm 16mm 20mm; }
@media print {
  :root { --bg: #fff; --bg-soft: #f6f6f9; --line: #dcdce6; --text: #111; --muted: #555; --accent: #662C91; --accent-soft: #f3ebf9; --shadow: none; }
  body { font-size: 10.5pt; line-height: 1.5; background: #fff; }
  .topbar, .sidebar, .toc, .actions, .pager, .crumbs, .scrim, .video-frame { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .doc { max-width: none; }
  .doc h1 { font-size: 22pt; }
  .prose h2 { font-size: 15pt; break-after: avoid; }
  .prose h3, .prose h4 { break-after: avoid; }
  .table-wrap { overflow: visible; border: 0; }
  table { font-size: 9pt; border: 1px solid var(--line); }
  tr, .card, .smartlink { break-inside: avoid; }
  thead { display: table-header-group; }
  .video figcaption { font-size: 9pt; }
  .video figcaption::before { content: "▶ "; }
  a { color: var(--accent); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .print-all .doc { break-before: page; }
}
.print-all { padding: 0; }
.print-all .doc { max-width: none; }
.cover { height: 250mm; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 0 10mm; }
.cover h1 { font-size: 34pt; margin: 18px 0 0; letter-spacing: -.02em; }
.cover p { font-size: 14pt; margin: 0; }
.cover .muted { color: var(--muted); font-size: 11pt; margin-top: 10px; }
.print-toc { break-before: page; }
.print-toc ol { columns: 2; column-gap: 24px; padding-left: 18px; font-size: 10pt; }
.print-toc li.top { font-weight: 600; margin-top: 6px; }

/* Pentagon Connect logo */
.logo-img { height: 34px; width: auto; display: block; }
.logo-img.on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img.on-light { display: none; } :root:not([data-theme="light"]) .logo-img.on-dark { display: block; } }
:root[data-theme="dark"] .logo-img.on-light { display: none; } :root[data-theme="dark"] .logo-img.on-dark { display: block; }
.brand-sub { font-weight: 600; color: var(--muted); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); line-height: 1.2; }
.cover-logo { height: 90px; width: auto; }
@media (max-width: 860px) { .logo-img { height: 28px; } .brand-sub { display: none; } }
@media print { .logo-img.on-dark { display: none !important; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost) { color: #0f1017; } }
:root[data-theme="dark"] .btn:not(.ghost) { color: #0f1017; }

/* theme toggle: show the sun in dark mode (switch to light), the moon in light mode */
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; } :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media print { .theme-toggle { display: none !important; } }
