:root {
    --bg: #fffaf3;
    --surface: #ffffff;
    --text: #2f2014;
    --muted: #6f5a4a;
    --accent: #8b2c20;
    --accent-soft: #f6e3c6;
    --border: #ead8bf;
    --shadow: 0 8px 20px rgba(96, 64, 34, 0.08);
    --radius: 14px;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Noto Serif Devanagari", "Kokila", "Mangal", serif;
    background:
        radial-gradient(circle at top right, #fff0d9 0%, transparent 40%),
        radial-gradient(circle at left -10%, #ffe9cc 0%, transparent 35%),
        var(--bg);
    color: var(--text);
    line-height: 1.62;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.page-shell {
    min-height: 72vh;
    padding: 1rem 0 2rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    background: rgba(255, 250, 243, 0.92);
    border-bottom: 1px solid var(--border);
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
}

.brand {
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.site-nav a {
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    color: var(--text);
}

.site-nav a.active,
.site-nav a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.hero {
    padding: 1.6rem 0 0.8rem;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-weight: 700;
}

.hero h1 {
    margin: 0.35rem 0 0;
    font-size: clamp(1.65rem, 2.7vw, 2.5rem);
    line-height: 1.2;
}

.hero-copy {
    color: var(--muted);
    margin: 0.8rem 0 1rem;
}

.hero-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
}

.hero-search input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

button,
.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 10px;
    padding: 0.72rem 0.9rem;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

button:hover,
.btn:hover {
    text-decoration: none;
    border-color: var(--accent);
}

.btn.primary,
.hero-search button,
.filter-bar button {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn.ghost {
    background: #fff;
}

section {
    margin-top: 1.35rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.section-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.category-grid,
.card-grid {
    display: grid;
    gap: 0.8rem;
}

.category-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.card-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.category-card,
.item-card,
.shared-box,
.info-box,
.empty-box {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 0.9rem;
}

.category-card h3,
.item-card h2,
.item-card h3 {
    margin: 0;
    font-size: 1.07rem;
    line-height: 1.35;
}

.category-card p,
.item-card p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.meta {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.65rem;
}

.two-col {
    display: grid;
    gap: 1rem;
}

.stack-list {
    display: grid;
    gap: 0.55rem;
}

.stack-item {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stack-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.page-title h1 {
    margin: 0;
}

.page-title p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.search-count {
    margin-top: 0;
    color: var(--muted);
}

.pager {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.tags {
    font-size: 0.9rem;
}

.read-page {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1.1rem;
}

.read-header h1 {
    margin: 0.1rem 0 0.5rem;
    line-height: 1.32;
}

.read-header .lead {
    color: var(--muted);
}

.read-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.read-content {
    margin-top: 1rem;
    font-size: 1.18rem;
    line-height: 1.9;
}

.read-content[data-font-size="small"] {
    font-size: 1.03rem;
}

.read-content[data-font-size="large"] {
    font-size: 1.32rem;
}

.read-nav {
    margin-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
}

.library-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.site-footer {
    margin-top: 2.1rem;
    border-top: 1px solid var(--border);
    background: rgba(255, 248, 237, 0.9);
}

.footer-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.theme-night {
    --bg: #1f1a17;
    --surface: #2a2320;
    --text: #f3e9d9;
    --muted: #d2bea6;
    --accent: #f0a152;
    --accent-soft: #3e3228;
    --border: #4a3c2f;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

@media (min-width: 760px) {
    .two-col {
        grid-template-columns: 1fr 1fr;
    }

    .filter-bar {
        grid-template-columns: 1fr 210px 130px;
    }
}
