/* ================================================================
   StartupInvestors – Design System
   Dark professional theme, Inter font
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:          #080d18;
  --bg-2:        #0d1425;
  --card:        #111827;
  --card-hover:  #16203a;
  --border:      #1e2d45;
  --border-2:    #253452;

  --text:        #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;

  --accent:      #3b82f6;
  --accent-dark: #2563eb;
  --accent-glow: rgba(59,130,246,.15);

  --green:       #10b981;
  --orange:      #f59e0b;
  --purple:      #a855f7;
  --rose:        #f43f5e;
  --teal:        #06b6d4;

  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-sm:   0 2px 8px  rgba(0,0,0,.3);
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  min-height: 100vh;
}

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

h1,h2,h3,h4,h5,h6 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1rem; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ─── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,13,24,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex: 1;
}

.nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color .15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); text-decoration: none; }

.nav-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.nav-search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .875rem .45rem 2.25rem;
  font-size: .875rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.nav-search input::placeholder { color: var(--text-3); }
.nav-search input:focus { border-color: var(--accent); }
.nav-search .search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: .875rem;
}

.nav-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  transition: background .15s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-dark); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  transition: background .15s, transform .1s;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--accent);      color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

.btn-outline   { background: transparent; color: var(--text); border: 1px solid var(--border-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.btn-ghost { background: var(--card); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); }

.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.source-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  text-decoration: none;
  color: var(--text);
}
.source-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}

.source-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.source-card .card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.source-card .card-meta {
  font-size: .8rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .2rem;
}

.source-card .card-desc {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-card .card-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

/* ─── Badges / Tags ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .6rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* Type badges */
.badge-equity        { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-non_dilutive  { background: rgba(16,185,129,.15); color: #34d399; }
.badge-debt          { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-alternative   { background: rgba(168,85,247,.15); color: #c084fc; }

/* Neutral tags */
.tag {
  background: rgba(255,255,255,.06);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .55rem;
  font-size: .75rem;
  font-weight: 500;
}

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,.12), transparent);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,.3);
  color: var(--accent);
  border-radius: 999px;
  padding: .3rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-2);
  overflow: hidden;
  background: var(--card);
}
.hero-search input {
  flex: 1;
  background: transparent;
  border: none;
  padding: .875rem 1.25rem;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}
.hero-search input::placeholder { color: var(--text-3); }
.hero-search button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .875rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.hero-search button:hover { background: var(--accent-dark); }

/* ─── Stats bar ───────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.stat-item .stat-label {
  font-size: .8rem;
  color: var(--text-3);
  margin-top: .1rem;
}

/* ─── Category Section ────────────────────────────────────── */
.section { padding: 3rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .75rem;
}
.section-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .5rem; }
.section-sub { color: var(--text-2); margin-bottom: 2rem; font-size: .95rem; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  text-decoration: none;
}
.category-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-3px);
  text-decoration: none;
}

.category-card .cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.cat-equity     .cat-icon { background: rgba(59,130,246,.15); }
.cat-grants     .cat-icon { background: rgba(16,185,129,.15); }
.cat-accels     .cat-icon { background: rgba(245,158,11,.15); }
.cat-debt       .cat-icon { background: rgba(168,85,247,.15); }
.cat-alt        .cat-icon { background: rgba(6,182,212,.15); }

.category-card .cat-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.category-card .cat-count {
  font-size: .875rem;
  color: var(--text-3);
}

.category-card .cat-desc {
  font-size: .8rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}

/* ─── Source Grid ─────────────────────────────────────────── */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ─── Browse Layout ───────────────────────────────────────── */
.browse-layout {
  display: flex;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  align-items: flex-start;
}

