/* ==========================================================================
   XCommander — an Xcode-flavoured theme for Grav
   Palette follows Xcode's "Default (Dark)" editor theme and macOS dark chrome.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #111114;
  --bg-raised: #17171b;
  --editor: #1f1f24;
  --editor-line: #23252b;
  --chrome: #2a2a2f;
  --chrome-2: #242428;
  --well: #19191d;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #dfdfe1;
  --text-strong: #ffffff;
  --text-dim: #98989f;
  --text-faint: #5f5f67;

  /* macOS system colours (dark) */
  --accent: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --yellow: #ffd60a;
  --orange: #ff9f0a;

  /* Xcode "Default (Dark)" syntax */
  --syn-keyword: #ff7ab2;
  --syn-string: #ff8170;
  --syn-comment: #7f8c98;
  --syn-number: #d9c97c;
  --syn-type: #dabaff;
  --syn-decl: #6bdfff;
  --syn-func: #b281eb;
  --syn-project: #78c2b3;
  --syn-attr: #cc9768;
  --syn-pp: #ffa14f;
  --syn-url: #6699ff;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 12px;
  --shadow-window: 0 0 0 0.5px rgba(0, 0, 0, 0.9), 0 24px 60px -12px rgba(0, 0, 0, 0.65), 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  --menubar-h: 40px;
  --gutter: 64px;
}

/* ----- Base --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-padding-top: calc(var(--menubar-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(10, 132, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(255, 122, 178, 0.07), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

::selection { background: rgba(10, 132, 255, 0.4); color: #fff; }

a { color: var(--syn-decl); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

code, kbd, pre, samp { font-family: var(--font-mono); }

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9em;
  height: 1.7em;
  padding: 0 0.45em;
  margin: 0 0.12em;
  font: 600 0.72em/1 var(--font-sans);
  letter-spacing: 0.02em;
  color: #1d1d1f;
  vertical-align: 0.12em;
  background: linear-gradient(#ffffff, #e4e4e8);
  border: 1px solid #b9b9c0;
  border-bottom-width: 3px;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { top: 8px; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 20px;
}
.container-editor { max-width: 960px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ----- Menu bar ------------------------------------------------------------- */

.menubar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--menubar-h);
  background: rgba(20, 20, 24, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--hairline);
}
.menubar-inner {
  height: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
}
.menubar a { color: var(--text); text-decoration: none; }
.menubar-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 6px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--text-strong) !important;
}
.menubar-app img { display: block; border-radius: 5px; }
.menubar-menus { display: flex; align-items: center; gap: 2px; }
.menubar-menus a,
.menubar-app,
.status-item {
  padding: 3px 10px;
  border-radius: 6px;
  transition: background-color 0.12s;
}
.menubar-menus a:hover,
.menubar-app:hover,
.status-item:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.menubar-menus a.is-active { font-weight: 600; color: var(--text-strong); }
.menubar-status { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  color: var(--text-dim);
  background: none;
  border: 0;
  cursor: pointer;
}
.status-item kbd { font-size: 10px; height: 18px; border-bottom-width: 2px; }
.status-clock { color: var(--text); font-variant-numeric: tabular-nums; padding-right: 8px; white-space: nowrap; }

@media (max-width: 640px) {
  .status-label, .status-clock { display: none; }
  .menubar-app span { display: none; }
}

/* ----- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  font: 600 15px/1 var(--font-sans);
  color: var(--text-strong);
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.12s, background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(#2b95ff, var(--accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 24px -8px rgba(10, 132, 255, 0.7);
}
.btn-primary:hover { background: linear-gradient(#3d9eff, #1a8cff); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn kbd { font-size: 11px; margin: 0; }

/* ----- Window chrome -------------------------------------------------------- */

.window {
  position: relative;
  background: var(--editor);
  border-radius: var(--radius);
  box-shadow: var(--shadow-window);
  border: 1px solid var(--hairline-strong);
  overflow: hidden;
}
.window-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 46px;
  padding: 0 14px;
  background: linear-gradient(#2e2e33, var(--chrome));
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
}
.lights { display: inline-flex; gap: 8px; flex: none; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35) inset; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }

