/* ==========================================================================
   Howpedia — public site styles
   ========================================================================== */

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

:root {
  --ink: #241b13;
  --ink-soft: #4a3a2b;
  --muted: #6b5a46;
  --line: #e3d3bb;
  --line-strong: #d3bfa2;
  --paper: #efe4d2;
  --cream: #f7ede0;
  --brand-50: #f7efe2;
  --brand-100: #f0e2cb;
  --brand-200: #ddc9ab;
  --brand-500: #b8863c;
  --brand-600: #9c6b26;
  --brand-700: #7d5219;
  --brand-900: #3b2712;
  --amber: #f2b544;
  --coral: #e07a5f;
  --header-bg: #2b1a11;
  --header-ink: #f6ead6;
  --header-amber: #e2a23f;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(60, 40, 15, 0.05), 0 10px 30px -20px rgba(60, 40, 15, 0.3);
  --shadow-md: 0 18px 40px -24px rgba(60, 40, 15, 0.4);
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --container: 1200px;
}

html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container.narrow { max-width: 840px; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--brand-700); color: #fff; padding: 10px 18px; border-radius: 999px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid rgba(156, 107, 38, 0.5); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 22px; font-size: 14.5px; font-weight: 650; line-height: 1.2;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(60, 40, 15, 0.7); }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-light { background: #fff; color: var(--brand-900); }
.btn-light:hover { background: var(--brand-100); transform: translateY(-1px); }
.btn-small { padding: 8px 14px; font-size: 13px; }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-700); font-size: 14.5px; font-weight: 650;
}
.text-link:hover { color: var(--brand-500); }
.text-link .icon { transition: transform 0.2s ease; }
.text-link:hover .icon { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #c8862a;
  color: var(--header-bg);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px rgba(43, 26, 17, 0.18);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand-text {
  font-family: var(--font-display); font-size: 25px; font-weight: 700;
  letter-spacing: -0.035em; color: var(--header-amber); line-height: 1;
}
.brand-dot { color: var(--header-amber); }
.brand-sm .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.brand-sm .brand-mark svg { width: 20px; height: 20px; }
.brand-sm .brand-text { font-size: 21px; }

.header-search {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto; min-width: 0; max-width: 640px;
  padding: 7px 0;
  border: 0; border-bottom: 1.5px solid rgba(246, 234, 214, 0.45);
  background: transparent; color: rgba(246, 234, 214, 0.7);
  transition: border-color 0.2s ease;
}
.header-search:focus-within {
  border-color: var(--header-amber);
  background: transparent;
  box-shadow: none;
}
.header-search input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  border: 0; background: transparent; outline: none;
  font-size: 16px; color: var(--header-ink);
}
.header-search input::placeholder { color: rgba(246, 234, 214, 0.72); }
.header-search-btn {
  flex: none;
  padding: 10px 22px;
  border: 1px solid rgba(246, 234, 214, 0.26);
  border-radius: 8px;
  background: rgba(246, 234, 214, 0.14);
  color: var(--header-ink);
  font: 700 14px/1.1 var(--font-body);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.header-search-btn:hover { background: rgba(246, 234, 214, 0.24); transform: translateY(-1px); }

.header-menu {
  flex: none; display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border: 0; border-radius: 999px;
  background: #f6ead6; cursor: pointer;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.6);
}
.header-menu-badge {
  padding: 6px 10px; border-radius: 7px;
  background: #c8862a; color: var(--header-bg);
  font: 800 11px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
}
.header-menu-lines {
  position: relative; display: flex; flex-direction: column; gap: 3.5px;
  width: 22px; padding: 2px 0;
}
.header-menu-lines i {
  display: block; height: 2px; border-radius: 2px; background: var(--header-bg);
}
.header-menu-lines i:nth-child(2) { width: 17px; }
.header-menu-dot {
  position: absolute; top: -3px; right: -5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #d94436; border: 2px solid #f6ead6;
}
.header-menu:hover .header-menu-badge { background: #b87a2a; }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 24px; flex: none; }
.header-tool {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--header-ink);
}
.header-tool-icon {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1.5px solid rgba(246, 234, 214, 0.6); border-radius: 50%;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.header-tool-icon .icon { width: 17px; height: 17px; }
.header-tool small {
  font: 700 9.5px/1 var(--font-body);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(246, 234, 214, 0.82);
}
.header-tool:hover .header-tool-icon {
  border-color: var(--header-amber);
  background: rgba(226, 162, 63, 0.14);
}
.header-tool:hover small { color: var(--header-amber); }

/* ---------- Mobile drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(38, 24, 14, 0.45); backdrop-filter: blur(3px);
}
.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(380px, 92vw); background: #fff; padding: 20px 22px 40px;
  transform: translateX(102%); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto; box-shadow: -30px 0 60px -30px rgba(60, 40, 15, 0.5);
}
body.menu-open .mobile-drawer { transform: translateX(0); }
body.menu-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mobile-drawer .brand-mark {
  border-radius: 10px;
  background: linear-gradient(150deg, var(--brand-600), var(--brand-900));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.mobile-drawer .brand-text { color: var(--brand-900); }
.mobile-drawer .brand-dot { color: var(--brand-500); }
.icon-button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer;
}
.drawer-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 16px; color: var(--muted); margin-bottom: 18px; background: var(--cream);
}
.drawer-search input { width: 100%; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink); }
.drawer-nav { display: flex; flex-direction: column; }
.drawer-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 2px; font-size: 15px; font-weight: 560; color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.drawer-link > span { display: inline-flex; align-items: center; gap: 9px; }
.drawer-link small { color: var(--muted); font-weight: 500; }
.drawer-link:hover { color: var(--brand-700); }
.drawer-divider { height: 18px; }

/* ---------- Hero ---------- */
.hero {
  background: #fdf1dd;
  color: var(--ink);
  padding: 44px 0 46px;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  align-items: center;
  gap: 44px;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-body); font-weight: 700;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.24; letter-spacing: -0.015em;
  max-width: 660px;
}
.hero-sub {
  margin: 24px 0 0;
  font-family: var(--font-body);
  font-size: 20px; line-height: 1.4; color: var(--ink-soft);
}

.hero-search {
  display: flex; align-items: stretch; gap: 10px;
  width: 100%; max-width: 520px;
  margin-top: 18px;
  padding: 0 0 0 16px;
  background: #fff;
  border: 1px solid var(--line-strong); border-radius: 10px;
  color: #8b7a63;
  box-shadow: 0 12px 26px -22px rgba(60, 40, 15, 0.55);
}
.hero-search:focus-within { border-color: var(--brand-500); }
.hero-search .icon { flex: none; width: 20px; height: 20px; align-self: center; }
.hero-search input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: 400 17px/1.2 var(--font-body); color: var(--ink); padding: 16px 0;
}
.hero-search input::placeholder { color: #9c8a72; }
.hero-search-btn {
  flex: none; align-self: stretch;
  padding: 0 26px; border: 0; border-radius: 0 9px 9px 0;
  background: var(--brand-500); color: #fff;
  font: 700 16px/1 var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease;
}
.hero-search-btn:hover { background: var(--brand-600); }

.hero-dice {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 15px;
  font: 700 14.5px/1 var(--font-body);
  color: var(--brand-700);
}
.hero-dice:hover { color: var(--brand-900); text-decoration: underline; text-underline-offset: 3px; }

.hero-art { display: flex; justify-content: flex-end; }
.hero-art img { display: block; width: 100%; max-width: 470px; height: auto; }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section-tight { padding: 40px 0 76px; }
.section-tinted { background: var(--cream); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 34px;
}
.kicker {
  display: block; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--brand-600);
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; letter-spacing: -0.022em;
  margin-top: 6px;
}

