:root {
    --bg: #0c0f1a;
    --bg-alt: #111528;
    --surface: #161a2e;
    --surface-hover: #1c2140;
    --surface-strong: #222845;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    --emerald: #10b981;
    --emerald-soft: rgba(16, 185, 129, 0.15);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.15);
    --sky: #38bdf8;
    --sky-soft: rgba(56, 189, 248, 0.15);
    --purple: #a78bfa;
    --purple-soft: rgba(167, 139, 250, 0.15);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.15);
    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, 0.15);
    --violet: #c084fc;
    --violet-soft: rgba(192, 132, 252, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --container: 1200px;
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font: 400 15px/1.7 var(--font);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 0.15em 0.45em;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

::selection {
    background: rgba(16, 185, 129, 0.3);
    color: #fff;
}

a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, details:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 2px;
}

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

.skip-link {
    position: fixed; top: -100px; left: 16px; z-index: 999;
    padding: 12px 20px; border-radius: var(--radius); background: var(--emerald);
    color: #000; font-weight: 700; font-size: 14px;
    transition: top 200ms;
}
.skip-link:focus-visible { top: 16px; outline-offset: 4px; }

/* Container */
.container {
    width: min(100% - 2rem, var(--container));
    margin: 0 auto;
}

/* Site Frame */
.site-frame { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-bottom: 80px; }

/* ─── Header ─── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-h);
    background: rgba(12, 15, 26, 0.85);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    width: min(100% - 2rem, var(--container));
    margin: 0 auto;
    height: 100%;
    display: flex; align-items: center; gap: 24px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon { display: flex; }
.logo-text strong { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.logo-text span { color: var(--emerald); font-weight: 600; }

.main-nav {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto;
}
.nav-item {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--text-muted);
    transition: all 150ms;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-item.is-active { color: var(--emerald); background: var(--emerald-soft); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.header-search { position: relative; }
.search-field {
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px; height: 38px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 200ms;
}
.search-field:focus-within {
    border-color: var(--emerald);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.search-icon { color: var(--text-soft); flex-shrink: 0; }
.search-field input {
    border: 0; background: transparent; outline: none;
    width: 160px; font-size: 14px; color: var(--text);
}
.search-field input::placeholder { color: var(--text-soft); }

.menu-btn {
    display: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: transparent;
    color: var(--text-muted); cursor: pointer;
    transition: all 150ms;
}
.menu-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* Search Dropdown */
.search-dropdown {
    position: absolute; left: 0; right: 0;
    top: calc(100% + 8px); z-index: 80;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 320px;
}
.search-result-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; gap: 12px;
    transition: background 120ms;
}
.search-result-link:hover, .search-result-link.is-active { background: rgba(255,255,255,0.05); }
.search-result-title { font-weight: 600; font-size: 14px; }
.search-result-meta { color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.search-result-empty { padding: 14px; color: var(--text-soft); font-size: 14px; }

/* Mobile Menu */
.mobile-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
}
.mobile-menu {
    position: fixed; top: 0; right: 0; bottom: 0;
    z-index: 70; width: min(320px, 85vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 20px;
    display: flex; flex-direction: column; gap: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 250ms ease;
}
.mobile-menu:not([hidden]) { transform: translateX(0); }
.mobile-menu[hidden] { display: flex; }

.mobile-menu-header {
    display: flex; justify-content: space-between; align-items: center;
}
.mobile-close {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: transparent; color: var(--text-muted); cursor: pointer;
}

.mobile-nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-link {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-weight: 500; font-size: 15px; color: var(--text-muted);
    transition: all 150ms;
}
.mobile-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.mobile-link.is-active { color: var(--emerald); background: var(--emerald-soft); }

.mobile-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); margin-bottom: 10px; }
.mobile-chips { display: flex; flex-wrap: wrap; gap: 8px; }

body.has-menu-open { overflow: hidden; }

