:root {
  --ink: #171a1f;
  --muted: #626a76;
  --paper: #f6f3ec;
  --panel: #fffdf8;
  --line: #dcd6ca;
  --accent: #ef6c35;
  --accent-dark: #a83d16;
  --soft: #ece7dc;
  --shadow: 0 18px 50px rgba(39, 31, 20, 0.08);
  --radius: 20px;
  --content: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.header-inner, .footer-inner, .page-shell {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -0.035em;
  font-size: 1.18rem;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  letter-spacing: 0;
}
.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.94rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-dark); }

main { min-height: calc(100vh - 160px); }
.hero {
  padding: clamp(4rem, 9vw, 7.5rem) 0 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  gap: clamp(2rem, 7vw, 5rem);
  align-items: end;
}
.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 850;
}
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.04em; }
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3.2rem, 9vw, 7.4rem);
  line-height: 0.92;
}
.hero-copy { margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }

.blog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 1.4rem;
  border-top: 1px solid var(--line);
}
.blog-tools h2 { margin: 0; font-size: 1.25rem; }
.search-box { width: min(100%, 360px); }
.search-box label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.78rem 1rem;
  background: var(--panel);
  color: var(--ink);
}
.search-box input:focus { outline: 3px solid rgba(239, 108, 53, 0.2); border-color: var(--accent); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.15rem;
  padding-bottom: 5rem;
}
.post-card {
  grid-column: span 4;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c9bba8; color: var(--ink); }
.post-card:first-child { grid-column: 1 / -1; min-height: 360px; }
.post-card-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.82rem; }
.post-card-category { color: var(--accent-dark); font-weight: 850; text-transform: uppercase; letter-spacing: 0.08em; }
.post-card h3 { margin: auto 0 0.9rem; font-size: clamp(1.55rem, 3vw, 2.55rem); }
.post-card p { margin: 0 0 1.1rem; color: var(--muted); }
.post-card-read { font-weight: 850; }
.empty-state { padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

.article-shell { width: min(calc(100% - 2rem), 780px); margin: 0 auto; padding: 4rem 0 6rem; }
.breadcrumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 2.2rem; }
.breadcrumbs a { color: inherit; }
.article-meta { display: flex; gap: 0.9rem; align-items: center; color: var(--muted); font-size: 0.9rem; }
.article-category { color: var(--accent-dark); font-weight: 850; text-transform: uppercase; letter-spacing: 0.08em; }
.article-header h1 { margin: 0.8rem 0 1rem; font-size: clamp(2.7rem, 7vw, 5.4rem); }
.article-lede { margin: 0 0 2.5rem; color: var(--muted); font-size: clamp(1.15rem, 2.5vw, 1.4rem); }
.article-body h2 { margin: 3rem 0 1rem; font-size: clamp(1.65rem, 4vw, 2.25rem); }
.article-body p { margin: 0 0 1.25rem; font-size: 1.04rem; }
.article-body ul { padding-left: 1.2rem; }
.callout { margin: 2rem 0; padding: 1.3rem 1.4rem; border-left: 5px solid var(--accent); background: var(--soft); border-radius: 0 var(--radius) var(--radius) 0; }
.sources, .related { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.sources h2, .related h2 { font-size: 1.35rem; }
.sources li { margin-bottom: 0.55rem; }
.related-links { display: grid; gap: 0.75rem; }
.related-links a { display: block; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-weight: 800; text-decoration: none; }

.page-header { padding: 5rem 0 1rem; }
.page-header h1 { margin: 0 0 1rem; font-size: clamp(3rem, 8vw, 6rem); }
.page-header p { max-width: 720px; color: var(--muted); font-size: 1.2rem; }
.content-page { width: min(calc(100% - 2rem), 780px); margin: 0 auto; padding-bottom: 6rem; }
.content-page h2 { margin-top: 2.8rem; font-size: 2rem; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.footer-inner a { color: inherit; }

.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page h1 { font-size: clamp(4rem, 16vw, 10rem); margin: 0; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .post-card, .post-card:first-child { grid-column: span 6; min-height: 300px; }
}
@media (max-width: 600px) {
  .hero { padding-top: 3.5rem; }
  .blog-tools { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .post-card, .post-card:first-child { grid-column: 1 / -1; min-height: 270px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}

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

.blog-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 0 5rem;
}
.blog-pagination a,
.blog-pagination .current-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.blog-pagination a:first-child { justify-self: start; }
.blog-pagination a:last-child { justify-self: end; }
.blog-pagination a:hover { border-color: #c9bba8; box-shadow: var(--shadow); }
.blog-pagination .current-page { color: var(--muted); }
.pagination-spacer { min-width: 1px; }

@media (max-width: 600px) {
  .blog-pagination { grid-template-columns: 1fr 1fr; }
  .blog-pagination .current-page { grid-column: 1 / -1; grid-row: 1; }
  .blog-pagination a:first-child { grid-column: 1; }
  .blog-pagination a:last-child { grid-column: 2; }
}