.scheme { display: inline-flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.scheme svg { width: 15px; height: 15px; fill: var(--text-dim); }
.scheme-name { padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.scheme-name b { color: var(--text-faint); font-weight: 400; margin: 0 2px; }

.activity {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(380px, 46%);
  height: 26px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
}
.activity-app { color: var(--text); font-weight: 600; }
.activity-sep { width: 1px; height: 12px; background: var(--hairline-strong); }
.activity-text { overflow: hidden; text-overflow: ellipsis; }
.activity-text.is-running::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border: 1.5px solid var(--text-dim);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}
.activity-text.is-success { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

.scheme + .activity { position: static; transform: none; flex: 1; min-width: 0; width: auto; max-width: 380px; margin-left: auto; }
@media (max-width: 1100px) { .window-demo .scheme-name { display: none; } }
[data-whichkey]:focus { outline: none; }

.window-tabs {
  display: flex;
  height: 34px;
  padding: 0 8px;
  align-items: center;
  background: var(--chrome-2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-radius: 6px;
}
.tab.is-active { background: rgba(255, 255, 255, 0.08); color: var(--text-strong); }

.ficon { width: 14px; height: 14px; flex: none; }
.ficon-md path:first-child { fill: #d0d0d6; }
.ficon-md path:last-child { stroke: #8c8c94; stroke-width: 1; }
.ficon-swift rect { fill: #f05138; }
.ficon-folder path { fill: #4aa3f5; }

.jumpbar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 14px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--editor);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  overflow: hidden;
}
.jumpbar a { color: var(--text-dim); }
.jumpbar a:hover { color: var(--text); }
.jumpbar [aria-current] { color: var(--text); }
.jumpbar-arrows { color: var(--text-faint); letter-spacing: 6px; margin-right: 4px; }
.jumpbar-sep { color: var(--text-faint); }

@media (max-width: 640px) {
  .scheme, .jumpbar-arrows { display: none; }
  .activity { width: auto; max-width: 62%; left: auto; right: 12px; transform: none; }
}

/* ----- Prose (Markdown content) ---------------------------------------------- */

.prose {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: break-word;
}
.prose > * { margin: 0 0 1.1em; }
.prose > :last-child { margin-bottom: 0; }

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 1.9em 0 0.6em;
}
.prose > h1:first-child, .prose > h2:first-child { margin-top: 0; }
.prose h1 { font-size: 2.1em; font-weight: 800; letter-spacing: -0.035em; }
.prose h2 { font-size: 1.5em; font-weight: 750; }
.prose h3 { font-size: 1.2em; font-weight: 700; }
.prose h4 { font-size: 1em; font-weight: 700; }
.hero-title em { white-space: nowrap; }
.prose h1 + h2 { margin-top: -0.2em; font-weight: 500; color: var(--text-dim); font-size: 1.25em; letter-spacing: -0.01em; }

/* Markdown sigils, dimmed, like a source view */
.prose h2::before, .prose h3::before, .prose h4::before {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--syn-keyword);
  opacity: 0.7;
  margin-right: 0.5em;
}
.prose h2::before { content: "##"; }
.prose h3::before { content: "###"; }
.prose h4::before { content: "####"; }
.prose h1 + h2::before { content: none; }

.prose a { color: var(--syn-url); text-decoration: underline; text-decoration-color: rgba(102, 153, 255, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--text-strong); font-weight: 650; }
.prose em { color: #ececef; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose ul li::marker { color: var(--syn-keyword); }
.prose ol li::marker { color: var(--syn-number); font-family: var(--font-mono); font-size: 0.9em; }

.prose :not(pre) > code {
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  color: var(--syn-string);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  border-radius: 5px;
}

.prose blockquote {
  margin-left: 0;
  padding: 0.2em 0 0.2em 1.2em;
  color: var(--syn-comment);
  border-left: 2px solid rgba(127, 140, 152, 0.5);
  font-style: italic;
}
.prose blockquote p { margin: 0.4em 0; }

.prose hr {
  border: 0;
  height: 1px;
  margin: 2.4em 0;
  background: linear-gradient(90deg, transparent, var(--hairline-strong) 20%, var(--hairline-strong) 80%, transparent);
}

.prose img {
  display: block;
  border-radius: 10px;
}
.prose p > img:only-child { margin: 1.6em auto; }
.prose div[style*="text-align: center"] img { display: inline-block; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55)); }

.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 0.55em 0.8em; border-bottom: 1px solid var(--hairline); text-align: left; }
.prose th { color: var(--text-strong); font-weight: 600; background: rgba(255, 255, 255, 0.03); }

.prose .is-rtl, .prose [dir="rtl"] { font-size: 1.2em; line-height: 1.9; font-family: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", var(--font-sans); }

/* Code blocks: a small Xcode editor per fence */
.codeblock {
  position: relative;
  margin: 1.6em 0;
  background: #1a1a1e;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
}
.codeblock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 6px 0 8px;
  font: 12px var(--font-sans);
  color: var(--text-dim);
  background: var(--chrome-2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
.codeblock-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 24px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.codeblock-lang { color: var(--text-faint); white-space: nowrap; }
.codeblock-copy {
  margin-left: auto;
  font: inherit;
  color: var(--text-dim);
  background: none;
  border: 0;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
}
.codeblock-copy:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.prose pre {
  margin: 0;
  padding: 14px 0;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 4;
  background: #1a1a1e;
  border-radius: 10px;
}
.codeblock pre { border-radius: 0; }
pre code { color: #e6e6e9; font-family: var(--font-mono); }
.codeblock code { display: block; min-width: max-content; counter-reset: codeline; }
.codeblock .line { display: block; padding: 0 20px; white-space: pre; border-left: 2px solid transparent; }
.codeblock.has-lines .line::before {
  counter-increment: codeline;
  content: counter(codeline);
  display: inline-block;
  width: 2.2em;
  margin-right: 18px;
  margin-left: -6px;
  text-align: right;
  color: var(--text-faint);
  user-select: none;
  -webkit-user-select: none;
}
.codeblock .line.is-marked { background: rgba(10, 132, 255, 0.13); border-left-color: var(--accent); }
.codeblock .line.is-marked::before { color: var(--text); }
.codeblock .line-add { background: rgba(48, 209, 88, 0.12); color: #b8f5c8; border-left-color: var(--green); }
.codeblock .line-del { background: rgba(255, 69, 58, 0.12); color: #ffc2bd; border-left-color: var(--red); }
.codeblock .line-hunk { color: var(--syn-decl); }

.codeblock.is-terminal { background: #0c0c0e; }
.codeblock.is-terminal pre { background: #0c0c0e; }
.codeblock.is-terminal .codeblock-head { position: relative; background: #232327; padding-left: 12px; }
.codeblock.is-terminal .lights i { width: 11px; height: 11px; }
.codeblock-title { position: absolute; left: 50%; transform: translateX(-50%); color: var(--text-dim); }
.term-prompt { color: var(--green); font-weight: 700; }
.term-cmd { color: var(--text-strong); }
.term-out { color: var(--text-dim); }

.tok-kw { color: var(--syn-keyword); font-weight: 600; }
.tok-str { color: var(--syn-string); }
.tok-com { color: var(--syn-comment); font-style: italic; }
.tok-num { color: var(--syn-number); }
.tok-type { color: var(--syn-type); }
.tok-decl { color: var(--syn-decl); }
.tok-fn { color: var(--syn-func); }
.tok-prop { color: var(--syn-project); }
.tok-attr { color: var(--syn-attr); }
.tok-pp { color: var(--syn-pp); }

/* GitHub-style alerts → Xcode issue annotations */
.prose .md-alert {
  --issue: var(--accent);
  margin: 1.5em 0;
  padding: 12px 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--issue) 11%, transparent);
  border: 0;
  border-left: 3px solid var(--issue);
  border-radius: 0 8px 8px 0;
  font-style: normal;
}
.prose .md-alert--tip { --issue: var(--green); }
.prose .md-alert--important { --issue: #bf5af2; }
.prose .md-alert--warning { --issue: var(--yellow); }
.prose .md-alert--caution { --issue: var(--red); }
.prose .md-alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font: 600 13px var(--font-mono);
  color: var(--issue);
  text-transform: lowercase;
}
.prose .md-alert-title::after { content: ":"; }
.prose .md-alert-title svg { fill: currentColor; width: 14px; height: 14px; }
.prose .md-alert-body > :last-child { margin-bottom: 0; }

/* Line-number gutter, one number per top-level block */
.prose[data-gutter] { counter-reset: line; }
.prose[data-gutter] > * { position: relative; counter-increment: line; }
.prose[data-gutter] > *::after {
  content: counter(line);
  position: absolute;
  top: 0;
  left: calc(-1 * var(--gutter));
  width: calc(var(--gutter) - 26px);
  text-align: right;
  font: 400 normal 12px var(--font-mono);
  line-height: 29.75px; /* 17px × 1.75: the prose line box */
  letter-spacing: 0;
  text-decoration: none;
  color: var(--text-faint);
  pointer-events: none;
}
.prose[data-gutter] > h1::after { line-height: 42.8px; }
.prose[data-gutter] > h2::after { line-height: 30.6px; }
.prose[data-gutter] > h3::after { line-height: 24.5px; }
.prose[data-gutter] > h1 + h2::after { line-height: 25.5px; }
.prose[data-gutter] > .codeblock::after,
.prose[data-gutter] > pre::after,
.prose[data-gutter] > div::after { top: 7px; line-height: 20px; }
.prose[data-gutter] > *:hover::after { color: var(--text); }

@media (max-width: 760px) {
  .prose[data-gutter] > *::after { display: none; }
}

/* ----- Page window (generic content) ---------------------------------------- */

.container-editor { padding-block: 40px 0; }
.window-page .prose { padding: 40px 48px 56px calc(var(--gutter) + 8px); }
.window-page .prose > :first-child { margin-top: 0; }
@media (max-width: 760px) {
  .container-editor { padding-inline: 10px; padding-top: 16px; }
  .window-page .prose { padding: 26px 20px 36px; font-size: 16.5px; }
}

/* ----- Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 64px;
  align-items: center;
}
.hero-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 0 26px;
  /* Lit by the same glow as the demo beside it: an ambient shadow under a
     tight contact one, plus a faint blue bloom picked from --accent. */
  filter:
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5))
    drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45))
    drop-shadow(0 6px 34px rgba(10, 132, 255, 0.18));
}
.hero-title {
  margin: 0 0 22px;
  font: 800 clamp(44px, 6.4vw, 76px)/1.0 var(--font-display);
  letter-spacing: -0.048em;
  color: var(--text-strong);
  text-wrap: balance;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--syn-keyword) 5%, var(--syn-type) 50%, var(--syn-decl) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 33em;
  margin: 0 0 32px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}
.hero-sub kbd { font-size: 12px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 12.5px var(--font-mono);
  color: var(--text-dim);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--green);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.hero-demo { position: relative; }
.hero-demo::before {
  content: "";
  position: absolute;
  inset: 10% -6% -8% 8%;
  background: radial-gradient(closest-side, rgba(10, 132, 255, 0.35), rgba(191, 90, 242, 0.18) 55%, transparent);
  filter: blur(40px);
  z-index: -1;
}
.window-demo .window-body { position: relative; height: 382px; overflow: hidden; }
.demo-code {
  margin: 0;
  padding: 14px 0;
  font-size: 12.8px;
  line-height: 1.72;
  background: none;
  counter-reset: ln;
  overflow: hidden;
}
.demo-code .line { display: block; padding-right: 16px; white-space: pre; }
.demo-code .line::before {
  counter-increment: ln;
  content: counter(ln);
  display: inline-block;
  width: 44px;
  padding-right: 18px;
  text-align: right;
  color: var(--text-faint);
}
.demo-code .line.is-current { background: var(--editor-line); }
.demo-code .line.is-current::before { color: var(--text); }

/* Which-key panel (shared by the demo and the site leader) */
.whichkey {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(26, 26, 31, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--hairline-strong);
}
.whichkey-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--hairline-strong);
  color: var(--text-dim);
  font-size: 12px;
}
.whichkey-head > :first-child { color: var(--syn-keyword); font-weight: 700; }
.whichkey-head .is-error { color: var(--red); font-weight: 500; }
.whichkey-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 20px;
}
.wk-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 2px 6px;
  margin: 0 -6px;
  font: inherit;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 5px;
  white-space: nowrap;
}
button.wk-item { cursor: pointer; }
button.wk-item:hover, .wk-item.is-hit { background: rgba(255, 255, 255, 0.08); }
.wk-key { color: var(--syn-number); font-weight: 700; min-width: 2.4ch; text-align: right; }
.wk-arrow { color: var(--text-faint); }
.wk-label { overflow: hidden; text-overflow: ellipsis; }
.wk-item.is-group .wk-label { color: var(--syn-type); }
.wk-item.is-group .wk-label::before { content: "+"; }

