/* VCMatch brand system, replicated as plain CSS for the Threads microsite.
   Tokens sourced from vc-matcher-app-rails theme.css / blog.css / cards.css. */

:root {
  --primary: #9779F0;
  --primary-foreground: #FFFFFF;
  --accent: #435DFD;
  --accent-foreground: #FFFFFF;
  --background: #F4F4FE;
  --foreground: #101626;
  --card: #FFFFFF;
  --card-foreground: #101626;
  --secondary: #EFEFFC;
  --muted: #EFEFFC;
  --muted-foreground: #494F60;
  --border: #D6D6E3;
  --ring: #435DFD;
  --deep-purple: #331F6E;
  --cyan: #3598E0;
  --neutral-400: #B4BBD3;
  --neutral-500: #8790A7;
  --neutral-600: #676D84;
  --radius: 0.75rem;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bilmond', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.container--narrow { max-width: 46rem; }

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

.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.site-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--foreground);
}
.site-logo:hover { text-decoration: none; }
.site-logo__mark {
  background: linear-gradient(135deg, #9779F0 38%, #435DFD 60%, #101626 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-logo__sub {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.site-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--foreground); background: var(--secondary); text-decoration: none; }
.site-nav a.is-pill {
  background: rgba(151, 121, 240, 0.1);
  color: var(--primary);
}
.site-nav a.is-pill:hover { background: rgba(151, 121, 240, 0.2); }

@media (max-width: 640px) {
  .site-nav a.hide-sm { display: none; }
}

/* -------------------------------------------------------------------- hero */

.hero {
  background: linear-gradient(160deg, #101626 0%, #1a1040 25%, #331F6E 45%, #435DFD 70%, #9779F0 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  max-width: 46rem;
}

.hero p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 42rem;
  margin: 0;
}

.hero__stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.hero__stat { min-width: 7rem; }
.hero__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.2;
}
.hero__stat span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); }

/* -------------------------------------------------------------- filter bar */

.filter-bar {
  position: sticky;
  top: 3.4rem;
  z-index: 40;
  background: rgba(244, 244, 254, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.filter-bar__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-bar select {
  appearance: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--foreground);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23494F60' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.4rem 2rem 0.4rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-bar select:hover { border-color: var(--primary); }
.filter-bar select:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(67, 93, 253, 0.15); }

.filter-bar__count {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-left: auto;
}
.filter-bar__count strong { color: var(--foreground); }

.filter-bar__reset {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: none;
}
.filter-bar__reset.is-visible { display: inline; }

/* ------------------------------------------------------------ thread cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.25rem;
  padding: 2rem 0 3rem;
}

.thread-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--card-foreground);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.thread-card:hover {
  text-decoration: none;
  box-shadow: 0 10px 30px -12px rgba(16, 22, 38, 0.25);
  border-color: rgba(151, 121, 240, 0.3);
  transform: translateY(-2px);
}
.thread-card.is-hidden { display: none; }

.thread-card__byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.avatar {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: linear-gradient(135deg, #9779F0 20%, #435DFD 75%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.avatar--lg { width: 3.5rem; height: 3.5rem; font-size: 1.2rem; }

.thread-card__author { min-width: 0; }
.thread-card__author strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-card__author span {
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.thread-card h2, .thread-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}
.thread-card:hover h2, .thread-card:hover h3 { color: var(--primary); }

.thread-card__summary {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.chip--accent { background: rgba(67, 93, 253, 0.12); color: var(--accent); }
.chip--primary { background: rgba(151, 121, 240, 0.12); color: #6d4fd8; }
.chip--muted { background: var(--secondary); color: var(--muted-foreground); }
.chip--warn { background: #FEF3E2; color: #92600A; }

.thread-card__footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
}
.thread-card:hover .thread-card__footer { opacity: 1; }

/* ------------------------------------------------------------ browse links */

.browse-section { padding: 1rem 0 3.5rem; }
.browse-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
.browse-section > .container > p { color: var(--muted-foreground); margin: 0 0 1.25rem; font-size: 0.95rem; }

.browse-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.75rem; }
.browse-links a {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--foreground);
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.browse-links a:hover {
  text-decoration: none;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px -6px rgba(151, 121, 240, 0.4);
}
.browse-links a span { color: var(--neutral-500); font-weight: 400; margin-left: 0.3rem; }

