/* flisk.tv's blog, releases, help and docs (flisk/site.py, SITE.md): Flisk purple on night, the brand pack's tokens
   (as brand/pages.css), the system's type. No script, no font, nothing from elsewhere. */
:root {
  color-scheme: dark;
  --night: #07060b;
  --panel: #110e1a;
  --field: #1a1528;
  --line: #2c2440;
  --line-soft: #1f1930;
  --ink: #f4f2ff;
  --soft: #b6b0c8;
  --muted: #8d8a99;
  --accent: #864dff;
  --accent-deep: #672de7;
  --accent-light: #a97cff;
  --on-accent: #ffffff;
  --radius: 12px;
  --top: 64px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 50% at 50% -10%, #1d0f3f 0%, #0d0819 38%, var(--night) 70%) no-repeat, var(--night);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; top: 8px; padding: 8px 12px; background: var(--accent); color: var(--on-accent); border-radius: 8px; z-index: 20; }
.skip:focus { left: 16px; }

/* The header: the wordmark, the four sections, the way to the apps */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--night) 78%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.top-inner {
  max-width: 1240px; margin: 0 auto; height: var(--top); padding: 0 16px;
  display: flex; align-items: center; gap: 24px;
}
.home { display: flex; flex: none; }
.home .flisk-wordmark { height: 20px; width: auto; display: block; }
.sections { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-right: auto; }
.sections::-webkit-scrollbar { display: none; }
.sections a {
  color: var(--soft); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.sections a:hover { color: var(--ink); background: var(--field); }
.sections a[aria-current] { color: var(--ink); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.get {
  flex: none; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--on-accent);
  background: var(--accent); padding: 7px 14px; border-radius: 999px;
}
.get:hover { background: var(--accent-deep); color: var(--on-accent); }

/* The frame: a column for posts and releases; sidebar, page and contents for help and docs */
.frame { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 48px 16px 80px; }
.frame.narrow { max-width: 760px; }
.frame.with-sidebar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
.frame.with-sidebar.with-toc { grid-template-columns: 240px minmax(0, 1fr) 200px; }
.doc { max-width: 760px; min-width: 0; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 700; margin: 0 0 12px; letter-spacing: -0.025em; }

.lede { margin-bottom: 40px; }
.lede p { color: var(--soft); font-size: 19px; margin: 0; max-width: 60ch; }
.lede .formats { font-size: 15px; margin-top: 12px; }
.feed { font-size: 15px; white-space: nowrap; }

/* Words: posts, releases, help and docs */
.prose { color: var(--soft); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre, .prose dl { margin: 0 0 20px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2 { font-size: 26px; margin: 48px 0 12px; }
.prose h3 { font-size: 20px; margin: 32px 0 8px; }
.prose h4 { font-size: 17px; margin: 24px 0 8px; }
.prose .headerlink { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.prose :is(h2, h3, h4):hover .headerlink, .prose .headerlink:focus { opacity: 1; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent-light); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose figure { margin: 28px 0; }
.prose figure.embed iframe { display: block; width: 100%; border-radius: var(--radius); background: var(--panel); }
.prose figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; }
.prose blockquote {
  margin-left: 0; padding: 14px 18px; border-left: 3px solid var(--accent);
  background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink);
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono); font-size: 0.88em; color: var(--ink);
  background: var(--field); border: 1px solid var(--line-soft); padding: 0.1em 0.38em; border-radius: 6px;
}
.prose pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; line-height: 1.55; font-size: 14px;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; white-space: pre; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); font-weight: 600; }
.prose .lead { font-size: 21px; color: var(--ink); line-height: 1.55; }

