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

:root {
    --text: #1a1a1a;
    --text-muted: #666;
    --bg: #fafafa;
    --accent: #2563eb;
    --border: #e5e5e5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--text);
}

main {
    flex: 1;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

main:has(.hero):not(.landing) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero {
    text-align: center;
    max-width: 600px;
}

.landing .hero {
    max-width: 700px;
    margin: 0 auto 3rem auto;
    padding-top: 2rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: #fff;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.15s;
}

.cta-button:hover {
    background: #1d4ed8;
}

.featured {
    margin-top: 1rem;
}

.featured h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.featured-cta {
    text-align: center;
    margin-top: 2rem;
}

.featured-cta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.featured-cta a:hover {
    text-decoration: underline;
}

/* Library */

.library h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.library .subtitle {
    margin-bottom: 1.5rem;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.cat-filter {
    display: inline-block;
    padding: 0.35rem 1rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.15s;
}

.cat-filter:hover,
.cat-filter.active {
    border-color: var(--accent);
    color: var(--accent);
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.prompt-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}

.prompt-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

.prompt-card .card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.prompt-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.prompt-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.difficulty {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background: var(--border);
    color: var(--text-muted);
}

.difficulty.beginner { background: #dcfce7; color: #166534; }
.difficulty.intermediate { background: #fef3c7; color: #92400e; }
.difficulty.advanced { background: #fee2e2; color: #991b1b; }

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
}

.back-link:hover {
    color: var(--accent);
}

.category-header {
    margin-bottom: 2rem;
}

/* Prompt Detail */

.prompt-detail {
    max-width: 800px;
}

.prompt-meta-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.breadcrumb {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb:hover {
    text-decoration: underline;
}

.model {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background: #ede9fe;
    color: #5b21b6;
}

.prompt-detail h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.prompt-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 2rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.prompt-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.prompt-body h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.prompt-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.prompt-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.prompt-body code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em;
}

.prompt-body p code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.prompt-body ul, .prompt-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prompt-body li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

/* About */

.about-page {
    max-width: 700px;
}

.about-page h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.about-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.about-section a {
    color: var(--accent);
    text-decoration: none;
}

.about-section a:hover {
    text-decoration: underline;
}

.about-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.about-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.about-cta {
    margin-top: 3rem;
}

@media (max-width: 640px) {
    .prompt-grid {
        grid-template-columns: 1fr;
    }
    .library h1 {
        font-size: 1.75rem;
    }
    .prompt-detail h1 {
        font-size: 1.5rem;
    }
}

/* Footer */

footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--text);
}