/* ---------- Article cards ---------- */
.card-grid { display: grid; gap: 24px; }
.card-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.card-media {
  position: relative; display: block; aspect-ratio: 16 / 10;
  overflow: hidden; background: var(--brand-50);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 21px;
  line-height: 1.28; letter-spacing: -0.012em;
}
.card-title a:hover { color: var(--brand-700); }
.card-summary {
  color: var(--muted); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  font-size: 12.5px; color: var(--muted);
}
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }

.chip {
  position: absolute; left: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); color: var(--ink);
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(60, 40, 15, 0.12);
  backdrop-filter: blur(6px);
}
.chip .icon { color: var(--chip-color, var(--brand-600)); }
.chip-lg {
  position: static; display: inline-flex; background: color-mix(in srgb, var(--chip-color, #9c6b26) 12%, #fff);
  color: color-mix(in srgb, var(--chip-color, #9c6b26) 70%, #2b2118);
  padding: 7px 14px 7px 12px; font-size: 12.5px; box-shadow: none;
}
.chip-lg .icon { color: var(--chip-color, var(--brand-600)); }

/* Featured mosaic */
.featured-grid {
  display: grid; grid-template-columns: 1.55fr 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 22px;
}
.card-featured { grid-row: span 3; }
.card-featured .card-media { aspect-ratio: auto; flex: 1; min-height: 300px; }
.card-featured .card-title { font-size: clamp(24px, 2.4vw, 30px); }
.card-featured .card-summary { font-size: 15.5px; -webkit-line-clamp: 3; }
.card-featured .card-body { padding: 22px 26px 26px; gap: 10px; }

.card-compact { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: stretch; }
.card-compact .card-media { aspect-ratio: auto; height: 100%; }
.card-compact .chip { display: none; }
.card-compact .card-body { padding: 14px 18px; gap: 6px; }
.card-compact .card-title { font-size: 16.5px; line-height: 1.3; }
.card-compact .card-summary {
  font-size: 13px; -webkit-line-clamp: 2; display: -webkit-box;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-compact .card-meta { font-size: 11.5px; padding-top: 4px; }

/* ---------- Category tiles ---------- */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px;
}
.category-tile {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 20px; border-radius: 16px; min-height: 148px;
  background: #fff; border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.category-tile:hover { transform: translateY(-3px); border-color: var(--tile-color, var(--brand-500)); box-shadow: var(--shadow-sm); }
.category-tile-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--tile-color, var(--brand-600));
  background: color-mix(in srgb, var(--tile-color, #9c6b26) 12%, #fff);
  margin-bottom: 10px;
}
.category-tile-icon .icon { width: 22px; height: 22px; }
.category-tile-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.category-tile-count { font-size: 12.5px; color: var(--muted); }
.category-tile-arrow {
  position: absolute; right: 18px; bottom: 20px; color: var(--muted);
  opacity: 0; transform: translateX(-4px); transition: all 0.2s ease;
}
.category-tile:hover .category-tile-arrow { opacity: 1; transform: translateX(0); color: var(--tile-color, var(--brand-600)); }

/* ---------- Home layout ---------- */
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; align-items: start; }
.home-aside { display: flex; flex-direction: column; gap: 20px; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 22px 24px;
}
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-bottom: 14px;
}
.panel-title .icon { color: var(--coral); }
.trending-list { display: flex; flex-direction: column; }
.trending-list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.trending-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.trending-rank {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; margin-top: 2px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 12px; font-weight: 700;
}
.trending-list a { display: flex; flex-direction: column; gap: 2px; }
.trending-list strong { font-size: 14px; font-weight: 620; line-height: 1.35; }
.trending-list a:hover strong { color: var(--brand-700); }
.trending-list small { font-size: 12px; color: var(--muted); }
.panel-trust {
  background: linear-gradient(160deg, var(--brand-50), #fff 65%);
  border-color: var(--brand-200);
}
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand-700); margin-bottom: 10px;
}
.panel-trust h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.panel-trust p { font-size: 14px; color: var(--muted); margin-bottom: 12px; }

/* Value strip */
.value-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.value-item { display: flex; gap: 16px; padding: 30px 28px; border-right: 1px solid var(--line); }
.value-item:last-child { border-right: 0; }
.value-icon {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700);
}
.value-icon .icon { width: 23px; height: 23px; }
.value-item h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.value-item p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* CTA */
.cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 44px 48px; border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(120deg, #f4e7d2, #e8d6b8);
  color: var(--ink);
}
.cta::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: rgba(156, 107, 38, 0.1); right: -80px; top: -140px;
}
.cta h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; margin-bottom: 8px; }
.cta p { color: var(--muted); font-size: 15px; }
.cta .btn { position: relative; z-index: 1; flex: none; }