/* The blog */
.posts { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.post-card a {
  display: block; padding: 24px 26px; border-radius: 18px; text-decoration: none; color: inherit;
  background: linear-gradient(160deg, var(--panel), color-mix(in srgb, var(--panel) 60%, var(--night)));
  border: 1px solid var(--line-soft); transition: border-color 0.15s, transform 0.15s;
}
.post-card a:hover { border-color: var(--accent); transform: translateY(-1px); }
.post-card time { font-size: 14px; color: var(--muted); }
.post-card h2 { font-size: 26px; margin: 6px 0 8px; }
.post-card p { color: var(--soft); margin: 0 0 12px; }
.post-card .more { color: var(--accent-light); font-weight: 600; font-size: 15px; }

.post-head { margin-bottom: 36px; }
.up { display: inline-block; font-size: 15px; text-decoration: none; margin-bottom: 20px; }
.byline { color: var(--muted); font-size: 15px; margin: 0; }
.post .prose { font-size: 18px; }

/* The release log */
.release { padding: 32px 0; border-top: 1px solid var(--line); }
.release.single { border-top: 0; padding-top: 0; }
.release > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; }
.release > header h2 { font-size: 26px; margin: 0; }
.release > header h2 a { color: var(--ink); text-decoration: none; }
.release > header h2 a:hover { color: var(--accent-light); }
.release > header time { color: var(--muted); font-size: 15px; }
.badge {
  display: inline-block; font: 600 13px/1 var(--mono); color: var(--on-accent); background: var(--accent);
  padding: 5px 9px; border-radius: 999px; letter-spacing: 0.02em; vertical-align: middle;
}
.release.single .badge { margin-bottom: 12px; margin-left: 12px; }
.release .prose h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-light); margin-top: 24px; }

/* Help and docs: the sidebar, the page, its contents */
.sidebar { position: sticky; top: calc(var(--top) + 24px); align-self: start; max-height: calc(100vh - var(--top) - 48px); overflow-y: auto; font-size: 15px; }
.sidebar summary { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 18px; }
.sidebar h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 6px; padding-left: 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--soft); text-decoration: none; line-height: 1.4; }
.sidebar a:hover { color: var(--ink); background: var(--panel); }
.sidebar a.on { color: var(--ink); background: var(--field); box-shadow: inset 2px 0 0 var(--accent); }
.sidebar .sidebar-top { font-weight: 600; }

.doc-head { margin-bottom: 32px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.summary { font-size: 19px; color: var(--soft); margin: 0; }
.source { font-size: 14px; margin-top: 24px; }
.source a { color: var(--muted); }

.toc { position: sticky; top: calc(var(--top) + 24px); align-self: start; font-size: 14px; }
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; padding: 3px 0; color: var(--soft); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--ink); }

.cards-group { margin-top: 36px; }
.cards-group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 12px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cards a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line-soft); text-decoration: none; color: var(--ink);
  transition: border-color 0.15s;
}
.cards a:hover { border-color: var(--accent); }
.cards span { color: var(--soft); font-size: 15px; line-height: 1.5; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a {
  flex: 1 1 0; max-width: 48%; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); line-height: 1.4;
}
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.pager .next { text-align: right; margin-left: auto; }

.all-posts { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line-soft); }
.all-posts h2 { font-size: 20px; margin: 0 0 14px; display: flex; align-items: baseline; gap: 12px; }
.all-posts .feed { font-size: 14px; font-weight: 400; }
.all-posts ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.all-posts li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.all-posts [aria-current] { color: var(--ink); font-weight: 600; }
.all-posts time { color: var(--muted); font-size: 14px; }

/* The footer */
.bottom { border-top: 1px solid var(--line-soft); }
.bottom-inner { max-width: 1240px; margin: 0 auto; padding: 28px 16px 40px; }
.bottom nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.bottom a { color: var(--muted); text-decoration: none; }
.bottom a:hover { color: var(--ink); }
.flisk-cookie-settings { margin: 0 0 24px; }

/* Narrower: the contents go first, then the sidebar folds into a list to open */
@media (max-width: 1100px) {
  .frame.with-sidebar.with-toc { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 800px) {
  body { font-size: 16px; }
  .top-inner { gap: 12px; }
  .get { display: none; }
  .frame { padding-top: 32px; }
  .frame.with-sidebar, .frame.with-sidebar.with-toc { display: block; }
  .sidebar { position: static; max-height: none; margin-bottom: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .sidebar summary { display: block; padding: 12px 16px; cursor: pointer; font-weight: 600; }
  .sidebar nav { padding: 0 8px 14px; }
  .sidebar:not([open]) nav { display: none; }
  .post .prose { font-size: 17px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .top, .bottom, .sidebar, .toc, .pager, .all-posts, .source { display: none; }
  body { background: #fff; color: #000; }
  .prose, .prose strong, h1, h2, h3 { color: #000; }
}
