:root {
  --ink: #1f2933;
  --muted: #5f6b76;
  --line: #d9dee3;
  --accent: #1d5fa8;
  --accent-ink: #ffffff;
  --paper: #ffffff;
  --tint: #f3f6f9;
  --mark: #fff3bf;
  --error: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 680px; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; gap: 24px; justify-content: space-between; padding-top: 20px; padding-bottom: 32px; }

.button {
  display: inline-block;
  padding: 12px 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); max-width: 18em; margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--muted); max-width: 40em; }

.how { background: var(--tint); padding: 40px 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.steps h2 { font-size: 19px; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--muted); }

.examples { padding: 48px 0; }
.example-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.example-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.example-card:hover { border-color: var(--accent); }
.example-field { font-weight: 700; }
.example-brief { color: var(--muted); font-size: 15px; font-style: italic; }
.example-first { font-size: 15px; }
.example-more { margin-top: auto; color: var(--accent); font-weight: 600; }

.pricing { background: var(--tint); padding: 48px 0; }
.pricing h2 { font-size: 40px; margin: 0; }
.pricing h2 small { font-size: 18px; color: var(--muted); font-weight: 400; }

.waitlist-form { display: grid; gap: 8px; margin-top: 20px; }
.waitlist-form label { font-weight: 600; font-size: 15px; }
.waitlist-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.waitlist-form .button { justify-self: start; margin-top: 8px; }
.fineprint { font-size: 14px; color: var(--muted); }
.error { color: var(--error); margin: 0; font-size: 15px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Example digest page, styled like the email itself. */
.example-page { padding-top: 24px; }
.example-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 13px; color: var(--muted); }
.profile-brief { background: var(--tint); border-radius: 8px; padding: 16px 20px; margin-bottom: 28px; }
.profile-brief h1 { font-size: 15px; margin: 0 0 4px; color: var(--muted); }
.profile-brief p { margin: 0; font-style: italic; }

.digest { border: 1px solid var(--line); border-radius: 8px; padding: 24px; overflow-wrap: anywhere; }
.digest-meta { font-size: 14px; color: var(--muted); margin-top: 0; }
.digest-title { margin: 0; font-size: 24px; }
.digest-date { color: var(--muted); margin-top: 4px; }
.paper { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.paper h3 { font-size: 18px; margin: 0 0 6px; }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { text-decoration: underline; }
.paper-authors, .paper-source { margin: 0; font-size: 15px; color: var(--muted); }
.paper-reason { margin-bottom: 4px; }
.paper-feedback { margin-top: 0; font-size: 15px; color: var(--accent); }
.digest-footer { border-top: 1px solid var(--line); margin-top: 20px; font-size: 14px; color: var(--muted); }
.digest-footer p { margin: 6px 0; }
.cta { margin-top: 28px; }

/* Signing in, the chat, the profile and the preview. */
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.site-nav { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.site-nav form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.page { padding-top: 32px; }
.page h1 { font-size: 30px; margin-top: 0; }
.notice { background: var(--tint); border-radius: 6px; padding: 10px 14px; font-size: 15px; }
.digest-state { background: var(--tint); border-radius: 6px; padding: 10px 14px; font-size: 15px; }
.digest-state p { margin: 0 0 8px; }
.digest-state form { margin: 0; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.stack-form { display: grid; gap: 8px; margin-top: 20px; }
.stack-form label { font-weight: 600; font-size: 15px; margin-top: 8px; }
.stack-form .choice, .choices .choice { display: flex; gap: 8px; align-items: baseline; font-weight: 400; font-size: 16px; margin-top: 4px; }
.choices { border: 0; padding: 0; margin: 8px 0 0; }
.choices legend { font-weight: 600; font-size: 15px; padding: 0; }
.stack-form input:not([type="checkbox"]):not([type="radio"]), .stack-form textarea, .stack-form select, .chat-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.stack-form .button { justify-self: start; margin-top: 12px; }
.restart { margin-top: 16px; }

.chat { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 12px; }
.bubble { margin: 0; padding: 10px 14px; border-radius: 10px; max-width: 85%; overflow-wrap: anywhere; }
.bubble-assistant { background: var(--tint); align-self: flex-start; }
.bubble-user { background: var(--accent); color: var(--accent-ink); align-self: flex-end; }
.bubble-problem { border: 1px solid var(--error); color: var(--error); align-self: flex-start; }
.thinking { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.htmx-indicator { opacity: 0; transition: opacity 150ms; }
.htmx-request.htmx-indicator { opacity: 1; }
.chat-form { display: grid; gap: 8px; }
.chat-form .button { justify-self: end; }
.chat-form textarea:disabled, .chat-form .button:disabled { opacity: 0.6; }
.chat-links { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; font-size: 15px; }
.chat-links form { margin: 0 0 0 auto; }

.progress { padding-left: 22px; }
.progress li { margin: 6px 0; }
.progress .current { font-weight: 600; }
.progress .waiting { color: var(--muted); }
.progress .done { color: var(--muted); text-decoration: line-through; }

.paper-near { opacity: 0.85; }
.paper-label { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.rating { display: flex; gap: 8px; margin: 8px 0 0; }
.rate-button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--accent); font: inherit; font-size: 15px; cursor: pointer; }
.rate-button:hover { border-color: var(--accent); }
.rate-chosen { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.next-step { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 28px; }
.advanced { margin-top: 32px; font-size: 15px; }
.advanced summary { cursor: pointer; color: var(--muted); }
.query-source { margin: 12px 0 4px; font-weight: 600; }
.query { margin: 0; padding: 10px 12px; background: var(--tint); border-radius: 6px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

.prose { padding-top: 24px; }
.prose mark { background: var(--mark); }
.updated { color: var(--muted); }
.thanks { padding-top: 48px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .digest { padding: 16px; }
  .site-footer .wrap { flex-direction: column; gap: 8px; }
}