/* ─── Breadcrumbs ─── */
.breadcrumbs { padding: 16px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }
.breadcrumbs li:not(:last-child)::after { content: '/'; opacity: 0.4; }
.breadcrumbs a:hover { color: var(--emerald); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 500; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; min-height: 40px; padding: 0 20px;
    border: 1px solid transparent; border-radius: var(--radius);
    font-weight: 600; font-size: 14px; cursor: pointer;
    transition: all 150ms; white-space: nowrap;
}
.btn-primary {
    background: var(--emerald); color: #000; border-color: var(--emerald);
}
.btn-primary:hover { background: #0ea472; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.btn-secondary {
    background: rgba(255,255,255,0.06); border-color: var(--border-strong); color: var(--text);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 0; padding: 0 12px; }
.btn-ghost:hover { color: var(--text); }

/* ─── Tags / Chips ─── */
.tag, .chip {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 12px; border-radius: 999px; font-size: 12px;
    font-weight: 600; line-height: 1.4;
    transition: all 150ms;
}
.tag-primary { background: var(--emerald-soft); color: var(--emerald); }
.tag-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }
.tag-sm { font-size: 11px; padding: 2px 8px; }

.chip {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer;
}
.chip:hover, .chip.is-active {
    background: var(--emerald-soft); border-color: rgba(16,185,129,0.3);
    color: var(--emerald);
}

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card h2 {
    font-family: var(--font-display); font-size: 20px; font-weight: 700;
    margin-bottom: 16px; line-height: 1.3;
}
.card p { color: var(--text-muted); line-height: 1.7; }
.card + .card { margin-top: 16px; }

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.sidebar-card + .sidebar-card { margin-top: 12px; }
.sidebar-card h3 {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    margin-bottom: 14px; color: var(--text);
}

/* ─── Alert ─── */
.alert { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; }
.alert-warning { background: var(--amber-soft); border: 1px solid rgba(245,158,11,0.2); color: var(--amber); }
.alert p { margin: 0; }

/* ─── Hero Section ─── */
.hero {
    padding: 80px 0 48px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.08), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06), transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.05), transparent 45%);
}
.hero-content { margin: 0 auto; text-align: center; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px; border-radius: 999px;
    background: var(--emerald-soft); border: 1px solid rgba(16,185,129,0.2);
    color: var(--emerald); font-size: 13px; font-weight: 600;
    margin-bottom: 24px;
}
.hero h1 {
    font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700; line-height: 1.1; margin-bottom: 16px;
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc { color: var(--text-muted); font-size: 17px; max-width: 560px; margin: 0 auto 32px; }

.hero-search { position: relative; max-width: 600px; margin: 0 auto; }
.hero-search-field {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 6px 6px 18px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    transition: all 200ms;
}
.hero-search-field:focus-within {
    border-color: var(--emerald);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
.hero-search-field input {
    flex: 1; border: 0; background: transparent; outline: none;
    font-size: 15px; color: var(--text); min-height: 44px;
}
.hero-search-field input::placeholder { color: var(--text-soft); }
.hero-search-field .btn { border-radius: var(--radius); min-height: 40px; }

.hero-prompts {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; align-items: center;
    margin-top: 20px;
}
.hero-prompts > span { font-size: 13px; color: var(--text-soft); }

.hero-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; max-width: 600px; margin: 40px auto 0;
}
.hero-stat {
    text-align: center; padding: 16px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.hero-stat strong {
    display: block; font-family: var(--font-display);
    font-size: 22px; font-weight: 700; color: var(--emerald);
}
.hero-stat span { font-size: 12px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }

/* Quick Nav */
.quick-nav { padding: 24px 0; border-bottom: 1px solid var(--border); }
.quick-nav-grid { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.quick-nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    font-size: 14px; font-weight: 500; color: var(--text-muted);
    transition: all 150ms;
}
.quick-nav-item:hover { color: var(--text); background: rgba(255,255,255,0.07); border-color: var(--border-strong); }

/* ─── Sections ─── */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-spaced { margin-top: 48px; }
.section-spaced h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 20px; }

.section-header { margin-bottom: 36px; }
.section-header h2 {
    font-family: var(--font-display); font-size: 28px; font-weight: 700;
    margin-bottom: 8px;
}
.section-header p { color: var(--text-muted); font-size: 16px; max-width: 560px; }
.section-header-sm h2 { font-size: 22px; }
.section-header-sm { margin-bottom: 20px; }
.section-action { margin-top: 32px; text-align: center; }

/* ─── Category Grid ─── */
.category-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.category-card {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 200ms;
    position: relative; overflow: hidden;
}
.category-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: 0 3px 3px 0;
    transition: width 200ms;
}
.accent-emerald::before { background: var(--emerald); }
.accent-amber::before { background: var(--amber); }
.accent-sky::before { background: var(--sky); }
.accent-purple::before { background: var(--purple); }
.accent-red::before { background: var(--red); }
.accent-green::before { background: var(--green); }
.accent-violet::before { background: var(--violet); }

