/* ============================================================
   Blank-workspace copilot welcome. A centered, Claude/ChatGPT-style
   surface that reuses the sidebar copilot's Stimulus controller and the
   shared .cop-* chat classes (bubbles, markdown, chips, thinking dots) —
   this file only lays out the centered hero + prominent composer and
   restyles the suggestion chips as inline pills. Everything is scoped to
   .cop-welcome so the sidebar is untouched.
   ============================================================ */

.cop-welcome {
  max-width: 720px;
  margin: 0 auto;
  padding: 7vh 24px 64px;
  min-height: calc(100vh - 48px); /* 48px topbar — vertically center the empty state */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

/* ---- Hero greeting ---- */
.cop-welcome-hero { text-align: center; }
.cop-welcome-spark {
  display: inline-block;
  font-size: 30px; line-height: 1; color: var(--accent);
  margin-bottom: 12px;
}

/* Entrance: the hero and the composer/thread ease up on first paint, lightly
   staggered. Base state ends fully visible so content never depends on the
   animation running; reduced-motion shortens it to ~instant below. */
.cop-welcome-hero,
.cop-welcome-thread { animation: cop-welcome-rise .5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cop-welcome-thread { animation-delay: .08s; }
@keyframes cop-welcome-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cop-welcome-title {
  font-family: var(--serif);
  font-size: clamp(27px, 3.6vw, 40px);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.12;
  margin: 0 0 10px; color: var(--ink);
}
.cop-welcome-sub {
  font-size: 15px; line-height: 1.5; color: var(--ink-3);
  margin: 0 auto; max-width: 50ch;
}

/* ---- Thread (transcript + composer + suggestions) ---- */
/* position: relative anchors the .cop-drop scrim (drag-and-drop attachments). */
.cop-welcome-thread { display: flex; flex-direction: column; gap: 14px; position: relative; }

/* The transcript collapses to nothing while empty (the hero is the empty state),
   then grows as the conversation streams in, capped so the composer stays put. */
.cop-welcome .cop-scroll {
  flex: 0 1 auto;
  max-height: 46vh;
  padding: 0;
  gap: 12px;
}
.cop-welcome .cop-bubble { font-size: 14px; }

/* ---- Composer: one prominent, rounded input (no sidebar footer chrome) ---- */
.cop-welcome .cop-composer {
  border-top: none;
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 8px;
}
.cop-welcome .cop-composer-row { gap: 6px; }
.cop-welcome .cop-tray { padding: 2px 2px 0; }
.cop-welcome .cop-attach { width: 36px; height: 36px; border-radius: 11px; border-color: transparent; }
.cop-welcome .cop-attach:hover { border-color: var(--rule-2); }
.cop-welcome .cop-composer textarea { padding-left: 6px; }
.cop-welcome .cop-composer:focus-within {
  border-color: var(--accent-edge);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-pop);
}
.cop-welcome .cop-composer textarea {
  border: none; background: transparent; box-shadow: none;
  padding: 8px 0; font-size: 15px; line-height: 1.5; max-height: 200px;
}
.cop-welcome .cop-composer textarea:focus { box-shadow: none; border: none; background: transparent; }
.cop-welcome .cop-send { width: 36px; height: 36px; border-radius: 11px; }
.cop-welcome.busy .cop-send { opacity: .5; pointer-events: none; }

/* ---- Suggestion chips: inline, wrapping pills below the composer ---- */
.cop-welcome-suggest {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin-top: 2px;
}
.cop-welcome-suggest .cop-welcome-chip {
  width: auto; flex: 0 1 auto; text-align: center;
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px;
  color: var(--ink-2); position: relative;
  transition: transform .12s ease;
}
/* Hover fill crossfades via opacity (compositor) instead of background (paint);
   the lift stays S-tier transform. Border/text color snap. */
.cop-welcome-suggest .cop-welcome-chip::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--accent-soft); opacity: 0; transition: opacity .12s ease;
  pointer-events: none; z-index: -1;
}
.cop-welcome-suggest .cop-welcome-chip:hover::after { opacity: 1; }
.cop-welcome-suggest .cop-welcome-chip:hover {
  color: var(--ink); border-color: var(--accent-edge);
  transform: translateY(-1px);
}
.cop-welcome-suggest .cop-welcome-chip:active { transform: translateY(0); }

/* Keyboard focus ring — the composer's box uses :focus-within, but the chips and
   send button need their own visible focus state for Tab navigation. */
.cop-welcome-suggest .cop-welcome-chip:focus-visible,
.cop-welcome .cop-send:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .cop-welcome { padding: 5vh 16px 48px; gap: 20px; }
  .cop-welcome-title { font-size: 25px; }
  .cop-welcome-sub { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cop-welcome-hero,
  .cop-welcome-thread { animation-duration: 0.01ms; }
  .cop-welcome-suggest .cop-welcome-chip { transition: none; }
  .cop-welcome-suggest .cop-welcome-chip:hover { transform: none; }
}