.window-demo .whichkey {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 18px 16px;
  transform: translateY(105%);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.window-demo .whichkey.is-open { transform: translateY(0); }
.window-demo .whichkey-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 12.5px; }

.keystrokes {
  position: absolute;
  left: 50%;
  top: 36%;
  z-index: 2;
  display: flex;
  gap: 8px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.keystrokes kbd {
  font-size: 22px;
  height: 52px;
  min-width: 52px;
  padding: 0 16px;
  border-radius: 10px;
  border-bottom-width: 5px;
  animation: keyin 0.16s ease-out;
}
.keystrokes.is-fading { opacity: 0; transition: opacity 0.4s; }
@keyframes keyin { from { transform: translateY(-8px) scale(0.9); opacity: 0; } }

.hud {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 10px;
  width: 170px;
  height: 150px;
  font: 600 14px var(--font-sans);
  color: var(--text-strong);
  text-align: center;
  background: rgba(50, 50, 56, 0.78);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  transform: translate(-50%, -50%);
  animation: hud 1.6s ease forwards;
  pointer-events: none;
}
.hud svg { width: 54px; height: 54px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hud-menu {
  display: flex;
  align-items: center;
  width: auto;
  height: auto;
  padding: 12px 18px;
  font: 500 13px var(--font-sans);
  border-radius: 12px;
  white-space: nowrap;
}
.hud-menu b { color: var(--text-dim); font-weight: 400; margin: 0 6px; }
@keyframes hud {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  12%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.98); }
}