/* ---------- Page hero (browse, static) ---------- */
.page-hero { padding: 52px 0 20px; background: linear-gradient(180deg, var(--cream), var(--paper)); border-bottom: 1px solid var(--line); }
.page-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(36px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.025em;
  margin: 18px 0 12px;
}
.page-hero p { max-width: 700px; color: var(--muted); font-size: 16.5px; }
.page-updated { font-size: 13px; color: var(--muted); margin-top: 10px; }

.breadcrumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}
.breadcrumbs a:hover { color: var(--brand-700); }
.breadcrumbs span { color: var(--line-strong); }
.breadcrumbs span:last-child { color: var(--muted); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 34px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  transition: all 0.15s ease;
}
.filter-chip .icon { color: var(--chip-color, var(--brand-600)); }
.filter-chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.filter-chip.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.filter-chip.is-active .icon { color: #fff; }

/* ---------- Category page ---------- */
.category-hero {
  padding: 38px 0 48px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat-color, #9c6b26) 9%, var(--cream)), var(--paper));
  border-bottom: 1px solid var(--line);
}
.category-hero-row { display: flex; align-items: center; gap: 26px; margin-top: 26px; }
.category-hero-icon {
  width: 76px; height: 76px; border-radius: 20px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--cat-color, var(--brand-600));
  box-shadow: 0 16px 30px -18px color-mix(in srgb, var(--cat-color, #9c6b26) 70%, transparent);
}
.category-hero-icon .icon { width: 34px; height: 34px; }
.category-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 4.2vw, 48px); letter-spacing: -0.025em; line-height: 1.06;
}
.category-hero p { color: var(--muted); margin-top: 8px; max-width: 640px; }
.category-count {
  display: inline-block; margin-top: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand-700);
}

