/* ============================================================
   Theme CSS — Anshuman Biswas Blog
   Replaces Tailwind CDN + modern-theme.css
   ============================================================ */

/* ----------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --surface: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

.dark {
  --bg-primary: #1d1d1f;
  --bg-secondary: #2c2c2e;
  --bg-tertiary: #3a3a3c;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #86868b;
  --border: #424245;
  --border-light: #38383a;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --surface: #2c2c2e;
}

/* ----------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
svg { flex-shrink: 0; }

/* ----------------------------------------------------------
   3. Utility Classes (compact Tailwind replacement)
   ---------------------------------------------------------- */

/* Display */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }
.contents { display: contents; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.top-20 { top: 5rem; }
.left-3 { left: 0.75rem; }
.right-2 { right: 0.5rem; }
.bottom-6 { bottom: 1.5rem; }
.z-0 { z-index: 0; }
.-z-10 { z-index: -10; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Flex */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }
.self-center { align-self: center; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Space */
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Width & Height */
.w-1 { width: 0.25rem; }
.w-2 { width: 0.5rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-auto { width: auto; }
.w-full { width: 100%; }
.h-1 { height: 0.25rem; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-48 { height: 12rem; }
.h-64 { height: 16rem; }
.h-96 { height: 24rem; }
.h-full { height: 100%; }
.h-px { height: 1px; }
.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-none { max-width: none; }
.max-h-32 { max-height: 8rem; }
.max-h-60 { max-height: 15rem; }
.max-h-96 { max-height: 24rem; }

/* Padding */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-8 { padding-bottom: 2rem; }
.pr-4 { padding-right: 1rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-4 { padding-left: 1rem; }
.pl-6 { padding-left: 1.5rem; }

/* Margin */
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-5 { margin-left: 1.25rem; }
.ml-auto { margin-left: auto; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }
.-m-1 { margin: -0.25rem; }
.-ml-1 { margin-left: -0.25rem; }
.-mr-2 { margin-right: -0.5rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1.15; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.leading-4 { line-height: 1rem; }
.leading-5 { line-height: 1.25rem; }
.leading-6 { line-height: 1.5rem; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-wider { letter-spacing: 0.05em; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.line-through { text-decoration: line-through; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Text Colors — mapped to design tokens & semantic values */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-transparent { color: transparent; }
.text-gray-50 { color: #f9fafb; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.text-green-400 { color: #4ade80; }
.text-green-500 { color: #22c55e; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: var(--accent); }
.text-blue-700 { color: var(--accent-hover); }
.text-blue-800 { color: #1e40af; }
.text-yellow-400 { color: #facc15; }
.text-yellow-500 { color: #eab308; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }
.text-purple-300 { color: #d8b4fe; }
.text-purple-600 { color: #9333ea; }
.text-purple-700 { color: #7e22ce; }
.text-indigo-400 { color: #818cf8; }
.text-indigo-500 { color: #6366f1; }
.text-indigo-600 { color: var(--accent); }
.text-indigo-700 { color: var(--accent-hover); }
.text-indigo-800 { color: #3730a3; }
.text-amber-700 { color: #b45309; }
.text-emerald-400 { color: #34d399; }
.text-emerald-600 { color: #059669; }
.text-orange-500 { color: #f97316; }
.text-orange-600 { color: #ea580c; }
.text-teal-300 { color: #5eead4; }
.text-teal-400 { color: #2dd4bf; }
.text-teal-500 { color: #14b8a6; }
.text-teal-600 { color: var(--accent); }
.text-teal-700 { color: #0f766e; }
.text-blue-900 { color: #1e3a5f; }
.text-green-900 { color: #14532d; }
.text-purple-900 { color: #581c87; }
.text-emerald-800 { color: #065f46; }
.dark .text-teal-300 { color: #5eead4; }
.dark .text-teal-400 { color: #2dd4bf; }

/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-black { background-color: #000000; }
.bg-transparent { background-color: transparent; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-600 { background-color: #4b5563; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-gray-950 { background-color: #030712; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-700 { background-color: #b91c1c; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: var(--accent); }
.bg-blue-700 { background-color: var(--accent-hover); }
.bg-blue-800 { background-color: #1e40af; }
.bg-blue-900 { background-color: #1e3a5f; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-purple-500 { background-color: #a855f7; }
.bg-purple-600 { background-color: #9333ea; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-indigo-600 { background-color: var(--accent); }
.bg-indigo-700 { background-color: var(--accent-hover); }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-600 { background-color: #d97706; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-orange-500 { background-color: #f97316; }
.bg-orange-600 { background-color: #ea580c; }
.bg-teal-50 { background-color: #f0fdfa; }
.bg-teal-600 { background-color: var(--accent); }
.bg-teal-700 { background-color: #0f766e; }
.bg-teal-900 { background-color: #134e4a; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }

.bg-opacity-50 { --bg-opacity: 0.5; }
.bg-opacity-75 { --bg-opacity: 0.75; }

/* Gradients — use --tw-gradient-stops when set (for via support), else fallback to from/to */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent))); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent))); }
.from-blue-50 { --tw-gradient-from: #eff6ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-blue-100 { --tw-gradient-from: #dbeafe; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-blue-500 { --tw-gradient-from: #3b82f6; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-blue-600 { --tw-gradient-from: var(--accent); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-green-50 { --tw-gradient-from: #f0fdf4; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-green-500 { --tw-gradient-from: #22c55e; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-purple-50 { --tw-gradient-from: #faf5ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-purple-100 { --tw-gradient-from: #f3e8ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-purple-500 { --tw-gradient-from: #a855f7; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-indigo-500 { --tw-gradient-from: #6366f1; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-indigo-600 { --tw-gradient-from: var(--accent); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-emerald-500 { --tw-gradient-from: #10b981; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-orange-500 { --tw-gradient-from: #f97316; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-amber-500 { --tw-gradient-from: #f59e0b; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.to-blue-100 { --tw-gradient-to: #dbeafe; }
.to-blue-900 { --tw-gradient-to: #1e3a5f; }
.to-green-100 { --tw-gradient-to: #dcfce7; }
.to-green-800 { --tw-gradient-to: #166534; }
.to-purple-50 { --tw-gradient-to: #faf5ff; }
.to-purple-100 { --tw-gradient-to: #f3e8ff; }
.to-purple-600 { --tw-gradient-to: #9333ea; }
.to-purple-800 { --tw-gradient-to: #6b21a8; }
.to-indigo-600 { --tw-gradient-to: var(--accent); }
.to-teal-600 { --tw-gradient-to: var(--accent); }
.to-red-600 { --tw-gradient-to: #dc2626; }
.to-red-700 { --tw-gradient-to: #b91c1c; }
.to-orange-600 { --tw-gradient-to: #ea580c; }
.to-amber-600 { --tw-gradient-to: #d97706; }
.to-amber-700 { --tw-gradient-to: #b45309; }
.to-indigo-100 { --tw-gradient-to: #e0e7ff; }
.to-teal-50 { --tw-gradient-to: #f0fdfa; }
.from-red-500 { --tw-gradient-from: #ef4444; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-red-600 { --tw-gradient-from: #dc2626; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-gray-400 { --tw-gradient-from: #9ca3af; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
/* Hover gradient stops */
.hover\:from-blue-600:hover { --tw-gradient-from: #2563eb; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.hover\:to-indigo-700:hover { --tw-gradient-to: #4338ca; }
.hover\:from-red-600:hover { --tw-gradient-from: #dc2626; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.hover\:to-red-700:hover { --tw-gradient-to: #b91c1c; }
.hover\:from-amber-600:hover { --tw-gradient-from: #d97706; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.hover\:to-amber-700:hover { --tw-gradient-to: #b45309; }
.hover\:from-blue-100:hover { --tw-gradient-from: #dbeafe; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.hover\:to-indigo-100:hover { --tw-gradient-to: #e0e7ff; }
/* Via gradient stops — update --tw-gradient-stops to include the via color */
.via-slate-900 { --tw-gradient-stops: var(--tw-gradient-from, transparent), #0f172a, var(--tw-gradient-to, transparent); }
.via-indigo-50 { --tw-gradient-stops: var(--tw-gradient-from, transparent), #eef2ff, var(--tw-gradient-to, transparent); }

.bg-clip-text { -webkit-background-clip: text; background-clip: text; }

/* Borders */
.border { border: 1px solid var(--border); }
.border-0 { border-width: 0; }
.border-2 { border-width: 2px; }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.border-l-4 { border-left: 4px solid var(--border); }
.border-r-0 { border-right-width: 0; }
.border-transparent { border-color: transparent; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-600 { border-color: #4b5563; }
.border-red-200 { border-color: #fecaca; }
.border-red-300 { border-color: #fca5a5; }
.border-red-600 { border-color: #dc2626; }
.border-red-800 { border-color: #991b1b; }
.border-green-200 { border-color: #bbf7d0; }
.border-green-800 { border-color: #166534; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-300 { border-color: #93c5fd; }
.border-blue-600 { border-color: var(--accent); }
.border-blue-800 { border-color: #1e40af; }
.border-yellow-200 { border-color: #fef08a; }
.border-yellow-800 { border-color: #854d0e; }
.border-purple-200 { border-color: #e9d5ff; }
.border-purple-600 { border-color: #9333ea; }
.border-purple-800 { border-color: #6b21a8; }
.border-indigo-300 { border-color: #a5b4fc; }
.border-indigo-500 { border-color: #6366f1; }
.border-indigo-600 { border-color: var(--accent); }
.border-amber-200 { border-color: #fde68a; }
.border-amber-800 { border-color: #92400e; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-emerald-800 { border-color: #065f46; }
.border-orange-200 { border-color: #fed7aa; }
.border-orange-800 { border-color: #9a3412; }
.border-teal-300 { border-color: #5eead4; }
.border-teal-600 { border-color: var(--accent); }
.dark .border-teal-600 { border-color: var(--accent); }

/* Divide */
.divide-y > * + * { border-top: 1px solid var(--border); }
.divide-x > * + * { border-left: 1px solid var(--border); }
.divide-gray-200 > * + * { border-color: #e5e7eb; }

/* Rounded */
.rounded { border-radius: 0.25rem; }
.rounded-sm { border-radius: 0.125rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: var(--radius-lg); }
.rounded-2xl { border-radius: var(--radius-xl); }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-none { border-radius: 0; }
.rounded-l-md { border-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem; }
.rounded-r-md { border-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem; }
.rounded-t-lg { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }

/* Shadows */
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-5 { opacity: 0.05; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.opacity-100 { opacity: 1; }

/* Visibility */
.invisible { visibility: hidden; }
.visible { visibility: visible; }

/* Transitions */
.transition { transition: all 0.15s ease; }
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-opacity { transition: opacity 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

/* Transform */
.transform { transform: translateZ(0); }
.hover\:scale-105:hover { transform: scale(1.05); }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Disabled states */
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.disabled\:transform-none:disabled { transform: none; }
.disabled\:from-gray-400:disabled { --tw-gradient-from: #9ca3af; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.disabled\:to-gray-500:disabled { --tw-gradient-to: #6b7280; }

/* Animations */
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* Lists */
.list-disc { list-style-type: disc; }
.list-decimal { list-style-type: decimal; }
.list-inside { list-style-position: inside; }

/* Misc */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.align-middle { vertical-align: middle; }
.align-text-bottom { vertical-align: text-bottom; }
.object-cover { object-fit: cover; }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.scroll-smooth { scroll-behavior: smooth; }
.select-none { user-select: none; }
.select-all { user-select: all; }

/* Disabled states */
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* ----------------------------------------------------------
   4. Dark-mode Utility Overrides
   ---------------------------------------------------------- */
.dark .dark\:block { display: block; }
.dark .dark\:hidden { display: none; }
.dark .dark\:flex { display: flex; }
:not(.dark) .dark\:block { display: none; }
:not(.dark) .dark\:hidden { display: block; }

/* Dark text */
.dark .dark\:text-white { color: #ffffff; }
.dark .dark\:text-gray-50 { color: #f9fafb; }
.dark .dark\:text-gray-100 { color: #f3f4f6; }
.dark .dark\:text-gray-200 { color: #e5e7eb; }
.dark .dark\:text-gray-300 { color: #d1d5db; }
.dark .dark\:text-gray-400 { color: #9ca3af; }
.dark .dark\:text-gray-500 { color: #6b7280; }
.dark .dark\:text-red-200 { color: #fecaca; }
.dark .dark\:text-red-300 { color: #fca5a5; }
.dark .dark\:text-red-400 { color: #f87171; }
.dark .dark\:text-green-200 { color: #bbf7d0; }
.dark .dark\:text-green-300 { color: #86efac; }
.dark .dark\:text-green-400 { color: #4ade80; }
.dark .dark\:text-blue-200 { color: #bfdbfe; }
.dark .dark\:text-blue-300 { color: #93c5fd; }
.dark .dark\:text-blue-400 { color: #60a5fa; }
.dark .dark\:text-yellow-200 { color: #fef08a; }
.dark .dark\:text-yellow-300 { color: #fde047; }
.dark .dark\:text-yellow-400 { color: #facc15; }
.dark .dark\:text-purple-300 { color: #d8b4fe; }
.dark .dark\:text-purple-400 { color: #c084fc; }
.dark .dark\:text-indigo-300 { color: #a5b4fc; }
.dark .dark\:text-indigo-400 { color: #818cf8; }
.dark .dark\:text-amber-300 { color: #fcd34d; }
.dark .dark\:text-amber-400 { color: #fbbf24; }
.dark .dark\:text-emerald-200 { color: #a7f3d0; }
.dark .dark\:text-emerald-400 { color: #34d399; }
.dark .dark\:text-orange-200 { color: #fed7aa; }

/* Dark backgrounds */
.dark .dark\:bg-gray-700 { background-color: #374151; }
.dark .dark\:bg-gray-800 { background-color: #1f2937; }
.dark .dark\:bg-gray-900 { background-color: #111827; }
.dark .dark\:bg-gray-950 { background-color: #030712; }
.dark .dark\:bg-slate-600 { background-color: #475569; }
.dark .dark\:bg-slate-700 { background-color: #334155; }
.dark .dark\:bg-slate-800 { background-color: #1e293b; }
.dark .dark\:bg-slate-900 { background-color: #0f172a; }
.dark .dark\:bg-white { background-color: #ffffff; }
.dark .dark\:bg-red-900 { background-color: #7f1d1d; }
.dark .dark\:bg-red-100 { background-color: #fee2e2; }
.dark .dark\:bg-green-900 { background-color: #14532d; }
.dark .dark\:bg-green-100 { background-color: #dcfce7; }
.dark .dark\:bg-blue-900 { background-color: #1e3a5f; }
.dark .dark\:bg-blue-100 { background-color: #dbeafe; }
.dark .dark\:bg-yellow-900 { background-color: #713f12; }
.dark .dark\:bg-purple-900 { background-color: #581c87; }
.dark .dark\:bg-indigo-900 { background-color: #312e81; }
.dark .dark\:bg-amber-900 { background-color: #78350f; }
.dark .dark\:bg-emerald-800 { background-color: #065f46; }
.dark .dark\:bg-orange-900 { background-color: #7c2d12; }

/* Dark backgrounds with opacity */
.dark .dark\:bg-red-900\/20 { background-color: rgba(127,29,29,0.2); }
.dark .dark\:bg-red-900\/30 { background-color: rgba(127,29,29,0.3); }
.dark .dark\:bg-red-800\/50 { background-color: rgba(153,27,27,0.5); }
.dark .dark\:bg-green-900\/20 { background-color: rgba(20,83,45,0.2); }
.dark .dark\:bg-green-900\/30 { background-color: rgba(20,83,45,0.3); }
.dark .dark\:bg-blue-900\/20 { background-color: rgba(30,58,95,0.2); }
.dark .dark\:bg-blue-900\/30 { background-color: rgba(30,58,95,0.3); }
.dark .dark\:bg-yellow-900\/20 { background-color: rgba(113,63,18,0.2); }
.dark .dark\:bg-purple-900\/20 { background-color: rgba(88,28,135,0.2); }
.dark .dark\:bg-purple-900\/30 { background-color: rgba(88,28,135,0.3); }
.dark .dark\:bg-indigo-900\/20 { background-color: rgba(49,46,129,0.2); }
.dark .dark\:bg-indigo-900\/30 { background-color: rgba(49,46,129,0.3); }
.dark .dark\:bg-amber-900\/30 { background-color: rgba(120,53,15,0.3); }
.dark .dark\:bg-emerald-900\/20 { background-color: rgba(6,78,59,0.2); }
.dark .dark\:bg-orange-900\/10 { background-color: rgba(124,45,18,0.1); }
.dark .dark\:bg-emerald-900\/10 { background-color: rgba(6,78,59,0.1); }
.dark .dark\:bg-red-900\/10 { background-color: rgba(127,29,29,0.1); }
.dark .dark\:bg-green-900\/10 { background-color: rgba(20,83,45,0.1); }
.dark .dark\:bg-blue-900\/10 { background-color: rgba(30,58,95,0.1); }
.dark .dark\:bg-purple-900\/10 { background-color: rgba(88,28,135,0.1); }

/* Dark borders */
.dark .dark\:border-gray-600 { border-color: #4b5563; }
.dark .dark\:border-gray-700 { border-color: #374151; }
.dark .dark\:border-slate-600 { border-color: #475569; }
.dark .dark\:border-slate-700 { border-color: #334155; }
.dark .dark\:border-red-200 { border-color: #fecaca; }
.dark .dark\:border-red-800 { border-color: #991b1b; }
.dark .dark\:border-green-200 { border-color: #bbf7d0; }
.dark .dark\:border-green-800 { border-color: #166534; }
.dark .dark\:border-blue-200 { border-color: #bfdbfe; }
.dark .dark\:border-blue-800 { border-color: #1e40af; }
.dark .dark\:border-yellow-200 { border-color: #fef08a; }
.dark .dark\:border-yellow-800 { border-color: #854d0e; }
.dark .dark\:border-purple-200 { border-color: #e9d5ff; }
.dark .dark\:border-purple-600 { border-color: #9333ea; }
.dark .dark\:border-purple-800 { border-color: #6b21a8; }
.dark .dark\:border-indigo-600 { border-color: var(--accent); }
.dark .dark\:border-indigo-800 { border-color: #3730a3; }
.dark .dark\:border-amber-200 { border-color: #fde68a; }
.dark .dark\:border-amber-800 { border-color: #92400e; }
.dark .dark\:border-emerald-200 { border-color: #a7f3d0; }
.dark .dark\:border-emerald-800 { border-color: #065f46; }
.dark .dark\:border-orange-200 { border-color: #fed7aa; }
.dark .dark\:border-orange-800 { border-color: #9a3412; }
.dark .dark\:border-slate-700\/50 { border-color: rgba(51,65,85,0.5); }
.dark .dark\:border-blue-800\/50 { border-color: rgba(30,64,175,0.5); }
.dark .dark\:border-green-800\/50 { border-color: rgba(22,101,52,0.5); }
.dark .dark\:border-purple-800\/50 { border-color: rgba(107,33,168,0.5); }
.dark .dark\:border-indigo-800\/50 { border-color: rgba(55,48,163,0.5); }
.dark .dark\:border-orange-800\/50 { border-color: rgba(154,52,18,0.5); }

/* Dark dividers */
.dark .dark\:divide-gray-700 > * + * { border-color: #374151; }
.dark .dark\:divide-slate-600 > * + * { border-color: #475569; }
.dark .dark\:divide-slate-700 > * + * { border-color: #334155; }

/* Dark gradients */
.dark .dark\:from-gray-800 { --tw-gradient-from: #1f2937; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:from-slate-800 { --tw-gradient-from: #1e293b; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:from-slate-900 { --tw-gradient-from: #0f172a; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:from-slate-950 { --tw-gradient-from: #020617; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-gray-900 { --tw-gradient-to: #111827; }
.dark .dark\:to-slate-800 { --tw-gradient-to: #1e293b; }
.dark .dark\:to-slate-900 { --tw-gradient-to: #0f172a; }

/* Dark hover */
.dark .dark\:hover\:bg-slate-600:hover { background-color: #475569; }
.dark .dark\:hover\:bg-slate-700:hover { background-color: #334155; }
.dark .dark\:hover\:bg-gray-600:hover { background-color: #4b5563; }
.dark .dark\:hover\:bg-gray-700:hover { background-color: #374151; }
.dark .dark\:hover\:bg-teal-900:hover { background-color: #134e4a; }
.dark .dark\:hover\:text-gray-200:hover { color: #e5e7eb; }
.dark .dark\:hover\:text-gray-300:hover { color: #d1d5db; }
.dark .dark\:hover\:text-indigo-300:hover { color: #a5b4fc; }

/* Dark focus */
.dark .dark\:focus\:ring-offset-slate-800:focus { --tw-ring-offset-color: #1e293b; }

/* Dark gradient activation (templates use dark:bg-gradient-to-br to activate gradient only in dark mode) */
.dark .dark\:bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent))); }
.dark .dark\:bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent))); }

/* Dark via gradient */
.dark .dark\:via-slate-900 { --tw-gradient-stops: var(--tw-gradient-from, transparent), #0f172a, var(--tw-gradient-to, transparent); }

/* Missing dark gradient from/to with opacity */
.dark .dark\:from-purple-900 { --tw-gradient-from: #581c87; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-blue-900 { --tw-gradient-to: #1e3a5f; }
.dark .dark\:from-blue-900\/30 { --tw-gradient-from: rgba(30,58,95,0.3); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-blue-800\/30 { --tw-gradient-to: rgba(30,64,175,0.3); }
.dark .dark\:from-green-900\/30 { --tw-gradient-from: rgba(20,83,45,0.3); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-green-800\/30 { --tw-gradient-to: rgba(22,101,52,0.3); }
.dark .dark\:from-purple-900\/30 { --tw-gradient-from: rgba(88,28,135,0.3); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-purple-800\/30 { --tw-gradient-to: rgba(107,33,168,0.3); }
.dark .dark\:from-blue-900\/20 { --tw-gradient-from: rgba(30,58,95,0.2); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-purple-900\/20 { --tw-gradient-to: rgba(88,28,135,0.2); }
.dark .dark\:from-green-900\/20 { --tw-gradient-from: rgba(20,83,45,0.2); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-teal-900\/20 { --tw-gradient-to: rgba(19,78,74,0.2); }
.dark .dark\:from-slate-800 { --tw-gradient-from: #1e293b; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:to-slate-700 { --tw-gradient-to: #334155; }
.dark .dark\:hover\:from-slate-700:hover { --tw-gradient-from: #334155; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.dark .dark\:hover\:to-slate-600:hover { --tw-gradient-to: #475569; }

/* Opacity-variant backgrounds */
.bg-white\/90 { background-color: rgba(255,255,255,0.9); }
.bg-white\/70 { background-color: rgba(255,255,255,0.7); }
.dark .dark\:bg-slate-800\/70 { background-color: rgba(30,41,59,0.7); }
.dark .dark\:bg-slate-800\/50 { background-color: rgba(30,41,59,0.5); }
.dark .dark\:bg-slate-900\/50 { background-color: rgba(15,23,42,0.5); }
.dark .dark\:bg-gray-800\/70 { background-color: rgba(31,41,55,0.7); }

/* Opacity-variant borders */
.border-gray-200\/50 { border-color: rgba(229,231,235,0.5); }
.border-emerald-200\/50 { border-color: rgba(167,243,208,0.5); }
.border-blue-200\/50 { border-color: rgba(191,219,254,0.5); }
.dark .dark\:border-emerald-800\/50 { border-color: rgba(6,95,70,0.5); }
.dark .dark\:border-yellow-800\/50 { border-color: rgba(133,77,14,0.5); }

/* Missing dark text colors */
.dark .dark\:text-blue-100 { color: #dbeafe; }
.dark .dark\:text-blue-200 { color: #bfdbfe; }
.dark .dark\:text-green-100 { color: #dcfce7; }
.dark .dark\:text-green-200 { color: #bbf7d0; }
.dark .dark\:text-purple-100 { color: #f3e8ff; }
.dark .dark\:text-purple-200 { color: #e9d5ff; }
.dark .dark\:text-yellow-100 { color: #fef9c3; }
.dark .dark\:text-amber-200 { color: #fde68a; }
.dark .dark\:text-emerald-300 { color: #6ee7b7; }
.dark .dark\:text-orange-300 { color: #fdba74; }
.dark .dark\:text-red-200 { color: #fecaca; }
.dark .dark\:text-emerald-800 { color: #065f46; }

/* Missing dark bg colors */
.dark .dark\:bg-green-800 { background-color: #166534; }
.dark .dark\:bg-blue-800 { background-color: #1e40af; }

/* Backdrop blur */
.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* Shadow with color (used by api-access hero icon) */
.shadow-blue-500\/25 { box-shadow: 0 10px 15px -3px rgba(59,130,246,0.25); }
.hover\:shadow-blue-600\/30:hover { box-shadow: 0 10px 15px -3px rgba(37,99,235,0.3); }

/* Dark prose */
.dark .dark\:prose-invert { color: var(--text-primary); }
.dark .dark\:prose-invert a { color: var(--accent); }

/* ----------------------------------------------------------
   5. Hover Utilities
   ---------------------------------------------------------- */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-gray-600:hover { background-color: #4b5563; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-gray-900:hover { background-color: #111827; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:bg-red-200:hover { background-color: #fecaca; }
.hover\:bg-red-600:hover { background-color: #dc2626; }
.hover\:bg-red-700:hover { background-color: #b91c1c; }
.hover\:bg-green-50:hover { background-color: #f0fdf4; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-blue-700:hover { background-color: var(--accent-hover); }
.hover\:bg-blue-800:hover { background-color: #1e40af; }
.hover\:bg-indigo-700:hover { background-color: var(--accent-hover); }
.hover\:bg-purple-50:hover { background-color: #faf5ff; }
.hover\:bg-purple-700:hover { background-color: #7e22ce; }
.hover\:bg-teal-50:hover { background-color: #f0fdfa; }
.hover\:bg-teal-700:hover { background-color: #0f766e; }
.hover\:bg-amber-200:hover { background-color: #fde68a; }
.hover\:bg-emerald-700:hover { background-color: #047857; }
.hover\:bg-slate-600:hover { background-color: #475569; }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-yellow-600:hover { background-color: #ca8a04; }

.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-blue-600:hover { color: var(--accent); }
.hover\:text-blue-700:hover { color: var(--accent-hover); }
.hover\:text-indigo-300:hover { color: #a5b4fc; }
.hover\:text-indigo-500:hover { color: #6366f1; }
.hover\:text-indigo-800:hover { color: #3730a3; }
.hover\:text-indigo-900:hover { color: #312e81; }
.hover\:text-teal-500:hover { color: #14b8a6; }
.hover\:text-red-300:hover { color: #fca5a5; }
.hover\:text-red-900:hover { color: #7f1d1d; }
.hover\:text-green-700:hover { color: #15803d; }
.hover\:text-yellow-600:hover { color: #ca8a04; }
.hover\:text-purple-700:hover { color: #7e22ce; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); }
.hover\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04); }

/* Hover gradients */
.hover\:from-blue-600:hover { --tw-gradient-from: var(--accent); }
.hover\:from-blue-700:hover { --tw-gradient-from: var(--accent-hover); }
.hover\:to-purple-700:hover { --tw-gradient-to: #7e22ce; }
.hover\:to-indigo-700:hover { --tw-gradient-to: var(--accent-hover); }
.hover\:from-red-600:hover { --tw-gradient-from: #dc2626; }
.hover\:to-red-700:hover { --tw-gradient-to: #b91c1c; }
.hover\:from-amber-600:hover { --tw-gradient-from: #d97706; }
.hover\:to-amber-700:hover { --tw-gradient-to: #b45309; }
.hover\:from-emerald-600:hover { --tw-gradient-from: #059669; }
.hover\:to-teal-700:hover { --tw-gradient-to: #0f766e; }
.hover\:from-orange-600:hover { --tw-gradient-from: #ea580c; }

/* Focus */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--accent); }
.focus\:ring-offset-2:focus { box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent); }
.focus\:ring-indigo-500:focus { --tw-ring-color: var(--accent); }
.focus\:ring-blue-500:focus { --tw-ring-color: var(--accent); }
.focus\:ring-purple-500:focus { --tw-ring-color: #a855f7; }
.focus\:ring-teal-500:focus { --tw-ring-color: var(--accent); }
.focus\:ring-red-500:focus { --tw-ring-color: #ef4444; }
.focus\:border-teal-500:focus { border-color: var(--accent); }
.focus\:border-indigo-500:focus { border-color: var(--accent); }
.focus\:border-blue-500:focus { border-color: var(--accent); }
.focus\:border-transparent:focus { border-color: transparent; }
.focus\:ring-opacity-50:focus { --tw-ring-opacity: 0.5; }

/* Group hover */
.group:hover .group-hover\:text-blue-400 { color: #60a5fa; }
.group:hover .group-hover\:text-blue-600 { color: var(--accent); }
.group:hover .group-hover\:text-indigo-300 { color: #a5b4fc; }
.group:hover .group-hover\:text-white { color: #ffffff; }

/* ----------------------------------------------------------
   6. Responsive
   ---------------------------------------------------------- */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
  .sm\:text-lg { font-size: 1.125rem; }
  .sm\:text-2xl { font-size: 1.5rem; }
  .sm\:text-5xl { font-size: 3rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .md\:text-5xl { font-size: 3rem; line-height: 1.15; }
  .md\:h-96 { height: 24rem; }
  .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* ----------------------------------------------------------
   7. Component Styles
   ---------------------------------------------------------- */

/* --- Navbar --- */
.navbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}
.dark .navbar { background: rgba(29, 29, 31, 0.85); }

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.2s, background-color 0.2s;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border: none;
  background: none;
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.nav-link.active {
  color: var(--accent);
  font-weight: 600;
}

/* --- Logo --- */
.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.logo-text .highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  margin: 0 1px;
  vertical-align: middle;
}

/* --- Avatar --- */
.avatar-circle {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.375rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}
.username-text { margin-right: 0.25rem; }

/* --- Dropdowns --- */
.admin-dropdown, .user-dropdown { position: relative; display: inline-block; }

.admin-dropdown-btn, .user-dropdown-btn {
  display: flex;
  align-items: center;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.2s, background-color 0.2s;
}
.admin-dropdown-btn:hover, .user-dropdown-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.admin-dropdown-btn svg, .user-dropdown-btn svg {
  margin-left: 0.25rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.admin-dropdown-menu, .user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 0.375rem 0;
  min-width: 12rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 1000;
  pointer-events: none;
}
.dark .admin-dropdown-menu, .dark .user-dropdown-menu {
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.admin-dropdown.open .admin-dropdown-menu,
.user-dropdown.open .user-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.admin-dropdown.open .admin-dropdown-btn svg,
.user-dropdown.open .user-dropdown-btn svg {
  transform: rotate(180deg);
}

.dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-tertiary); color: var(--accent); }

/* --- Mobile Menu --- */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius);
}
.mobile-menu-button:hover { background: var(--bg-tertiary); }

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --- Main Content --- */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  margin-bottom: 2.5rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}
.hero h1 .hero-accent {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Editorial Post Layout --- */

/* Post feed — clean vertical list */
.post-feed {
  display: flex;
  flex-direction: column;
}

/* Single post item — borderless, clean */
.post-item {
  display: block;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: opacity 0.15s;
  cursor: pointer;
}
.post-item:first-child { padding-top: 0; }
.post-item:last-child { border-bottom: none; }
.post-item:hover { opacity: 0.85; }

/* Layout: text left, optional image right */
.post-item-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.post-item-text {
  flex: 1;
  min-width: 0;
}

.post-item-image {
  flex-shrink: 0;
  width: 180px;
  height: 120px;
  border-radius: var(--radius);
  overflow: hidden;
}
.post-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  .post-item-inner { flex-direction: column-reverse; gap: 1rem; }
  .post-item-image { width: 100%; height: 180px; }
}

/* Lead post — first item, bigger type */
.post-item.post-lead .post-item-image {
  width: 280px;
  height: 180px;
}
.post-item.post-lead .post-item-title {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

@media (max-width: 640px) {
  .post-item.post-lead .post-item-image { width: 100%; height: 200px; }
}

/* Meta line: date, featured badge, categories */
.post-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* Title */
.post-item-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.375rem;
}
.post-item-title a {
  color: var(--text-primary);
  text-decoration: none;
}
.post-item:hover .post-item-title a { color: var(--accent); }

/* Excerpt — flatten rendered HTML so line-clamp works */
.post-item-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-item.post-lead .post-item-excerpt { -webkit-line-clamp: 3; }
.post-item-excerpt * {
  display: inline;
  margin: 0;
  padding: 0;
}
.post-item-excerpt br { display: none; }
.post-item-excerpt p::after { content: " "; }
.post-item-excerpt a { color: inherit; text-decoration: none; pointer-events: none; }

/* Category pills */
.category-pill {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(13,148,136,0.1);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dark .category-pill { background: rgba(45,212,191,0.12); }

.category-pills {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* Featured badge */
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #a16207;
  font-size: 0.75rem;
  font-weight: 500;
}
.featured-badge svg { width: 0.875rem; height: 0.875rem; }
.dark .featured-badge { color: #facc15; }

/* Read more */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: gap 0.2s;
  margin-top: 0.5rem;
}
.read-more:hover { gap: 0.625rem; }

/* Meta separator dot */
.post-item-meta .sep { color: var(--text-tertiary); }

/* Post prev/next navigation */
.post-nav { border-top: 1px solid var(--border-light); padding-top: 1.5rem; }
.post-nav-inner { display: flex; justify-content: space-between; align-items: center; }
.post-nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border-radius: var(--radius-lg);
  text-decoration: none; color: inherit; max-width: 45%;
  transition: background 0.15s;
}
.post-nav-link:hover { background: var(--bg-secondary); }
.post-nav-next { text-align: right; }
.post-nav-arrow { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--text-tertiary); }
.post-nav-link:hover .post-nav-arrow { color: var(--accent); }
.post-nav-label { font-size: 0.8125rem; color: var(--text-tertiary); margin-bottom: 0.125rem; }
.post-nav-title { font-weight: 600; font-size: 0.9375rem; }

/* Legacy compat — used by blog-view and infinite scroll */
.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.blog-post {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-post:hover {
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.dark .blog-post:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.blog-post.featured-post { border-left: 3px solid #eab308; }
.dark .blog-post.featured-post { border-left-color: #facc15; }
.blog-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.blog-post-date { display: flex; align-items: center; gap: 0.375rem; }
.reading-time { display: flex; align-items: center; }
.blog-post-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.blog-post-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}
.blog-post-title a:hover { color: var(--accent); }
.blog-post-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Search Cmd+K badge */
.search-kbd {
  display: none;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
  margin-left: 0.375rem;
  line-height: 1;
}
@media (min-width: 768px) {
  .search-kbd { display: inline-block; }
}

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 0 2rem;
  margin-top: auto;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--accent); }
.footer-text {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

/* --- Forms --- */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.form-input::placeholder { color: var(--text-tertiary); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(13,148,136,0.25);
}
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border-light); }

/* ----------------------------------------------------------
   8. Prose — Article Typography
   ---------------------------------------------------------- */
.prose { max-width: none; line-height: 1.7; color: var(--text-primary); }
.prose h1 { font-size: 2rem; font-weight: 700; margin: 1.5em 0 0.6em; line-height: 1.2; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 1.5em 0 0.6em; line-height: 1.25; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin: 1.25em 0 0.5em; line-height: 1.3; }
.prose h4 { font-size: 1.125rem; font-weight: 600; margin: 1em 0 0.5em; }
.prose p { margin: 1em 0; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin: 0.75em 0; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin: 0.75em 0; }
.prose ol ol { list-style-type: lower-alpha; }
.prose ol ol ol { list-style-type: lower-roman; }
.prose li { margin: 0.25em 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; font-weight: 500; }
.prose a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.prose pre a, .prose code a { color: inherit; text-decoration: none; pointer-events: none; font-weight: inherit; }
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--accent); font-weight: 600; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}

.prose pre {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  position: relative;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.prose :not(pre) > code {
  background: rgba(13,148,136,0.08);
  color: var(--accent);
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  font-weight: 500;
}
.dark .prose :not(pre) > code {
  background: rgba(45,212,191,0.12);
  color: var(--accent);
}

.prose table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--border-light);
  width: 100%;
}
.prose th, .prose td { border-bottom: 1px solid var(--border-light); padding: 0.625rem 0.875rem; }
.prose th { background: var(--bg-secondary); font-weight: 600; text-align: left; }

.prose img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
  cursor: pointer;
}
.prose p > img, .prose div > img, .prose figure > img, .prose a > img {
  display: block;
  margin: 12px auto;
  width: 100%;
}
.prose figure { margin: 2rem 0; text-align: center; }
.prose figure img { width: 100%; }
.prose figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-tertiary);
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 2rem 0;
}

.prose h2:hover::before, .prose h3:hover::before, .prose h4:hover::before {
  content: '#';
  position: absolute;
  left: -1.25rem;
  color: var(--accent);
  font-weight: 400;
}
.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: 100px; }

/* --- Image Gallery --- */
.image-gallery figure { margin: 2rem 0; text-align: center; }
.image-gallery figure img {
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  max-width: 100%;
  height: auto;
}
.prose .image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  margin: 12px 0;
}
.prose .image-gallery a { display: flex; justify-content: center; align-items: center; }
.prose .image-gallery img { display: block; margin: 0; }

figcaption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-style: italic;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.6;
  padding: 0.5rem 1rem 0;
  border-top: 1px solid var(--border-light);
}

/* --- Code Blocks (Prism) --- */
pre[class*="language-"], code[class*="language-"] {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}
pre[class*="language-"] { border-radius: 0.75rem; padding: 1rem 1.25rem; }
.dark pre[class*="language-"] { background: #0d1117; }
.dark pre[class*="language-"] code { line-height: 1.6; tab-size: 2; }
.dark code[class*="language-"] { background: transparent; }
.dark .token.comment { color: #8b949e; font-style: italic; }
.dark .token.string { color: #a5d6ff; }
.dark .token.keyword { color: #ff7b72; }
.dark .token.function { color: #d2a8ff; }
.dark .token.number, .dark .token.boolean { color: #79c0ff; }

/* --- Video Container --- */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.5rem 0;
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- Copy Button for Code --- */
.prose pre .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 0.25rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.prose pre:hover .copy-btn { opacity: 1; }
.dark .prose pre .copy-btn { background: rgba(255,255,255,0.15); color: #e5e7eb; }

/* --- Formatting Guide: Tabs & Alerts --- */
.format-tab {
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6b7280;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
  background: none;
}
.format-tab:hover { color: #374151; border-bottom-color: #d1d5db; }
.dark .format-tab { color: #9ca3af; }
.dark .format-tab:hover { color: #d1d5db; }
.format-tab.active { border-bottom-color: #3b82f6; color: #2563eb; }
.dark .format-tab.active { color: #60a5fa; }
.format-tab-content { display: none; }
.format-tab-content.active { display: block; }

.formatting-guide .alert {
  padding: 1rem;
  border-radius: 0.5rem;
  border-width: 1px;
  border-style: solid;
}
.formatting-guide .alert-info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
.dark .formatting-guide .alert-info {
  background-color: rgba(30,58,95,0.2);
  border-color: #1e40af;
  color: #bfdbfe;
}
.formatting-guide .alert-warning {
  background-color: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}
.dark .formatting-guide .alert-warning {
  background-color: rgba(113,63,18,0.2);
  border-color: #854d0e;
  color: #fde68a;
}
.formatting-guide .alert-success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.dark .formatting-guide .alert-success {
  background-color: rgba(20,83,45,0.2);
  border-color: #166534;
  color: #bbf7d0;
}

/* --- Search Modal --- */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5rem;
}
.search-modal {
  border-radius: 1rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 640px;
  margin: 0 1rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
.dark .search-modal {
  background: #1e293b;
  border-color: #334155;
}
.search-modal-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.dark .search-modal-header {
  border-color: #334155;
}
.search-modal-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #111827;
}
.dark .search-modal-input { color: #f1f5f9; }
.search-modal-input::placeholder { color: #9ca3af; }
.search-kbd {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  color: #6b7280;
  margin-left: 0.75rem;
  flex-shrink: 0;
}
.dark .search-kbd {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}
.search-results-container {
  max-height: 24rem;
  overflow-y: auto;
  padding: 0.5rem;
}
.search-placeholder,
.search-loading,
.search-error {
  text-align: center;
  padding: 2rem 1rem;
  color: #9ca3af;
}
.search-error { color: #ef4444; }
.search-placeholder-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
}
.search-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.6s linear infinite;
}
.dark .search-spinner { border-color: #334155; border-top-color: #60a5fa; }
.search-section-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}
.search-result-item {
  display: block;
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #111827;
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.dark .search-result-item { color: #f1f5f9; }
.search-result-item:hover,
.search-result-item.search-result-active { background: #f3f4f6; }
.dark .search-result-item:hover,
.dark .search-result-item.search-result-active { background: #334155; }
.search-result-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.search-result-excerpt { font-size: 0.8125rem; color: #6b7280; line-height: 1.5; margin-bottom: 0.375rem; }
.dark .search-result-excerpt { color: #94a3b8; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-excerpt mark { background: rgba(59,130,246,0.2); color: #1e40af; border-radius: 2px; padding: 0 2px; }
.dark .search-result-excerpt mark { background: rgba(96,165,250,0.25); color: #93c5fd; }
.search-result-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.search-result-date { font-size: 0.75rem; color: #9ca3af; }
.search-result-categories { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.search-category-tag {
  display: inline-block;
  padding: 0.0625rem 0.4rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(99,102,241,0.1);
  color: #6366f1;
}
.dark .search-category-tag { background: rgba(99,102,241,0.2); color: #a5b4fc; }

/* ----------------------------------------------------------
   9. Responsive Adjustments
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-button { display: block; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 3rem 1rem; }
  .main-container { padding: 1.5rem 1rem; }
  .blog-post { padding: 1.25rem; }
  .footer-links { flex-direction: column; gap: 0.75rem; }
  .blog-post-meta { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}

@media (max-width: 480px) {
  .nav-container { padding: 0.75rem 1rem; }
  .hero h1 { font-size: 1.75rem; }
}

/* ----------------------------------------------------------
   10. Print
   ---------------------------------------------------------- */
@media print {
  .navbar, .footer, .mobile-menu-button, .mobile-menu { display: none; }
  body { background: white; color: black; }
  .main-container { max-width: 100%; padding: 0; }
}
