/* AgentPage public site. One stylesheet, no build step, no JavaScript, no web fonts.
   Mobile-first. Light and dark follow the visitor's system setting. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1c1b19;
  --muted: #55524b;
  --border: #d6d2c7;
  --accent: #0b5d57;
  --accent-text: #ffffff;
  --link: #0b5d57;
  --focus: #1a4fd6;
  --note-bg: #e8f3f1;
  --draft-bg: #fff2b8;
  --draft-text: #3a2f00;
  --draft-border: #b89400;
  --code-bg: #efece4;
  --radius: 10px;
  --wrap: 68rem;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121413;
    --surface: #1a1d1c;
    --surface-2: #222625;
    --text: #ecebe6;
    --muted: #b4b2aa;
    --border: #3a3f3d;
    --accent: #5fd0c4;
    --accent-text: #08201d;
    --link: #7fdcd1;
    --focus: #8fb2ff;
    --note-bg: #17302d;
    --draft-bg: #4a3d00;
    --draft-text: #ffe9a0;
    --draft-border: #a68500;
    --code-bg: #25292a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }
main > .wrap { padding-top: 1.5rem; }

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.measure { max-width: var(--measure); }

/* Skip link */
.skip {
  position: absolute;
  left: 16px;
  top: -4rem;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 10;
}
.skip:focus { top: 8px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-header nav ul,
.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
}
.site-header nav a,
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}
.site-header nav a:hover,
.site-footer nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer nav a { color: var(--link); text-decoration: underline; }

/* Typography */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol, dl, table, pre, blockquote { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.35rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

code, kbd, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
code, kbd {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
pre code { background: none; padding: 0; overflow-wrap: normal; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Hero */
.hero { padding: 1.5rem 0 1rem; }
.hero h1 { font-size: 2.1rem; max-width: 22ch; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-text);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--link); }

/* Sections and cards */
section { scroll-margin-top: 1rem; }
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1rem 3.6rem;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.steps p { margin: 0; }

/* Example prompts */
.prompt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin: 0 0 0.5rem;
  font-style: normal;
}
.prompt-note { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.95rem; }

/* Illustration of the morning email */
.mail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 34rem;
  overflow: hidden;
}
.mail header {
  background: var(--surface-2);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.mail header p { margin: 0; }
.mail .body { padding: 0.9rem 1rem 0.3rem; }
.mail .body li { margin-bottom: 0.6rem; }
.caption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Notes and callouts */
.note {
  background: var(--note-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
}
.note p:last-child { margin-bottom: 0; }
.note strong:first-child { display: inline-block; margin-bottom: 0.15rem; }

/* DRAFT markers: legal pages and placeholders */
.draft-banner {
  background: var(--draft-bg);
  color: var(--draft-text);
  border-bottom: 3px solid var(--draft-border);
  padding: 0.75rem 0;
  font-size: 0.95rem;
}
.draft-banner p { margin: 0; }
.draft-note {
  background: var(--draft-bg);
  color: var(--draft-text);
  border: 1px dashed var(--draft-border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.draft-note p:last-child { margin-bottom: 0; }
mark.ph {
  background: var(--draft-bg);
  color: var(--draft-text);
  padding: 0.05em 0.3em;
  border-radius: 4px;
  border: 1px solid var(--draft-border);
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap:focus-visible { outline-offset: 0; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 36rem;
  margin: 0;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  font-weight: 700;
  padding: 0.7rem 0.9rem 0.3rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--border);
}
thead th { background: var(--surface-2); border-top: 0; }
tbody th { font-weight: 600; }

/* Legal pages */
.legal { max-width: var(--measure); }
.legal h2 { font-size: 1.3rem; }
.legal ol.clauses { padding-left: 1.4rem; }
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin: 1.25rem 0 2rem;
}
.toc h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.toc ol, .toc ul { margin: 0; columns: 1; }
.toc li { break-inside: avoid; }
.toc a { display: inline-block; padding: 0.15rem 0; }

dl.defs dt { font-weight: 700; margin-top: 0.75rem; }
dl.defs dd { margin: 0 0 0.25rem 0; }

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2rem 1rem;
  margin: 0 0 0.75rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Wider screens */
@media (min-width: 40rem) {
  h1 { font-size: 2.4rem; }
  .hero h1 { font-size: 2.8rem; }
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .toc ol, .toc ul { columns: 2; column-gap: 2rem; }
}

@media (min-width: 56rem) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .hero { padding: 3rem 0 2rem; }
}

@media print {
  .site-header nav, .skip, .actions { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .draft-banner, .draft-note, mark.ph { border: 1px solid #000; background: #fff; color: #000; }
}

/* Conversations: example chat with an assistant, and the visitor's chat window */
.convo { display: grid; gap: 0.6rem; max-width: 42rem; margin: 0 0 0.5rem; }
.msg {
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  max-width: 94%;
  border: 1px solid var(--border);
  background: var(--surface);
}
.msg .who { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.15rem; }
.msg p { margin: 0 0 0.5rem; }
.msg p:last-child { margin-bottom: 0; }
.msg.you { justify-self: end; background: var(--note-bg); }
.msg.tool { justify-self: start; font-size: 0.9rem; color: var(--muted); border-style: dashed; background: transparent; }
.msg code { font-size: 0.85em; }

.chatwin {
  display: grid;
  gap: 0.5rem;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}
.chatwin .bubble { padding: 0.6rem 0.9rem; border-radius: 14px; max-width: 88%; background: var(--surface-2); }
.chatwin .bubble p { margin: 0 0 0.4rem; }
.chatwin .bubble p:last-child { margin-bottom: 0; }
.chatwin .bubble.visitor { justify-self: end; background: var(--accent); color: var(--accent-text); }
.chatwin .notice { font-weight: 600; }

/* Connection address */
.address {
  display: block;
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-wrap: anywhere;
  user-select: all;
}

.two-col { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 52rem) { .two-col { grid-template-columns: 1fr 1fr; } }

.faq details { margin-bottom: 0.6rem; }
.faq details p:last-child { margin-bottom: 0.8rem; }
