/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fafafe;
  --bg-white: #ffffff;
  --bg-surface: #f3f2fa;
  --border: #e5e3f1;
  --border-light: #eeedf6;
  --text: #1e1b2e;
  --text-secondary: #5c5775;
  --text-muted: #9490a8;
  --accent: #6c5ce7;
  --accent-hover: #5a48d5;
  --accent-light: #ede9ff;
  --accent-glow: rgba(108, 92, 231, 0.12);
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --blue-bg: #dbeafe;
  --emerald: #10b981;
  --emerald-light: #ecfdf5;
  --emerald-bg: #d1fae5;
  --amber: #f59e0b;
  --amber-light: #fffbeb;
  --amber-bg: #fef3c7;
  --violet: #8b5cf6;
  --violet-light: #f5f3ff;
  --violet-bg: #ede9fe;
  --user-bg: #6c5ce7;
  --ai-bg: #ffffff;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 100px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent-hover);
}

/* ===== Top Bar ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.topbar.visible {
  transform: translateY(0);
  opacity: 1;
}

.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.topbar-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== Page Layout ===== */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 56px 0 44px;
}

.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.1;
}

.hero-title {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.3;
}

.hero-org {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn .icon,
.btn svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
}

.btn-outline {
  background: var(--bg-white);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== Highlights ===== */
.highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 8px 0 44px;
}

button.highlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 12px 20px;
  border-radius: var(--radius-lg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}

button.highlight:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.highlight-blue {
  background: var(--blue-light);
  border-color: var(--blue-bg);
}
.highlight-blue .highlight-number { color: var(--blue); }

.highlight-emerald {
  background: var(--emerald-light);
  border-color: var(--emerald-bg);
}
.highlight-emerald .highlight-number { color: var(--emerald); }

.highlight-amber {
  background: var(--amber-light);
  border-color: var(--amber-bg);
}
.highlight-amber .highlight-number { color: var(--amber); }

.highlight-violet {
  background: var(--violet-light);
  border-color: var(--violet-bg);
}
.highlight-violet .highlight-number { color: var(--violet); }

.highlight-number {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.highlight-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
  font-weight: 500;
}

/* ===== Chat Section ===== */
.chat-section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.chat-intro {
  text-align: center;
  margin-bottom: 24px;
}

.chat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: 14px;
  color: #fff;
}

.chat-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.chat-subheading {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Suggestions ===== */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}

.suggestion-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-family: var(--font);
  font-weight: 450;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.suggestion-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* ===== Chat Form ===== */
#chat-form {
  position: sticky;
  bottom: 0;
  background: var(--bg-white);
  padding-top: 16px;
  margin-top: 24px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#question {
  flex: 1;
  padding: 13px 18px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#question::placeholder {
  color: var(--text-muted);
}

#question:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-white);
}

#question:disabled {
  opacity: 0.4;
}

#submit-btn {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

#submit-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.05);
}

#submit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== Chat Messages ===== */
#chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.message {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.message-user {
  justify-content: flex-end;
}

.message-user .message-content {
  background: var(--user-bg);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  max-width: 72%;
  padding: 11px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

.message-ai {
  justify-content: flex-start;
}

.message-ai .message-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  max-width: 88%;
  padding: 16px 20px;
  font-size: 0.92rem;
  line-height: 1.7;
}

.message-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.message-text p {
  margin-bottom: 10px;
}

.message-text p:last-child {
  margin-bottom: 0;
}

.message-text ol,
.message-text ul {
  margin: 6px 0 10px;
  padding-left: 22px;
}

.message-text li {
  margin-bottom: 4px;
}

.message-text strong {
  color: var(--text);
  font-weight: 600;
}

.message-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.resume-link {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.82rem;
  box-shadow: 0 2px 6px rgba(108, 92, 231, 0.2);
  transition: background var(--transition);
}

.resume-link:hover {
  background: var(--accent-hover);
}

.error-text {
  color: #ef4444;
}

/* ===== Typing Indicator ===== */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 6px 0;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

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

/* ===== Hidden SEO Content ===== */
.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Footer ===== */
footer {
  padding: 24px 0 32px;
  text-align: center;
}

footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .page {
    padding: 0 16px;
    overflow-x: hidden;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 1rem;
  }

  .hero-org {
    font-size: 0.88rem;
  }

  .hero-actions {
    gap: 8px;
  }

  .btn {
    padding: 9px 14px;
    font-size: 0.8rem;
  }

  .highlights {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 0 28px;
  }

  .highlight {
    padding: 18px 8px 14px;
  }

  .highlight-number {
    font-size: 1.3rem;
  }

  .highlight-label {
    font-size: 0.63rem;
  }

  .chat-section {
    padding: 28px 18px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
  }

  .chat-heading {
    font-size: 1.15rem;
  }

  .chat-subheading {
    font-size: 0.82rem;
  }

  .suggestions {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .suggestions::-webkit-scrollbar {
    display: none;
  }

  .suggestion-btn {
    font-size: 0.75rem;
    padding: 7px 12px;
    flex-shrink: 0;
  }

  #question {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  #submit-btn {
    width: 42px;
    height: 42px;
  }

  .message-user .message-content {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .message-ai .message-content {
    max-width: 96%;
    padding: 14px 14px;
    font-size: 0.88rem;
  }
}
