@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Serif:wght@400;500&display=swap");

/* All dark, in the app icon's colours: its tile is the page, its bunny the text. */
:root {
  color-scheme: dark;
  --bg: #1d1f24;
  --panel: #24272d;
  --raised: #2c2f36;
  --sunk: #17191d;
  --ink: #f5f3eb;
  --muted: #a8a59c;
  --rule: #33363d;
  --rule-strong: #4b4e56;
  --link: #f5f3eb;
  --accent: #f5f3eb;
  --accent-ink: #111214;
  --accent-hover: #ffffff;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --column: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p a, .note a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--muted); }
p a:hover, .note a:hover { text-decoration-color: var(--link); }

/* The framed column: thin rules down both sides, as on zed.dev. */
.frame {
  max-width: var(--column);
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.band { border-bottom: 1px solid var(--rule); }
.pad { padding: 56px 48px; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top .frame { display: flex; align-items: center; gap: 28px; padding: 10px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 600 17px var(--sans); }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 22px; font: 14px var(--sans); }
.nav a { color: var(--ink); }
.spacer { flex: 1; }
.kbd {
  font: 11px var(--mono); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 4px; padding: 1px 6px; background: var(--panel);
}
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px var(--sans); border-radius: 6px; padding: 8px 16px;
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
}
.button:hover { text-decoration: none; border-color: var(--rule-strong); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.small { padding: 6px 12px; }
.button.large { padding: 11px 22px; font-size: 15px; gap: 10px; }
.button.large .ico { width: 16px; height: 16px; }
.top-actions { display: flex; gap: 8px; }
.button .ico { width: 15px; height: 15px; flex: none; }
.button .ico.heart { color: #db61a2; }
.button.primary .kbd { background: transparent; border-color: rgb(17 18 20 / 0.35); color: rgb(17 18 20 / 0.7); }

/* Hero: the headline, one line, the download for the visitor's platform, then the screenshot. */
.hero.pad { padding-bottom: 40px; }
.hero h1 {
  font: 400 44px/1.15 var(--serif); margin: 0 0 14px; letter-spacing: -0.01em; max-width: 760px;
}
.tagline { font-style: italic; color: var(--muted); margin: 0 0 28px; max-width: 760px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.get-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.get-note a { color: var(--muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.get-note a:hover { color: var(--ink); }
.get-note .copy { font-size: 13px; padding: 5px 10px; }
.copy {
  display: inline-flex; align-items: center; gap: 12px;
  font: 14px var(--mono); background: var(--sunk); border: 1px solid var(--rule);
  border-radius: 6px; padding: 7px 12px; color: var(--ink);
}
.copy .prompt { color: var(--muted); }

/* The screenshot, framed like a window */
.shot { padding: 48px; }
.window {
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--panel);
  box-shadow: 0 24px 56px -20px rgb(0 0 0 / 0.65);
}
.window img { display: block; width: 100%; }

/* Feature cards: a bordered grid */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); }
.card { padding: 26px 28px 30px; border-right: 1px solid var(--rule); }
.card:last-child { border-right: 0; }
.card h3 { font: 500 17px var(--serif); margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.cards + .cards { border-top: 1px solid var(--rule); }

/* Each story keeps its evidence large enough to read, with the original a click away. */
.story { padding: 48px; }
.story-copy { max-width: 850px; }
.story h2 { font: 400 30px/1.25 var(--serif); margin: 0 0 14px; }
.story p { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.story-copy:only-child > p:last-child { margin-bottom: 0; }
.story code, .split code { overflow-wrap: anywhere; }
.story-shot { margin: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--bg); }
.story-shot a, .story-shot img { display: block; width: 100%; }
.story-shot img { height: auto; }

/* Text beside code */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.split > div { padding: 48px; }
.split > div + div { border-left: 1px solid var(--rule); background: var(--panel); }
.split h2 { font: 400 28px/1.25 var(--serif); margin: 0 0 12px; }
.split p { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
pre {
  margin: 0; font: 13.5px/1.6 var(--mono); white-space: pre; overflow-x: auto;
}
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs label {
  font: 500 12.5px var(--sans); padding: 4px 10px; border-radius: 5px; color: var(--muted);
  border: 1px solid transparent; cursor: pointer;
}
/* The tabs are radio buttons, so the panel needs no script. */
.code-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.code-tabs .code { display: none; }
.code-tabs pre.giallo { background: transparent; }
#language-python:checked ~ .tabs label[for=language-python],
#language-rust:checked ~ .tabs label[for=language-rust],
#language-c:checked ~ .tabs label[for=language-c],
#language-cpp:checked ~ .tabs label[for=language-cpp],
#decompiler-python:checked ~ .tabs label[for=decompiler-python],
#decompiler-rust:checked ~ .tabs label[for=decompiler-rust] { color: var(--ink); background: var(--raised); border-color: var(--rule); }
#language-python:focus-visible ~ .tabs label[for=language-python],
#language-rust:focus-visible ~ .tabs label[for=language-rust],
#language-c:focus-visible ~ .tabs label[for=language-c],
#language-cpp:focus-visible ~ .tabs label[for=language-cpp],
#decompiler-python:focus-visible ~ .tabs label[for=decompiler-python],
#decompiler-rust:focus-visible ~ .tabs label[for=decompiler-rust] { outline: 2px solid var(--ink); outline-offset: 1px; }
#language-python:checked ~ .code.python,
#language-rust:checked ~ .code.rust,
#language-c:checked ~ .code.c,
#language-cpp:checked ~ .code.cpp,
#decompiler-python:checked ~ .code.python,
#decompiler-rust:checked ~ .code.rust { display: block; }
.out { color: var(--muted); margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--rule); }
/* The hero's screenshot in two of the app's themes, chosen by radio
 * buttons as the code panel's languages are. */
.theme-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-tabs > .window { display: none; }
.theme-tabs > .window img { display: block; width: 100%; height: auto; }
.theme-tabs > .tabs { justify-content: center; margin: 14px 0 0; }
#theme-one-dark:checked ~ .window.one-dark,
#theme-one-light:checked ~ .window.one-light { display: block; }
#theme-one-dark:checked ~ .tabs label[for=theme-one-dark],
#theme-one-light:checked ~ .tabs label[for=theme-one-light] { color: var(--ink); background: var(--raised); border-color: var(--rule); }
#theme-one-dark:focus-visible ~ .tabs label[for=theme-one-dark],
#theme-one-light:focus-visible ~ .tabs label[for=theme-one-light] { outline: 2px solid var(--ink); outline-offset: 1px; }

/* Footer band: a step darker than the page. */
.foot { background: var(--sunk); color: var(--muted); }
.foot .frame { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; }
.foot .frame > div { padding: 36px 28px 44px; border-right: 1px solid var(--rule); font-size: 13px; }
.foot .frame > div:last-child { border-right: 0; }
.foot h4 { font: 500 14px var(--serif); color: var(--ink); margin: 0 0 12px; }
.foot a { display: block; color: var(--muted); margin: 4px 0; font: 13px var(--sans); }
.foot a:hover { color: var(--ink); }

/* Download page */
.dl { display: grid; grid-template-columns: 3fr 2fr; }
.dl > div { padding: 48px; }
.dl > div + div { border-left: 1px solid var(--rule); }
.dl h1 { font: 400 34px var(--serif); margin: 0; }
.ver { display: flex; align-items: baseline; gap: 16px; margin: 4px 0 28px; color: var(--muted); }
.platform { margin: 0 0 26px; scroll-margin-top: 112px; }
.platform h3 { font: 500 14px var(--sans); margin: 0 0 8px; display: flex; justify-content: space-between; }
.platform h3 .arch { font-weight: 400; color: var(--link); }
.platform .button { width: 100%; background: var(--raised); }
/* The visitor's own platform, as the browser reports it, comes first and stands out. */
.platform.yours .button { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.platform.yours .button:hover { background: var(--accent-hover); }
.platform.yours .copy { border-color: var(--rule-strong); }
.platform .note { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.platform .copy { width: 100%; justify-content: space-between; }
.side h3 { font: 400 22px var(--serif); margin: 0 0 10px; }
.side p { color: var(--muted); font-size: 13.5px; }
.side .card2 { border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 22px; margin-bottom: 20px; }
.icon {
  width: 96px; height: 96px; border-radius: 21px; border: 1px solid var(--rule-strong); overflow: hidden;
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.7); margin-bottom: 26px;
}
.icon img { display: block; width: 100%; }

/* A faint dot grid: in the margins and behind the screenshot; the text sections stay plain. */
body { background-image: radial-gradient(rgb(245 243 235 / 0.06) 1px, transparent 1.2px); background-size: 16px 16px; }
.band > .frame { background: var(--bg); }
.band > .frame:has(> .shot) { background: transparent; }

/* Short pages: the last band grows so the footer always reaches the bottom of the window. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; }
main > .band:last-child:not(.code-band) { flex: 1; display: flex; }
main > .band:last-child > .frame { flex: 1; width: 100%; }
.split > .code-tabs { align-self: start; }
.split { background: linear-gradient(to right, var(--bg) 41.666%, var(--panel) 41.666%); }

/* The download page's processor menus and copy button, drawn as the text and key they replace. */
.platform h3 .arch { position: relative; }
.platform h3 .arch::after { content: "\25BE"; position: absolute; right: 0; pointer-events: none; }
.arch select {
  appearance: none; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit;
  padding: 0 0.95em 0 0; margin: 0; cursor: pointer; text-align: right;
}
.copy button.kbd { cursor: pointer; }
.copy button.kbd:hover { color: var(--ink); }

/* Docs: the sidebar, the page, its table of contents. */
.docs { display: grid; grid-template-columns: 232px minmax(0, 1fr) 216px; }
.docs > .sidebar, .docs > .toc { padding: 40px 20px 48px; font: 13.5px/1.5 var(--sans); }
.docs > .sidebar { border-right: 1px solid var(--rule); }
.docs > .toc { border-left: 1px solid var(--rule); }
.docs > aside > nav { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; }
.sidebar a { display: block; color: var(--muted); padding: 3px 10px; border-radius: 5px; }
.sidebar a:hover { color: var(--ink); text-decoration: none; background: var(--panel); }
.sidebar a.on { color: var(--ink); background: var(--raised); font-weight: 500; }
.sidebar h5, .toc h5 { font: 500 12px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 10px 6px; }
.sidebar h5 a { padding: 0; color: inherit; background: none; }
.toc h5 { margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; color: var(--muted); padding: 2px 0; overflow-wrap: anywhere; }
.toc a:hover { color: var(--ink); }

.prose { padding: 40px 48px 64px; font-size: 14.5px; line-height: 1.7; min-width: 0; }
.prose h1 { font: 400 34px/1.2 var(--serif); margin: 0 0 20px; }
.prose h2 { font: 400 24px/1.3 var(--serif); margin: 44px 0 12px; padding-top: 4px; }
.prose h3 { font: 500 17px/1.4 var(--serif); margin: 32px 0 8px; }
.prose h4 { font: 500 14.5px/1.4 var(--sans); margin: 24px 0 6px; }
.prose h2 a, .prose h3 a { color: inherit; }
.prose :is(h2, h3, h4) { scroll-margin-top: 72px; }
.prose p, .prose ul, .prose ol, .prose dl, .prose table, .prose pre { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose :is(li, td, dd) a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.prose code { font: 0.92em var(--mono); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 0 4px; }
.prose pre { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); }
.prose th { font: 500 13px var(--sans); color: var(--muted); }
.prose img { max-width: 100%; border: 1px solid var(--rule); border-radius: 8px; }
.prose blockquote { margin: 0 0 16px; padding: 0 0 0 16px; border-left: 2px solid var(--rule); color: var(--muted); }
.prose dt { margin-top: 18px; }
.prose dt code { background: none; border: 0; padding: 0; font-weight: 500; }
.prose dd { margin: 4px 0 0 22px; color: var(--muted); }
.prose dd p { margin: 0 0 8px; }
.prose ul.index { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.prose ul.index li { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--rule); display: flex; gap: 16px; align-items: baseline; }
.prose ul.index li a { text-decoration: none; font: 500 15px var(--serif); white-space: nowrap; }
.prose ul.index li span { color: var(--muted); font-size: 13.5px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--rule); font: 14px var(--sans); }

/* Blog: one centred column of prose, dated. */
.blog > .prose { max-width: 820px; margin: 0 auto; }
.post-meta { display: block; color: var(--muted); font: 13px var(--sans); }
.prose .post-meta + h1 { margin-top: 6px; }
.prose p.post-meta { margin: -8px 0 28px; }
.prose ul.posts { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.prose ul.posts li { margin: 0; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.prose ul.posts li > a { display: inline-block; margin: 4px 0 6px; font: 400 22px/1.3 var(--serif); text-decoration: none; }
.prose ul.posts li p { margin: 0; color: var(--muted); font-size: 13.5px; }

@media (max-width: 960px) {
  .top .frame { flex-wrap: wrap; gap: 16px; padding: 12px 24px; }
  .top .nav { order: 3; flex-basis: 100%; }
  .pad, .shot, .story, .split > div, .dl > div { padding: 32px 24px; }
  .split, .dl { grid-template-columns: minmax(0, 1fr); }
  .split > div + div, .dl > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .split { background: var(--bg); }
  .card { padding: 24px 20px; min-width: 0; }
  .foot .frame { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot .frame > div:nth-child(2) { border-right: 0; }
  .foot .frame > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs > .toc { display: none; }
  .docs > .sidebar { border-right: 0; border-bottom: 1px solid var(--rule); padding: 20px 24px; }
  .docs > aside > nav { position: static; max-height: none; }
  .prose { padding: 32px 24px 48px; }
}

@media (max-width: 540px) {
  .top .frame { gap: 12px; padding: 10px 16px; }
  .top-actions { margin-left: auto; }
  .top .spacer, .top .kbd { display: none; }
  .top .nav { justify-content: space-between; gap: 12px; }
  .button.small { padding: 6px 9px; }
  .top-actions .ico { display: none; }
  .pad, .story, .split > div, .dl > div { padding: 28px 20px; }
  .shot { padding: 20px 12px; }
  .hero h1 { font-size: 34px; }
  .actions .button { flex: 1 1 auto; }
  .story h2, .split h2 { font-size: 27px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { border-right: 0; padding: 22px 20px; }
  .card + .card { border-top: 1px solid var(--rule); }
  .ver { flex-wrap: wrap; gap: 4px 16px; }
  .copy { max-width: 100%; min-width: 0; }
  .copy > span { min-width: 0; overflow-wrap: anywhere; }
  .copy button { flex: none; }
  .side .card2 { padding: 18px; }
  .prose { padding: 28px 20px 40px; overflow-wrap: anywhere; }
  .prose h1 { font-size: 30px; }
  .prose pre { overflow-wrap: normal; }
  .prose ul.index li { display: block; }
  .prose ul.index li a { white-space: normal; }
  .prose ul.index li span { display: block; }
  .pager { flex-wrap: wrap; }
  .foot .frame > div { padding: 28px 20px; }
}
