/* Clean white with pink and purple. The chat itself is sharp and plain; the painted marks live around it. */
:root {
  --bg: #FFFFFF;
  --ink: #2A1B3D;
  --soft: rgba(42, 27, 61, .58);
  --line: rgba(42, 27, 61, .14);
  --gum: #F48FB7;
  --plum: #9B7BD8;
  --lilac: #C7B3F2;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.65 var(--sans);
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--gum); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px 20px 0;
  position: relative;
  z-index: 2;
}
@media (min-width: 720px) { .top { padding: 24px 32px 0; } }
.top a { text-decoration: none; }
.top .name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.top nav { display: flex; gap: 20px; font-size: 14px; }
.top nav a { color: var(--soft); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }

/* ---------- painted marks (only when p5.brush ran) ---------- */
.blob {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  aspect-ratio: 1;
  opacity: 0;
  -webkit-mask: var(--mask) center / contain no-repeat;
  mask: var(--mask) center / contain no-repeat;
  transition: opacity 1.2s;
}
.has-marks .blob { opacity: .9; }
.blob-1 { --mask: var(--mark-blob-a); width: min(72vw, 460px); top: -9%; right: -14%; background: var(--gum); }
.blob-2 { --mask: var(--mark-blob-b); width: min(64vw, 400px); bottom: -10%; left: -14%; background: var(--lilac); }
@media (min-width: 1100px) {
  .blob-1 { right: -4%; top: -6%; }
  .blob-2 { left: -4%; bottom: -8%; }
}

/* Brush underline for titles. Falls back to a plain underline. */
.u-brush {
  position: relative;
  z-index: 0;
  text-decoration: underline;
  text-decoration-color: var(--plum);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}
.has-marks .u-brush { text-decoration: none; }
.has-marks .u-brush::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -4%;
  right: -4%;
  bottom: -.02em;
  height: .42em;
  background: var(--plum);
  -webkit-mask: var(--mark-stroke) center / 100% 100% no-repeat;
  mask: var(--mark-stroke) center / 100% 100% no-repeat;
}

/* ---------- ask page ---------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.started-page .stage { justify-content: flex-end; }

.thread { display: flex; flex-direction: column; gap: 40px; padding: 40px 0 8px; }
.thread:empty { display: none; }
.turn .q { font-weight: 600; font-size: 1.15rem; line-height: 1.35; margin: 0 0 10px; overflow-wrap: anywhere; letter-spacing: -.01em; }
.turn .a { max-width: 62ch; }
.turn .a p { margin: 0 0 .8em; }
.turn .a ul { margin: 0 0 .8em; padding-left: 1.2em; }
.turn .a li { margin-bottom: .3em; }
.turn .a.err { color: var(--soft); }
.src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 0; font: 12px/1 var(--mono); }
.src .label { color: var(--soft); margin-right: 4px; }
.chip { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; }
a.chip:hover { border-color: var(--ink); }
.turn.latest .chip { background: var(--gum); border-color: var(--gum); }

.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font: 12.5px/1 var(--mono); }
.suggest .chip { cursor: pointer; }
.suggest .chip:hover { border-color: var(--ink); }
.started-page .suggest { display: none; }

.cursor { display: inline-block; width: .6em; height: 1.15em; background: var(--ink); vertical-align: -.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.ask {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--ink);
  background: var(--bg);
  margin-bottom: 16vh;
}
.started-page .ask { position: sticky; bottom: 16px; margin: 24px 0 16px; box-shadow: 0 -24px 24px var(--bg); }
.ask textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: none;
  background: none;
  padding: 15px 16px;
  font-size: 17px;
  line-height: 1.45;
  max-height: 40vh;
}
.ask textarea::placeholder { color: var(--soft); }
.ask button {
  flex: none;
  width: 54px;
  border: 0;
  border-left: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  font-size: 18px;
}
.ask button:disabled { background: var(--bg); color: var(--soft); cursor: default; }

/* ---------- projects page ---------- */
.projects { width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 20px 96px; }
.projects h1 { font-weight: 600; font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1; letter-spacing: -.035em; margin: 48px 0 12px; }
.projects .lede { margin: 0 0 40px; color: var(--soft); max-width: 52ch; }
.project { padding: 40px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.project .meta { margin: 0 0 10px; font: 12px/1.5 var(--mono); color: var(--soft); }
.project h2 { font-weight: 600; font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 14px; }
.project:target h2 .u-brush::after { background: var(--gum); }
.project:target h2 .u-brush { text-decoration-color: var(--gum); }
.project p { margin: 0 0 12px; max-width: 60ch; }
.project .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; font: 12px/1 var(--mono); }
.project .links a { padding: 5px 8px; border: 1px solid var(--line); text-decoration: none; background: var(--bg); }
.project .links a:hover { border-color: var(--ink); }
.earlier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.earlier li { max-width: 62ch; }
.earlier li b { font-weight: 600; }
.earlier li span { color: var(--soft); }
.foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--soft); }

@media (prefers-reduced-motion: reduce) {
  .blob { transition: none; }
  .cursor { animation: none; }
}
