:root {
  --bg: #05060a;
  --panel: #0b0d14;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef1ff;
  --muted: #8a90a8;
  --accent: #5a6bff;
  --accent-soft: #8f9bff;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(90, 107, 255, 0.35); }

/* ---------- ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.b1 {
  width: 640px;
  height: 640px;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(90, 107, 255, 0.16), transparent);
  animation: drift1 22s ease-in-out infinite alternate;
}

.b2 {
  width: 720px;
  height: 720px;
  bottom: -320px;
  right: -160px;
  background: radial-gradient(closest-side, rgba(90, 107, 255, 0.1), transparent);
  animation: drift2 26s ease-in-out infinite alternate;
}

@keyframes drift1 {
  from { transform: translateX(-50%) translateY(0); }
  to   { transform: translateX(-50%) translateY(60px); }
}

@keyframes drift2 {
  from { transform: translate(0, 0); }
  to   { transform: translate(-80px, -60px); }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 6, 10, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
}

.header-inner--end { justify-content: flex-end; }

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark { width: 20px; height: 24px; display: block; }

.brand-mini span {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.header-note {
  font-size: 13px;
  color: var(--muted);
}

.header-spacer { display: none; }

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.header-back svg { width: 15px; height: 15px; }

.header-back:hover {
  color: var(--text);
  border-color: rgba(143, 155, 255, 0.4);
  background: rgba(90, 107, 255, 0.08);
}

/* ---------- hero (index) ---------- */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 48px 24px;
}

.hero-inner {
  width: 100%;
  max-width: 760px;
  text-align: center;
}

.f-logo {
  position: relative;
  margin-bottom: 34px;
}

.f-logo::before {
  content: '';
  position: absolute;
  inset: -140px -160px;
  background: radial-gradient(closest-side, rgba(90, 107, 255, 0.14), transparent);
  pointer-events: none;
}

.logo-f {
  position: relative;
  display: block;
  width: min(58vw, 200px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 0 46px rgba(90, 107, 255, 0.45));
  animation: breathe 7s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 0 40px rgba(90, 107, 255, 0.4)); }
  50%      { filter: drop-shadow(0 0 64px rgba(120, 133, 255, 0.62)); }
}

.f-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.f-stroke:nth-child(1) { animation-delay: 0.15s; }
.f-stroke:nth-child(2) { animation-delay: 0.3s; }
.f-stroke:nth-child(3) { animation-delay: 0.45s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

.wordmark {
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 200;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  color: #e9ecff;
  margin-bottom: 18px;
}

.tagline {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 44px;
}

/* ---------- search ---------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 8px 8px 24px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search:focus-within {
  border-color: rgba(143, 155, 255, 0.55);
  box-shadow: 0 0 0 5px rgba(90, 107, 255, 0.14), 0 12px 40px rgba(0, 0, 0, 0.45);
}

.search.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.search-icon {
  width: 19px;
  height: 19px;
  color: #5d6480;
  flex-shrink: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 10px 16px;
}

.search input::placeholder { color: #5d6480; }

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6e7bff, #8f9bff);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.search-btn svg { width: 20px; height: 20px; }

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(90, 107, 255, 0.45);
}

.search-btn:active { transform: scale(0.95); }

/* ---------- suggestions ---------- */

.suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.suggest-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}

.chip {
  font-family: inherit;
  font-size: 13px;
  color: #9aa1bd;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chip:hover {
  color: #fff;
  border-color: rgba(143, 155, 255, 0.5);
  transform: translateY(-1px);
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px 30px;
  font-size: 12.5px;
  color: #565d78;
}

/* ---------- result page ---------- */

.result {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.query-line {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 26px;
}

.query-line span { color: var(--text); }

.slide {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(30px, 5vw, 56px);
  overflow: hidden;
  animation: slideUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 155, 255, 0.7), transparent);
}

.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 50% 0%, rgba(90, 107, 255, 0.08), transparent);
  pointer-events: none;
}

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

.slide-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.slide-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aab4ff;
  background: rgba(90, 107, 255, 0.14);
  border: 1px solid rgba(90, 107, 255, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
}

.slide-tag--nda {
  color: #9aa1bd;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.slide-company {
  font-size: 13.5px;
  color: var(--muted);
}

