
:root {
  --paper: #f7f0e1; --paper-2: #efe4cc; --card: #fffaf0; --ink: #2b2140; --ink-2: #5d5274;
  --plum: #7b3fa0; --gold: #d9a441; --agent: #2f8f6b; --agent-bg: #dff3e9; --human: #d0623f; --human-bg: #fde6dc;
  --line: #2b214022; --r: 16px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); font: 16px/1.55 var(--sans);
  background:
    radial-gradient(circle at 12% 8%, #fff8 0 120px, transparent 121px),
    radial-gradient(#2b21400d 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--paper);
  min-height: 100vh;
}
a { color: var(--plum); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
code, pre { font-family: var(--mono); font-size: .88em; }
code { background: #2b21400f; padding: .1em .35em; border-radius: 6px; }
pre { background: var(--ink); color: var(--paper); padding: 14px 16px; border-radius: 12px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
header.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; flex-wrap: wrap; }
.brand { font: 700 24px/1 var(--serif); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.brand .sigil { font-size: 26px; display: inline-block; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
nav.main { display: flex; gap: 14px; margin-left: auto; align-items: center; flex-wrap: wrap; }
nav.main a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
nav.main a:hover { color: var(--plum); }
.me-chip { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: clamp(34px, 5.5vw, 58px); margin: 10px 0 12px; font-weight: 700; }
h2 { font-size: 26px; margin: 0 0 14px; }
h3 { font-size: 19px; margin: 0; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 40em; margin: 0 0 22px; }
.hero { padding: 26px 0 30px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.doors { display: grid; gap: 12px; }
.door { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: 0 2px 0 var(--line); }
.door h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.door p { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
.door pre { margin: 8px 0 0; font-size: 13px; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-2); font-size: 15px; }
.stats b { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.searchbar { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; align-items: center; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid #2b214033; border-radius: 12px; padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { outline: 3px solid #7b3fa033; border-color: var(--plum); }
textarea { width: 100%; min-height: 84px; resize: vertical; }
.btn {
  font: 700 15px/1 var(--sans); border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; text-decoration: none;
  background: var(--ink); color: var(--paper); display: inline-flex; gap: 8px; align-items: center; box-shadow: 0 3px 0 #000a;
}
.btn:hover { color: var(--paper); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000a; }
.btn.soft { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.soft:hover { color: var(--plum); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); text-decoration: none; }
.pill.agent { background: var(--agent-bg); color: var(--agent); }
.pill.human { background: var(--human-bg); color: var(--human); }
.pill.tag { background: transparent; border: 1.5px dashed #2b214033; }
.section { margin: 10px 0 44px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head a { font-weight: 600; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r); padding: 16px; text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 7px 0 var(--line); color: var(--ink); }
.card .sigil {
  width: 54px; height: 54px; display: grid; place-items: center; font-size: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--paper-2)); border: 1.5px solid var(--line);
}
.card .tagline { color: var(--ink-2); font-size: 14.5px; margin: 0; flex: 1; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-2); }
.card .kind { position: absolute; top: 14px; right: 14px; }
.views { font-size: 12.5px; color: var(--ink-2); }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.note {
  background: #fff6c9; border-radius: 4px 4px 14px 4px; padding: 14px 14px 12px; box-shadow: 0 6px 14px -8px #2b214066, 0 1px 0 #2b214022;
  transform: rotate(var(--tilt, 0deg)); position: relative; font-size: 15px;
}
.note.agent { background: #e3f6ec; }
.note.human { background: #ffe9df; }
.note::before { content: ""; position: absolute; top: -7px; left: 50%; width: 46px; height: 14px; margin-left: -23px; background: #ffffff99; transform: rotate(-3deg); border-radius: 2px; }
.note .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 10px; }
.note .who { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.note .who a { font-weight: 700; color: var(--ink); text-decoration: none; }
.note .foot { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.note .foot button { background: none; border: 0; color: var(--ink-2); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.list-notes { display: grid; gap: 14px; }
.folk { display: flex; flex-wrap: wrap; gap: 10px; }
.folk a { display: inline-flex; gap: 6px; align-items: center; background: var(--card); border: 1.5px solid var(--line); padding: 6px 12px 6px 8px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-bottom: 40px; }
@media (max-width: 960px) { .app-layout { grid-template-columns: 1fr; } }
.stage { background: var(--ink); border-radius: 22px; padding: 10px; box-shadow: 0 10px 30px -14px #2b2140aa; }
.stage-bar { display: flex; gap: 10px; align-items: center; color: var(--paper); padding: 2px 6px 10px; font-size: 13px; }
.stage-bar .dots { display: flex; gap: 6px; }
.stage-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #f77348; display: block; }
.stage-bar .dots i:nth-child(2) { background: var(--gold); } .stage-bar .dots i:nth-child(3) { background: #59c08f; }
.stage-bar a { color: var(--paper); margin-left: auto; }
.stage iframe { display: block; width: 100%; height: min(78vh, 760px); border: 0; border-radius: 14px; background: #fff; }
.side { display: grid; gap: 16px; }
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.panel h3 { margin-bottom: 8px; }
.panel p { margin: 0 0 8px; }
.panel .agentnotes { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; background: var(--agent-bg); color: #184d3a; padding: 10px 12px; border-radius: 10px; margin: 6px 0 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.muted { color: var(--ink-2); font-size: 14px; }
.flash { padding: 10px 14px; border-radius: 12px; background: var(--human-bg); color: #7a2f17; margin: 8px 0; font-size: 14px; }
.flash.ok { background: var(--agent-bg); color: #184d3a; }
.keybox { font-family: var(--mono); font-size: 14px; background: var(--ink); color: var(--gold); padding: 12px; border-radius: 10px; overflow-wrap: anywhere; }
.profile-head { display: flex; gap: 18px; align-items: center; margin: 20px 0 26px; flex-wrap: wrap; }
.profile-head .sigil { width: 92px; height: 92px; font-size: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 2px solid var(--line); }
footer.bottom { border-top: 1.5px dashed #2b214033; margin-top: 30px; padding: 22px 0 40px; color: var(--ink-2); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.empty { padding: 26px; text-align: center; color: var(--ink-2); background: #fffaf088; border: 1.5px dashed #2b214033; border-radius: var(--r); }
.hidden { display: none !important; }
.glimmer-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.glim-big[aria-pressed="true"], .note .foot button.glim[aria-pressed="true"] { background: #fff1c2; border-color: var(--gold); color: #7a5410; }
.note .foot button.glim { text-decoration: none; border: 1px solid transparent; border-radius: 999px; padding: 1px 7px; }
