/* ============================================================
   DataKnobs — Data-Centric AI Knowledge Hub
   Standalone CSS (no Tailwind dependency)
   ============================================================ */

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #f8fafc;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
::selection { background: #ddd6fe; color: #4c1d95; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font: inherit; background: none; border: none; }

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --v50:  #f5f3ff;
  --v100: #ede9fe;
  --v200: #ddd6fe;
  --v300: #c4b5fd;
  --v600: #7c3aed;
  --v700: #6d28d9;
  --v900: #4c1d95;

  --s100: #f1f5f9;
  --s200: #e2e8f0;
  --s400: #94a3b8;
  --s500: #64748b;
  --s600: #475569;
  --s700: #334155;
  --s800: #1e293b;
  --s900: #0f172a;

  --max-w: 80rem;
  --max-w-article: 56rem;
  --radius-card: 1.5rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.10);
}

/* ── Shared helpers ───────────────────────────────────────── */
.hidden  { display: none !important; }

/* ── Hero gradient ────────────────────────────────────────── */
.hero-bg {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 40%, #7c3aed 70%, #4338ca 100%);
}

/* ── Card hover ───────────────────────────────────────────── */
.card-hover {
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card-hover:hover {
  box-shadow: 0 10px 40px -8px rgba(124,58,237,.18);
  transform: translateY(-3px);
  border-color: var(--v300) !important;
}

/* ============================================================
   SITE HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226,232,240,.8);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
}
.header-logo img { height: 3rem; width: auto; }
.header-logo span {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--s900);
  display: none;
}

/* Desktop hub nav */
.hub-nav {
  display: none;
  align-items: center;
  gap: .25rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--s600);
  overflow-x: auto;
}
.hub-nav a {
  padding: .5rem .75rem;
  border-radius: .5rem;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.hub-nav a:hover { color: var(--v700); background: var(--v50); }
.hub-nav .btn-search {
  margin-left: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--v600);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}
.hub-nav .btn-search:hover { background: var(--v700); }

/* Mobile toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  border-radius: .75rem;
  border: 1px solid var(--s200);
  color: var(--s700);
  transition: background .15s;
}
.nav-toggle:hover { background: #f8fafc; }
.nav-toggle svg { width: 1.5rem; height: 1.5rem; }

/* Mobile menu */
.mobile-menu {
  border-top: 1px solid var(--s200);
  padding-top: 1rem;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--s700);
}
.mobile-menu-links a {
  padding: .75rem 1rem;
  border-radius: .75rem;
  transition: background .15s;
}
.mobile-menu-links a:hover { background: #f8fafc; }
.mobile-menu-links .btn-search {
  margin-top: .5rem;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--v600);
  color: #fff;
  text-align: center;
  font-weight: 600;
  transition: background .15s;
}
.mobile-menu-links .btn-search:hover { background: var(--v700); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.site-hero {
  color: #fff;
  text-align: center;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  padding: .375rem 1rem;
  font-size: .875rem;
  color: var(--v100);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(6px);
}
.hero-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  max-width: 56rem;
  margin: 0 auto;
}
.hero-title span { color: var(--v200); }
.hero-lead {
  margin-top: 1.25rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
  line-height: 2;
  color: rgba(245,243,255,.9);
}
.hero-ctas {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-hero-primary {
  padding: .75rem 1.5rem;
  border-radius: var(--radius-full);
  background: #fff;
  color: #5b21b6;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  transition: transform .15s;
}
.btn-hero-primary:hover { transform: scale(1.02); }
.btn-hero-secondary {
  padding: .75rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background .15s;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,.15); }
.hero-pills {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}
.hero-pill {
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.1);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
}

/* ============================================================
   HUB MAIN VIEW
   ============================================================ */
.hub-main {
  flex-grow: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1rem;
  width: 100%;
}
.hub-sections { display: flex; flex-direction: column; gap: 4rem; }

/* Each rendered section */
.hub-section { scroll-margin-top: 6rem; }

.hub-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--s200);
}
.hub-section-icon {
  padding: .75rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.hub-section-icon svg { width: 1.5rem; height: 1.5rem; }
.hub-section-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--s900);
}