.slide-head-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- company badge ---------- */

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #c9cff0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
}

.company-badge svg {
  width: 13px;
  height: 13px;
  color: #2ecc71;
}

.nda-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9aa1bd;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 999px;
  padding: 5px 12px;
}

.agent-card-companies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.agent-card-companies .company-badge { padding: 5px 11px; font-size: 12.5px; }

.slide-type {
  font-size: 13px;
  color: #00e5ff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 18px;
}

.slide-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 18px;
  max-width: 680px;
}

.slide-desc {
  font-size: 16px;
  line-height: 1.7;
  color: #a9aec6;
  max-width: 660px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.m-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.m-card:nth-child(1) { animation-delay: 0.12s; }
.m-card:nth-child(2) { animation-delay: 0.2s; }
.m-card:nth-child(3) { animation-delay: 0.28s; }
.m-card:nth-child(4) { animation-delay: 0.36s; }

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

.m-value {
  display: block;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #8f9bff, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.m-label {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.slide-result {
  margin-top: 34px;
  padding: 24px 28px;
  background: rgba(90, 107, 255, 0.06);
  border-left: 2px solid var(--accent);
  border-radius: 0 16px 16px 0;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.slide-result h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #aab4ff;
  margin-bottom: 10px;
}

.slide-result p {
  font-size: 15.5px;
  line-height: 1.75;
  color: #d4d8ea;
}

.slide-case {
  margin-top: 20px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}

.slide-case h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #aab4ff;
  margin-bottom: 10px;
}

.slide-case p {
  font-size: 15.5px;
  line-height: 1.75;
  color: #d4d8ea;
}

.slide-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.stack-label {
  font-size: 12.5px;
  color: var(--muted);
}

.stack-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-item {
  font-size: 12.5px;
  color: #9aa1bd;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}

.more-line {
  text-align: center;
  font-size: 13.5px;
  color: #565d78;
  margin-top: 34px;
}

/* ---------- results grid ---------- */

.results-header {
  margin-bottom: 28px;
}

.results-summary {
  font-size: 17px;
  line-height: 1.7;
  color: #c9cff0;
  margin-bottom: 12px;
  max-width: 720px;
}

.results-loading {
  animation: loadingPulse 1.4s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.results-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.results-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

/* ---------- agent card ---------- */

.agent-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.agent-card:hover {
  border-color: rgba(143, 155, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.agent-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.agent-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.agent-card-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #8a90a8;
  margin-bottom: 20px;
  flex-grow: 1;
}

.agent-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #aab4ff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, gap 0.2s ease;
}

.agent-card-btn svg { width: 16px; height: 16px; }

.agent-card-btn:hover { color: #fff; gap: 12px; }

/* ---------- popular card ---------- */

.popular-card {
  background: linear-gradient(180deg, rgba(90, 107, 255, 0.06), rgba(90, 107, 255, 0.02));
  border: 1px solid rgba(90, 107, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.popular-card:hover {
  border-color: rgba(143, 155, 255, 0.4);
  transform: translateY(-2px);
}

.popular-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.popular-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.popular-stats span::before {
  content: '•';
  margin-right: 6px;
  color: var(--accent);
}

/* ---------- empty state ---------- */

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 14px;
  color: #565d78;
}

/* ---------- slide (detail) ---------- */

.slide {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(30px, 5vw, 56px);
  overflow: hidden;
  animation: slideUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.back-to-list {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 20px;
  margin-top: 32px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-to-list:hover {
  color: var(--text);
  border-color: rgba(143, 155, 255, 0.4);
}

/* ---------- transition overlay ---------- */

.transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.transition.active { opacity: 1; pointer-events: auto; }

.transition svg { width: 44px; height: 53px; }

.transition span {
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .page-index .site-header { display: none; }
  .header-inner { padding: 0 16px; height: 48px; }
  .header-back { padding: 10px; border-radius: 50%; }
  .header-back svg { width: 18px; height: 18px; }
  .back-text { display: none; }
  .hero { min-height: calc(100vh - 140px); padding: 40px 18px; }
  .site-footer { flex-direction: column; gap: 6px; padding: 0 20px 24px; }
  .search { padding-left: 20px; }
  .suggestions { flex-direction: column; align-items: center; gap: 8px; }
  .suggest-label { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
