:root {
  --fondo: #0a0a0a;
  --superficie: #141416;
  --bolla: #1a1a1d;
  --bordo: rgba(255, 255, 255, 0.07);
  --testo: #f4f4f5;
  --testo-2: #8b8b93;
  --testo-3: #55555c;
  --accento: #8b7bff;
  --accento-2: #6fc3ff;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vmin, 40px);
}

.thread {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vh, 22px);
}

.ask {
  align-self: flex-end;
  max-width: 82%;
  padding: 9px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--bolla);
  border: 1px solid var(--bordo);
  font-size: clamp(13px, 1.4vw + 7px, 14.5px);
  line-height: 1.4;
  opacity: 0;
}

.reply {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: clamp(150px, 34vh, 178px);
}

.reply__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.orb {
  position: relative;
  width: clamp(40px, 6vmin + 22px, 60px);
  aspect-ratio: 1;
  flex: none;
}

.orb__canvas,
.orb__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.orb__fallback {
  display: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 6%, var(--accento-2) 22%, var(--accento) 58%, #2a1f6b 100%);
}

.orb__glow {
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accento) 34%, transparent), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.reply__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reply__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.reply__status {
  position: relative;
  height: 17px;
  font-size: 13px;
}

.status {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

/* the word shines while it waits: a light band runs through the grey letters */
.status--think {
  color: transparent;
  background: linear-gradient(100deg, var(--testo-3) 0 35%, #e9e6ff 50%, var(--testo-3) 65% 100%);
  background-size: 260% 100%;
  background-position: var(--luce, 100%) 0;
  -webkit-background-clip: text;
  background-clip: text;
}

.status--done {
  color: var(--testo-3);
  opacity: 0;
}

.answer {
  font-size: clamp(14px, 1.5vw + 7.5px, 16px);
  line-height: 1.55;
  color: var(--testo);
  max-width: 46ch;
  min-height: 3.1em;
}

.answer .p {
  display: inline;
  opacity: 0;
}

.answer strong {
  font-weight: 600;
}

.tools {
  display: flex;
  gap: 4px;
  opacity: 0;
}

.tool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--testo-2);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.tool svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: 2px;
}

.tool:active { transform: scale(0.92); }

@media (hover: hover) {
  .tool:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--testo);
  }
}
