:root {
    --bg: #fbf8f4;
    --ink: #1f1b18;
    --muted: #7a716a;
    --line: #ece5dd;
    --card: #ffffff;
    --accent: #e60023; /* Pinterest red */
    --radius: 18px;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.center { text-align: center; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 248, 244, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 22px; padding: 14px 0; }
.brand { font-family: var(--serif); font-weight: 800; font-size: 1.7rem; letter-spacing: -.5px; white-space: nowrap; }
.brand.small { font-size: 1.4rem; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: .92rem; outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230, 0, 35, .12); }
.main-nav { display: flex; gap: 6px; }
.main-nav a { padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .94rem; }
.main-nav a:hover, .main-nav a.on { background: #f0e9e1; }
.catbar { border-top: 1px solid var(--line); background: #fff; }
.catbar .container { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.catbar .container::-webkit-scrollbar { display: none; }
.catbar a { white-space: nowrap; padding: 6px 14px; border-radius: 999px; font-size: .86rem; font-weight: 500; color: #514a44; }
.catbar a:hover { background: #f4eee7; }
.catbar a.on { background: var(--ink); color: #fff; }

/* ---------- shared bits ---------- */
.lead { font-size: 1.15rem; color: #5b534c; }
.meta { font-size: .82rem; color: var(--muted); }
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: transform .15s, background .15s; }
.btn:hover { filter: brightness(.88); transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f4eee7; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; color: hsl(calc(var(--h) + var(--shift, 0)), 55%, 28%); background: hsl(calc(var(--h) + var(--shift, 0)), 70%, 91%); }
.tag:hover { background: hsl(calc(var(--h) + var(--shift, 0)), 70%, 86%); }
.sec-title { font-family: var(--serif); font-size: 1.9rem; margin: 0 0 22px; letter-spacing: -.3px; }
.crumbs { font-size: .84rem; color: var(--muted); margin: 26px 0 10px; }
.crumbs a:hover { color: var(--accent); }

/* ---------- covers ---------- */
.cover { overflow: hidden; border-radius: var(--radius); background: #eee; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.r34 { aspect-ratio: 3 / 4; }
.cover.r45 { aspect-ratio: 4 / 5; }
.cover.r11 { aspect-ratio: 1 / 1; }
.cover.ph { display: grid; place-items: center; background:
    radial-gradient(circle at 25% 20%, hsl(calc(var(--h) + var(--shift, 0)), 85%, 90%), transparent 55%),
    linear-gradient(145deg, hsl(calc(var(--h) + var(--shift, 0)), 75%, 82%), hsl(calc(var(--h) + 35), 70%, 70%)); }
.cover.ph span { font-size: 4.6rem; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }

/* ---------- hero ---------- */
.hero { padding: 38px 0 10px; }
.hero-grid { display: block; }
.hero-text { max-width: 820px; padding: 44px 40px; border-radius: 28px; background: linear-gradient(145deg, hsl(calc(var(--h, 20) + var(--shift, 0)), 80%, 93%), #fff); border: 1px solid var(--line); }
.hero-cover .cover { aspect-ratio: 5 / 4; }
.hero-cover .cover.ph span { font-size: 8rem; }
.hero-text h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.12; margin: 14px 0; letter-spacing: -.8px; }
.hero-text h1 a:hover { color: var(--accent); }
.hero-text .btn { margin-top: 18px; }

/* ---------- topics ---------- */
.topics { padding: 46px 0 10px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; }
.topic { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: hsl(calc(var(--h) + var(--shift, 0)), 70%, 93%); transition: transform .15s, box-shadow .15s; }
.topic:hover { transform: translateY(-3px); box-shadow: 0 10px 24px hsla(calc(var(--h) + var(--shift, 0)), 50%, 40%, .18); }
.topic .em { font-size: 2rem; }
.topic strong { font-size: .95rem; color: hsl(calc(var(--h) + var(--shift, 0)), 50%, 22%); line-height: 1.25; }

/* ---------- masonry ---------- */
.latest { padding: 44px 0 30px; }
.masonry { column-count: 4; column-gap: 22px; }
.masonry.three { column-count: 3; }
.card-post { break-inside: avoid; margin-bottom: 22px; background: var(--card); border: 1px solid var(--line); border-top: 5px solid hsl(calc(var(--h) + var(--shift, 0)), 70%, 72%); border-radius: var(--radius); transition: transform .2s, box-shadow .2s; }
.card-post:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(60, 40, 20, .12); }
.card-post .cover { transition: transform .25s, box-shadow .25s; }
.card-post:hover .cover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(60, 40, 20, .16); }
.cp-body { padding: 18px 20px 20px; }
.cp-body h3 { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; margin: 8px 0 6px; }
.cp-body h3 a:hover { color: var(--accent); }
.cp-body p { margin: 0 0 8px; font-size: .9rem; color: #5b534c; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 20px 0 10px; color: var(--muted); font-size: .9rem; }

/* ---------- category hero ---------- */
.cat-hero { padding: 10px 0 34px; background: linear-gradient(180deg, hsl(calc(var(--h) + var(--shift, 0)), 70%, 92%), var(--bg)); }
.cat-hero h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); margin: 6px 0 8px; letter-spacing: -.6px; }
.cat-hero h1 span { margin-right: 6px; }

/* ---------- article ---------- */
.post-title { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.12; margin: 6px 0 14px; letter-spacing: -.8px; }
.byline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 22px; }
.share { margin-left: auto; }
.pin-btn { display: inline-block; background: var(--accent); color: #fff; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .82rem; }
.pin-btn:hover { filter: brightness(.88); }
.pin-btn.big { padding: 14px 30px; font-size: 1rem; }
.post-cover { margin-bottom: 30px; }
.post-cover.ph { aspect-ratio: 16 / 9; }
.post-cover.ph span { font-size: 7rem; }
.prose { font-size: 1.1rem; line-height: 1.8; color: #2d2823; }
.prose h2 { font-family: var(--serif); font-size: 1.65rem; line-height: 1.25; margin: 40px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose img { border-radius: 14px; margin: 26px auto; }
.prose ul, .prose ol { padding-left: 1.3em; }
.post-end { margin: 44px 0 10px; padding: 30px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.related { background: #fff; margin-top: 40px; border-top: 1px solid var(--line); }
.page-title { font-family: var(--serif); font-size: 2.6rem; margin: 6px 0 20px; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark, #1f1b18); color: #d8d0c8; margin-top: 60px; padding: 50px 0 20px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .brand { color: #fff; }
.site-footer p { font-size: .9rem; color: #a59c93; max-width: 320px; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: .95rem; }
.site-footer a { display: block; padding: 3px 0; font-size: .9rem; color: #b9b0a7; }
.site-footer a:hover { color: #fff; }
.copy { margin-top: 36px; padding-top: 18px; border-top: 1px solid #3a342f; font-size: .82rem; color: #8b827a; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
    .masonry { column-count: 3; }
    .hero-grid { grid-template-columns: 1fr; gap: 24px; }
    .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .bar { gap: 10px; padding: 10px 0; }
    .brand { font-size: 1.3rem; }
    .search { max-width: none; }
    .search input { padding: 8px 14px; }
    .main-nav { display: none; }
    .hero { padding-top: 20px; }
    .sec-title { font-size: 1.5rem; }
    .prose { font-size: 1.04rem; }
    .masonry, .masonry.three { column-count: 2; column-gap: 14px; }
    .cp-body p { display: none; }
    .cover.ph span { font-size: 3rem; }
    .hero-cover .cover.ph span { font-size: 5rem; }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- legal / contact ---------- */
.muted-note { color: var(--muted); font-size: .9rem; }
.prose ul { margin: 0 0 18px; }
.prose li { margin-bottom: 6px; }
.contact-form { display: grid; gap: 14px; margin: 26px 0 34px; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.contact-form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.contact-form input, .contact-form textarea { font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fdfcfa; outline: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230, 0, 35, .12); }
.contact-form .btn { border: 0; cursor: pointer; justify-self: start; }
.notice { padding: 14px 18px; border-radius: 12px; margin: 20px 0; font-size: 1rem; }
.notice.ok { background: #dcfce7; color: #166534; }
.notice.err { background: #fee2e2; color: #991b1b; }
@media (max-width: 720px) { .contact-form { padding: 18px; } }
.brand { overflow: hidden; text-overflow: ellipsis; max-width: 70vw; letter-spacing: -.3px; }
@media (max-width: 720px) { .brand { font-size: 1.1rem; max-width: 52vw; } }

/* ---------- clean card grid (text only) ---------- */
.home-head { padding: 54px 0 6px; }
.home-head h1 { font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1.1; margin: 0 0 10px; letter-spacing: -1px; }
.home-head .lead { margin: 0; max-width: 560px; }
.latest { padding: 30px 0 30px; }
.grid, .masonry, .masonry.three { display: grid; column-count: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card-post { margin: 0; padding: 0; border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 16px; background: #fff; transition: transform .18s, box-shadow .18s, border-color .18s; }
.card-post:hover { transform: translateY(-3px); border-color: hsl(calc(var(--h) + var(--shift, 0)), 55%, 75%); box-shadow: 0 16px 32px -12px rgba(40, 30, 20, .18); }
.cp-link { display: flex; flex-direction: column; height: 100%; padding: 26px 26px 22px; }
.cp-cat { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: hsl(calc(var(--h) + var(--shift, 0)), 60%, 34%); margin-bottom: 12px; }
.cp-link h3 { font-family: var(--serif); font-size: 1.32rem; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.2px; }
.cp-link:hover h3 { color: var(--accent); }
.cp-link p { margin: 0 0 18px; color: #5b534c; font-size: .95rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cp-link .meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 44px 0 10px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--ink); }
.pager a { background: #fff; border: 1px solid var(--line); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .cur { background: var(--ink); color: #fff; }
.pager .dots { color: var(--muted); }
.cat-hero { padding: 6px 0 30px; background: linear-gradient(180deg, hsl(calc(var(--h) + var(--shift, 0)), 60%, 94%), var(--bg)); }
@media (max-width: 1000px) { .grid, .masonry, .masonry.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .grid, .masonry, .masonry.three { grid-template-columns: 1fr; gap: 14px; }
    .home-head { padding-top: 30px; }
    .cp-link { padding: 20px; }
    .cp-link p { display: -webkit-box; }
    .pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; }
}

/* ---------- mobile safety ---------- */
.prose { overflow-wrap: anywhere; }
.prose img, .prose iframe, .prose video { max-width: 100%; height: auto; }
.prose table, .prose pre { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 640px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- hamburger menu (mobile) ---------- */
.menu-btn, .mobile-menu { display: none; }
.menu-btn { width: 44px; height: 44px; margin-left: auto; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
html.menu-open, html.menu-open body { overflow: hidden; }
@media (max-width: 720px) {
    .bar .search, .main-nav, .catbar { display: none; }
    .menu-btn { display: inline-flex; }
    .bar { justify-content: space-between; }
    .site-header { background: #fff; backdrop-filter: none; }
    .mobile-menu:not([hidden]) {
        display: block; position: fixed; left: 0; right: 0; bottom: 0; top: var(--hh, 65px); z-index: 19;
        overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
        background: #fff; border-top: 1px solid var(--line); animation: mmIn .22s ease-out;
    }
    @keyframes mmIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
    .mm-inner { padding: 20px 20px calc(36px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }

    .mm-search { display: flex; gap: 8px; }
    .mm-search input { flex: 1; min-width: 0; padding: 14px 18px; border: 1px solid #d9d1c8; border-radius: 12px; background: #fff; font: inherit; font-size: 1rem; outline: none; -webkit-appearance: none; appearance: none; }
    .mm-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
    .mm-search button { padding: 0 20px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; }

    .mm-links { margin-top: 22px; border-top: 1px solid var(--line); }
    .mm-links a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 1.12rem; color: var(--ink); }
    .mm-links a::after { content: ""; width: 9px; height: 9px; border-top: 2px solid #9a9088; border-right: 2px solid #9a9088; transform: rotate(45deg); margin-right: 4px; }
    .mm-links a.on { color: var(--accent); }
    .mm-links a.on::after { border-color: var(--accent); }

    .mm-title { margin: 30px 0 12px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6f665e; }
    .mm-cats { display: grid; gap: 8px; }
    .mm-cats a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px 0 14px; border: 1px solid var(--line); border-left: 4px solid hsl(calc(var(--h) + var(--shift, 0)), 60%, 62%); border-radius: 12px; background: #fff; font-size: 1rem; font-weight: 500; color: var(--ink); }
    .mm-cats a:active { background: #f6f2ed; }
    .mm-cats a.on { border-color: var(--accent); background: #fbf6f4; font-weight: 600; }
    .mm-cats .ct { min-width: 30px; padding: 3px 9px; border-radius: 999px; background: #f1ebe4; color: #6f665e; font-size: .8rem; font-weight: 600; text-align: center; }

    .mm-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
    .mm-foot a { font-size: .88rem; color: #6f665e; }
}