.category-card:hover {
    border-color: var(--border-strong); background: var(--surface-hover);
    transform: translateY(-2px); box-shadow: var(--shadow);
}
.category-card:hover::before { width: 4px; }

.category-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: var(--radius); font-size: 20px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
}
.category-info { flex: 1; min-width: 0; }
.category-info h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.category-info p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.category-count {
    font-family: var(--font-display); font-size: 13px; font-weight: 700;
    color: var(--text-soft); white-space: nowrap; align-self: center;
}

.more-categories { margin-top: 32px; }
.more-categories h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 16px; }
.mini-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mini-category {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius);
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    transition: all 150ms;
}
.mini-category:hover { background: rgba(255,255,255,0.06); border-color: var(--border-strong); }
.mini-icon { font-size: 18px; }
.mini-label { flex: 1; font-size: 14px; font-weight: 500; }
.mini-count { font-size: 13px; color: var(--text-soft); font-weight: 600; }

/* ─── Spotlight Grid ─── */
.spotlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.spotlight-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column; gap: 12px;
    transition: all 200ms;
}
.spotlight-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.spotlight-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--emerald); }
.spotlight-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.3; }
.spotlight-card p { font-size: 14px; color: var(--text-muted); flex: 1; }
.spotlight-cta { font-size: 13px; font-weight: 600; color: var(--emerald); margin-top: auto; }

/* ─── Guide Grid ─── */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card {
    padding: 24px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column; gap: 12px;
    transition: all 200ms;
}
.guide-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.guide-card-header { display: flex; align-items: center; gap: 10px; }
.guide-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); }
.guide-time { font-size: 12px; color: var(--text-soft); }
.guide-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.guide-card p { font-size: 14px; color: var(--text-muted); }

/* ─── Collection Grid ─── */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.collection-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.collection-header { padding: 20px 20px 16px; }
.collection-header h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 6px; }
.collection-header p { font-size: 13px; color: var(--text-muted); }
.collection-items { display: flex; flex-direction: column; }
.collection-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; gap: 12px;
    border-top: 1px solid var(--border);
    transition: background 120ms;
}
.collection-item:hover { background: rgba(255,255,255,0.03); }
.collection-item-title { font-size: 14px; font-weight: 500; }
.collection-item-badge { font-size: 11px; color: var(--text-soft); text-transform: uppercase; font-weight: 600; }

/* ─── FAQ ─── */
.faq-grid { display: grid; gap: 10px; max-width: 800px; }
.faq-list { display: grid; gap: 10px; }
.faq-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 200ms;
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 16px 20px; cursor: pointer;
    font-weight: 600; font-size: 15px;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary span { flex: 1; }