@media (max-width: 980px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 72px; }
  .hero-logo { width: 64px; height: 64px; margin-bottom: 20px; }
}
@media (max-width: 560px) {
  .window-demo .window-body { height: 330px; }
  .demo-code { font-size: 11px; }
  .demo-code .line::before { width: 30px; padding-right: 10px; }
  .window-demo .whichkey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 11.5px; }
}

/* ----- Sections --------------------------------------------------------------- */

.section { padding: 64px 0; }
.section-head { margin-bottom: 32px; }
.mark {
  margin: 0 0 10px;
  font: 700 13px var(--font-mono);
  color: var(--syn-comment);
}
.section-head h2 {
  margin: 0;
  font: 800 clamp(30px, 4vw, 44px)/1.1 var(--font-display);
  letter-spacing: -0.035em;
  color: var(--text-strong);
}
.section-lead { max-width: 40em; margin: 14px 0 0; font-size: 18px; color: var(--text-dim); }

.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.feature {
  position: relative;
  padding: 22px 22px 24px;
  background: linear-gradient(180deg, #1c1c21, #16161a);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.feature-keys { margin: 0 0 18px; min-height: 30px; }
.feature-keys kbd { font-size: 12px; height: 28px; min-width: 30px; margin: 0 6px 0 0; }
.feature h3 { margin: 0 0 8px; font: 700 17px/1.3 var(--font-display); color: var(--text-strong); letter-spacing: -0.01em; }
.feature p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-dim); }
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.section .container-editor { padding-top: 0; }

