:root {
    --ink: #111111;
    --muted: #6a6a6a;
    --line: #dedbd5;
    --paper: #fffdf8;
    --soft: #f2efe8;
    --white: #ffffff;
    --accent: #ff5b35;
    --accent-soft: #ffe3da;
    --success: #176b42;
    --success-soft: #e0f4e9;
    --danger: #a62828;
    --danger-soft: #fde7e7;
    --sidebar: #171717;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(17, 17, 17, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2.8rem, 8vw, 6.7rem); }
h2 { font-size: clamp(2rem, 4vw, 3.8rem); }
h3 { font-size: 1.45rem; }
p { color: var(--muted); }
small { color: var(--muted); }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { max-width: 880px; }
.reading-width { max-width: 760px; }
.eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    font-weight: 750;
    transition: transform .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-dark { color: var(--white); background: var(--ink); }
.button-light { color: var(--ink); background: transparent; }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.text-link { font-weight: 800; text-decoration: underline; text-underline-offset: 5px; }
.alert {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 12px;
}
.alert ul { margin-bottom: 0; }
.alert-success { color: var(--success); background: var(--success-soft); }
.alert-danger { color: var(--danger); background: var(--danger-soft); }

.site-header {
    position: sticky;
    z-index: 30;
    top: 0;
    border-bottom: 1px solid rgba(222, 219, 213, .85);
    background: rgba(255, 253, 248, .93);
    backdrop-filter: blur(14px);
}
.nav-wrap {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand, .admin-brand { display: flex; align-items: center; gap: 12px; }
.brand span:last-child, .admin-brand span:last-child { display: grid; }
.brand small, .admin-brand small { font-size: .72rem; }
.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--accent);
    font-size: 1.15rem;
    font-weight: 900;
}
.main-nav { display: flex; align-items: center; gap: 28px; font-weight: 700; }
.main-nav > a { position: relative; }
.main-nav > a::after {
    position: absolute;
    right: 0;
    bottom: -6px;
    left: 0;
    height: 2px;
    content: "";
    background: var(--accent);
    transform: scaleX(0);
    transition: transform .2s;
}
.main-nav > a:hover::after { transform: scaleX(1); }
.nav-search {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
}
.nav-search input {
    width: 105px;
    padding: 8px 4px 8px 15px;
    border: 0;
    outline: 0;
    background: transparent;
}
.nav-search button { padding: 7px 13px; border: 0; background: transparent; font-weight: 900; }
.menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
}