/* Article card grid (injected by JS) */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.article-card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--s200);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.article-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--s900);
  margin-bottom: .75rem;
  line-height: 1.4;
  transition: color .15s;
}
.article-card:hover h3 { color: var(--v700); }
.article-card p {
  font-size: .875rem;
  color: var(--s600);
  line-height: 1.7;
  flex-grow: 1;
}
.article-card-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-tag {
  display: inline-flex;
  align-items: center;
  border-radius: .375rem;
  padding: .25rem .625rem;
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid;
}
.article-arrow {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.article-arrow svg { width: 1rem; height: 1rem; color: var(--s400); transition: color .15s; }
.article-card:hover .article-arrow { background: var(--v50); }
.article-card:hover .article-arrow svg { color: var(--v600); }

/* ── Tag colour variants (set in JS via tagClass) ─────────── */
.tag-amber   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tag-violet  { background: #f5f3ff; color: #6d28d9; border-color: #c4b5fd; }
.tag-emerald { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.tag-rose    { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.tag-sky     { background: #f0f9ff; color: #0c4a6e; border-color: #bae6fd; }
.tag-indigo  { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.tag-orange  { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.tag-slate   { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.tag-fuchsia { background: #fdf4ff; color: #86198f; border-color: #f0abfc; }

/* ── Section icon colour variants ────────────────────────── */
.section-icon-amber   { background: #fef3c7; color: #b45309; }
.section-icon-violet  { background: #ede9fe; color: #6d28d9; }
.section-icon-emerald { background: #d1fae5; color: #065f46; }
.section-icon-rose    { background: #ffe4e6; color: #9f1239; }
.section-icon-sky     { background: #e0f2fe; color: #0c4a6e; }
.section-icon-indigo  { background: #e0e7ff; color: #3730a3; }
.section-icon-orange  { background: #ffedd5; color: #9a3412; }
.section-icon-slate   { background: #f1f5f9; color: #334155; }
.section-icon-fuchsia { background: #fae8ff; color: #86198f; }

/* ============================================================
   ARTICLE READER VIEW
   ============================================================ */
.article-view {
  flex-grow: 1;
  max-width: var(--max-w-article);
  margin: 0 auto;
  padding: 3rem 1rem;
  width: 100%;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--s500);
  margin-bottom: 2rem;
  transition: color .15s;
}
.back-btn:hover { color: var(--v700); }
.back-btn svg {
  width: 1rem; height: 1rem;
  transition: transform .15s;
}
.back-btn:hover svg { transform: translateX(-3px); }

.article-paper {
  background: #fff;
  border-radius: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--s200);
  padding: 1.5rem;
}
.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--s100);
}
.article-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  font-weight: 500;
}
.article-meta-sep { color: var(--s300); }
.article-meta-read { color: var(--s500); }
.article-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--s900);
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.article-summary {
  font-size: 1.125rem;
  color: var(--s500);
  font-style: italic;
  line-height: 1.7;
}

/* ── Prose (article body) ─────────────────────────────────── */
.prose {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--s700);
}
.prose p { margin-bottom: 1.25rem; }
.prose h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-top: 2rem;
  margin-bottom: .75rem;
}
.prose h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #3730a3;
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}
.prose strong { color: #4c1d95; font-weight: 600; }
.prose em { font-style: italic; }
.prose a { color: var(--v600); text-decoration: underline; }
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--v600); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #1f2937;
  color: #d1d5db;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.footer-logo img { height: 2.5rem; width: auto; filter: brightness(10); margin-bottom: 1rem; }
.footer-tagline { font-size: .875rem; color: #9ca3af; }
.footer-col h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size: .875rem;
  color: #d1d5db;
  transition: color .2s;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-contact { display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.footer-contact a { transition: color .2s; }
.footer-contact a:hover { color: #fff; text-decoration: underline; }
.footer-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}
.footer-socials a { color: #9ca3af; transition: color .2s; }
.footer-socials a:hover { color: #fff; }
.footer-socials svg { width: 1.25rem; height: 1.25rem; }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #374151;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.footer-copy { font-size: .875rem; color: #9ca3af; }
.footer-site-link { font-size: .875rem; color: #a78bfa; transition: color .2s; }
.footer-site-link:hover { color: #c4b5fd; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
  .header-logo img  { height: 3.5rem; }
  .header-logo span { display: block; }
  .hero-pills       { grid-template-columns: repeat(3, 1fr); }
  .footer-bottom    { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 768px) {
  .hub-nav      { display: flex; }
  .nav-toggle   { display: none; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid  { grid-template-columns: repeat(2, 1fr); }
  .article-paper { padding: 2.5rem 3rem; }
}

@media (min-width: 1024px) {
  .header-inner { padding: 1rem 2rem; }
  .hub-main     { padding: 3rem 2rem; }
  .footer-grid  { grid-template-columns: repeat(4, 1fr); }
}
