@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* Shared site asset: hiring-specific layout stays scoped to this stylesheet. */

.message-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #6e6a60;
}

.message-sources a {
  color: #114f42;
  text-decoration: underline;
}

.project-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.8rem;
}

:root {
  --bg: #f5f0e8;
  --bg-strong: #e8dccd;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffaf2;
  --ink: #1f2a2e;
  --muted: #6e6a60;
  --line: rgba(31, 42, 46, 0.12);
  --accent: #1e6f5c;
  --accent-strong: #114f42;
  --warm: #d86f45;
  --danger: #9f3d38;
  --warning: #b28522;
  --ok: #356c4c;
  --shadow: 0 24px 64px rgba(57, 43, 28, 0.12);
  --radius: 24px;
  --radius-sm: 14px;
  --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 0 4.5rem 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 111, 69, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(30, 111, 92, 0.16), transparent 32%),
    linear-gradient(180deg, #fbf5ec 0%, #f0e7da 100%);
  line-height: 1.55;
}

button, input, textarea {
  font: inherit;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.app-shell {
  width: min(900px, calc(100% - 32px));
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 100px);
}

/* Header row */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
}

.header-row h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Icon links */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-link:hover {
  background: var(--accent-strong);
  color: #fff;
  border-color: transparent;
  text-decoration: none;
}

/* CSS mask icons */
.svg-mono {
  width: 20px;
  aspect-ratio: 1/1;
  background-color: currentColor;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
}

/* Single panel */
.panel-card {
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 24px;
}

/* Tab bar */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-button {
  border: none;
  background: transparent;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-size: 1.05rem;
}

.tab-button.is-active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.tab-button:hover:not(.is-active) {
  color: var(--ink);
}

/* Tab panels with grid-row transition */
.tab-panels {
  display: grid;
}

.tab-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.tab-panel.is-active {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.tab-panel > .panel-inner {
  min-height: 0;
  overflow: hidden;
}

/* Chat tab */
.mode-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.mode-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.mode-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.mode-button.is-active {
  background: var(--accent-strong);
  color: #fff;
  border-color: transparent;
}

.mode-button:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.85);
}

.llm-control {
  display: flex;
  flex: 0 1 340px;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  min-width: 240px;
}

.llm-picker {
  display: inline-flex;
  width: 100%;
}

.llm-picker select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 34px 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.llm-picker select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.llm-note {
  align-self: flex-end;
  margin-top: 4px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: right;
}

.llm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  line-height: 1.25;
}

.llm-status[hidden] {
  display: none;
}

.llm-spinner {
  width: 0.85rem;
  aspect-ratio: 1;
  border: 2px solid rgba(30, 111, 92, 0.24);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: waiting-spin 850ms linear infinite;
}

@keyframes waiting-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .llm-spinner {
    animation: none;
  }
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 50vh;
  min-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
  width: 6px;
}
.messages::-webkit-scrollbar-track {
  background: transparent;
}
.messages::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
  animation: messageIn 0.34s ease both;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.6;
}

.message.user .message-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.message.assistant.is-error .message-bubble {
  background: rgba(159, 61, 56, 0.1);
  border-color: rgba(159, 61, 56, 0.28);
  color: var(--danger);
}

.message.assistant.is-error .message-meta {
  color: var(--danger);
}

.message-meta {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 4px;
}

.message.user .message-meta {
  text-align: right;
}

.suggested-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.prompt-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.prompt-chip:hover {
  background: var(--accent-strong);
  color: #fff;
  border-color: transparent;
}

.input-area {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.input-area textarea {
  flex: 1;
  min-height: 90px;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  color: var(--ink);
  resize: vertical;
  font-size: 0.95rem;
}

.input-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-actions .send-button,
.input-actions .reset-button {
  flex: 1;
  min-height: 0;
}

.input-area textarea:focus {
  outline: 2px solid rgba(30, 111, 92, 0.35);
  outline-offset: 2px;
}

.send-button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.send-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 0;
  max-height: 44px;
  opacity: 0;
  transform: translateY(4px);
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, max-height 0.22s ease, padding 0.22s ease;
}

.loading-indicator.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-indicator.is-hiding {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(-4px);
}

.loading-indicator::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid rgba(30, 111, 92, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .messages {
    scroll-behavior: auto;
  }

  .message,
  .loading-indicator {
    animation: none;
    transition: none;
  }
}

.error-banner {
  background: rgba(159, 61, 56, 0.1);
  border: 1px solid rgba(159, 61, 56, 0.25);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 8px;
}

.reset-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s ease;
}

.reset-button:hover {
  background: rgba(159, 61, 56, 0.08);
  color: var(--danger);
  border-color: rgba(159, 61, 56, 0.3);
}

/* Evidence cards */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.evidence-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.evidence-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(57, 43, 28, 0.08);
}

.evidence-card h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--accent-strong);
}

.evidence-card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.evidence-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(30, 111, 92, 0.1);
  color: var(--accent-strong);
  margin-right: 6px;
  margin-bottom: 6px;
}

.evidence-card .caveat {
  font-size: 0.8rem;
  color: var(--warning);
  margin-top: 8px;
  font-style: italic;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.skills-column h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

.skills-column.demonstrated h3 { border-color: var(--ok); }
.skills-column.transferable h3 { border-color: var(--accent); }
.skills-column.developing h3 { border-color: var(--warning); }
.skills-column.gaps h3 { border-color: var(--danger); }

.skills-column ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  color: var(--ink);
}

.skills-column li {
  margin-bottom: 6px;
}

.skills-column .note {
  color: var(--muted);
  font-size: 0.78rem;
}

/* FAQ */
.faq-item {
  margin-bottom: 16px;
}

.faq-item h4 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--accent-strong);
}

.faq-item p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 18px);
    margin: 9px;
  }

  .panel-card {
    padding: 16px;
  }

  .header-row h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .contact-stack {
    gap: 8px;
  }

  .icon-link {
    width: 38px;
    height: 38px;
  }

  .message {
    max-width: 92%;
  }

  .mode-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .mode-group {
    flex: 1 1 100%;
  }

  .llm-control {
    flex: 1 1 100%;
    align-items: stretch;
    margin-left: 0;
  }

  .llm-note {
    align-self: flex-start;
    text-align: left;
  }

  .llm-status {
    align-self: flex-start;
  }

  .input-area {
    flex-direction: column;
  }

  .send-button {
    width: 100%;
  }

  .evidence-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }
}