.faq-chevron { flex-shrink: 0; color: var(--text-soft); transition: transform 200ms; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 20px 16px; }
.faq-answer p { color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* ─── Longform ─── */
.longform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.longform-card {
    padding: 28px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.longform-card h2 { font-family: var(--font-display); font-size: 20px; margin-bottom: 12px; }
.longform-card p { color: var(--text-muted); font-size: 15px; line-height: 1.7; }

/* ─── Listing Page ─── */
.listing-hero {
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.listing-hero-content { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.listing-icon {
    width: 56px; height: 56px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: var(--radius-lg); font-size: 26px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
}
.listing-hero h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 8px; }
.listing-desc { color: var(--text-muted); font-size: 15px; margin-bottom: 12px; max-width: 600px; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.listing-filter {
    position: relative;
    display: flex; gap: 12px; align-items: center;
    max-width: 500px;
}
.listing-filter .search-field { flex: 1; }

/* ─── Results Grid ─── */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.listing-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.search-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.result-card {
    display: flex; gap: 14px; align-items: center;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 180ms;
}
.result-card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.result-card-compact { padding: 16px; }

.result-media {
    width: 64px; height: 64px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: var(--radius); overflow: hidden;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.result-media img { width: 48px; height: 48px; image-rendering: pixelated; object-fit: contain; }
.result-media.is-fallback span { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text-soft); }

.result-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.result-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.result-editions { font-size: 11px; color: var(--text-soft); }
.result-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.result-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.result-facts span { font-size: 12px; color: var(--text-soft); }
.result-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ─── Search Page ─── */
.search-hero {
    text-align: center; padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.search-hero h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 10px; }
.search-hero > p { color: var(--text-muted); max-width: 520px; margin: 0 auto 28px; }
.search-form-large { position: relative; max-width: 600px; margin: 0 auto 16px; }
.search-meta { display: flex; gap: 8px; justify-content: center; }

.filter-section { margin-bottom: 28px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ─── Detail Page ─── */
.detail-page { padding-top: 24px; }

.detail-header {
    display: flex; gap: 24px; align-items: flex-start;
    padding-bottom: 28px; margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.detail-media {
    width: 128px; height: 128px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.detail-media img { width: 96px; height: 96px; image-rendering: pixelated; object-fit: contain; }
.detail-media .fallback-text { font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--text-soft); }

.detail-intro { flex: 1; min-width: 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.detail-page h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 12px; }
.detail-summary { color: var(--text-muted); font-size: 16px; margin-bottom: 16px; max-width: 600px; }

.id-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.id-item { display: flex; flex-direction: column; gap: 2px; }
.id-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; }
.id-value { font-size: 14px; font-weight: 600; }

.taxonomy-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.detail-main { display: flex; flex-direction: column; }
.detail-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }

/* Fact Card */
.fact-card { background: linear-gradient(135deg, var(--surface), rgba(16, 185, 129, 0.03)); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.fact-item dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; margin-bottom: 4px; }
.fact-item dd { font-weight: 600; font-size: 15px; }

/* Info List */
.info-list { display: grid; gap: 10px; padding-left: 20px; list-style: disc; }
.info-list li { color: var(--text-muted); line-height: 1.6; font-size: 14px; }
.info-list.compact { gap: 6px; }
.info-list.compact li { font-size: 13px; }

/* Recipe */
.recipe-list { display: grid; gap: 16px; }
.recipe-item {
    padding: 16px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--border);
    border-radius: var(--radius); display: grid; gap: 14px;
}
.recipe-head { display: flex; justify-content: space-between; align-items: center; }
.recipe-head strong { font-family: var(--font-display); font-size: 15px; }
.crafting-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid-cell {
    min-height: 52px; padding: 8px;
    display: grid; place-items: center; text-align: center;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12px; color: var(--text-soft);
}
.grid-cell.has-item { color: var(--text); font-weight: 500; background: rgba(255,255,255,0.06); }
.ingredient-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Table of Contents */
.toc ul { display: grid; gap: 6px; }
.toc a {
    display: block; padding: 6px 12px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    transition: all 150ms;
}
.toc a:hover { color: var(--emerald); background: var(--emerald-soft); }

/* Reference List */
.ref-list { display: grid; gap: 12px; }
.ref-item { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ref-item:last-child { padding-bottom: 0; border-bottom: 0; }
.ref-item dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; }
.ref-item dd { font-size: 14px; }
.ref-item code { font-size: 13px; }

/* Related Links */
.related-links { display: grid; gap: 6px; }
.related-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 150ms; gap: 8px;
}
.related-link:hover { background: rgba(255,255,255,0.04); border-color: var(--border-strong); }
.related-link span:first-child { font-size: 14px; font-weight: 500; }
.related-type { font-size: 11px; color: var(--text-soft); text-transform: uppercase; font-weight: 600; white-space: nowrap; }

/* Guide Header */
.guide-header {
    padding: 40px 0 28px; margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.guide-header h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 12px; }

/* Compare Stats */
.compare-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 40px;
}
.stat-card {
    padding: 20px; text-align: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stat-card strong { display: block; font-family: var(--font-display); font-size: 24px; color: var(--emerald); margin-bottom: 4px; }
.stat-card span { font-size: 12px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Empty State ─── */
.empty-state {
    text-align: center; padding: 64px 24px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.empty-state h2 { font-family: var(--font-display); margin-bottom: 10px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }

/* ─── 404 Page ─── */
.error-page {
    text-align: center; padding: 80px 24px;
    max-width: 500px; margin: 40px auto;
}
.error-code {
    font-family: var(--font-display); font-size: 96px; font-weight: 900;
    background: linear-gradient(135deg, var(--emerald), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1;
    margin-bottom: 16px;
}
.error-page h1 { font-family: var(--font-display); font-size: 28px; margin-bottom: 12px; }
.error-page p { color: var(--text-muted); margin-bottom: 28px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Footer ─── */
.site-footer {
    margin-top: auto;
    padding: 64px 0 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 40px;
}
.footer-brand { }
.footer-brand .logo { margin-bottom: 16px; }
.footer-desc { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin-bottom: 16px; max-width: 320px; }
.footer-versions { display: flex; flex-wrap: wrap; gap: 8px; }
.version-badge {
    display: inline-flex; padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-soft);
}

.footer-col h3 {
    font-family: var(--font-display); font-size: 14px; font-weight: 700;
    margin-bottom: 16px; color: var(--text);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.footer-col ul { display: grid; gap: 10px; }
.footer-col a {
    font-size: 14px; color: var(--text-muted);
    transition: color 150ms;
}
.footer-col a:hover { color: var(--emerald); }

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.footer-bottom p { font-size: 12px; color: var(--text-soft); text-align: center; }

/* ─── Villager Trades ─── */
.trade-card .text-muted { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 16px; }
.profession-grid { display: flex; flex-direction: column; gap: 8px; }
.profession-block { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.2s; }
.profession-block[open] { border-color: var(--border-strong); }
.profession-block[open] .profession-header { background: var(--surface-hover); }
.profession-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; transition: background 0.15s; }
.profession-header::-webkit-details-marker { display: none; }
.profession-header:hover { background: var(--surface-hover); }
.profession-emoji { font-size: 1.5rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: 10px; flex-shrink: 0; }
.profession-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profession-info strong { font-size: 1rem; color: var(--text); }
.profession-ws { font-size: 0.8rem; color: var(--text-muted); }
.profession-body { padding: 0 16px 16px; }
.profession-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 16px; }
.trade-level { margin-bottom: 16px; }
.trade-level-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 6px 10px; background: var(--bg); border-radius: 6px; }
.trade-level-badge { font-weight: 700; font-size: 0.85rem; }
.trade-level-info { font-size: 0.75rem; color: var(--text-muted); }
.trade-table-wrap { overflow-x: auto; }
.trade-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.trade-table th { text-align: left; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.trade-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.trade-table tr:last-child td { border-bottom: none; }
.trade-table tr:hover td { background: var(--surface-hover); }
.trade-enchanted td { background: rgba(167, 139, 250, 0.05); }
.trade-cost, .trade-result { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.trade-cost img, .trade-result img { image-rendering: pixelated; vertical-align: middle; flex-shrink: 0; }
.trade-arrow { color: var(--emerald); font-weight: bold; text-align: center; }
.trade-plus { color: var(--text-muted); font-size: 0.75rem; }
.trade-uses { color: var(--text-muted); text-align: center; font-size: 0.8rem; }
.enchant-badge { font-size: 0.7rem; margin-left: 4px; }

/* ─── Section icons/animations ─── */
.card > h2 { display: flex; align-items: center; gap: 8px; }
.fact-icon { font-size: 0.85em; margin-right: 2px; }
.fact-card .fact-item { padding: 8px; transition: background 0.15s; border-radius: 8px; }
.fact-card .fact-item:hover { background: var(--surface-hover); }
.detail-media { animation: fadeScaleIn 0.4s ease-out; }
@keyframes fadeScaleIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.detail-intro { animation: fadeSlideUp 0.5s ease-out; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: cardFadeIn 0.4s ease-out both; }
@keyframes cardFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.category-card { transition: transform 0.2s, box-shadow 0.2s; }
.category-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.spotlight-card { transition: transform 0.2s, box-shadow 0.2s; }
.spotlight-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.hero-stat { animation: fadeSlideUp 0.6s ease-out both; }
.hero-stat:nth-child(1) { animation-delay: 0.1s; }
.hero-stat:nth-child(2) { animation-delay: 0.2s; }
.hero-stat:nth-child(3) { animation-delay: 0.3s; }
.hero-stat:nth-child(4) { animation-delay: 0.4s; }
.hero-badge { animation: fadeScaleIn 0.5s ease-out; }
.hero h1 { animation: fadeSlideUp 0.6s ease-out 0.1s both; }
.hero-desc { animation: fadeSlideUp 0.6s ease-out 0.2s both; }
.hero-search { animation: fadeSlideUp 0.6s ease-out 0.3s both; }
.quick-nav-item { transition: transform 0.15s, background 0.15s; }
.quick-nav-item:hover { transform: translateX(4px); }
.sidebar-card { animation: cardFadeIn 0.5s ease-out both; }
.related-link { transition: transform 0.15s, background 0.15s; }
.related-link:hover { transform: translateX(3px); }
.result-card { transition: transform 0.15s, box-shadow 0.15s; }
.result-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

/* ─── Popular grid ─── */
.popular-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.popular-chip { display: inline-flex; align-items: center; padding: 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 50px; color: var(--text); font-size: 0.875rem; font-weight: 500; text-decoration: none; transition: all 0.15s; }
.popular-chip:hover { background: var(--emerald-soft); border-color: var(--emerald); color: var(--emerald); transform: translateY(-1px); }

/* ─── Commands ─── */
.command-card .text-muted { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 16px; }
.command-list { display: flex; flex-direction: column; gap: 12px; }
.command-item { display: flex; flex-direction: column; gap: 4px; }
.command-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.command-code-wrap { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; overflow-x: auto; }
.command-code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.875rem; color: var(--emerald); white-space: nowrap; flex: 1; user-select: all; }
.btn-copy { flex-shrink: 0; background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 6px; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
.btn-copy:hover { color: var(--emerald); border-color: var(--emerald); background: var(--emerald-soft); }
.btn-copy.copied { color: var(--green); border-color: var(--green); }

/* ─── Recipe images ─── */
.grid-cell { display: flex; align-items: center; justify-content: center; }
.grid-cell img { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; }
.grid-cell-text { font-size: 0.65rem; color: var(--text-muted); text-align: center; line-height: 1.1; word-break: break-all; }
.recipe-result { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; }
.recipe-result img { width: 32px; height: 32px; image-rendering: pixelated; }
.recipe-result span { font-weight: 600; color: var(--text); }
.chip-with-img { display: inline-flex; align-items: center; gap: 4px; }
.chip-with-img img { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: middle; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .main-nav { display: none; }
    .menu-btn { display: flex; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hero { padding: 56px 0 32px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .section { padding: 48px 0; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-intro { text-align: left; }
    .detail-media { width: 96px; height: 96px; }
    .detail-media img { width: 72px; height: 72px; }
    .listing-hero-content { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .collection-grid { grid-template-columns: 1fr; }
    .longform-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: 1fr; }
    .header-search { display: none; }
}

@media (max-width: 480px) {
    .container { width: calc(100% - 1.5rem); }
    .hero-search-field { flex-direction: column; padding: 12px; }
    .hero-search-field input { min-height: 40px; }
    .hero-search-field .btn { width: 100%; }
    .hero h1 { font-size: 1.75rem; }
    .results-grid { grid-template-columns: 1fr; }
    .result-card { flex-direction: column; }
    .result-media { width: 100%; height: 80px; }
    .crafting-grid { grid-template-columns: repeat(2, 1fr); }
    .fact-grid { grid-template-columns: 1fr 1fr; }
    .id-grid { flex-direction: column; }
    .filter-chips { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
