/* carebun.com in the carebun theme: the same tokens, faces, menu, cards and pills as the reading portal
   (../portal/assets/carebun.css). Kept whole in this file so the page renders without the portal's build. */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --sunken: #e9ebef; --fg: #171a20; --muted: #5f6673; --faint: #8b92a0;
  --line: #dde0e6; --accent: #0d7c78; --accent-ink: #ffffff; --accent-soft: #e0f2f1;
  --hot: #d9541f; --hot-soft: #fbe9e0; --code-bg: #f0f1f4;
  --up: #1f8a4c; --up-soft: #dcf1e4; --down: #c0392b; --warn: #c98a1a;
  --shadow: 0 1px 2px rgba(23,26,32,.06), 0 8px 24px -12px rgba(23,26,32,.18);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  /* the names the back office and the write-up still use */
  --cream: var(--bg); --crumb: var(--surface); --flour: var(--sunken); --ink: var(--fg); --ink-2: var(--muted); --ink-3: var(--faint);
  --line-2: var(--line); --crust: var(--accent); --crust-deep: var(--accent); --crust-soft: var(--accent-soft); --sesame: var(--sunken);
  --leaf: var(--up); --leaf-soft: var(--up-soft); --berry: var(--down); --sun: var(--warn); --shadow-lg: var(--shadow);
  --serif: var(--display); --sans: var(--display);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111318; --surface: #191c23; --sunken: #0d0f13; --fg: #e8eaee; --muted: #a0a7b4; --faint: #6f7684;
  --line: #2a2f3a; --accent: #4cc5bf; --accent-ink: #0b1a19; --accent-soft: #15302f; --hot: #ff8a5c; --hot-soft: #3a2218;
  --code-bg: #0f1116; --up: #5fd08a; --up-soft: #16301f; --down: #ff7b72; --warn: #e7bb5e;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--fg); font: 16px/1.6 var(--display); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
p { text-wrap: pretty; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: .86em; background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 10px; z-index: 80; }
.skip:focus { left: 16px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font: 600 .72rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- parts shared with the portal ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none !important; color: inherit; }
.brand .mark { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 800 .95rem var(--display); }
.brand .t { font: 700 1rem var(--display); letter-spacing: -.01em; white-space: nowrap; }
.who { font: 600 .8rem var(--display); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); text-decoration: none !important; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.who:hover { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 .88rem var(--display); padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); text-decoration: none !important; white-space: nowrap; cursor: pointer; }
.btn:hover { filter: brightness(1.07); }
.btn.hot { background: var(--hot); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); filter: none; }
.btn.sm { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: default; }
.pill { font: 700 .7rem var(--display); padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); white-space: nowrap; }