/* ---------- Search ---------- */
.search-hero { padding: 56px 0 8px; background: linear-gradient(180deg, var(--cream), var(--paper)); }
.search-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 4.2vw, 46px); letter-spacing: -0.025em; margin-bottom: 22px; }
.hero-search-sm { margin-top: 0; box-shadow: 0 12px 30px -22px rgba(60, 40, 15, 0.55); border: 1px solid var(--line); background: #fff; max-width: 100%; }
.search-summary { margin-top: 18px; font-size: 14.5px; color: var(--muted); }
.search-summary strong { color: var(--ink); }

.result-list { display: flex; flex-direction: column; gap: 14px; }
.result-item {
  display: grid; grid-template-columns: 210px minmax(0, 1fr) auto;
  gap: 22px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.result-item:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.result-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 11px; background: var(--brand-50); }
.result-category { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-600); }
.result-body h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.3; margin: 4px 0 4px; }
.result-body p { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-meta { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.result-arrow { color: var(--muted); margin-right: 8px; }

.empty-state {
  text-align: center; padding: 64px 28px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--cream);
}
.empty-state h2 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 0 auto 22px; }
.empty-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px 0; }
.search-hint h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-bottom: 20px; }

/* ---------- Article ---------- */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 120;
  height: 3px; width: 100%; transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%; background: linear-gradient(90deg, var(--brand-500), var(--amber));
  pointer-events: none;
}
.article { padding-top: 34px; }
.article .breadcrumbs { margin-bottom: 26px; }
.article-header { max-width: 860px; margin: 0 auto; }
.article-header h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 4.6vw, 55px); line-height: 1.06; letter-spacing: -0.028em;
  margin: 16px 0 16px;
}
.article-deck { font-size: 19px; line-height: 1.55; color: var(--muted); }
.article-byline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.author-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 14px; font-weight: 750; letter-spacing: 0.02em;
}
.byline-text { display: flex; flex-direction: column; gap: 2px; }
.byline-text strong { font-size: 14px; font-weight: 650; }
.byline-text span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.article-actions { margin-left: auto; display: flex; gap: 4px; }

