:root {
  --bg: #ffffff;
  --fg: #23262d;
  --muted: #5f6570;
  --line: #dde0e6;
  --soft: #f5f6f8;
  --soft-2: #e9ebef;
  --band: #c3dfe8;
  --code-bg: #eceef1;
  --button-bg: #23262d;
  --button-fg: #ffffff;
  --frame: #23262d;
  --ok: #1d8a4c;
  --note: #d6e6f8;
  --tip: #d7efdf;
  --warning: #f7e8c6;
  --caution: #f6d3d8;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #14161b;
  --fg: #e5e7eb;
  --muted: #9ba2ad;
  --line: #2c3038;
  --soft: #1b1e24;
  --soft-2: #22262d;
  --band: #1b3039;
  --code-bg: #1f2329;
  --button-bg: #e5e7eb;
  --button-fg: #14161b;
  --frame: #3a3f48;
  --ok: #4cc283;
  --note: #1c2d42;
  --tip: #183326;
  --warning: #3a2f16;
  --caution: #3d1e25;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
  overflow-x: clip;
}
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.bar { max-width: 72rem; margin: 0 auto; padding: 0 16px; }

/* Header: logo on the left, links and the Documentation button on the right. */
.top { border-bottom: 1px solid var(--line); }
.home .top { border-bottom-color: transparent; }
.top .bar { min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 21px; font-weight: 400; letter-spacing: -0.01em; }
.brand strong { font-weight: 700; }
/* NotusBook's mark is a dark square: on the dark theme it turns light, or it sinks into the background. */
:root[data-theme="dark"] .book-mark { filter: invert(1); }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.top nav a.nav-demo { font-weight: 600; }
.top nav a.nav-docs { border: 2px solid var(--fg); border-radius: 4px; padding: 5px 14px; font-weight: 600; }
.top nav a.nav-docs:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
.nav-short { display: none; }
.theme-slot { display: inline-flex; }
.theme { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--fg); cursor: pointer; }
.theme:hover { background: var(--soft-2); }

/* Footer: a grey band with link columns. */
footer { margin-top: auto; background: var(--soft-2); padding: 32px 0 24px; }
.page + footer, .page ~ footer { margin-top: 56px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 72px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 0 0 12px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 20px 0 0; padding-top: 16px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-name { font-weight: 600; }

/* Text. */
.page { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; flex: 1 0 auto; }
.page main { max-width: 52rem; min-width: 0; }
h1, h2, h3, h4 { line-height: 1.3; margin: 1.6em 0 0.6em; font-weight: 500; }
h1 { font-size: 1.75rem; margin-top: 1.1em; }
.docs h1 { font-size: 1.6rem; font-weight: 400; }
h2 { font-size: 1.4rem; padding-bottom: 0.3em; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: 4px; overflow-x: auto; line-height: 1.5; margin: 0 0 1em; }
pre code { background: none; padding: 0; font-size: 0.86em; overflow-wrap: normal; }
.code { margin: 0 0 1em; }
.code pre { margin: 0; border-top-left-radius: 0; }
.code-label { display: inline-block; margin: 0; padding: 3px 12px; background: var(--soft-2); border-radius: 4px 4px 0 0;
  font-size: 13px; font-weight: 600; color: var(--muted); }
.table { overflow-x: auto; margin: 1em 0; }
table { border-collapse: collapse; font-size: 0.94em; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 600; }
th.align-center, td.align-center { text-align: center; }
th.align-right, td.align-right { text-align: right; }
blockquote { margin: 1em 0; padding: 0 1em; border-left: 3px solid var(--line); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Alert boxes: a tinted box with a short title, as on pocketbase.io. */
.alert { border-radius: 4px; padding: 10px 16px; margin: 1em 0; background: var(--note); }
.alert p { margin: 0.4em 0; }
.alert-title { font-weight: 700; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.04em; }
.alert-tip { background: var(--tip); }
.alert-important, .alert-warning { background: var(--warning); }
.alert-caution { background: var(--caution); }
.alert pre { background: var(--bg); }

/* Buttons. */
.button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 44px; padding: 8px 24px; border: 2px solid var(--fg); border-radius: 4px; background: var(--bg);
  text-decoration: none; font-weight: 600; margin: 4px 8px 4px 0; }
.button:hover { background: var(--soft-2); text-decoration: none; }
.button span { font-size: 13px; font-weight: 400; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
.button.primary { background: var(--button-bg); border-color: var(--button-bg); color: var(--button-fg); }
.button.primary:hover { opacity: 0.9; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px; }
.downloads .button { margin: 0; }
.promise { font-size: 1.2rem; font-weight: 600; border-left: 4px solid var(--fg); padding-left: 14px; }

/* Documentation: grouped menu on the left in a grey column, the page beside it. */
.docs { display: grid; grid-template-columns: 16rem minmax(0, 1fr); grid-template-areas: "side main"; gap: 0 40px; }
.docs main { grid-area: main; padding-bottom: 8px; }
.side { grid-area: side; background: var(--soft); border-right: 1px solid var(--line); padding: 20px 14px 32px; margin-left: -16px;
  font-size: 14.5px; }
.side-group { margin: 18px 10px 6px; font-weight: 600; }
.side-group:first-child { margin-top: 4px; }
.side ul { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 1px solid var(--line); margin-left: 12px; }
.side li a { display: block; padding: 4px 10px; border-radius: 4px; color: var(--muted); text-decoration: none; }
.side li a:hover { color: var(--fg); background: var(--soft-2); }
.side li a[aria-current] { color: var(--fg); background: var(--soft-2); font-weight: 600; }
.toc { margin: 0 0 1.4em; }
.toc-title { margin: 0 0 4px; font-weight: 600; }
.toc ul { margin: 0; padding-left: 20px; }
.toc li { margin: 2px 0; }
.prev-next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--line); }
.prev-next a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 18px; border-radius: 4px;
  font-weight: 600; text-decoration: none; border: 2px solid transparent; }