/* ---------- the shell: the left-side menu, then the page ---------- */
body.pshell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.pbar { display: none; }
.menu { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.menu .brand { flex: none; padding: 2px 6px 14px; }
.menu nav { display: grid; gap: 2px; }
.menu nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; font: 600 .95rem var(--display); color: var(--fg); text-decoration: none; }
.menu nav a svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu nav a:hover { background: var(--sunken); }
.menu nav a.on { background: var(--accent-soft); color: var(--accent); }
.menu nav a.on svg { stroke: var(--accent); }
.menu nav a.mine { display: none; margin-top: 8px; }
:root[data-signed-in] .menu nav a.mine { display: flex; }
.menu .sub-nav { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.menu .sub-nav p { font: 600 .68rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 10px 6px; }
.menu .sub-nav a { padding: 6px 10px; font-size: .88rem; font-weight: 500; color: var(--muted); }
.menu .sub-nav a:hover { color: var(--fg); }
.menu-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); justify-items: start; }
.menu-foot .kept { font: .76rem/1.45 var(--display); color: var(--muted); }
:root[data-signed-in] .menu-foot .kept { display: none; }
.scrim { display: none; }
.pmain { min-width: 0; }
.pg { max-width: 1120px; margin: 0 auto; padding: 36px 24px 20px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 8px 0 34px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin: 14px 0 0; }
.hero h1 em, .hdb-head h2 em { font-style: normal; color: var(--accent); }
.lede { font-family: var(--body); font-size: 1.08rem; line-height: 1.6; color: var(--muted); max-width: 56ch; margin-top: 14px; }
.cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.tray { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.tray-head, .tray-foot { display: flex; justify-content: space-between; gap: 10px; font: 600 .7rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 6px 10px; }
.tray-head [data-upcount] { color: var(--up); }
.tray-foot { padding: 10px 6px 0; justify-content: flex-start; gap: 6px; font: 500 .72rem var(--mono); letter-spacing: 0; text-transform: none; color: var(--faint); }
.tray ul { list-style: none; display: grid; gap: 4px; }
.tray li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; background: var(--bg); }
.tray-g { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 55% 32%); flex: none; }
.tray-host { flex: 1; min-width: 0; font: 400 .8rem var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-host b { color: var(--fg); font-weight: 500; }
.tray-s, .app-status { display: inline-flex; align-items: center; gap: 7px; font: 400 .72rem var(--mono); color: var(--faint); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.up { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 18%, transparent); }
.dot.wait { background: var(--faint); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- numbers ---------- */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 44px; }
.numbers div { padding: 14px 16px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.numbers b { font: 800 1.6rem/1.1 var(--display); letter-spacing: -.02em; color: var(--hot); font-variant-numeric: tabular-nums; }
.numbers span { color: var(--muted); font-size: .8rem; line-height: 1.35; }

/* ---------- the apps ---------- */
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.directory, .hdb, .how, .ideas { scroll-margin-top: 70px; }
.dir-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.dir-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunken); }
.chips button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 .85rem var(--display); color: var(--muted); white-space: nowrap; }
.chips button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--faint); }
.search input { height: 38px; width: 220px; padding: 0 38px 0 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.search input:focus, .idea-form input:focus, .idea-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search kbd { position: absolute; right: 10px; font: 500 .68rem var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.group { margin-bottom: 38px; }
.group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.group-head h3 { font-size: 1.3rem; }
.group-head p { color: var(--muted); font-size: .84rem; }
.group-head .count { margin-left: auto; font: 500 .76rem var(--mono); color: var(--faint); }
.apps { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.app { display: flex; flex-direction: column; }
.app-link { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 18px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none !important; }
.app-link:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.app-top { display: flex; justify-content: space-between; align-items: center; }
.glyph { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 55% 32%); }
.app-name { font: 700 1.12rem/1.2 var(--display); letter-spacing: -.01em; margin-top: 4px; }
.app-tag { font-weight: 600; font-size: .9rem; line-height: 1.4; color: var(--fg); }
.app-blurb { font-family: var(--body); color: var(--muted); font-size: .92rem; line-height: 1.5; }
.facts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.facts span { font: 700 .7rem var(--display); padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.app-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sub { font: 400 .76rem var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.sub b { color: var(--fg); font-weight: 500; }
.sub-state { font: 700 .64rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); margin-right: 4px; }
.sub.on .sub-state { color: var(--up); }
.go { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--sunken); color: var(--muted); transition: background .15s, color .15s; }
.app-link:hover .go { background: var(--accent); color: var(--accent-ink); }
.app-notes { display: inline-flex; align-items: center; gap: 7px; margin: 8px 4px 0; font-size: .8rem; font-weight: 600; }
.uptime { display: flex; align-items: center; gap: 10px; }
.strip { display: flex; gap: 2px; flex: 1; }
.strip i { flex: 1; height: 10px; border-radius: 2px; background: var(--sunken); }
.strip i.ok { background: color-mix(in srgb, var(--up) 70%, var(--surface)); }
.strip i.part { background: var(--warn); }
.strip i.bad { background: var(--down); }
.uptime-label { font: 400 .66rem var(--mono); color: var(--faint); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.linkish { background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- HanuDB, the database underneath (words and numbers from hanudb/docs/site/hanudb.html) ---------- */
.hdb, .how { padding: 40px 0 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.hdb { display: flex; flex-direction: column; gap: 22px; }
.hdb-head h2 { max-width: 26ch; }
.hdb-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.hdb-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.hdb-box h3 { font-size: 1.1rem; }
.hdb-box ul { list-style: none; display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.hdb-box b { color: var(--fg); }
.hdb-box p { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; font-size: .86rem; }
.hdb-box.vm { border-top: 3px solid var(--accent); }
.hdb-box.bucket { border-top: 3px solid var(--hot); }
.hdb-arrows { display: flex; flex-direction: column; justify-content: center; gap: 12px; font: 500 .74rem var(--mono); color: var(--muted); text-align: center; }
.hdb-arrows span { padding: 6px 10px; border-radius: 999px; background: var(--sunken); white-space: nowrap; }
.hdb-arrows i { font-style: normal; color: var(--accent); }
.hdb-quote { font: 400 1.06rem/1.55 var(--body); color: var(--fg); max-width: 70ch; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.hdb-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hdb-grid > *, .hdb-pair > * { min-width: 0; }
.hdb-steps { list-style: none; counter-reset: s; display: grid; gap: 8px; }
.hdb-steps li { counter-increment: s; position: relative; padding: 12px 16px 12px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-family: var(--body); font-size: .92rem; color: var(--muted); line-height: 1.5; }
.hdb-steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 .72rem var(--display); }
.hdb-steps b { color: var(--fg); display: block; font: 700 .95rem var(--display); margin-bottom: 2px; }
.hdb-side { display: grid; gap: 14px; position: sticky; top: 20px; }
.hdb-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hdb-nums div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column-reverse; }
.hdb-nums dd { font: 800 1.5rem/1.1 var(--display); letter-spacing: -.02em; color: var(--hot); font-variant-numeric: tabular-nums; }
.hdb-nums dt { font-size: .78rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.hdb-note { font-size: .78rem; color: var(--faint); line-height: 1.5; }
.hdb-try { max-width: 100%; font: .76rem/1.6 var(--mono); background: #12151b; color: #e8eaee; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); overflow-x: auto; white-space: pre; }
.hdb-try code { background: none; padding: 0; font-size: inherit; }
.hdb-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.linkish-a { font-weight: 600; font-size: .86rem; }

/* ---------- how we build ---------- */
.principles { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.principles li { padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.principles svg { color: var(--accent); }
.principles h3 { font-size: 1.02rem; }
.principles p { font-family: var(--body); color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ---------- suggest one ---------- */
.ideas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start; margin: 44px 0 20px; padding: 28px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--line); }
.ideas-copy p:not(.eyebrow) { font-family: var(--body); color: var(--muted); margin-top: 12px; font-size: 1rem; }
.ideas .eyebrow { color: var(--accent); }
.seeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.seeds button { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 999px; padding: 5px 12px; font: 600 .8rem var(--display); }
.seeds button:hover { border-color: var(--accent); color: var(--accent); }
.idea-form { display: flex; flex-direction: column; gap: 12px; background: var(--surface); padding: 20px; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.idea-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .82rem; color: var(--muted); flex: 1; min-width: 0; }
.idea-form small { font-weight: 400; color: var(--faint); }
.idea-form input, .idea-form textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: .95rem; font-weight: 400; color: var(--fg); resize: vertical; width: 100%; }
.idea-form .row { display: flex; gap: 12px; }
.idea-form .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; }
.form-msg { font-size: .86rem; min-height: 1.2em; }
.form-msg.ok { color: var(--up); font-weight: 600; } .form-msg.err { color: var(--down); }

/* ---------- foot ---------- */
.foot { max-width: 1120px; margin: 36px auto 0; padding: 20px 24px 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--faint); font-size: .8rem; }
.foot a { color: var(--muted); } .foot b { color: var(--fg); }
.foot .fine { margin-left: auto; }

@media (prefers-color-scheme: dark) {
  .tray-g, .glyph { background: hsl(var(--h) 28% 20%); color: hsl(var(--h) 60% 76%); }
}
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hdb-grid { grid-template-columns: minmax(0, 1fr); } .hdb-side { position: static; }
  .principles { grid-template-columns: 1fr 1fr; }
  .ideas { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body.pshell { display: block; }
  .pbar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .pbar .brand { flex: 1 1 auto; }
  .menu-btn { width: 36px; height: 36px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; color: var(--fg); flex: none; }
  .menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .menu { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: min(280px, 84vw); height: auto; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .menu { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.35); }
  .menu-foot .who { display: none; }
  .pg { padding: 24px 16px 10px; }
  .foot { padding: 18px 16px 36px; } .foot .fine { margin-left: 0; }
}
@media (max-width: 720px) {
  .numbers { grid-template-columns: 1fr 1fr; margin-bottom: 34px; }
  .dir-tools, .search, .search input { width: 100%; }
  .chips { overflow-x: auto; max-width: 100%; }
  .apps { grid-template-columns: 1fr; }
  .hdb-pair { grid-template-columns: 1fr; }
  .hdb-arrows { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .hdb-arrows span { white-space: normal; }
  .principles { grid-template-columns: 1fr; }
  .ideas { padding: 18px; }
  .idea-form { padding: 16px; }
  .idea-form .row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
