/* moria.im: the apps' visual language (apps/client theme/Theme.kt). Circles are people (indigo), rounded squares
   with a diamond are agents (teal), a dashed amber ring means an agent sends what it reads to an AI company. */
:root {
  --ground: #f1f4f4; --paper: #ffffff; --paper-2: #f8fafa; --ink: #16202a; --ink-soft: #56626d; --line: #d9e0e0;
  --human: #3b45a3; --human-deep: #1b2470; --human-tint: #e2e4f7;
  --agent: #08766c; --agent-deep: #034841; --agent-tint: #d5eeea;
  --local: #3a7437; --own: #4a6989; --third: #9c6210; --third-tint: #ffe6bf;
  --code: #eaefee; --shadow: 0 18px 50px rgba(16, 23, 30, .10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #10171e; --paper: #18212b; --paper-2: #151e27; --ink: #e1e8ed; --ink-soft: #9aa7b3; --line: #2b3743;
    --human: #a7aeff; --human-deep: #dee0ff; --human-tint: #262c55;
    --agent: #55d3c3; --agent-deep: #b8f1e8; --agent-tint: #0f3a36;
    --local: #8fcb89; --own: #9fb8d6; --third: #e6b25e; --third-tint: #4a3410;
    --code: #1c2631; --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #10171e; --paper: #18212b; --paper-2: #151e27; --ink: #e1e8ed; --ink-soft: #9aa7b3; --line: #2b3743;
  --human: #a7aeff; --human-deep: #dee0ff; --human-tint: #262c55;
  --agent: #55d3c3; --agent-deep: #b8f1e8; --agent-tint: #0f3a36;
  --local: #8fcb89; --own: #9fb8d6; --third: #e6b25e; --third-tint: #4a3410;
  --code: #1c2631; --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; } }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.6 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--human); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--human); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: "Bricolage Grotesque", Figtree, system-ui, sans-serif; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); line-height: 1.12; font-weight: 700; }
h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; letter-spacing: 0; }
p { margin: 0; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
code { background: var(--code); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { background: var(--code); padding: 14px 16px; border-radius: 12px; overflow-x: auto; margin: 0; line-height: 1.55; }
pre code { background: none; padding: 0; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--agent); }
.muted { color: var(--ink-soft); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.25rem; }
.brand img { width: 30px; height: 30px; }
.top nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); background: var(--paper); }
@media (max-width: 620px) { .top nav a.hide-sm { display: none; } .top .wrap { gap: 8px; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 0; cursor: pointer; }
.btn.primary { background: var(--human); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #141b5c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #141b5c; } }
.btn.quiet { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* sections */
section { padding-block: 72px; }
.section-head { display: grid; gap: 12px; max-width: 720px; margin-bottom: 36px; }
.section-head p { font-size: 1.1rem; color: var(--ink-soft); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; gap: 10px; align-content: start; }
.panel p { color: var(--ink-soft); }

/* avatars: the apps' shapes */
.av { --s: 36px; width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .42); position: relative; }
.av.person { border-radius: 50%; background: var(--human); color: #fff; }
.av.agent { border-radius: 30%; background: var(--agent); color: #fff; }
.av.agent::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 30%; height: 30%; background: var(--paper); transform: rotate(45deg); border: 2px solid var(--agent); border-radius: 2px; }
.av.local { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--local); }
.av.own { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--own); }
.av.third { outline: 2px dashed var(--third); outline-offset: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av.person, :root:not([data-theme="light"]) .av.agent { color: #10171e; } }
:root[data-theme="dark"] .av.person, :root[data-theme="dark"] .av.agent { color: #10171e; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; background: var(--agent); color: var(--paper); }
.chip { display: inline-flex; align-items: center; font-size: 12px; padding: 1px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.chip.local { color: var(--local); }
.chip.own { color: var(--own); }
.chip.third { color: var(--third); background: var(--third-tint); border-style: dashed; }

/* footer */
footer.foot { border-top: 1px solid var(--line); padding-block: 40px 56px; margin-top: 40px; }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; color: var(--ink-soft); font-size: .95rem; }
footer.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
footer.foot a { color: var(--ink-soft); }

/* long text pages (docs, privacy, licenses) */
.page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-block: 48px 24px; }
@media (max-width: 900px) { .page { grid-template-columns: minmax(0, 1fr); } .page nav.toc { position: static; } }
.page nav.toc { position: sticky; top: 88px; align-self: start; display: grid; gap: 2px; font-size: .95rem; }
.page nav.toc a { color: var(--ink-soft); text-decoration: none; padding: 5px 10px; border-radius: 8px; }
.page nav.toc a:hover { background: var(--paper); color: var(--ink); }
.prose { max-width: 72ch; display: grid; gap: 18px; }
.prose h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.prose h2 { font-size: 1.6rem; margin-top: 28px; scroll-margin-top: 84px; }
.prose h3 { margin-top: 8px; scroll-margin-top: 84px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.prose .lede { font-size: 1.15rem; color: var(--ink-soft); }
.note { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--agent); border-radius: 12px; padding: 14px 18px; }
.note.warn { border-left-color: var(--third); }
table.plain { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.plain th, table.plain td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
table.plain tr:last-child td { border-bottom: 0; }
.steps { counter-reset: s; display: grid; gap: 14px; padding: 0; list-style: none; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.steps > li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--human-tint); color: var(--human); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
pre[data-copy] { position: relative; padding-right: 76px; }
pre .copy { position: absolute; top: 8px; right: 8px; font: 600 12px Figtree, system-ui, sans-serif; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer; }
