@font-face {
	font-family: "Newsreader";
	src: url("/fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Newsreader";
	src: url("/fonts/newsreader-latin-opsz-italic.woff2") format("woff2-variations");
	font-weight: 200 800;
	font-style: italic;
	font-display: swap;
}

:root {
	--paper: #f7f6f2;
	--ink: #1a1a1a;
	--ink-2: #5a574f;
	--muted: #8f8b81;
	--rule: #dedad1;

	--serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

	--measure: 36rem;
	--gutter: 1.5rem;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #151513;
		--ink: #e8e5dd;
		--ink-2: #a9a59b;
		--muted: #75726a;
		--rule: #2b2a27;
	}
}

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

html {
	background: var(--paper);
	color: var(--ink);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.1875rem;
	line-height: 1.55;
	font-optical-sizing: auto;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--ink);
	color: var(--paper);
}

a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: var(--muted);
	text-underline-offset: 0.18em;
}
a:hover {
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 1px solid var(--ink);
	outline-offset: 3px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Small uppercase monospace: every bit of interface chrome uses this. */
.label {
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted);
}

button.link {
	appearance: none;
	background: none;
	border: 0;
	padding: 0.25rem 0;
	cursor: pointer;
	color: var(--ink);
}
button.link.quiet {
	color: var(--muted);
}
button.link:hover {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* ── Layout ─────────────────────────────────────────────── */

.page {
	max-width: calc(var(--measure) + var(--gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--gutter);
	/* room for the fixed composer */
	padding-bottom: 9rem;
	min-height: 100dvh;
}

.masthead {
	display: flex;
	gap: 0.75rem;
	align-items: baseline;
	padding-top: max(1.75rem, env(safe-area-inset-top));
}

.masthead .label {
	padding: 0;
	line-height: 1;
}
.wordmark {
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1;
	color: var(--ink);
	text-decoration: none;
}
.wordmark span {
	color: var(--muted);
}
.model {
	padding: 0.2rem 0.4rem !important;
	border: 1px solid var(--rule);
	border-radius: 2px;
	transform: translateY(-0.1rem);
}
#new {
	margin-left: auto;
}

/* ── Intro ──────────────────────────────────────────────── */

.intro {
	padding-top: 24vh;
}
.intro h1 {
	margin: 0 0 1.5rem;
	font-size: 2.5rem;
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.015em;
}
.suggestions {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--rule);
}
.suggestions li {
	border-bottom: 1px solid var(--rule);
}
.suggestions button {
	appearance: none;
	display: block;
	width: 100%;
	padding: 0.7rem 0;
	border: 0;
	background: none;
	color: var(--ink-2);
	font: inherit;
	font-size: 1.0625rem;
	text-align: left;
	cursor: pointer;
}
.suggestions button::after {
	content: " →";
	color: var(--muted);
	opacity: 0;
	transition: opacity 120ms;
}
.suggestions button:hover {
	color: var(--ink);
}
.suggestions button:hover::after {
	opacity: 1;
}
.has-messages .intro {
	display: none;
}

/* ── Messages ───────────────────────────────────────────── */

#log {
	padding-top: 3.5rem;
}

.msg {
	margin-top: 2.75rem;
}
.intro + .msg {
	margin-top: 0;
}
.msg.cont {
	margin-top: 1.5rem;
}
.msg.cont .meta {
	display: none;
}
.msg.is-new {
	animation: arrive 150ms ease-out;
}

.meta {
	display: flex;
	gap: 0.75em;
	margin-bottom: 0.55rem;
}
.meta .who {
	color: var(--ink);
}

.body p {
	margin: 0 0 0.85em;
	overflow-wrap: anywhere;
}
.body p:last-child {
	margin-bottom: 0;
}