.article-hero { max-width: 1020px; margin: 30px auto 52px; }
.article-hero img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 306px;
  gap: 56px; max-width: 1120px; margin: 0 auto; align-items: start;
}
.article-main { min-width: 0; }
.article-intro p { font-size: 17.5px; line-height: 1.78; color: var(--ink-soft); margin-bottom: 18px; }
.article-intro p:first-of-type { font-size: 19.5px; color: var(--ink); }

.supplies {
  padding: 24px 28px; border-radius: 20px;
  background: var(--brand-50); border: 1px solid var(--brand-200);
  margin: 34px 0 10px;
}
.supplies h2 {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 23px; font-weight: 600; margin-bottom: 14px;
}
.supplies h2 .icon { color: var(--brand-600); }
.supplies ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
.supplies li { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; color: var(--ink-soft); }
.supplies li .icon { color: var(--brand-600); margin-top: 4px; }

.steps { margin-top: 46px; }
.steps-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
  margin-bottom: 6px;
}
.steps-head h2 { font-family: var(--font-display); font-size: 31px; font-weight: 600; letter-spacing: -0.02em; }
.steps-count { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.step {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 22px;
  padding: 30px 0; border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; }
.step-number {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-900); color: #fff;
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  box-shadow: 0 10px 20px -14px rgba(60, 40, 15, 0.8);
}
.step-content h3 {
  font-family: var(--font-display); font-size: 25px; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.015em; margin-bottom: 10px;
}
.step-content p { font-size: 16px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 12px; }
.step-figure { margin: 16px 0 4px; }
.step-figure img { border-radius: 14px; border: 1px solid var(--line); width: 100%; }

