/* style.css — the outfit. hand written, safe to edit.
   model.css is the brain and gets regenerated, keep weights out of here. */

:root {
  color-scheme: light dark;
  --bg1: #f6f1fd;
  --bg2: #fdeef6;
  --ink: #43364f;
  --muted: #93819f;
  --acc: #9d7bea;
  --acc-ink: #fff;
  --pill: #ece4f8;
  --pill-border: #d7c9ee;
  --bub-bot: #ffffff;
  --bub-user: linear-gradient(135deg, #9d7bea, #c86fc9);
  --warn-bg: #fff3d6;
  --warn-ink: #7a5c1e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg1: #201a2b;
    --bg2: #271c2e;
    --ink: #e9def5;
    --muted: #a08fb3;
    --acc: #a985f2;
    --acc-ink: #241640;
    --pill: #342a44;
    --pill-border: #4c3f61;
    --bub-bot: #2f2640;
    --bub-user: linear-gradient(135deg, #7b5cc9, #a55aa8);
    --warn-bg: #4a3b1c;
    --warn-ink: #ffe1a1;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 3rem 1.25rem 4rem;
  background: linear-gradient(165deg, var(--bg1), var(--bg2));
  color: var(--ink);
  font-family: "Segoe UI", ui-rounded, system-ui, sans-serif;
  display: flex;
  justify-content: center;
}

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

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
}

.page { width: min(46rem, 100%); }

header h1 {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.paw {
  display: inline-block;
  font-size: 0.5em;
  margin-left: 0.3em;
  transform: rotate(12deg);
}

.tag {
  color: var(--muted);
  max-width: 40rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.warn, .engine-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  line-height: 1.4;
}

/* engine notice. deliberately NOT .warn — model.css hides .warn via the
   feature-detection container query, which would take this out with it.
   found that the hard way.
   she computes the first reply fine everywhere — it's re-invalidation that
   gecko and webkit get wrong, and no feature query can detect that, so this
   is engine sniffing. i'm not thrilled about it either. */
.engine-warn { display: none; }

/* gecko */
@supports (-moz-orient: inline) { .engine-warn { display: block; } }
@supports (-moz-appearance: none) { .engine-warn { display: block; } }

/* webkit but not blink — -webkit-named-image never shipped in chromium */
@supports (background: -webkit-named-image(i)) { .engine-warn { display: block; } }

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.6rem 0 1.4rem;
}

.group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.glabel {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  width: 6.5rem;
  flex-shrink: 0;
}

.group label {
  border: 1px solid var(--pill-border);
  background: var(--pill);
  border-radius: 999px;
  padding: 0.32em 0.9em;
  cursor: pointer;
  font-size: 0.92rem;
  user-select: none;
  transition: transform 80ms ease;
}

.group label:hover { transform: translateY(-1px); }
.group label:active { transform: translateY(0) scale(0.97); }

/* the conversation */

.chat {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.2rem 0;
}

.row { display: flex; }
.row.user { justify-content: flex-end; }
.row.bot { justify-content: flex-start; align-items: flex-end; gap: 0.5rem; }

.bub {
  margin: 0;
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 1.02rem;
  overflow-wrap: break-word;
  box-shadow: 0 8px 24px rgb(70 40 110 / 0.10);
}

.um {
  background: var(--bub-user);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.qm {
  background: var(--bub-bot);
  border-bottom-left-radius: 6px;
}

.avatar {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.end::before {
  content: "▊";
  color: var(--acc);
  animation: think 1.1s steps(2) infinite;
  margin-left: 2px;
}

@keyframes think {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .end::before { animation: none; }
  .group label, .group label:hover, .group label:active { transition: none; transform: none; }
}

footer {
  margin-top: 1.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 42rem;
}

footer a { color: var(--acc); }