.body ul,
.body ol {
	margin: 0 0 0.85em;
	padding-left: 1.4em;
}
.body ul {
	list-style: none;
}
.body ul > li {
	position: relative;
}
.body ul > li::before {
	content: "–";
	position: absolute;
	left: -1.1em;
	color: var(--muted);
}
.body ol > li::marker {
	font-family: var(--mono);
	font-size: 0.8em;
	color: var(--muted);
}
.body li + li {
	margin-top: 0.3em;
}
.body h3 {
	margin: 1.4em 0 0.5em;
	font-size: 1em;
	font-weight: 600;
}
.body h3:first-child {
	margin-top: 0;
}
.body strong {
	font-weight: 600;
}
.body code,
.body pre {
	font-family: var(--mono);
	font-size: 0.8em;
}
.body code {
	padding: 0.1em 0.3em;
	background: color-mix(in srgb, var(--ink) 6%, transparent);
	border-radius: 2px;
}
.body pre {
	margin: 0 0 0.85em;
	padding: 0.9em 1em;
	overflow-x: auto;
	line-height: 1.5;
	background: color-mix(in srgb, var(--ink) 5%, transparent);
	border-radius: 2px;
}
.body pre code {
	padding: 0;
	background: none;
	font-size: 1em;
}
.body > :last-child {
	margin-bottom: 0;
}
.streaming > :last-child::after,
.streaming > ul:last-child > li:last-child::after,
.streaming > ol:last-child > li:last-child::after {
	content: "";
	display: inline-block;
	width: 0.45em;
	height: 0.45em;
	margin-left: 0.2em;
	border-radius: 50%;
	background: var(--ink);
	vertical-align: 0.1em;
}
.streaming > ul:last-child::after,
.streaming > ol:last-child::after,
.streaming > pre:last-child::after {
	content: none;
}

/* The visitor's own words recede slightly; the answers are the point. */
.msg.visitor .body {
	color: var(--ink-2);
}

.status {
	margin: 0.7rem 0 0;
}
.status.is-error {
	color: var(--ink);
}
.status button.link {
	padding: 0;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.msg.pending .body {
	opacity: 0.55;
}

@keyframes arrive {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}

/* ── "Want an email?" ───────────────────────────────────── */

.ping {
	margin-top: 2.75rem;
	padding: 1rem 0;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	animation: arrive 150ms ease-out;
}
.ping p {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	font-style: italic;
	color: var(--ink-2);
}
.ping-form {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 1.25rem;
}
.ping input {
	flex: 1 1 14rem;
	min-width: 0;
	padding: 0.2rem 0;
	border: 0;
	border-bottom: 1px solid var(--rule);
	border-radius: 0;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 1rem;
	outline: none;
}
.ping input:focus {
	border-bottom-color: var(--ink);
}
.ping input::placeholder {
	color: var(--muted);
}
.ping.done p {
	margin: 0;
}

/* ── Composer ───────────────────────────────────────────── */

.composer {
	position: fixed;
	inset: auto 0 0 0;
	background: var(--paper);
}
.challenge {
	max-width: var(--measure);
	margin: 0 auto;
}
@media (max-width: 39rem) {
	.challenge {
		margin: 0 var(--gutter);
	}
}
.disclaimer {
	max-width: var(--measure);
	margin: 0 auto;
	padding: 0 0 max(0.9rem, calc(env(safe-area-inset-bottom) + 0.4rem));
	font-size: 0.625rem;
	letter-spacing: 0.06em;
	text-transform: none;
}
@media (max-width: 39rem) {
	.disclaimer {
		margin: 0 var(--gutter);
	}
}
.composer-inner {
	display: flex;
	align-items: flex-end;
	gap: 1.25rem;
	max-width: var(--measure);
	margin: 0 auto;
	padding: 1rem 0 0.75rem;
	border-top: 1px solid var(--rule);
}
@media (max-width: 39rem) {
	.composer-inner {
		margin: 0 var(--gutter);
	}
}

#input {
	flex: 1;
	min-height: calc(1.55em);
	max-height: 40vh;
	padding: 0;
	border: 0;
	resize: none;
	background: transparent;
	color: var(--ink);
	font: inherit;
	line-height: 1.55;
	outline: none;
}
#input::placeholder {
	color: var(--muted);
	font-style: italic;
}

.send {
	appearance: none;
	background: none;
	border: 0;
	padding: 0.35rem 0;
	cursor: pointer;
	color: var(--ink);
}
.send:disabled {
	color: var(--muted);
	cursor: default;
	opacity: 0.6;
}

/* ── Pretending to be a model ────────────────────────────── */

.thinking .body {
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
}
.shimmer {
	font-style: italic;
	color: var(--muted);
	background: linear-gradient(90deg, var(--muted) 35%, var(--ink) 50%, var(--muted) 65%) 0 0 / 300% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer {
	from {
		background-position: 100% 0;
	}
	to {
		background-position: 0 0;
	}
}
.elapsed {
	font-variant-numeric: tabular-nums;
}


@media (prefers-reduced-motion: reduce) {
	.shimmer {
		animation: none;
		-webkit-text-fill-color: currentColor;
		background: none;
	}
	.msg.is-new,
	.ping {
		animation: none;
	}
}
