/* StarCloud AI - static directory styles */

:root {
    color-scheme: light;
    --brand: #0f766e;
    --brand-strong: #115e59;
    --brand-soft: #ccfbf1;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
}

.dark {
    color-scheme: dark;
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --brand-soft: #134e4a;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --line: #1e293b;
    --surface: #0f172a;
    --surface-soft: #020617;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--surface-soft);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

mark {
    border-radius: 4px;
    background: #fef08a;
    color: #0f172a;
    padding: 0 3px;
}

/* Local utility fallback so the page does not depend on Tailwind CDN. */
.mx-auto { margin-left: auto; margin-right: auto; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }
.flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1 1 0%; }
.relative { position: relative; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.max-w-\[1560px\] { max-width: 1560px; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.ml-2 { margin-left: 0.5rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.p-3 { padding: 0.75rem; }
.p-8 { padding: 2rem; }

.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; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.tracking-normal { letter-spacing: normal; }
.leading-6 { line-height: 1.5rem; }
.leading-7 { line-height: 1.75rem; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }

.rounded-lg { border-radius: 8px; }
.border { border: 1px solid var(--line); }
.border-t { border-top: 1px solid var(--line); }
.border-dashed { border-style: dashed; }
.shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }

.bg-white { background: #fff; }
.bg-slate-50 { background: #f8fafc; }
.bg-slate-950 { background: #020617; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-slate-950 { color: #020617; }
.text-white { color: #fff; }

.space-y-2 > * + * { margin-top: 0.5rem; }

.dark .dark\:bg-slate-950 { background: #020617; }
.dark .dark\:bg-slate-900 { background: #0f172a; }
.dark .dark\:border-slate-700 { border-color: #334155; }
.dark .dark\:border-slate-800 { border-color: #1e293b; }
.dark .dark\:text-white { color: #fff; }
.dark .dark\:text-slate-100 { color: #f1f5f9; }
.dark .dark\:text-slate-200 { color: #e2e8f0; }
.dark .dark\:text-slate-300 { color: #cbd5e1; }
.dark .dark\:text-slate-400 { color: #94a3b8; }

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-\[minmax\(0\,1fr\)_360px\] { grid-template-columns: minmax(0, 1fr) 360px; }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:items-end { align-items: end; }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

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

.site-header {
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 28rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.98));
}

.dark .site-header {
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.14), transparent 28rem),
        linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.98));
}

.site-header > div {
    gap: 1rem;
    padding-bottom: 1.1rem;
    padding-top: 1.1rem;
}

.hero-layout {
    align-items: center;
}

.hero-title {
    font-size: clamp(2rem, 3.1vw, 3.6rem);
    line-height: 1.02;
}

.hero-copy {
    max-width: 58rem;
    line-height: 1.55;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    display: inline-flex;
    height: 44px;
    width: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--brand);
    color: white;
    font-weight: 800;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-nav a {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 800;
    min-height: 38px;
    padding: 8px 12px;
    text-decoration: none;
}

.site-nav a.active,
.site-nav a:hover {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.compact-nav {
    margin-left: auto;
}

.eyebrow {
    color: var(--brand-strong);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.control-button,
.primary-button,
.secondary-button,
.filter-button,
.category-pill,
.link-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.control-button,
.secondary-button,
.filter-button,
.category-pill {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.control-button,
.filter-button,
.link-button {
    padding: 8px 12px;
    font-size: 0.875rem;
}

.primary-button {
    background: var(--brand);
    color: white;
    padding: 9px 14px;
}

.secondary-button {
    padding: 9px 14px;
    font-size: 0.875rem;
}

.primary-button:hover,
.control-button:hover,
.secondary-button:hover,
.filter-button:hover,
.category-pill:hover,
.link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.primary-button:hover {
    background: var(--brand-strong);
}

.filter-button.active,
.category-pill.active {
    border-color: var(--brand);
    background: var(--brand);
    color: white;
}

.link-button {
    background: transparent;
    color: var(--brand-strong);
    padding-inline: 0;
}

.search-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    padding: 13px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.dark .search-panel {
    background: rgba(15, 23, 42, 0.82);
}

.search-input,
.sort-select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-input {
    min-width: 0;
    padding: 8px 10px;
}

.sort-select {
    width: auto;
    min-width: 160px;
    padding: 8px 10px;
}

.search-input:focus,
.sort-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.filter-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}

.quick-filters,
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-filters {
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .quick-filters {
        justify-content: flex-end;
    }
}

.category-pill {
    flex: 0 1 auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.tools-section {
    margin-top: 1.15rem;
}

.pill-count {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    padding: 1px 7px;
    font-size: 0.72rem;
}

.category-pill.active .pill-count,
.filter-button.active .pill-count {
    background: rgba(255, 255, 255, 0.22);
}

.featured-card,
.mini-card,
.tool-card,
.detail-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.featured-card,
.mini-card {
    padding: 14px;
    text-align: left;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.featured-card:hover,
.mini-card:hover,
.tool-card:hover {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.mini-card {
    display: grid;
    min-width: 0;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
}

.mini-logo {
    grid-row: span 2;
    height: 40px;
    width: 40px;
    border-radius: 8px;
    background: var(--surface-soft);
    object-fit: contain;
}

.tool-card {
    min-width: 0;
    padding: 20px;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.tool-logo {
    height: 48px;
    width: 48px;
    flex: 0 0 auto;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    object-fit: contain;
    padding: 6px;
}

.tool-logo.large {
    height: 64px;
    width: 64px;
}

.favorite-toggle {
    min-height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 9px;
}

.favorite-toggle.active {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.tag,
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tag {
    background: var(--surface-soft);
    color: var(--muted);
    padding: 6px 8px;
}

.badge {
    background: var(--brand-soft);
    color: var(--brand-strong);
    padding: 4px 7px;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.72);
    opacity: 0;
    padding: 20px;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    max-height: min(760px, 92vh);
    width: min(760px, 100%);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 26px;
    transform: translateY(10px);
    transition: transform 150ms ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    height: 34px;
    width: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
}

.detail-panel {
    padding: 16px;
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 80;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    font-weight: 800;
    opacity: 0;
    padding: 9px 12px;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-2px);
}

.loading-spinner {
    height: 42px;
    width: 42px;
    border: 4px solid rgba(15, 118, 110, 0.18);
    border-top-color: var(--brand);
    border-radius: 999px;
    animation: spin 850ms linear infinite;
}

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

@media (max-width: 640px) {
    .search-panel {
        padding: 14px;
    }

    .search-panel .primary-button {
        padding-inline: 10px;
    }

    .tool-card {
        padding: 16px;
    }

    .modal-content {
        padding: 22px 16px 16px;
    }
}
