/* ===== AI Directory Theme — Main Stylesheet ===== */
:root {
  --background: #0f0a1f;
  --foreground: #f5f3fb;
  --card: #1a1330;
  --muted: #251a3d;
  --muted-foreground: #b6acce;
  --primary: #8b5cf6;
  --primary-foreground: #ffffff;
  --primary-glow: #a78bfa;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 0.75rem;
  --font-sans: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
}
html.light {
  --background: #fafaff;
  --foreground: #1a1330;
  --card: #ffffff;
  --muted: #f3f0fa;
  --muted-foreground: #6b6483;
  --primary: #6d28d9;
  --primary-foreground: #ffffff;
  --primary-glow: #8b5cf6;
  --border: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(139, 92, 246, 0.25), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(99, 102, 241, 0.18), transparent 60%);
  background-attachment: fixed;
}
html.light body { background-image: none; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.025em; line-height: 1.2; margin: 0 0 0.5em; }
a { color: var(--primary-glow); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(15, 10, 31, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
html.light .site-header { background: rgba(250, 250, 255, 0.85); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-header .brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--foreground); }
.site-header .brand .dot { color: var(--primary); }
.site-header nav { display: none; gap: 0.25rem; }
@media (min-width: 768px) { .site-header nav { display: flex; } }
.site-header nav a {
  padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.9rem; font-weight: 500;
  color: var(--muted-foreground);
}
.site-header nav a:hover, .site-header nav a.active { background: var(--muted); color: var(--foreground); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.9rem; border: 0; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { transform: scale(1.02); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); }
.icon-btn { background: var(--muted); border: 1px solid var(--border); color: var(--foreground); padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; }

/* Mobile nav */
.menu-toggle { display: inline-flex; }
@media (min-width: 768px) { .menu-toggle { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--border); padding: 0.75rem 1.25rem; flex-direction: column; gap: 0.25rem; }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 0.5rem 0.75rem; border-radius: 0.5rem; color: var(--foreground); }
.mobile-nav a:hover { background: var(--muted); text-decoration: none; }

/* Hero */
.hero { padding: 4rem 0 3rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.hero .lead { color: var(--muted-foreground); max-width: 640px; margin: 0 auto 2rem; font-size: 1.1rem; }
.search-form { max-width: 640px; margin: 0 auto; display: flex; gap: 0.5rem; }
.search-form input { flex: 1; padding: 0.85rem 1rem; border-radius: 0.75rem; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 1rem; }
.search-form input:focus { outline: 2px solid var(--primary); }

/* Grid & cards */
.section { padding: 3rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.section-head a { color: var(--primary-glow); font-weight: 600; font-size: 0.9rem; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 10px 30px -10px rgba(139,92,246,0.35); }
.card h3 { font-size: 1.1rem; margin: 0 0 0.35rem; }
.card p { color: var(--muted-foreground); margin: 0; font-size: 0.92rem; }
.card .tag { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); margin-right: 0.35rem; }

/* News card 16:9 */
.news-card { overflow: hidden; padding: 0; }
.news-card .thumb { aspect-ratio: 16/9; background: var(--muted); overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.news-card:hover .thumb img { transform: scale(1.03); }
.news-card .body { padding: 1rem 1.25rem 1.25rem; }
.news-card .meta { font-size: 0.78rem; color: var(--muted-foreground); margin-bottom: 0.35rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 3rem 0 2rem; color: var(--muted-foreground); font-size: 0.9rem; }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 2rem; }
.site-footer h4 { color: var(--foreground); font-size: 0.95rem; margin: 0 0 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin: 0.35rem 0; }
.site-footer a { color: var(--muted-foreground); }
.site-footer a:hover { color: var(--foreground); }
.site-footer .bottom { border-top: 1px solid var(--border); padding-top: 1.25rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* Single post */
.entry { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 800px; margin: 2rem auto; }
.entry h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.entry .meta { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 1.5rem; }
.entry .content { font-size: 1.02rem; }
.entry .content p { margin: 1em 0; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.85rem; color: var(--muted-foreground); padding: 1rem 0; }
.breadcrumbs a { color: var(--muted-foreground); }
.breadcrumbs span + span::before { content: " / "; margin: 0 0.35rem; }

/* Glossary list */
.glossary-list { columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .glossary-list { columns: 1; } }
.glossary-list .term { break-inside: avoid; margin-bottom: 1rem; padding: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.glossary-list .term h3 { font-size: 1rem; margin: 0 0 0.25rem; }

/* Utility */
.muted { color: var(--muted-foreground); }
.center { text-align: center; }
.mt-2 { margin-top: 1rem; } .mt-4 { margin-top: 2rem; }