/* ----- Lineage git graph --------------------------------------------------------- */

.gitgraph-legend { display: flex; gap: 18px; margin-bottom: 18px; font: 12.5px var(--font-mono); color: var(--text-dim); }
.gitgraph-legend span::before { content: ""; display: inline-block; width: 16px; height: 3px; margin-right: 8px; vertical-align: 3px; border-radius: 2px; }
.gitgraph-legend .lane-hacker::before { background: var(--syn-keyword); }
.gitgraph-legend .lane-apple::before { background: var(--syn-decl); }

.gitgraph {
  --x-hacker: 18px;
  --x-apple: 46px;
  --dot-y: 21px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: 14px;
}
.commit {
  position: relative;
  display: grid;
  grid-template-columns: 76px 72px 56px minmax(0, 1fr);
  align-items: baseline;
  padding: 10px 20px 10px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  background-image: linear-gradient(var(--syn-keyword), var(--syn-keyword)), linear-gradient(var(--syn-decl), var(--syn-decl));
  background-size: 2px 100%, 2px 100%;
  background-position: calc(var(--x-hacker) - 1px) 0, calc(var(--x-apple) - 1px) 0;
  background-repeat: no-repeat;
}
.commit:nth-child(1) { background-size: 2px calc(100% - var(--dot-y)), 0 0; background-position: calc(var(--x-hacker) - 1px) var(--dot-y), 0 0; }
.commit:nth-child(2) { background-size: 2px 100%, 0 0; }
.commit:nth-child(3) { background-size: 2px 100%, 2px calc(100% - var(--dot-y)); background-position: calc(var(--x-hacker) - 1px) 0, calc(var(--x-apple) - 1px) var(--dot-y); }
.commit:hover { background-color: rgba(255, 255, 255, 0.03); }
.commit::before {
  content: "";
  position: absolute;
  top: calc(var(--dot-y) - 6px);
  left: calc(var(--x-hacker) - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--well);
  border: 2.5px solid var(--syn-keyword);
}
.commit.lane-apple::before { left: calc(var(--x-apple) - 6px); border-color: var(--syn-decl); }
.commit-hash { grid-column: 2; color: var(--syn-number); }
.commit-year { color: var(--text-dim); }
.commit-msg { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-sans); }
.commit-msg b { font-size: 15.5px; font-weight: 600; color: var(--text-strong); }
.commit-msg span { font-size: 14px; color: var(--text-dim); }

.commit-merge {
  padding-top: 26px;
  padding-bottom: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='40' viewBox='0 0 64 40'%3E%3Cpath d='M18 0 C18 22 32 18 32 37' fill='none' stroke='%23ff7ab2' stroke-width='2'/%3E%3Cpath d='M46 0 C46 22 32 18 32 37' fill='none' stroke='%236bdfff' stroke-width='2'/%3E%3C/svg%3E");
  background-size: 64px 40px;
  background-position: 0 0;
}
.commit-merge::before {
  top: 30px;
  left: 24px;
  width: 16px;
  height: 16px;
  background: var(--green);
  border: 3px solid var(--well);
  box-shadow: 0 0 0 2px var(--green), 0 0 18px rgba(48, 209, 88, 0.6);
}
.commit-merge .commit-hash { color: var(--green); font-weight: 700; }
.commit-merge .commit-msg b { font-size: 17px; }

@media (max-width: 640px) {
  .commit { grid-template-columns: 70px 44px minmax(0, 1fr); }
  .commit-hash { display: none; }
  .commit-year { grid-column: 2; }
}

/* ----- Terminal (git log) ------------------------------------------------------ */