.prev-next a:hover { background: var(--soft-2); }
.prev-next .next { margin-left: auto; border-color: var(--fg); }
@media (max-width: 860px) {
  .docs { display: block; }
  .side { margin: 40px -16px 0; border-right: 0; border-top: 1px solid var(--line); }
}

/* Home page. */
.wide main { max-width: none; }
.hero { text-align: center; padding: 48px 16px 0; margin: 0 -16px; position: relative; }
.hero::before { content: ""; position: absolute; z-index: -1; left: 50%; width: 100vw; transform: translateX(-50%);
  top: -61px; height: calc(100% - 16rem + 61px); background: var(--band); }
.hero h1 { font-size: 2.6rem; line-height: 1.2; font-weight: 400; margin: 0 0 40px; border: 0; }
.hero h1 strong { font-weight: 700; }
.pill { list-style: none; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin: 0 0 40px;
  padding: 10px 26px; border: 2px solid var(--fg); border-radius: 999px; background: var(--bg); font-weight: 600; }
.pill li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 8px; }
.hero-preview { position: relative; max-width: 66rem; margin: 0 auto; }
.frame { margin: 0 auto; }
.frame img { width: 100%; height: auto; display: block; border: 4px solid var(--frame); border-radius: 12px; background: var(--frame); }
.hero-actions { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); display: flex; flex-direction: column;
  gap: 12px; width: 16rem; margin: 0; }
.hero-actions .button { margin: 0; min-height: 50px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.frame.small { max-width: 52rem; margin-top: 28px; }
.wide main h2 { border: 0; font-size: 1.5rem; font-weight: 400; margin: 2.4em 0 0.9em; padding: 0; }
.what-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); gap: 28px; align-items: stretch; }
.features { background: var(--soft-2); border-radius: 4px; display: flex; flex-direction: column; }
.feature { position: relative; padding: 20px 28px 18px 64px; border-bottom: 1px solid var(--line); }
.feature:first-child { background: var(--line); border-radius: 4px 4px 0 0; }
.feature .icon { position: absolute; left: 26px; top: 21px; }
.feature h3 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 400; }
.feature p { margin: 0; }
.features-more { margin-top: auto; padding: 16px; text-align: center; font-weight: 600; text-decoration: none; }
.features-more:hover { text-decoration: underline; }
.code-tabs { background: var(--code-bg); border-radius: 4px; padding: 10px 0 0; min-width: 0; display: flex; flex-wrap: wrap;
  align-content: flex-start; }
.code-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.code-tabs label { padding: 5px 14px; margin-left: 10px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: var(--mono); color: var(--muted); }
.code-tabs input:checked + label { background: var(--button-bg); color: var(--button-fg); }
.code-tabs input:focus-visible + label { outline: 2px solid var(--fg); outline-offset: 2px; }
.tab-panel { display: none; width: 100%; }
.tab-panel pre { margin: 0; background: none; padding: 14px 18px 18px; }
#tab-functions:checked ~ .panel-functions, #tab-react:checked ~ .panel-react, #tab-terminal:checked ~ .panel-terminal { display: block; }
.stack .center { margin-top: -0.4em; }
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px; max-width: 52rem; margin: 20px auto 0; }
.stack-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; border-radius: 4px;
  background: var(--soft); border: 1px solid var(--line); text-decoration: none; text-align: center; }
.stack-item:hover { border-color: var(--fg); }
.stack-item .icon { width: 30px; height: 30px; }
.stack-item strong { font-size: 1.1rem; font-weight: 600; }
.stack-item span { color: var(--muted); font-size: 14px; }
.narrow { max-width: 46rem; margin: 0 auto; }
.wide .narrow h2 { text-align: left; }
.why h2 { text-align: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 12px; }
.card { border-radius: 4px; padding: 20px 22px 16px; background: var(--soft-2); }
.card h3 { margin: 10px 0 6px; font-size: 1.1rem; font-weight: 500; }
.card p { margin: 0; }
.honest { max-width: 46rem; margin: 0 auto; padding-left: 20px; color: var(--muted); }
.honest li { margin: 4px 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: center; margin: 24px 0; }
.wide .split h2 { text-align: left; margin-top: 0.6em; }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; display: block; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 4px; }

/* 404. */
.not-found { max-width: 40rem; margin: 64px auto 0; text-align: center; }
.not-found h1 { font-size: 2rem; }
.not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.not-found-actions .button { margin: 0; }

@media (max-width: 860px) {
  .what-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 2.1rem; }
}
@media (max-width: 640px) {
  .hero::before { height: calc(100% + 61px - 9rem); }
  .hero-actions { position: static; transform: none; width: 100%; max-width: 20rem; margin: 24px auto 0; }
  .hero-actions .button { box-shadow: none; }
  .pill { flex-direction: column; align-items: flex-start; border-radius: 10px; gap: 6px; padding: 12px 20px; width: 100%; }
}
@media (max-width: 520px) {
  h1, .hero h1 { font-size: 1.75rem; }
  .hero h1 { margin-bottom: 24px; }
  .frame img { border-width: 2px; }
  .feature { padding: 16px 16px 14px 52px; }
  .feature .icon { left: 16px; top: 17px; }
  .top nav { gap: 6px 14px; }
  .top .bar { flex-wrap: nowrap; }
  .brand { font-size: 19px; }
  .top nav .nav-why, .top nav .nav-long { display: none; }
  .top nav .nav-short { display: inline; }
  .footer-links { gap: 8px 40px; }
}
