:root {
  --bg: #f4f1ea; --ink: #1d1b18; --soft: #6f6a60; --faint: #d9d3c6; --sheet: #ebe6dc; --accent: #0f6b6d; --accent-ink: #fff;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151412; --ink: #ede8df; --soft: #9b958a; --faint: #35322d; --sheet: #201e1b; --accent: #7fd0c8; --accent-ink: #0d2b2a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
body { min-height: 100dvh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

.page { max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 20px env(safe-area-inset-bottom); }

.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; }
.brand { font-family: var(--serif); font-size: 24px; text-decoration: none; letter-spacing: -0.015em; }
.brand span { color: var(--accent); font-style: italic; margin: 0 2px; }
.tools { display: flex; gap: 4px; }
.quiet { color: var(--soft); font-size: 13px; padding: 6px 10px; border-radius: 999px; }
.quiet:hover { background: var(--sheet); color: var(--ink); }

.intro { margin: auto 0; padding: 24px 0; }
.intro h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 6vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 14px; }
.intro p { color: var(--soft); margin: 0 0 26px; max-width: 46ch; }
.lenses { display: flex; flex-wrap: wrap; gap: 8px; }
.lenses button { border: 1px solid var(--faint); border-radius: 999px; padding: 9px 15px; font-size: 14px; }
.lenses button:hover, .lenses button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.thread { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; padding: 8px 0 24px; }
.thread:empty { flex: 0 0 auto; padding: 0; }
.msg { max-width: 100%; animation: rise .34s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } }
.msg.you { align-self: flex-end; max-width: 85%; background: var(--sheet); padding: 12px 16px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; word-wrap: break-word; }
.msg.q { font-family: var(--serif); font-size: clamp(21px, 3.4vw, 27px); line-height: 1.32; letter-spacing: -0.012em; padding: 4px 0; max-width: 90%; }
.msg.q p { margin: 0 0 10px; }
.msg.q p:last-child { margin: 0; }
.msg.q.first { padding-top: 12px; }
.msg.note { color: var(--soft); font-size: 14px; }
.msg.note .again { margin-left: 10px; color: var(--accent); border: 1px solid var(--faint); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.msg.note .again:hover { border-color: var(--accent); }
.msg.wait { display: flex; gap: 5px; padding: 10px 0; }
.msg.wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); animation: b 1.1s infinite; }
.msg.wait i:nth-child(2) { animation-delay: .15s; } .msg.wait i:nth-child(3) { animation-delay: .3s; }
@keyframes b { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ask { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 10px 0 10px; background: linear-gradient(to top, var(--bg) 75%, transparent); }
.ask textarea { flex: 1; resize: none; font: 17px/1.45 var(--sans); color: var(--ink); background: var(--sheet); border: 1px solid transparent; border-radius: 22px; padding: 12px 16px; max-height: 40vh; outline: none; }
.ask textarea:focus { border-color: var(--accent); }
.ask button { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .12s; }
.ask button:hover { transform: scale(1.06); }
.ask button:active { transform: scale(.94); }
.ask button:disabled { opacity: .4; cursor: default; }
.foot { color: var(--soft); font-size: 12.5px; text-align: center; margin: 0 0 14px; }

/* about page */
.prose { padding: 4vh 0 10vh; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 6vw, 42px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 18px; }
.prose h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 34px 0 8px; }
.prose p, .prose li { font-size: 17px; line-height: 1.6; }
.prose p { margin: 0 0 14px; }
.prose blockquote { margin: 18px 0; padding-left: 16px; border-left: 2px solid var(--accent); font-family: var(--serif); font-size: 21px; line-height: 1.35; }
.prose a { color: var(--accent); }