.terminal {
  background: #0c0c0e;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}
.terminal-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  background: #232327;
  border-bottom: 1px solid #000;
}
.terminal-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.terminal-body { padding: 18px 20px 20px; font: 14px/1.7 var(--font-mono); overflow-x: auto; }
.prompt { margin: 0; white-space: nowrap; }
.prompt::before { content: "➜ "; color: var(--green); font-weight: 700; }
.t-path { color: var(--syn-decl); font-weight: 700; }
.t-branch { color: var(--syn-keyword); }
.t-cmd { color: var(--text-strong); }
a.t-cmd:hover { color: var(--syn-decl); }
.gitlog { list-style: none; margin: 6px 0 12px; padding: 0; }
.gitlog a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 3px 8px;
  margin: 0 -8px;
  color: var(--text);
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
}
.gitlog a:hover { background: rgba(255, 255, 255, 0.06); }
.gitlog a:hover .subject { text-decoration: underline; text-underline-offset: 3px; }
.gitlog .hash { color: var(--syn-number); }
.gitlog .refs { color: var(--syn-project); font-weight: 700; }
.gitlog .subject { color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; }
.gitlog .when { margin-left: auto; padding-left: 16px; color: var(--text-faint); }
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-left: 6px;
  vertical-align: -0.2em;
  background: #e6e6e9;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 640px) {
  .terminal-body { font-size: 12.5px; padding: 14px; }
  .gitlog .when, .gitlog .refs { display: none; }
}

/* ----- Weblog listing ------------------------------------------------------------ */