.callout { margin-top: 38px; padding: 24px 28px; border-radius: 20px; }
.callout h2 { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 23px; font-weight: 600; margin-bottom: 12px; }
.callout ul { display: flex; flex-direction: column; gap: 9px; padding-left: 4px; }
.callout li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.65; color: var(--ink-soft); }
.callout li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.55;
}
.callout-tips { background: #fffaf0; border: 1px solid #f1e0b8; }
.callout-tips h2 .icon { color: #c9902a; }
.callout-warnings { background: #fff4f1; border: 1px solid #f3d4ca; }
.callout-warnings h2 .icon { color: #c9553c; }

.faq { margin-top: 46px; }
.faq > h2 { font-family: var(--font-display); font-size: 31px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 2px; font-size: 16.5px; font-weight: 620; cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { color: var(--brand-600); transition: transform 0.2s ease; }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-answer { padding: 0 2px 20px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.faq-answer p { margin-bottom: 10px; }

.feedback {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px;
  margin-top: 46px; padding: 28px 30px; border-radius: 22px;
  background: linear-gradient(150deg, var(--brand-50), #fff 80%);
  border: 1px solid var(--brand-200);
}
.feedback h2 { font-family: var(--font-display); font-size: 25px; font-weight: 600; margin-bottom: 4px; }
.feedback p { font-size: 13.5px; color: var(--muted); }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.article-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 42px; padding-top: 32px; border-top: 1px solid var(--line);
}
.pager-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pager-link:hover { border-color: var(--brand-300, var(--brand-200)); background: var(--brand-50); }
.pager-link span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager-link strong { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.35; }
.pager-next { text-align: right; align-items: flex-end; }

.article-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 18px; }
.side-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 20px 22px; }
.side-card h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.side-card h3 .icon { color: var(--brand-600); }
.toc nav { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; }
.toc a { padding: 7px 0; font-size: 13.5px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.toc a:last-child { border-bottom: 0; }
.toc a:hover { color: var(--brand-700); }
.toc-step { display: flex; gap: 8px; align-items: flex-start; }
.toc-step span {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--brand-50);
  font-size: 10.5px; font-weight: 700; color: var(--brand-700); margin-top: 1px;
}
.side-review { background: var(--cream); border-color: var(--line); }
.side-review h3 { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; text-transform: none; color: var(--ink); margin-bottom: 6px; }
.side-review p { font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.6; }
.side-related-list { display: flex; flex-direction: column; gap: 12px; }
.side-related-list a { display: flex; gap: 10px; align-items: center; }
.side-related-list img { width: 64px; height: 46px; object-fit: cover; border-radius: 8px; flex: none; }
.side-related-list strong { display: block; font-size: 13px; font-weight: 620; line-height: 1.35; }
.side-related-list small { font-size: 11px; color: var(--muted); }
.side-related-list a:hover strong { color: var(--brand-700); }

.related-section { margin-top: 72px; padding: 64px 0; background: var(--cream); border-top: 1px solid var(--line); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.page-number, .page-arrow {
  min-width: 42px; height: 42px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 11px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); background: #fff;
  transition: all 0.15s ease;
}
.page-number:hover, .page-arrow:hover { border-color: var(--brand-500); color: var(--brand-700); }
.page-number.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.page-arrow.is-disabled { opacity: 0.35; pointer-events: none; }
.page-gap { color: var(--muted); padding: 0 2px; }

/* ---------- Static pages ---------- */
.prose { max-width: 760px; }
.prose h2 {
  font-family: var(--font-display); font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em; margin: 44px 0 14px;
}
.prose h3 { font-size: 20px; font-weight: 650; margin: 30px 0 10px; }
.prose p { font-size: 16.5px; line-height: 1.78; color: var(--ink-soft); margin-bottom: 16px; }
.prose ul { margin: 0 0 18px; padding-left: 0; display: flex; flex-direction: column; gap: 8px; }
.prose li { position: relative; padding-left: 20px; font-size: 16px; color: var(--ink-soft); }
.prose li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); }
.prose a { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }
.contact-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.contact-card { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--cream); }
.contact-card h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 14px 0 6px; }
.contact-card p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 0; padding: 64px 0 0;
  background: #241811; color: rgba(255, 245, 231, 0.68);
}
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 44px; padding-bottom: 48px; }
.brand-footer .brand-text { color: #fff; }
.brand-footer .brand-dot { color: #e2a23f; }
.footer-brand p { font-size: 14px; line-height: 1.7; margin: 16px 0 14px; max-width: 320px; }
.footer-rss { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #e3bd86; }
.footer-rss:hover { color: #fff; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: #fff; margin-bottom: 4px; }
.footer-col a { font-size: 14px; color: rgba(255, 255, 255, 0.66); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-top: 22px; padding-bottom: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px; color: rgba(255, 255, 255, 0.45);
}
.footer-note { max-width: 520px; }

/* ---------- Errors ---------- */
.error-section { padding: 96px 0 110px; }
.center { text-align: center; }
.error-code {
  font-family: var(--font-display); font-size: clamp(80px, 12vw, 130px);
  font-weight: 600; line-height: 1; color: var(--brand-200); letter-spacing: -0.04em;
}
.error-section h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -0.02em; margin: 10px 0 12px; }
.error-copy { color: var(--muted); max-width: 480px; margin: 0 auto 26px; }
.error-section .hero-search { margin: 0 auto; max-width: 560px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.error-section .empty-links { margin: 26px 0; }
.error-section .text-link { margin-top: 10px; }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }

/* ---------- Flash message ---------- */
.flash {
  display: flex; align-items: center; gap: 8px;
  margin: 18px auto 0; padding: 12px 18px; border-radius: 12px;
  max-width: var(--container); font-size: 14px;
}
.flash-success { background: var(--brand-50); border: 1px solid var(--brand-200); color: var(--brand-700); }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .header-inner { gap: 20px; }
  .header-tools { gap: 15px; }
  .header-search { max-width: 420px; }
}

@media (max-width: 980px) {
  .header-tools { display: none; }
  .split-layout { grid-template-columns: 1fr; }
  .home-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .featured-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .card-featured { grid-column: span 2; grid-row: auto; }
  .featured-grid .card-compact:last-child { grid-column: span 2; grid-template-columns: 200px minmax(0, 1fr); }
  .card-featured .card-media { aspect-ratio: 16 / 9; flex: none; min-height: 0; }
  .card-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; gap: 44px; }
  .article-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .side-card.toc { display: none; }
  .value-strip { grid-template-columns: 1fr; }
  .value-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .value-item:last-child { border-bottom: 0; }
}

@media (max-width: 820px) {
  .header-search { display: none; }
  .header-inner { height: 66px; }
  .hero { padding: 34px 0 38px; }
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-art { display: none; }
  .section { padding: 58px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 34px 30px; }
  .contact-panel { grid-template-columns: 1fr; }
  .article-hero { margin-bottom: 38px; }
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .card-grid-2, .card-grid-3 { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .card-featured { grid-column: auto; }
  .featured-grid .card-compact:last-child { grid-column: auto; grid-template-columns: 120px minmax(0, 1fr); }
  .card-featured .card-body { padding: 20px; }
  .card-compact { grid-template-columns: 120px minmax(0, 1fr); }
  .card-compact .card-summary { display: none; }
  .home-aside { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(26px, 6.8vw, 34px); }
  .hero-sub { font-size: 17px; margin-top: 18px; }
  .hero-search { max-width: 100%; }
  .hero-search-btn { padding: 0 20px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .byline-text span { font-size: 12px; }
  .article-actions { margin-left: 0; width: 100%; }
  .article-header h1 { margin-top: 14px; }
  .step { grid-template-columns: 42px minmax(0, 1fr); gap: 16px; }
  .step-number { width: 38px; height: 38px; font-size: 17px; }
  .step-content h3 { font-size: 21px; }
  .supplies ul { grid-template-columns: 1fr; }
  .article-side { grid-template-columns: 1fr; }
  .article-pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
  .result-item { grid-template-columns: 108px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .result-arrow { display: none; }
  .result-body h2 { font-size: 17px; }
  .result-body p { -webkit-line-clamp: 2; }
  .category-hero-row { flex-direction: column; align-items: flex-start; gap: 18px; }
  .category-hero-icon { width: 62px; height: 62px; border-radius: 16px; }
  .category-hero-icon .icon { width: 28px; height: 28px; }
  .feedback { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 520px) {
  .brand-text { font-size: 22px; }
  .page-hero { padding-top: 36px; }
  .article { padding-top: 24px; }
  .article-hero img { border-radius: 18px; }
  .supplies, .callout, .feedback { padding: 20px 20px; }
  .card-compact { grid-template-columns: 1fr; }
  .card-compact .card-media { aspect-ratio: 16 / 9; }
  .card-compact .card-summary { display: -webkit-box; }
  .cta { padding: 28px 24px; }
}

/* ---------- Warm paper surfaces ---------- */
.card,
.category-tile,
.panel:not(.panel-trust),
.result-item,
.side-card,
.page-number { background-color: #fffdf8; }

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

@media print {
  .site-header, .site-footer, .article-side, .related-section, .article-actions,
  .feedback, .article-pager, .breadcrumbs, .reading-progress, .skip-link { display: none !important; }
  .article .container { max-width: 100%; padding: 0; }
  .article-layout { display: block; }
  .article-hero { margin: 20px 0; }
  .card, .callout, .supplies { break-inside: avoid; }
  body { font-size: 12pt; }
}
