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

:root {
    --bg:         #09090b;
    --surface:    #18181b;
    --surface-2:  #1f1f22;
    --border:     rgba(255, 255, 255, 0.07);
    --border-2:   rgba(255, 255, 255, 0.13);
    --text:       #f4f4f5;
    --text-muted: #71717a;
    --text-dim:   #3f3f46;
    --green:      #22c55e;
    --red:        #f87171;
    --amber:      #fbbf24;
    --purple:     #a855f7;
    --radius:     12px;
    --radius-sm:  8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────── */

.page {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

/* ─── Header ─────────────────────────────────────── */

.header {
    padding: 1.75rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ─── Language Switcher ──────────────────────────── */

.lang-switcher {
    position: absolute;
    right: 0;
    display: flex;
    gap: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.2rem;
}

.lang-btn {
    padding: 0.25rem 0.65rem;
    background: transparent;
    border: none;
    border-radius: 99px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--text);
    color: var(--bg);
}

.brand {
    display: flex;
    align-items: center;
}

.brand a {
    display: flex;
    align-items: center;
    opacity: 0.9;
    transition: opacity 0.15s;
}

.brand-logo {
    height: 62px;
    width: auto;
    display: block;
}

/* ─── Hero ───────────────────────────────────────── */

.hero {
    padding: 2.5rem 0 1.25rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.hero p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}

/* ─── Search Bar ─────────────────────────────────── */

.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar input:focus {
    border-color: var(--border-2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.035);
}

.search-bar input::placeholder {
    color: var(--text-dim);
}

/* ─── Category Filter ────────────────────────────── */

.category-filter {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.35rem 0.9rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.category-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
}

.category-btn.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ─── Tools Grid ─────────────────────────────────── */

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* ─── Tool Card ──────────────────────────────────── */

.tool-card {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    cursor: pointer;
    animation: fadeUp 0.3s ease backwards;
}

.tool-card:hover {
    border-color: var(--border-2);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.tool-card:active {
    transform: translateY(0);
}

/* ─── Tool Icon ──────────────────────────────────── */

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon svg {
    width: 22px;
    height: 22px;
}

/* ─── Tool Info ──────────────────────────────────── */

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 0.2rem;
    color: var(--text);
}

.tool-desc {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Tool Arrow ─────────────────────────────────── */

.tool-arrow {
    flex-shrink: 0;
    color: var(--text-dim);
    transition: color 0.15s, transform 0.15s;
}

.tool-arrow svg {
    width: 18px;
    height: 18px;
}

.tool-card:hover .tool-arrow {
    color: var(--text-muted);
    transform: translateX(3px);
}

/* ─── Empty State ────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 2rem;
    color: var(--text-dim);
}

.empty-state svg {
    width: 36px;
    height: 36px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ─── Footer ─────────────────────────────────────── */

.footer {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.footer-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
}

.footer-powered span {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.footer-powered a {
    display: flex;
    align-items: center;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.footer-powered a:hover {
    opacity: 1;
}

.powered-logo {
    height: 18px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

/* ─── Animations ─────────────────────────────────── */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.10s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.20s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.30s; }

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .tool-card {
        padding: 1rem 1.125rem;
        gap: 0.875rem;
    }

    .tool-icon {
        width: 42px;
        height: 42px;
    }

    .tool-icon svg {
        width: 18px;
        height: 18px;
    }
}