/* --------------------------------------------------------------- item page */

.breadcrumbs {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  padding: 1.25rem 0 0;
}
.breadcrumbs a { color: var(--muted-foreground); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span.sep { margin: 0 0.4rem; color: var(--neutral-400); }

.item-header { padding: 1.5rem 0 0.5rem; }
.item-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}
.author-card__meta { flex: 1; min-width: 12rem; }
.author-card__meta strong { display: block; font-size: 1rem; }
.author-card__meta .handle { font-size: 0.85rem; color: var(--muted-foreground); }
.author-card__side {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.role-chip {
  display: inline-block;
  padding: 0.18rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-chip--founder { background: rgba(53, 152, 224, 0.14); color: #1d6ca8; }
.role-chip--vc { background: rgba(51, 31, 110, 0.1); color: var(--deep-purple); }

.prose { font-size: 1.05rem; line-height: 1.78; }
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 0.75rem;
}
.prose p { margin: 0 0 1rem; }

blockquote.thread-quote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--foreground);
  box-shadow: 0 4px 16px -10px rgba(16, 22, 38, 0.15);
}
blockquote.thread-quote footer {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-style: normal;
  color: var(--muted-foreground);
}

.teaches-block {
  background: linear-gradient(135deg, rgba(151, 121, 240, 0.08), rgba(67, 93, 253, 0.08));
  border: 1px solid rgba(151, 121, 240, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
}
.teaches-block h2 { margin-top: 0 !important; }
.teaches-block p:last-child { margin-bottom: 0; }

ul.lessons { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.lessons li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
}
ul.lessons li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.attribution-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--foreground);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.attribution-card p { margin: 0; font-size: 0.9rem; color: var(--neutral-400); }
.attribution-card a.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  background: #fff;
  color: var(--foreground);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  transition: background 0.15s, transform 0.15s;
}
.attribution-card a.primary-link:hover { text-decoration: none; background: var(--secondary); transform: translateY(-1px); }
.attribution-card a.mirror-link { color: var(--primary); font-size: 0.85rem; }

.availability-note {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: #FEF7E8;
  border: 1px solid #F0D9A8;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: #6B4E0B;
}

.sources-list { list-style: none; padding: 0; margin: 0; }
.sources-list li { margin-bottom: 0.5rem; padding-left: 1.6rem; position: relative; }
.sources-list li::before { content: "↳"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.sources-list a { word-break: break-all; }

.vc-module {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vc-module:hover { border-color: rgba(151, 121, 240, 0.4); box-shadow: 0 8px 24px -14px rgba(16, 22, 38, 0.3); text-decoration: none; }
.vc-module__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.6rem;
  flex-shrink: 0;
  background: linear-gradient(160deg, #331F6E, #435DFD);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.vc-module__body { flex: 1; min-width: 0; }
.vc-module__body strong { display: block; color: var(--foreground); }
.vc-module__body span { font-size: 0.85rem; color: var(--muted-foreground); }
.vc-module__arrow { color: var(--primary); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }

.related-section { padding: 1rem 0 3rem; }
.related-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.item-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 0 0.25rem;
}
.item-meta-row a.chip:hover { text-decoration: none; filter: brightness(0.92); }

/* -------------------------------------------------------------- facet page */

.facet-hero {
  background: linear-gradient(160deg, #101626 0%, #1a1040 30%, #331F6E 60%, #435DFD 100%);
  color: #fff;
  padding: 3rem 0 2.5rem;
}
.facet-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 1rem;
}
.facet-hero p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 44rem;
  margin: 0;
}
.facet-hero .hero__eyebrow { margin-bottom: 1rem; }

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

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(16, 22, 38, 0.04);
  margin-top: 2rem;
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}
@media (min-width: 768px) {
  .site-footer__inner { flex-direction: row; }
}
.site-footer__links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.site-footer__links a { color: var(--muted-foreground); transition: color 0.15s; }
.site-footer__links a:hover { color: var(--foreground); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