/* ─── Sidebar Filters ─────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
}

.filter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.filter-card h3 {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .625rem;
  border-bottom: 1px solid var(--border);
}

.filter-group { margin-bottom: 1.25rem; }
.filter-group:last-child { margin-bottom: 0; }

.filter-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .5rem;
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
  border: 1px solid transparent;
}
.filter-option:hover {
  background: var(--card-hover);
  color: var(--text);
}
.filter-option.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(59,130,246,.3);
}

.filter-count {
  background: var(--bg-2);
  color: var(--text-3);
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .7rem;
  font-weight: 600;
}

.filter-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .7rem;
  font-size: .875rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.filter-input:focus { border-color: var(--accent); }
.filter-input option { background: var(--bg-2); }

/* ─── Main Content Area ───────────────────────────────────── */
.main-content { flex: 1; min-width: 0; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.results-count {
  font-size: .875rem;
  color: var(--text-2);
}
.results-count strong { color: var(--text); }

/* ─── Browse page top search bar ─────────────────────────── */
.browse-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

.browse-searchbar {
  display: flex;
  max-width: 500px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.browse-searchbar input {
  flex: 1;
  background: transparent;
  border: none;
  padding: .6rem 1rem;
  font-size: .9rem;
  color: var(--text);
  outline: none;
}
.browse-searchbar input::placeholder { color: var(--text-3); }
.browse-searchbar button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: .6rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.browse-searchbar button:hover { background: var(--accent-dark); }

/* Active filter chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 999px;
  padding: .25rem .7rem;
  font-size: .8rem;
  font-weight: 500;
}
.filter-chip button {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  opacity: .7;
}
.filter-chip button:hover { opacity: 1; }

/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 2rem;
  padding-bottom: 2rem;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  padding: 0 .5rem;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }

/* ─── Source Detail Page ──────────────────────────────────── */
.detail-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  font-weight: 800;
  color: var(--accent);
}

.detail-title { flex: 1; }
.detail-title h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.detail-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.detail-meta { font-size: .875rem; color: var(--text-2); display: flex; gap: 1rem; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: flex-start;
}

.detail-main > * + * { margin-top: 1.5rem; }

.detail-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.detail-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.detail-section p {
  color: var(--text-2);
  font-size: .95rem;
  line-height: 1.7;
}

.detail-sidebar > * + * { margin-top: 1rem; }

.info-list { display: flex; flex-direction: column; gap: .75rem; }
.info-item { display: flex; flex-direction: column; gap: .15rem; }
.info-item .label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}
.info-item .value {
  font-size: .95rem;
  color: var(--text);
  font-weight: 500;
}

.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Recent investments table */
.inv-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.inv-table th {
  text-align: left;
  color: var(--text-3);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
}
.inv-table td {
  padding: .75rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.inv-table tr:last-child td { border-bottom: none; }
.inv-table td:first-child { color: var(--text); font-weight: 600; }

/* ─── Submit Form ─────────────────────────────────────────── */
.submit-layout {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
}
.form-group .required { color: var(--rose); }

.form-input, .form-select, .form-textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .875rem;
  font-size: .9rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: var(--bg-2); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: .75rem; color: var(--text-3); }

/* ─── Empty / Loading States ──────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: .3; }
.empty-state h3 { color: var(--text-2); margin-bottom: .5rem; }
.empty-state p { font-size: .875rem; }

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.loading-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 4rem;
  color: var(--text-2);
}

/* ─── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1.25rem;
  font-size: .875rem;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 9999;
  transition: opacity .3s, transform .3s;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#toast.success { border-left: 3px solid var(--green); }
#toast.error { border-left: 3px solid var(--rose); }

/* ─── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--text-3); }

/* ─── Hero CTA link strip ─────────────────────────────────── */
.hero-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-link-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: var(--text-2);
  text-decoration: none;
}
.hero-link-item:hover { color: var(--text); text-decoration: none; }
.hero-sep { color: var(--border-2); }

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: .8rem;
  color: var(--text-3);
}
footer a { color: var(--text-2); }

/* ================================================================
   AI Search Engine – New Styles
   ================================================================ */

/* ─── AI Hero ─────────────────────────────────────────────── */
.ai-hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem 2rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59,130,246,.18), transparent),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(6,182,212,.06), transparent);
}

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

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,.35);
  color: var(--accent);
  border-radius: 999px;
  padding: .35rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
  letter-spacing: .02em;
}

.ai-badge-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

.ai-hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.ai-hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-hero-sub {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

/* ─── Search Box ──────────────────────────────────────────── */
.search-box-wrap {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 32px rgba(0,0,0,.3);
}

.search-box-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 32px rgba(59,130,246,.15);
}

.ai-search-textarea {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.25rem 1.5rem 1rem;
  font-size: 1rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  resize: none;
  line-height: 1.6;
  display: block;
}
.ai-search-textarea::placeholder { color: var(--text-3); }

.search-box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.char-count {
  font-size: .75rem;
  color: var(--text-3);
}

.ai-search-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .6rem 1.5rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .01em;
}
.ai-search-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.ai-search-btn:active { transform: translateY(0); }

