:root {
  color-scheme: dark;
  --bg: #0c1018;
  --panel: #121925;
  --line: #293449;
  --text: #ecf0f7;
  --muted: #a0adc3;
  --accent: #a2e8d2;
  --purple: #c9b4f7;
  --amber: #edc17c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 75% 0, #17203560, transparent 55%), var(--bg); font: 15px/1.6 system-ui, sans-serif; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button, .primary-action { min-height: 44px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.2; letter-spacing: -.045em; font-weight: 650; }
h2 { line-height: 1.3; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 5; padding: 12px 20px; background: var(--accent); color: var(--bg); }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; padding: 34px 22px 24px; display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--line); background: #101621e8; }
.sidebar-content { display: contents; }
.menu-toggle { display: none; }
.brand { color: var(--text); font-size: 25px; font-weight: 750; letter-spacing: -.05em; }
.brand span { color: var(--muted); font-weight: 450; }
.profile { display: flex; gap: 12px; align-items: center; margin: 42px 0 30px; }
.profile strong { font-size: 13px; font-weight: 600; }
.profile p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid #494060; border-radius: 50%; background: #26233c; color: var(--purple); font: 12px ui-monospace, monospace; }
.navigation { display: grid; gap: 8px; }
.navigation a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 12px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 12px; }
.navigation a > span:first-child { font-size: 21px; width: 21px; text-align: center; line-height: 1; }
.navigation a:hover { background: #1b2231; color: var(--text); }
.navigation a[aria-current="page"] { background: linear-gradient(100deg, #262639, #1c2431); color: #d8c9fc; border-color: #3b4059; box-shadow: inset 2px 0 var(--purple); }
.external { margin-left: auto; font-size: 13px; }
.nav-divider { height: 1px; margin: 16px 10px; background: var(--line); }
.contacts { display: grid; gap: 21px; margin-top: auto; padding: 45px 10px 0; }
.contacts a { display: flex; gap: 14px; align-items: start; color: var(--text); font-size: 12px; }
.contacts a > span:first-child { color: var(--purple); font-size: 18px; }
.contacts small { display: block; color: var(--muted); font-size: 11px; }
main { margin-left: 244px; padding: 40px clamp(24px, 3.8vw, 64px) 40px; max-width: 1730px; }
.library-heading, .filters { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); background: #0e1420; border-radius: 9px; }
.segmented button { border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 7px 18px; font-size: 12px; color: var(--muted); font-weight: 550; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { color: var(--accent); border-color: #729a91; background: #17242b; }
.scope { width: 340px; }
.scope button { flex: 1; font-size: 13px; }
.scope button span { margin-right: 9px; }
.lock-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 7px; }
.scope button[aria-pressed="true"] { color: #102421; background: var(--accent); box-shadow: 0 0 18px #a2e8d215; }
body[data-scope="Tailnet"] .scope button[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #21172f; }
.scope-note { margin: 10px 0 36px; color: var(--muted); font-size: 11px; }
.scope-note::before { content: ""; display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; margin: 0 8px 2px 1px; }
body[data-scope="Tailnet"] .scope-note { padding: 14px 18px; color: var(--purple); border: 1px solid #50416a; background: #231c3440; border-radius: 8px; font-size: 12px; }
body[data-scope="Tailnet"] .scope-note::before { background: var(--purple); }
.eyebrow { margin-bottom: 9px; color: var(--muted); font: 10px/1.6 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .15em; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.text-button:hover { color: var(--text); }
.filters { margin: 30px 0 20px; flex-wrap: wrap; gap: 14px; }
#resultCount { color: var(--muted); white-space: nowrap; font: 11px ui-monospace, monospace; }
.catalog-status { color: var(--amber); font-size: 12px; }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project { min-width: 0; display: flex; padding: 15px; gap: 20px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(130deg, #161e2a, #101621); transition: border-color .15s; }
.project:hover { border-color: #4c5c78; }
.project-art { position: relative; flex: 0 0 30%; min-width: 0; min-height: 244px; overflow: hidden; border: 1px solid #303c50; border-radius: 6px; background: radial-gradient(ellipse at 40% 70%, #314352 0, #172231 50%, #111823 100%); color: #8bc0cb; }
.project-art img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.project-art:not(:has(img))::after { content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid currentColor; opacity: .18; border-radius: 50%; top: 28%; left: -35%; box-shadow: 0 0 0 28px #ffffff08, 0 0 0 55px #ffffff05; }
.project-art.play { color: #e5ba7a; background: radial-gradient(ellipse at 50% 75%, #654b35, #242530 45%, #101922 85%); }
.project-art.read { color: #c9b4f7; background: radial-gradient(ellipse at 50% 75%, #3b3250, #1d2436 50%, #101922); }
.art-symbol { position: absolute; top: 37%; width: 100%; text-align: center; font: 62px/1 ui-monospace, monospace; font-weight: 200; }
.art-label { position: absolute; bottom: 16px; left: 12px; right: 12px; font: 9px/1.5 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .13em; }
.project-body { min-width: 0; display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 2px 0; }
.badge { display: inline-block; padding: 2px 8px; border: 1px solid #465165; border-radius: 20px; font-size: 10px; color: #aeb9cc; }
.badge.recommended { color: var(--accent); border-color: #567c73; background: #1b302c60; }
.badge.incomplete { color: var(--amber); border-color: #887044; background: #392e1d40; }
.project h2 { margin: 16px 0 7px; font-size: 20px; letter-spacing: -.025em; font-weight: 620; }
.project h2:first-child { margin-top: 0; }
.project h2 a { color: var(--text); }
.project h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.description { margin-bottom: 16px; font-size: 12px; color: var(--muted); line-height: 1.75; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 14px; padding-top: 8px; }
.project-tags span { padding: 2px 6px; color: #b3c4d9; background: #1a2430; border: 1px solid #34445b; border-radius: 4px; font-size: 9px; }
.project-tags .ai { color: #d9c7f1; background: #29213670; border-color: #544561; }
.project-tags .ai[title] { cursor: help; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 11px; }
.primary-action { display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; background: var(--accent); color: #10251f; border: 1px solid transparent; border-radius: 6px; font-size: 11px; font-weight: 650; }
.primary-action:hover { color: #10251f; background: #c6f6e6; }
.secondary-action { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; }
.secondary-action:hover { border-color: var(--purple); }
.benchmark-link { display: inline-block; padding: 9px 0; }
.related { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 10px; }
.service-status { margin-top: 9px; font-size: 10px; color: #f6a5a5; }
.pending { color: var(--amber); font-size: 11px; }
.library-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 35px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.empty-state { padding: 60px 25px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.empty-state h2 { color: var(--text); font-size: 22px; }
.empty-state button { padding: 9px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--accent); }
.about { max-width: 940px; padding-top: 30px; }
.about h1 { margin-bottom: 25px; }
.about > p:not(.eyebrow) { max-width: 690px; color: var(--muted); }
.about-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin: 28px 0 55px; font-size: 13px; }
.about h2 { font-size: 20px; font-weight: 600; }
.about-contact { margin-top: 40px; color: var(--muted); line-height: 2; }
dialog { width: min(670px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 30px; border: 1px solid #46536e; border-radius: 12px; background: #121925; color: var(--text); }
dialog::backdrop { background: #030711cf; backdrop-filter: blur(8px); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-header h2 { margin: 5px 0 20px; font-size: 26px; }
.close-button { flex-shrink: 0; width: 44px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 26px; }
.muted { color: var(--muted); }
.ai-guide dt { color: var(--purple); border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; }
.ai-guide dd { margin: 8px 0 20px; font-size: 13px; color: var(--muted); }
@media (min-width: 1700px) { main { margin-right: auto; } }
@media (max-width: 1150px) {
  .sidebar { width: 215px; padding-inline: 16px; }
  main { margin-left: 215px; padding-inline: 25px; }
  .project { gap: 14px; }
  .project-art { flex-basis: 25%; }
  .filters { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 950px) {
  .projects { grid-template-columns: 1fr; }
  .project-art { flex-basis: 30%; min-height: 200px; }
  .scope { width: 100%; }
}
@media (max-width: 650px) {
  .sidebar { position: static; width: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .brand { font-size: 24px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text); font-size: 12px; }
  .menu-toggle[aria-expanded="true"] { color: var(--purple); background: #262639; }
  .sidebar-content { display: block; grid-column: 1 / -1; padding: 4px 0 12px; }
  .menu-toggle:not([hidden])[aria-expanded="false"] + .sidebar-content { display: none; }
  .profile { margin: 14px 0; }
  .profile p { font-size: 12px; }
  .navigation { display: flex; flex-wrap: wrap; gap: 6px; }
  .navigation a { padding: 7px 10px; }
  .navigation a > span:first-child, .nav-divider { display: none; }
  .contacts { gap: 12px; padding: 16px 10px 0; margin-top: 12px; border-top: 1px solid var(--line); }
  main { margin-left: 0; padding: 16px 16px 30px; }
  .scope-note { margin: 8px 0 0; line-height: 1.5; }
  body[data-scope="Public"] .scope-note { display: none; }
  body[data-scope="Tailnet"] .scope-note { padding: 10px 12px; font-size: 11px; }
  .library-heading { gap: 8px; flex-wrap: wrap; }
  .library-heading .eyebrow { display: none; }
  .library-heading h1 { font-size: 26px; }
  .filters { margin: 10px 0 16px; gap: 8px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding-inline: 10px; }
  .scope { width: auto; flex: none; padding: 0; border: 0; background: transparent; gap: 2px; }
  .scope button { padding-inline: 7px; font-size: 10px; font-weight: 500; }
  .scope button span, .scope .lock-icon { display: none; }
  .scope button[aria-pressed="true"], body[data-scope="Tailnet"] .scope button[aria-pressed="true"] { color: var(--text); background: #1b2533; border-color: var(--line); box-shadow: none; }
  .project { padding: 12px; gap: 14px; }
  .project-art { flex-basis: 25%; }
  .project h2 { font-size: 19px; }
  .badge { font-size: 9px; }
  .description { font-size: 12px; }
  .art-symbol { font-size: 45px; }
  .art-label { font-size: 8px; left: 8px; right: 8px; }
  .about { padding-top: 0; }
  .about-contact a { overflow-wrap: anywhere; }
  dialog { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .project { transition: none; } }