.hero { padding: clamp(72px, 11vw, 150px) 0 100px; }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr);
    align-items: end;
    gap: 70px;
}
.hero h1 { max-width: 900px; margin-bottom: 28px; }
.hero p { max-width: 700px; font-size: 1.25rem; }
.hero-portrait {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    transform: rotate(2deg);
}
.portrait-circle {
    display: grid;
    aspect-ratio: 1;
    margin-bottom: 25px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background:
        radial-gradient(circle at 68% 25%, #ffc6b5 0 12%, transparent 13%),
        linear-gradient(145deg, #ff744f, #e63d1c);
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 900;
    letter-spacing: -.08em;
}
.hero-portrait p { margin-bottom: 0; font-size: 1rem; }

.featured-section { padding: 20px 0 90px; }
.featured-post {
    display: grid;
    overflow: hidden;
    grid-template-columns: 1.1fr .9fr;
    border-radius: 28px;
    color: var(--white);
    background: var(--ink);
    box-shadow: var(--shadow);
}
.featured-post > div { padding: clamp(34px, 6vw, 76px); }
.featured-post h2 { font-size: clamp(2.2rem, 5vw, 4.8rem); }
.featured-post p, .featured-post .post-meta { color: #c8c8c8; }
.featured-image { min-height: 420px; background: var(--accent); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-art {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, #ffbdab 0 9%, transparent 10%),
        radial-gradient(circle at 75% 70%, #7a1d0a 0 18%, transparent 19%),
        var(--accent);
}
.placeholder-art span { font-size: clamp(4rem, 9vw, 8rem); font-weight: 900; transform: rotate(-12deg); }

.section { padding: 95px 0; }
.section-muted { background: var(--soft); }
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 45px;
}
.section-heading h2 { margin-bottom: 0; }
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}
.post-list { display: grid; gap: 22px; }
.post-list .post-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: stretch;
}
.post-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-thumb { min-height: 210px; background: var(--soft); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-content { padding: 26px; }
.post-card h2 { margin-bottom: 14px; font-size: 1.65rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.post-meta a { color: var(--accent); }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.book-grid-large { grid-template-columns: repeat(3, 1fr); }
.book-card img, .book-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    margin-bottom: 22px;
    object-fit: cover;
    border-radius: 8px 18px 18px 8px;
    box-shadow: 10px 12px 25px rgba(0, 0, 0, .13);
}
.book-placeholder {
    display: flex;
    align-items: end;
    padding: 25px;
    color: var(--white);
    background: linear-gradient(145deg, var(--accent), #7c1b09);
}
.book-placeholder span { max-width: 85%; font-size: 1.55rem; font-weight: 900; line-height: 1.1; }
.book-card h2, .book-card h3 { margin-bottom: 10px; }
.book-card .button { margin-top: 10px; }

.page-hero { padding: 100px 0 65px; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin-bottom: 20px; font-size: clamp(3rem, 8vw, 6rem); }
.page-hero p { font-size: 1.2rem; }
.article-header { padding: 100px 0 55px; }
.article-header h1 { font-size: clamp(3rem, 8vw, 6.2rem); }
.article-lead { font-size: 1.3rem; }
.article-image { max-width: 1100px; }
.article-image img { width: 100%; max-height: 650px; object-fit: cover; border-radius: 24px; }
.article-body { padding-top: 60px; padding-bottom: 110px; font-family: Georgia, "Times New Roman", serif; font-size: 1.17rem; }
.article-body p { color: #333; }
.article-body h2, .article-body h3 { margin-top: 2.3em; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body blockquote {
    margin: 2.5em 0;
    padding: 8px 0 8px 28px;
    border-left: 5px solid var(--accent);
    color: var(--ink);
    font-size: 1.45rem;
    font-style: italic;
}
.article-body img { margin: 2.2rem auto; border-radius: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 55px; font-family: Inter, sans-serif; }
.tag-list a { padding: 7px 13px; border-radius: 999px; color: var(--ink); background: var(--soft); text-decoration: none; font-size: .86rem; font-weight: 750; }
.large-search { display: flex; gap: 10px; margin: 30px 0 18px; }
.large-search input { flex: 1; }
.empty-state { padding: 45px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.newsletter-section { padding: 75px 0; color: var(--white); background: var(--accent); }
.newsletter-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 60px; }
.newsletter-section .eyebrow, .newsletter-section p { color: #ffe7df; }
.newsletter-section h2 { margin-bottom: 12px; }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-form input { flex: 1; border-color: transparent; }
.site-footer { padding: 45px 0; color: var(--white); background: var(--ink); }
.site-footer p { margin: 8px 0 0; color: #aaa; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }

.auth-section { display: grid; min-height: 72vh; padding: 70px 20px; place-items: center; }
.auth-card { width: min(480px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.7rem; }

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfcac1;
    border-radius: 10px;
    color: var(--ink);
    background: var(--white);
    outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, .08); }
textarea { resize: vertical; }
label { display: grid; gap: 7px; font-weight: 720; }
label small { font-weight: 400; }
.stack-form { display: grid; gap: 20px; }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.check-row input { width: auto; }
.check-list { display: grid; gap: 8px; }
fieldset { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 6px; font-weight: 800; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 35px 0 0; padding: 0; list-style: none; }
.page-link {
    display: grid;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--white);
}
.page-item.active .page-link { color: var(--white); border-color: var(--ink); background: var(--ink); }
.page-item.disabled .page-link { opacity: .45; }

.admin-body { min-height: 100vh; background: #f4f3ef; }
.admin-sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 260px;
    flex-direction: column;
    padding: 24px;
    color: var(--white);
    background: var(--sidebar);
}
.admin-brand { margin-bottom: 34px; }
.admin-brand small { color: #999; }
.admin-sidebar nav { display: grid; gap: 5px; }
.admin-sidebar nav a { padding: 11px 13px; border-radius: 10px; color: #bcbcbc; font-weight: 700; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: var(--white); background: #2a2a2a; }
.admin-sidebar-footer { display: grid; gap: 8px; margin-top: auto; }
.admin-sidebar-footer a, .admin-sidebar-footer button {
    width: 100%;
    padding: 9px 0;
    border: 0;
    color: #aaa;
    background: transparent;
    text-align: left;
}
.admin-shell { min-height: 100vh; margin-left: 260px; }
.admin-topbar {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}
.admin-topbar > div { display: flex; align-items: center; gap: 10px; }
.admin-content { padding: 34px; }
.admin-content > .alert { width: 100%; margin: 0 0 24px; }
.admin-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.admin-heading h1 { margin-bottom: 8px; font-size: clamp(2.1rem, 5vw, 3.4rem); }
.admin-heading p { margin-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { display: grid; gap: 12px; padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.stat-card span { color: var(--muted); font-size: .86rem; font-weight: 700; }
.stat-card strong { font-size: 2.5rem; line-height: 1; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.panel h2 { font-size: 1.45rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.panel-heading h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 12px; border-bottom: 1px solid #eceae5; text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: 0; }
.action-cell { display: flex; gap: 12px; align-items: center; }
.action-cell form { margin: 0; }
.link-danger { padding: 0; border: 0; color: var(--danger); background: transparent; }
.status, .badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-published { color: var(--success); background: var(--success-soft); }
.status-draft { color: #765c16; background: #fff2c6; }
.badge { margin-left: 7px; color: #8e270d; background: var(--accent-soft); }
.filter-bar { display: grid; grid-template-columns: 1fr 190px auto; gap: 10px; margin-bottom: 18px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 22px; }
.editor-sidebar { position: sticky; top: 90px; }
.code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.55; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-preview { max-height: 230px; border-radius: 10px; object-fit: cover; }
.book-preview { max-width: 180px; max-height: none; }
.max-form { max-width: 980px; }
.two-panel-grid { display: grid; grid-template-columns: 340px 1fr; align-items: start; gap: 22px; }
.taxonomy-list { display: grid; gap: 13px; }
.taxonomy-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.taxonomy-edit { display: grid; flex: 1; grid-template-columns: 1fr 1fr 1.5fr auto auto; align-items: center; gap: 8px; }
.taxonomy-edit-short { grid-template-columns: 1fr 1fr auto auto; }
.taxonomy-edit span { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.admin-menu { display: none; }

@media (max-width: 1000px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .book-grid, .book-grid-large { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-grid { grid-template-columns: 1fr; }
    .editor-sidebar { position: static; }
    .two-panel-grid { grid-template-columns: 1fr; }
    .taxonomy-edit, .taxonomy-edit-short { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
    h1 { font-size: clamp(2.65rem, 14vw, 4.2rem); }
    .menu-button { display: block; }
    .main-nav {
        position: absolute;
        top: 84px;
        right: 20px;
        left: 20px;
        display: none;
        padding: 22px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: var(--white);
        box-shadow: var(--shadow);
    }
    .main-nav.is-open { display: grid; }
    .nav-search input { width: 100%; }
    .hero-grid, .featured-post, .newsletter-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 70px; }
    .hero-portrait { max-width: 420px; }
    .featured-image { min-height: 300px; }
    .section { padding: 70px 0; }
    .post-list .post-card { grid-template-columns: 1fr; }
    .section-heading, .footer-grid, .admin-heading { align-items: flex-start; flex-direction: column; }
    .newsletter-form, .large-search { flex-direction: column; }
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform .25s;
    }
    .admin-sidebar.is-open { transform: translateX(0); }
    .admin-shell { margin-left: 0; }
    .admin-menu { display: block; }
    .admin-content { padding: 22px; }
    .admin-topbar { padding-inline: 22px; }
    .filter-bar { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .container { width: min(100% - 26px, 1180px); }
    .post-grid, .book-grid, .book-grid-large, .stat-grid, .form-grid-2 { grid-template-columns: 1fr; }
    .hero-portrait { padding: 22px; }
    .auth-card { padding: 28px; }
    .panel { padding: 20px; }
    .taxonomy-edit, .taxonomy-edit-short { grid-template-columns: 1fr; }
    .taxonomy-item { align-items: flex-start; flex-direction: column; }
}