/* ─── Example chips ───────────────────────────────────────── */
.search-examples {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.examples-label {
  font-size: .8rem;
  color: var(--text-3);
  white-space: nowrap;
}

.example-chip {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.example-chip:hover {
  background: var(--accent-glow);
  border-color: rgba(59,130,246,.4);
  color: var(--accent);
}

/* ─── Loading State ───────────────────────────────────────── */
.ai-loading {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.loading-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.loading-spinner-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.loading-spinner-wrap .spinner {
  width: 36px;
  height: 36px;
  border-width: 3.5px;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  margin-bottom: 2rem;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background .3s, color .3s;
}

.step-pending {
  background: var(--bg-2);
  border: 2px solid var(--border);
  color: var(--text-3);
}

.step-done {
  background: rgba(16,185,129,.2);
  border: 2px solid var(--green);
  color: var(--green);
}

.step-text {
  font-size: .9rem;
  color: var(--text-2);
}

.loading-note {
  font-size: .8rem;
  color: var(--text-3);
  margin: 0;
}

/* ─── Results Section ─────────────────────────────────────── */
.results-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

.results-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  color: var(--text-2);
  flex-wrap: wrap;
}
.meta-left strong { color: var(--text); font-size: 1rem; }

.param-chips {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.param-chip {
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.chip-sector  { background: rgba(59,130,246,.15);  color: #60a5fa; }
.chip-stage   { background: rgba(16,185,129,.15);  color: #34d399; }
.chip-country { background: rgba(245,158,11,.15);  color: #fbbf24; }
.chip-type    { background: rgba(168,85,247,.15);  color: #c084fc; }

/* ─── Results Grid ────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.25rem;
}

/* ─── Result Card ─────────────────────────────────────────── */
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
  position: relative;
}

.result-card:hover {
  border-color: rgba(59,130,246,.4);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.result-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.result-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: -.01em;
}

.result-card-title {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .4rem;
  line-height: 1.3;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.result-type-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

.type-vc     { background: rgba(59,130,246,.15);  color: #60a5fa; }
.type-accel  { background: rgba(245,158,11,.15);  color: #fbbf24; }
.type-grant  { background: rgba(16,185,129,.15);  color: #34d399; }
.type-angel  { background: rgba(168,85,247,.15);  color: #c084fc; }
.type-corp   { background: rgba(6,182,212,.15);   color: #22d3ee; }
.type-micro  { background: rgba(244,63,94,.15);   color: #fb7185; }
.type-debt   { background: rgba(234,179,8,.15);   color: #facc15; }
.type-crowd  { background: rgba(132,204,22,.15);  color: #a3e635; }

.result-country {
  font-size: .8rem;
  color: var(--text-3);
}

.result-check {
  font-size: .8rem;
  color: var(--green);
  font-weight: 600;
  background: rgba(16,185,129,.08);
  padding: .15rem .5rem;
  border-radius: 5px;
}

.top-match-badge {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(168,85,247,.25));
  border: 1px solid rgba(59,130,246,.35);
  color: #93c5fd;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 5px;
}

.result-description {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0;
}

/* ─── Result sub-sections ─────────────────────────────────── */
.result-section {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.result-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
}

.portfolio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.portfolio-chip {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 5px;
  padding: .2rem .6rem;
  font-size: .78rem;
  font-weight: 500;
}

.result-strategy,
.result-contact {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}

.result-card-footer {
  margin-top: auto;
  display: flex;
  gap: .6rem;
  align-items: center;
  padding-top: .25rem;
  border-top: 1px solid var(--border);
}

.draft-email-btn {
  margin-left: auto;
}

/* ─── Error State ─────────────────────────────────────────── */
.error-state {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.error-card {
  background: var(--card);
  border: 1px solid rgba(244,63,94,.3);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.error-icon {
  width: 52px;
  height: 52px;
  background: rgba(244,63,94,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--rose);
  margin: 0 auto 1.25rem;
}

.error-card h3 {
  color: var(--text);
  margin-bottom: .5rem;
}

.error-card p {
  color: var(--text-2);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* ─── How it Works ────────────────────────────────────────── */
.how-it-works {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}

.hiw-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.hiw-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.hiw-step {
  position: relative;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .2s;
}
.hiw-step:hover { border-color: var(--accent); }

.hiw-step-num {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: .75rem;
  font-weight: 800;
  color: var(--border-2);
  letter-spacing: .05em;
}

.hiw-step-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hiw-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
}

.hiw-step p {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}

/* ─── Email Panel ─────────────────────────────────────────── */
.email-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.email-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.email-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 540px;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.5);
}
.email-panel.open { transform: translateX(0); }

.email-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-shrink: 0;
}

.email-panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .2rem;
  color: var(--text);
}

.email-panel-sub {
  font-size: .8rem;
  color: var(--text-3);
  margin: 0;
}

.email-panel-close {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.email-panel-close:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Email panel – improved spacing & readability ────────── */
.email-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.email-subject-wrap {
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.email-subject-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .4rem;
}

.email-subject-text {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.email-textarea {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: .9rem;
  color: var(--text);
  font-family: inherit;
  line-height: 1.8;
  outline: none;
  resize: vertical;
  transition: border-color .2s;
  min-height: 380px;
  width: 100%;
}
.email-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.08); }

.email-panel-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bg-2);
}

.email-panel-footer .btn {
  padding: .55rem 1.1rem;
  font-size: .85rem;
}

.email-panel-footer .btn-primary {
  padding: .6rem 1.4rem;
}

/* ─── result-who contact highlight ───────────────────────── */
.result-who {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Hamburger menu ──────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--accent); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--accent); }

/* ─── Browse filter toggle bar (mobile only) ─────────────── */
.filter-toggle-bar { display: none; }
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.filter-toggle-btn:hover,
.filter-toggle-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── AI Search Responsive ────────────────────────────────── */
@media (max-width: 900px) {
  .results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Hamburger */
  .hamburger { display: flex; }
  .nav-cta   { display: none; }
  .nav-search { display: none !important; }

  /* Mobile nav dropdown */
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: .25rem;
    z-index: 99;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
  }
  .nav-links.mobile-open { display: flex; }
  .nav-links a {
    font-size: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.active,
  .nav-links a:hover { color: var(--accent); text-decoration: none; }

  /* Browse filter toggle */
  .filter-toggle-bar {
    display: flex;
    padding: .75rem 1rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
  }

  /* Sidebar hidden by default on mobile */
  .sidebar {
    display: none;
    width: 100%;
    position: static;
  }
  .sidebar.filters-open { display: block; }

  /* Browse layout stacks */
  .browse-layout { flex-direction: column; padding: 1rem; }

  /* Email panel full-screen on mobile */
  .email-panel {
    max-width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .email-textarea { min-height: 260px; }
}

@media (max-width: 640px) {
  .ai-hero       { padding: 2rem 1rem 1.5rem; min-height: auto; }
  .ai-hero-sub   { font-size: .95rem; }
  .ai-hero-title { font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .hiw-steps     { grid-template-columns: 1fr; }
  .results-section { padding: 1rem 1rem 3rem; }
  .result-card   { padding: 1.1rem; }
  .result-card-header { gap: .75rem; }
  .result-card-logo { width: 42px; height: 42px; font-size: 1.1rem; border-radius: 10px; }
  .result-name   { font-size: .95rem; }
  .loading-card  { padding: 2rem 1.25rem; }
  .results-meta-bar { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .draft-email-btn  { margin-left: 0; }
  .result-card-footer { flex-wrap: wrap; }
  .detail-grid   { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
  .form-grid     { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; }
  .stats-bar     { gap: 1.5rem; }
  .section       { padding: 2rem 1rem; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .source-grid   { grid-template-columns: 1fr; }
  .hero          { padding: 3rem 1rem 2rem; }
  .navbar        { padding: 0 1rem; gap: .75rem; }
  .search-examples { gap: .35rem; }
  .example-chip  { font-size: .75rem; padding: .25rem .7rem; }
}

/* ─── Freshness bar ───────────────────────────────────────── */
.freshness-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: .35rem;
}
.freshness-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  transition: width .4s;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .browse-layout { flex-direction: column; padding: 1rem; }
  .sidebar { width: 100%; position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; }
}

@media (max-width: 640px) {
  .navbar { padding: 0 1rem; gap: 1rem; }
  .nav-search, .nav-links { display: none; }
  .hero { padding: 3rem 1rem 2rem; }
  .stats-bar { gap: 1.5rem; }
  .section { padding: 2rem 1rem; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; border-radius: var(--radius); }
  .hero-search button { border-radius: 0 0 var(--radius) var(--radius); }
}
