/* ==========================================================================
   Roxan — tokens, type and the parts the site and the app share.
   Black, white and a hairline: no gradients, no glow, no colour. Status is
   carried by words and shape, never by colour alone. One quiet face for
   everything you read and press; the display face is kept for a few large
   lines, so each of them means something.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0a0a0a;       /* cards, fields, the composer */
  --raise: #151515;       /* the row you are on, your own messages, toasts */
  --wash: rgba(255, 255, 255, .06);    /* a row or a button under the pointer */
  --line: rgba(255, 255, 255, .08);    /* a divider */
  --line-2: rgba(255, 255, 255, .16);  /* the edge of a control or a card */
  --line-3: rgba(255, 255, 255, .34);  /* an edge that wants attention */
  --text: #f5f5f5;
  --muted: #a8a8a8;    /* 8.8:1 on black */
  --dim: #808080;      /* 5.3:1 on black, 4.6:1 on --raise: the smallest text */
  --r1: 8px;           /* rows, small buttons, fields inside a card */
  --r2: 12px;          /* fields, notes */
  --r3: 16px;          /* cards */
  --r4: 22px;          /* the composer, the example, a plan */
  --fd: "Unbounded", "Geist", ui-sans-serif, system-ui, sans-serif;
  --fb: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fm: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --out: cubic-bezier(.16, 1, .3, 1);
  --io: cubic-bezier(.65, 0, .35, 1);
  --t: .16s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { font: 400 16px/1.6 var(--fb); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, svg, canvas { display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
b, strong { font-weight: 500; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
::selection { background: #fff; color: #000; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 9999; padding: 8px 14px; border-radius: var(--r1); background: #fff; color: #000; font-weight: 500; }
.skip:focus { left: 14px; }

/* ------------------------------------------------------------ Type */
.label { font: 500 12.5px/1.3 var(--fb); color: var(--dim); }
.display { font: 300 clamp(44px, 7.2vw, 112px)/1 var(--fd); letter-spacing: -.055em; }
.h2 { font: 300 clamp(30px, 4vw, 56px)/1.08 var(--fd); letter-spacing: -.05em; text-wrap: balance; }
.h3 { font: 300 clamp(20px, 1.9vw, 26px)/1.2 var(--fd); letter-spacing: -.03em; }
.lead { max-width: 52ch; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.65; color: var(--muted); }
.fine { font-size: 13px; line-height: 1.5; color: var(--dim); }

/* ------------------------------------------------------------ Buttons and tags */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border-radius: 999px; background: #fff; color: #000; font: 500 14px/1 var(--fb); white-space: nowrap; transition: background var(--t), border-color var(--t), color var(--t), transform .12s; }
.btn:hover { background: #dedede; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--wash); border-color: var(--line-3); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
/* A link that goes on: the arrow in its markup is drawn as a small chevron. */
.go { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 400; color: var(--text); transition: color var(--t); }
.go i { width: 6px; height: 6px; margin-left: -1px; font-size: 0; border-top: 1.25px solid currentColor; border-right: 1.25px solid currentColor; transform: rotate(45deg); transition: transform .4s var(--out); }
.go:hover i { transform: translateX(3px) rotate(45deg); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 999px; font: 500 12px/1 var(--fb); color: var(--muted); white-space: nowrap; }
.tag.live { background: #fff; border-color: #fff; color: #000; }

/* ------------------------------------------------------------ The mark: a ring and a point of attention */
.mark { --s: 18px; position: relative; display: inline-block; flex: none; width: var(--s); height: var(--s); border: 1.5px solid currentColor; border-radius: 50%; }
.mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: calc(var(--s) * .26); height: calc(var(--s) * .26); margin: calc(var(--s) * -.13) 0 0 calc(var(--s) * -.13); border-radius: 50%; background: currentColor; transform: translate(calc(var(--s) * .12), calc(var(--s) * -.12)); }
.mark.think { animation: breathe 1.6s var(--io) infinite; }
@keyframes breathe { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* ------------------------------------------------------------ Conversation: a message is text, an action is a card */
.msg { display: flex; gap: 12px; margin: 0 0 24px; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: min(82%, 560px); padding: 10px 16px; border-radius: 18px 18px 6px 18px; background: var(--raise); font: 400 15px/1.55 var(--fb); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot > .mark { --s: 16px; margin-top: 5px; color: var(--dim); }
.msg.bot .body { flex: 1; min-width: 0; font: 380 15.5px/1.7 var(--fb); }
.msg .meta { margin-top: 6px; font: 400 12px/1.3 var(--fb); color: var(--dim); font-variant-numeric: tabular-nums; }

.md > * + * { margin-top: .9em; }
.md p { overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { font: 500 1.05em/1.35 var(--fb); letter-spacing: -.01em; margin-top: 1.4em; }
.md h1 { font-size: 1.25em; }
.md h2 { font-size: 1.14em; }
.md ul, .md ol { padding-left: 1.45em; }
.md ul li { position: relative; }
.md ul li::before { content: ""; position: absolute; left: -1.1em; top: .85em; width: 6px; height: 1px; background: var(--dim); }
.md ol { list-style: decimal; }
.md ol li::marker { color: var(--dim); font-variant-numeric: tabular-nums; }
.md li + li { margin-top: .35em; }
.md li > ul, .md li > ol { margin-top: .35em; }
.md a { text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: text-decoration-color var(--t); }
.md a:hover { text-decoration-color: #fff; }
.md code { font: 400 .86em var(--fm); padding: .12em .4em; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.md pre { position: relative; border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); overflow: auto; }
.md pre code { display: block; padding: 14px 16px; border: 0; border-radius: 0; background: none; font-size: 13px; line-height: 1.6; white-space: pre; }
.md pre .copy { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--bg); font: 500 12px/1 var(--fb); color: var(--muted); transition: color var(--t), border-color var(--t); }
.md pre .copy:hover { color: #fff; border-color: var(--line-3); }
.md blockquote { padding-left: 16px; border-left: 1px solid var(--line-3); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); }
.md table { display: block; overflow: auto; border-collapse: collapse; font-size: .92em; }
.md th, .md td { padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.md th { font: 500 12.5px/1.3 var(--fb); color: var(--dim); }

/* An action Roxan proposes or has taken. It is never drawn like a message. */
.act { margin: 4px 0 24px 28px; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--r3); background: var(--panel); }
.act[data-state="awaiting"] { border-color: var(--line-3); }
.act > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.act > header .label { color: var(--muted); }
/* The state is a word and a dot: hollow while it waits, filled once it is done. */
.act .state { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px/1 var(--fb); color: var(--muted); }
.act .state::before { content: ""; width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
.act[data-state="done"] .state { color: #fff; }
.act[data-state="done"] .state::before { background: currentColor; }
.act .title { margin-bottom: 10px; font: 500 15.5px/1.4 var(--fb); }
.act dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14.5px; font-weight: 380; }
.act dt { font: 400 13px/1.7 var(--fb); color: var(--dim); }
.act dd { overflow-wrap: anywhere; }
.act dd input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--bg); }
.act .why { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--dim); }
.act .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Something Roxan would like to keep: dashed until you say yes. */
.mem { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 4px 0 24px 28px; padding: 9px 12px 9px 14px; border: 1px dashed var(--line-3); border-radius: var(--r2); }
.mem[data-state="kept"] { border-style: solid; border-color: var(--line-2); }
.mem[data-state="dismissed"] { border-color: var(--line); color: var(--dim); }
.mem .label { color: var(--muted); }
.mem .what { flex: 1 1 200px; min-width: 0; font: 380 14.5px/1.45 var(--fb); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
