/* Base Styles */
:root {
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode */
body.dark {
    background-color: var(--color-gray-900);
    color: var(--color-gray-100);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 1.75rem; }
}

/* Layout */
.max-w-7xl {
    max-width: 80rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Flexbox */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Spacing */
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-16 { margin-top: 4rem; }

/* Colors */
.bg-white { background-color: white; }
.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-gray-100 { background-color: var(--color-gray-100); }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-100 { background-color: #d1fae5; }
.bg-green-500 { background-color: #10b981; }
.bg-purple-100 { background-color: #e9d5ff; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-orange-500 { background-color: #f97316; }

.text-white { color: white; }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-900 { color: var(--color-gray-900); }
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #059669; }
.text-purple-600 { color: #7c3aed; }

/* Dark mode (theme.js adds .dark to body) */
body.dark .dark\:bg-gray-700 { background-color: var(--color-gray-700); }
body.dark .dark\:bg-gray-800 { background-color: var(--color-gray-800); }
body.dark .dark\:bg-gray-900 { background-color: var(--color-gray-900); }
body.dark .dark\:bg-blue-900 { background-color: #1e3a8a; }
body.dark .dark\:bg-green-900 { background-color: #064e3b; }
body.dark .dark\:bg-purple-900 { background-color: #4c1d95; }
body.dark .dark\:text-gray-100 { color: var(--color-gray-100); }
body.dark .dark\:text-gray-300 { color: var(--color-gray-300); }
body.dark .dark\:text-gray-400 { color: var(--color-gray-400); }
body.dark .dark\:text-blue-400 { color: #60a5fa; }
body.dark .dark\:text-green-400 { color: #34d399; }
body.dark .dark\:text-purple-400 { color: #a78bfa; }
body.dark .dark\:from-gray-800 { --tw-gradient-from: var(--color-gray-800); }
body.dark .dark\:to-gray-900 { --tw-gradient-to: var(--color-gray-900); }
body.dark .dark\:border-gray-600 { border-color: var(--color-gray-600); }
body.dark .dark\:border-gray-700 { border-color: var(--color-gray-700); }
body.dark .dark\:hover\:bg-gray-800:hover { background-color: var(--color-gray-800); }

/* Borders */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-200 { border-color: var(--color-gray-200); }
.border-gray-300 { border-color: var(--color-gray-300); }

/* Rounded */
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-md {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Hover */
.hover\:bg-gray-100:hover { background-color: var(--color-gray-100); }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Focus */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--color-primary); }
.focus\:ring-blue-500:focus { --tw-ring-color: #3b82f6; }

/* Transitions */
.transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Text */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.top-1\/2 { top: 50%; }
.right-2 { right: 0.5rem; }

/* Transform */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.-translate-y-1\/2 { --tw-translate-y: -50%; }

/* Width/Height */
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }

/* Display */
.hidden { display: none; }

/* Gradient */
.bg-gradient-to-b {
    background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
}

.from-blue-50 { --tw-gradient-from: #eff6ff; }
.to-white { --tw-gradient-to: white; }

/* Custom Components */
.platform-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-card:hover {
    transform: translateY(-2px);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    background: none;
}

/* Input */
input {
    font-family: inherit;
}

/* Theme Toggle Icons */
body.dark .sun-icon { display: none; }
body.dark .moon-icon { display: block !important; }

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    z-index: 50;
}

body.dark .search-results {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-gray-100);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

body.dark .search-result-item {
    border-color: var(--color-gray-700);
}

.search-result-item:hover {
    background-color: var(--color-gray-50);
}

body.dark .search-result-item:hover {
    background-color: var(--color-gray-700);
}

/* Group Cards */
.group-card {
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body.dark .group-card {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
}

.group-card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-gray-200);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Filters */
.filter-bar {
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

body.dark .filter-bar {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.375rem;
    background: white;
    color: var(--color-gray-700);
    transition: all 0.15s ease;
}

body.dark .pagination-btn {
    background: var(--color-gray-800);
    border-color: var(--color-gray-600);
    color: var(--color-gray-300);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

body.dark .pagination-btn:hover:not(:disabled) {
    background: var(--color-gray-700);
    border-color: var(--color-gray-500);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Responsive */
@media (max-width: 640px) {
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .platform-card {
        padding: 1rem;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* ---- Utilities and content styles used by group, platform and guide pages ---- */
a { color: inherit; text-decoration: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; min-width: 12rem; }
.gap-4 { gap: 1rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-none { max-width: none; }
.p-2 { padding: .5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.pb-8 { padding-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }
.text-gray-500 { color: var(--color-gray-500); }
.bg-yellow-50 { background-color: #fefce8; border-left: 4px solid #facc15; }
.hover\:underline:hover { text-decoration: underline; }
body.dark .dark\:bg-blue-900\/20 { background-color: rgba(30, 58, 138, .2); }
body.dark .dark\:bg-yellow-900\/20 { background-color: rgba(113, 63, 18, .25); }
body.dark .dark\:text-gray-500 { color: var(--color-gray-400); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:text-5xl { font-size: 3rem; line-height: 1.1; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.prose { line-height: 1.75; }
.prose-lg { font-size: 1.0625rem; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 .75rem; }
.prose h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.5rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: .25rem 0; }
.prose code { font-size: .9em; background: var(--color-gray-100); padding: .1rem .3rem; border-radius: .25rem; word-break: break-all; }
body.dark .prose code { background: var(--color-gray-800); }
.prose a, .intro a, .bg-yellow-50 a, section.max-w-3xl a, main p a { color: var(--color-primary-dark); text-decoration: underline; }
body.dark .prose a, body.dark .intro a, body.dark .bg-yellow-50 a, body.dark main p a { color: #60a5fa; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; }
.footer-links a:hover { text-decoration: underline; }

/* ---- Directory components (generated by scripts/build.py) ---- */
.muted { color: var(--color-gray-500); font-size: .875em; }
body.dark .muted { color: var(--color-gray-400); }
.top-links a:not(:first-child) { display: none; }
.top-links a:hover { text-decoration: underline; }
@media (min-width: 640px) { .top-links a:not(:first-child) { display: inline; } }
.lead { font-size: 1.125rem; }
.btn { display: inline-block; padding: .875rem 1.75rem; background: #2563eb; color: #fff !important; font-weight: 600; border-radius: .5rem; text-decoration: none !important; }
.btn:hover { background: #1d4ed8; }
.quote { border-left: 4px solid var(--color-primary); background: var(--color-gray-50); padding: 1rem 1.25rem; border-radius: 0 .5rem .5rem 0; font-size: 1.125rem; line-height: 1.6; }
.quote p { margin-bottom: .5rem; }
body.dark .quote { background: var(--color-gray-800); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; border-top: 1px solid var(--color-gray-200); padding-top: 1.25rem; }
.facts dt { font-weight: 600; }
.facts a, .sim-list a, .data-table a, .dir-list a, .columns-list a, .chip-list a, .topic-card strong { color: var(--color-primary-dark); }
body.dark .facts a, body.dark .sim-list a, body.dark .data-table a, body.dark .dir-list a, body.dark .columns-list a, body.dark .chip-list a, body.dark .topic-card strong { color: #60a5fa; }
.facts a:hover, .sim-list a:hover, .data-table a:hover, .dir-list a:hover, .columns-list a:hover { text-decoration: underline; }
body.dark .facts { border-color: var(--color-gray-700); }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; gap: .125rem; } .facts dd { margin-bottom: .5rem; } }
.sim-list { display: grid; gap: .5rem 1.5rem; list-style: none; }
@media (min-width: 640px) { .sim-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table-wrap { overflow-x: auto; border: 1px solid var(--color-gray-200); border-radius: .5rem; }
body.dark .table-wrap { border-color: var(--color-gray-700); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.data-table th, .data-table td { padding: .625rem .875rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-gray-100); }
.data-table th { background: var(--color-gray-50); font-weight: 600; white-space: nowrap; }
body.dark .data-table th { background: var(--color-gray-800); }
body.dark .data-table th, body.dark .data-table td { border-color: var(--color-gray-700); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.topic-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.topic-card { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.125rem; border: 1px solid var(--color-gray-200); border-radius: .5rem; background: #fff; transition: box-shadow .15s ease, transform .15s ease; }
.topic-card:hover { box-shadow: 0 6px 12px -4px rgb(0 0 0 / .12); transform: translateY(-1px); }
body.dark .topic-card { background: var(--color-gray-800); border-color: var(--color-gray-700); }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-block; padding: .375rem .75rem; border: 1px solid var(--color-gray-300); border-radius: 9999px; font-size: .875rem; }
.chip:hover { background: var(--color-gray-100); }
body.dark .chip { border-color: var(--color-gray-600); }
body.dark .chip:hover { background: var(--color-gray-800); }
.columns-list, .dir-list { list-style: none; columns: 1; column-gap: 2rem; }
.columns-list li, .dir-list li { break-inside: avoid; padding: .25rem 0; }
@media (min-width: 640px) { .columns-list { columns: 2; } .dir-list { columns: 2; } }
@media (min-width: 1024px) { .columns-list { columns: 4; } .dir-list { columns: 3; } }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .45rem; border-radius: .25rem; margin-left: .25rem; vertical-align: middle; }
.badge-verified { background: #d1fae5; color: #065f46; }
.badge-partner { background: #e0e7ff; color: #3730a3; }
body.dark .badge-verified { background: #064e3b; color: #a7f3d0; }
body.dark .badge-partner { background: #312e81; color: #c7d2fe; }
.prose h3 + p { margin-top: 0; }
.mt-8 { margin-top: 2rem; }