.blog-head { padding: 40px 48px 26px; border-bottom: 1px solid var(--hairline); }
.blog-head .mark { margin-bottom: 8px; }
.blog-head h1 {
  margin: 0 0 16px;
  font: 800 clamp(28px, 3.6vw, 38px)/1.15 var(--font-display);
  letter-spacing: -0.035em;
  color: var(--text-strong);
}
.blog-intro { margin-bottom: 16px; color: var(--text-dim); }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; font: 12.5px var(--font-mono); color: var(--text-dim); }
/* Brand marks in the menu bar: the feed icon, the Mastodon icon. */
.menubar-menus a.menubar-mark { display: inline-flex; align-items: center; padding: 3px 8px; }
.rss-icon, .mastodon-icon { display: block; flex: none; }
.rss-link { display: inline-flex; border-radius: 5px; transition: transform 0.12s, filter 0.12s; }
.rss-link:hover { transform: translateY(-1px); filter: brightness(1.1); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  color: var(--syn-pp);
  border: 1px solid rgba(255, 161, 79, 0.35);
  border-radius: 999px;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip:hover { background: rgba(255, 161, 79, 0.1); text-decoration: none; }
.filter code { color: var(--syn-type); }
.filter a { margin-left: 4px; color: var(--text-dim); }

.post-list { list-style: none; margin: 0; padding: 8px 0; }
.post-row + .post-row { border-top: 1px solid var(--hairline); }
.post-link {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 48px 22px 48px;
  color: inherit;
  text-decoration: none !important;
  transition: background-color 0.12s;
}
.post-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.12s;
}
.post-link:hover, .post-link:focus-visible { background: var(--editor-line); }
.post-link:hover::before, .post-link:focus-visible::before { opacity: 1; }
.post-date { padding-top: 4px; font: 13px var(--font-mono); color: var(--text-faint); }
.post-main { display: flex; flex-direction: column; gap: 6px; }
.post-title { font: 700 21px/1.3 var(--font-display); letter-spacing: -0.02em; color: var(--text-strong); }
.post-link:hover .post-title { color: #fff; }
.post-summary {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2px; font: 12px var(--font-mono); color: var(--text-faint); }
.tag { color: var(--syn-type); }
.post-empty { padding: 32px 48px; color: var(--text-dim); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px 22px;
  font: 13px var(--font-mono);
  border-top: 1px solid var(--hairline);
}
.pager-count { color: var(--text-faint); }

@media (max-width: 760px) {
  .blog-head { padding: 26px 20px 20px; }
  .post-link { grid-template-columns: 1fr; gap: 6px; padding: 18px 20px; }
  .post-date { padding: 0; }
  .pager { padding-inline: 20px; }
}

/* ----- Post ------------------------------------------------------------------------ */

.post-head { padding: 48px 48px 8px calc(var(--gutter) + 8px); }
.doc-comment { margin: 0 0 14px; font: 13.5px var(--font-mono); color: var(--syn-comment); }
.post-head h1 {
  margin: 0;
  font: 800 clamp(32px, 4.6vw, 50px)/1.08 var(--font-display);
  letter-spacing: -0.04em;
  color: var(--text-strong);
  text-wrap: balance;
}
.post-subtitle { margin: 12px 0 0; font-size: 20px; color: var(--text-dim); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; font: 13px var(--font-mono); }
.post-tags .tag { padding: 2px 9px; background: rgba(218, 186, 255, 0.08); border: 1px solid rgba(218, 186, 255, 0.2); border-radius: 6px; }
.post-tags .tag:hover { background: rgba(218, 186, 255, 0.16); text-decoration: none; }
.window-post .prose { padding-top: 28px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  text-decoration: none !important;
  transition: border-color 0.15s, background-color 0.15s;
}
.post-nav-link:hover { border-color: rgba(10, 132, 255, 0.55); background: #1a1a1f; }
.post-nav-link.is-next { text-align: right; }
.post-nav-dir { font: 12px var(--font-mono); color: var(--text-faint); }
.post-nav-title { font-weight: 600; color: var(--text-strong); }

@media (max-width: 760px) {
  .post-head { padding: 28px 20px 0; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.is-next { text-align: left; }
}

/* Minimap */
.minimap { display: none; }
@media (min-width: 1240px) {
  .js .minimap.is-ready {
    display: block;
    position: fixed;
    z-index: 10;
    top: calc(var(--menubar-h) + 40px);
    left: calc(50% + 480px + 18px);
    width: 76px;
    height: calc(100vh - var(--menubar-h) - 80px);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
  }
  .minimap:hover { opacity: 1; }
}
.minimap-track { position: absolute; inset: 0 0 auto 0; }
.minimap-bar { position: absolute; left: 0; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.2); }
.minimap-bar.is-block {
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 4px);
}
.minimap-bar.is-heading { background: var(--syn-keyword); height: 3px; opacity: 0.9; }
.minimap-bar.is-code { background: repeating-linear-gradient(180deg, rgba(107, 223, 255, 0.35) 0 2px, transparent 2px 4px); }
.minimap-bar.is-media { background: rgba(218, 186, 255, 0.25); border-radius: 2px; }
.minimap-viewport {
  position: absolute;
  left: -6px;
  right: -6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ----- Error ------------------------------------------------------------------------- */

.build-failed { padding: 48px; }
.build-failed-badge { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; color: var(--text-strong); }
.build-failed-badge .x { display: grid; place-items: center; width: 20px; height: 20px; font-size: 11px; color: #fff; background: var(--red); border-radius: 50%; }
.build-failed-badge .count { font: 12px var(--font-mono); color: var(--text-dim); }
.build-failed h1 {
  margin: 12px 0 24px;
  font: 800 clamp(80px, 16vw, 150px)/1 var(--font-mono);
  letter-spacing: -0.06em;
  background: linear-gradient(180deg, #fff, #6d6d74);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.issue { padding: 16px 20px; font: 14px/1.7 var(--font-mono); background: rgba(255, 69, 58, 0.09); border-left: 3px solid var(--red); border-radius: 0 10px 10px 0; }
.issue p { margin: 0; }
.issue-loc { color: var(--text-dim); font-size: 12.5px; }
.issue-kind { color: var(--red); font-weight: 700; }
.issue code { color: var(--syn-string); }
.issue-note { margin-top: 8px; font-family: var(--font-sans); color: var(--text-dim); }
.fixit { margin-top: 14px !important; }
.fixit-label { padding: 1px 8px; margin-right: 6px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 5px; }
@media (max-width: 640px) { .build-failed { padding: 28px 20px; } }

/* ----- Footer console --------------------------------------------------------------- */

.console { margin-top: 96px; }
.console-window {
  background: var(--well);
  border: 1px solid var(--hairline);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--chrome-2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
.console-tab { padding: 2px 10px; border-radius: 5px; }
.console-tab.is-active { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.console-filter { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.console-body { padding: 14px 18px 18px; font: 13px/1.75 var(--font-mono); color: var(--text); }
.console-body p { margin: 0; }
.lldb { color: var(--syn-comment); }
.out { color: var(--text-dim); padding-left: 0; }
.out a, .out .mail { color: var(--syn-decl); }
.out-list { list-style: none; margin: 0; padding-left: 1.2em; }
.idx { color: var(--text-faint); }
.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 0;
  padding: 18px 2px 36px;
  font-size: 12.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--hairline);
}

/* ----- Leader overlay (which-key + Open Quickly) ----------------------------------------- */

.leader { position: fixed; inset: 0; z-index: 100; }
.leader-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }

.whichkey-site {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px max(24px, calc((100vw - 1140px) / 2)) calc(22px + env(safe-area-inset-bottom));
  font-size: 14px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  animation: slideup 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideup { from { transform: translateY(100%); } }
.whichkey-site .whichkey-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 32px; }
.whichkey-site .wk-item { padding: 5px 8px; margin: 0 -8px; }

.palette {
  position: absolute;
  top: 14vh;
  left: 50%;
  width: min(640px, calc(100vw - 24px));
  transform: translateX(-50%);
  background: rgba(38, 38, 44, 0.88);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  backdrop-filter: blur(30px) saturate(1.8);
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
  box-shadow: 0 0 0 0.5px #000, 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: pop 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(0.97); } }
.palette-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--hairline); }
.palette-field svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--text-dim); stroke-width: 1.6; stroke-linecap: round; }
.palette-field input {
  flex: 1;
  min-width: 0;
  height: 56px;
  font: 400 21px var(--font-sans);
  color: var(--text-strong);
  background: none;
  border: 0;
  outline: 0;
}
.palette-field input::placeholder { color: var(--text-faint); }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 420px); overflow-y: auto; }
.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.palette-item .ficon { opacity: 0.9; }
.palette-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.palette-item-title mark { background: none; color: var(--text-strong); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.palette-item-detail { font: 12px var(--font-mono); color: var(--text-faint); white-space: nowrap; }
.palette-item[aria-selected="true"] { background: var(--accent); }
.palette-item[aria-selected="true"] .palette-item-title,
.palette-item[aria-selected="true"] mark,
.palette-item[aria-selected="true"] .palette-item-detail { color: #fff; }
.palette-empty { padding: 18px; color: var(--text-dim); text-align: center; }
.palette-foot { display: flex; gap: 18px; margin: 0; padding: 8px 16px; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--hairline); }
.palette-foot kbd { font-size: 10px; height: 18px; border-bottom-width: 2px; }

/* ----- Misc ------------------------------------------------------------------------------ */

.alert, .notices { margin: 16px 0; padding: 12px 16px; border-radius: 10px; background: rgba(10, 132, 255, 0.12); border-left: 3px solid var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.prose mark { color: var(--text-strong); background: rgba(255, 214, 10, 0.22); border-radius: 3px; padding: 0 0.2em; }
.prose abbr { text-decoration: underline dotted var(--text-faint); }

/* ----- Content components (see the Style Guide page) ---------------------------------- */

.prose h5, .prose h6 { margin: 1.6em 0 0.4em; font-size: 0.8em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.prose h2, .prose h3 { scroll-margin-top: calc(var(--menubar-h) + 24px); }
.heading-anchor {
  margin-left: 0.4em;
  font: 500 0.7em var(--font-mono);
  color: var(--text-faint) !important;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.15s;
}
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }

.prose .lead { font-size: 1.22em; line-height: 1.6; color: var(--text-strong); }
.prose .mark { margin-top: 2.4em; }
.prose del { color: var(--text-faint); text-decoration-color: var(--red); }
.prose sub, .prose sup { font-size: 0.72em; }

.prose .task-list-item { list-style: none; margin-left: -1.4em; }
.prose .task-list-item input {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0 0.6em 0 0;
  vertical-align: -2px;
  border: 1.5px solid var(--text-faint);
  border-radius: 4px;
}
.prose .task-list-item input:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
  border-color: var(--accent);
}

.prose figure { margin: 2em 0; }
.prose figure img { display: block; margin: 0 auto; border-radius: 10px; }
.prose figure > figcaption:not(.codeblock-head) { margin-top: 10px; font-size: 0.85em; text-align: center; color: var(--text-dim); }

/* Screenshot in a macOS window frame: <figure class="shot"> */
.prose figure.shot > img, .prose figure.shot > video {
  border-radius: 10px;
  border: 1px solid var(--hairline-strong);
  border-top: 28px solid #2c2c31;
  box-shadow: var(--shadow-window);
}
.prose figure.shot { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; }
.prose figure.shot > img { max-height: 70vh; }
.prose figure.shot::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 12px;
  width: 52px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 5px, #ff5f57 4.5px, transparent 5px),
    radial-gradient(circle at 23px 5px, #febc2e 4.5px, transparent 5px),
    radial-gradient(circle at 41px 5px, #28c840 4.5px, transparent 5px);
}

.prose .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.prose .grid-2 figure { margin: 0; }
@media (max-width: 640px) { .prose .grid-2 { grid-template-columns: 1fr; } }

.prose video { display: block; width: 100%; border-radius: 10px; }

.prose details {
  padding: 12px 16px;
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.prose summary { cursor: pointer; font-weight: 600; color: var(--text-strong); list-style: none; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::before { content: "▸"; display: inline-block; width: 1.2em; color: var(--text-dim); transition: transform 0.15s; }
.prose details[open] summary::before { transform: rotate(90deg); }
.prose details[open] summary { margin-bottom: 8px; }
.prose details > :last-child { margin-bottom: 0; }

/* Key bindings list, like the which-key panel: <ul class="keymap"> */
.prose ul.keymap {
  list-style: none;
  padding: 12px 16px;
  font: 14px/1.5 var(--font-mono);
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.prose ul.keymap li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 6px 0; }
.prose ul.keymap li + li { border-top: 1px dashed var(--hairline); }
.prose ul.keymap li::marker { content: none; }
.prose ul.keymap kbd { font-size: 12px; }
.prose ul.keymap span { margin-left: auto; padding-left: 16px; color: var(--text); font-family: var(--font-sans); }
.prose ul.keymap span b { color: var(--text-faint); font-weight: 400; }

/* Pull quote: <blockquote class="pull"> */
.prose blockquote.pull {
  margin: 2em 0;
  padding: 0;
  border: 0;
  font: 700 1.55em/1.3 var(--font-display);
  letter-spacing: -0.02em;
  font-style: normal;
  color: var(--text-strong);
  text-wrap: balance;
}
.prose blockquote.pull::before { content: "“"; display: block; height: 0.55em; font-size: 2.4em; line-height: 1; color: var(--syn-keyword); }
.prose blockquote.pull cite { display: block; margin-top: 0.6em; font: 400 0.55em var(--font-mono); color: var(--text-dim); }
