/* --------------------------------------------------------------------------
   The welcome — a new conversation's first screen (views/welcome.js)

   Rebuilt 2026-10-15: the mark beside a greeting, a line asking how to help,
   the message box centred under them while the conversation is empty, and
   under the box a chip per module that opens its questions. It leaves at the
   first question, and the box goes back to the bottom.
   -------------------------------------------------------------------------- */

/* Empty: the greeting, the box and the chips, together in the middle. */
.chat.is-welcome {
  justify-content: center;
  overflow-y: auto;
  padding-bottom: 6vh;
}

.chat.is-welcome .transcript {
  flex: 0 0 auto;
  overflow: visible;
  padding: 24px 0 8px;
}

.chat.is-welcome .composer {
  background: none;
  padding-top: 4px;
}

.welcome {
  width: min(var(--column), 100%);
  margin: 0 auto;
  padding: 0 24px 18px;
  text-align: center;
  animation: welcome-rise .5s var(--ease-out) both;
  transition: opacity .24s ease, transform .24s ease;
}

.welcome.is-leaving {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.welcome-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
  color: var(--text-strong);
}

.welcome-mark {
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--ds-blue) 35%, transparent));
}

/* Its light comes on as the screen opens, a few times — not forever (WCAG 2.2.2). */
.welcome-mark .nura-light { animation: nura-breathe 1.8s ease-in-out .5s 3; }
.welcome-mark .nura-glow { animation: nura-halo 1.8s ease-in-out .5s 3; }

.welcome-lead {
  margin: 10px auto 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* The headline figures, under the greeting (2026-10-15): a tile each, its
   module's colour as a small mark; pressed, it asks its question. */
.welcome-figures { margin: 22px auto 0; }

.welcome-figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: min(calc(var(--column) - 48px), 100%);
  margin: 0 auto;
}

.welcome-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 86px;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: start;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.welcome-figure::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--hue);
}

.welcome-figure:hover {
  border-color: color-mix(in srgb, var(--hue) 45%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.welcome-figure-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.welcome-figure-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.welcome-figure-detail { font-size: 12px; color: var(--text-faint); }

/* Points about to lapse: the one figure that asks for attention. */
.welcome-figure.is-attention { border-color: var(--warn-border); background: var(--warn-soft); }
.welcome-figure.is-attention::before { background: var(--warn); }
.welcome-figure.is-attention .welcome-figure-label { color: var(--warn); }

.welcome-figure.is-placeholder { cursor: default; gap: 8px; justify-content: center; box-shadow: none; }
.welcome-figure.is-placeholder::before { display: none; }
.welcome-figure.is-placeholder i {
  display: block;
  height: 12px;
  width: 60%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--border) 0%, color-mix(in srgb, var(--accent) 14%, var(--surface)) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.welcome-figure.is-placeholder i + i { width: 85%; height: 9px; }

.welcome-figures-when {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
}

@media (prefers-reduced-motion: reduce) {
  .welcome-figure { transition: none; }
  .welcome-figure:hover { transform: none; }
  .welcome-figure.is-placeholder i { animation: none; }
}

/* Under the box: the module chips, and the questions of the one pressed. */
.welcome-below {
  width: min(calc(var(--column) - 48px), calc(100% - 48px));
  margin: 18px auto 0;
  animation: welcome-rise .5s var(--ease-out) .12s both;
}

.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 13px 4px 5px;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, color .15s;
}

.welcome-chip-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hue) 14%, var(--surface));
  color: var(--hue);
}

.welcome-chip:hover { border-color: color-mix(in srgb, var(--hue) 55%, var(--border-strong)); color: var(--text-strong); }

.welcome-chip[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--hue) 60%, var(--border-strong));
  background: color-mix(in srgb, var(--hue) 9%, var(--surface));
  color: var(--text-strong);
}

.welcome-asks {
  margin: 12px 0 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: arrive-fade .2s ease-out both;
}

.welcome-asks[hidden] { display: none; }

.welcome-ask {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 14px;
  color: var(--text-body);
  text-align: start;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.welcome-ask:hover, .welcome-ask:focus-visible {
  background: color-mix(in srgb, var(--hue) 8%, var(--surface));
  color: var(--text-strong);
}

.welcome-ask-arrow {
  flex: none;
  color: var(--hue);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s, transform .15s;
}

.welcome-ask:hover .welcome-ask-arrow,
.welcome-ask:focus-visible .welcome-ask-arrow { opacity: 1; transform: none; }

@keyframes welcome-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .welcome { padding: 0 16px 14px; }
  .welcome-title { font-size: 28px; gap: 10px; }
  .welcome-lead { font-size: 15px; }
  .welcome-below { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .welcome, .welcome-below, .welcome-mark .nura-light, .welcome-mark .nura-glow, .welcome-asks { animation: none; }
  .welcome { transition: none; }
}
