@import "tailwindcss";

@layer base {
    :root {
        --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
        --color-accent: #4f46e5;
        --color-accent-hover: #4338ca;
    }

    html {
        scroll-behavior: smooth;
    }

    body {
        font-family: var(--font-sans);
        -webkit-font-smoothing: antialiased;
    }

    .prose {
        color: #374151;
        max-width: none;
        line-height: 1.8;
    }

    .prose h1, .prose h2, .prose h3, .prose h4 {
        color: #111827;
        font-weight: 700;
        line-height: 1.3;
        margin-top: 2em;
        margin-bottom: 0.75em;
    }

    .prose h1 { font-size: 2.25rem; }
    .prose h2 { font-size: 1.75rem; }
    .prose h3 { font-size: 1.375rem; }
    .prose h4 { font-size: 1.125rem; }

    .prose p {
        margin-bottom: 1.5em;
    }

    .prose a {
        color: var(--color-accent);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .prose a:hover {
        color: var(--color-accent-hover);
    }

    .prose strong {
        font-weight: 600;
        color: #111827;
    }

    .prose ul, .prose ol {
        padding-left: 1.5em;
        margin-bottom: 1.5em;
    }

    .prose ul { list-style-type: disc; }
    .prose ol { list-style-type: decimal; }

    .prose li {
        margin-bottom: 0.4em;
    }

    .prose blockquote {
        border-left: 4px solid var(--color-accent);
        padding-left: 1.5em;
        margin: 2em 0;
        font-style: italic;
        color: #6b7280;
    }

    .prose code {
        background: #f3f4f6;
        padding: 0.2em 0.4em;
        border-radius: 4px;
        font-size: 0.875em;
        color: #1f2937;
    }

    .prose pre {
        background: #1f2937;
        color: #f9fafb;
        padding: 1.5em;
        border-radius: 0.75rem;
        overflow-x: auto;
        margin: 2em 0;
        font-size: 0.875rem;
        line-height: 1.7;
    }

    .prose pre code {
        background: none;
        padding: 0;
        color: inherit;
        font-size: inherit;
    }

    .prose img {
        border-radius: 0.75rem;
        margin: 2em auto;
    }

    .prose hr {
        border-color: #e5e7eb;
        margin: 3em 0;
    }

    .prose table {
        width: 100%;
        border-collapse: collapse;
        margin: 2em 0;
        font-size: 0.9rem;
    }

    .prose th, .prose td {
        padding: 0.75em 1em;
        border: 1px solid #e5e7eb;
        text-align: left;
    }

    .prose th {
        background: #f9fafb;
        font-weight: 600;
    }

    [x-cloak] { display: none !important; }
}

@layer components {
    .btn-primary {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        background: var(--color-accent);
        color: white;
        border-radius: 0.75rem;
        font-weight: 600;
        font-size: 0.9375rem;
        transition: background 0.15s, transform 0.1s;
        text-decoration: none;
    }

    .btn-primary:hover {
        background: var(--color-accent-hover);
        transform: translateY(-1px);
    }

    .btn-outline {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 1.25rem;
        border: 2px solid #e5e7eb;
        color: #374151;
        border-radius: 0.75rem;
        font-weight: 500;
        font-size: 0.9375rem;
        transition: border-color 0.15s, color 0.15s;
        text-decoration: none;
    }

    .btn-outline:hover {
        border-color: var(--color-accent);
        color: var(--color-accent);
    }

    .card {
        background: white;
        border-radius: 1rem;
        overflow: hidden;
        border: 1px solid #f3f4f6;
        transition: box-shadow 0.2s, transform 0.2s;
    }

    .card:hover {
        box-shadow: 0 10px 40px -10px rgba(0,0,0,0.12);
        transform: translateY(-3px);
    }

    .tag {
        display: inline-flex;
        align-items: center;
        padding: 0.25rem 0.75rem;
        background: #eef2ff;
        color: var(--color-accent);
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        text-decoration: none;
    }
}
