:root {
  --ink: #1b2a4a;
  --ink-soft: #4a5878;
  --paper: #f3f6fb;
  --card: #ffffff;
  --highlight: #ffd84d;
  --blue: #2f5bff;
  --mint: #bfe9d6;
  --line: #d5dcea;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body); color: var(--ink); line-height: 1.65;
  background-color: var(--paper);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1100px, 92%); margin: 0 auto; }

/* Header */
header { position: sticky; top: 0; z-index: 10; background: rgba(243,246,251,.92); backdrop-filter: blur(6px); border-bottom: 2px solid var(--ink); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo-slot { width: 48px; height: 48px; flex: none; border-radius: 12px; display: block; }
.brand-text { line-height: 1.1; }
.brand-name { font: 800 1.35rem var(--display); letter-spacing: -0.02em; }
.brand-domain { font: 500 .78rem var(--display); color: var(--ink-soft); }
nav ul { list-style: none; display: flex; gap: 22px; font: 500 .98rem var(--display); }
nav a { padding: 6px 2px; border-bottom: 3px solid transparent; }
nav a:hover { border-bottom-color: var(--highlight); }
.nav-cta { background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 999px; font: 700 .92rem var(--display); }
.nav-cta:hover { background: var(--blue); }

/* Hero */
.hero { padding: 84px 0 48px; }
.hero h1 { font: 800 clamp(2.6rem, 8vw, 5.6rem)/1.02 var(--display); letter-spacing: -0.035em; max-width: 14ch; }
.rotator { display: inline-block; background: var(--highlight); padding: 0 .18em; margin-left: -.05em; border-radius: 6px; min-width: 2ch; }
.caret { display: inline-block; width: .08em; height: .85em; background: var(--ink); margin-left: 2px; vertical-align: -.05em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin-top: 24px; max-width: 52ch; font-size: 1.15rem; color: var(--ink-soft); }
.search { margin-top: 32px; display: flex; max-width: 520px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.search input { flex: 1; border: 0; padding: 15px 18px; font: 500 1rem var(--display); background: transparent; color: var(--ink); min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 5px 5px 0 var(--blue); border-color: var(--blue); }
.search button { border: 0; background: var(--highlight); color: var(--ink); padding: 0 22px; font: 700 1rem var(--display); cursor: pointer; }
.search button:hover { background: #ffcb1f; }
.hero-small { padding: 56px 0 28px; }
.page-title { font: 800 clamp(2.2rem, 6vw, 3.6rem)/1.05 var(--display); letter-spacing: -0.03em; }

/* Section heads, chips */
.section-title { font: 800 1.9rem var(--display); letter-spacing: -0.02em; margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.count { font: 700 .9rem var(--display); background: var(--highlight); border-radius: 999px; padding: 2px 10px; vertical-align: middle; margin-left: 6px; }
.topics { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip { border: 2px solid var(--ink); background: var(--card); color: var(--ink); padding: 7px 16px; border-radius: 999px; font: 600 .92rem var(--display); cursor: pointer; }
.chip:hover { background: var(--highlight); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.more-wrap { text-align: center; margin-top: 30px; }

/* Featured */
.featured { display: grid; grid-template-columns: 1.1fr 1fr; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; margin-bottom: 64px; box-shadow: 8px 8px 0 var(--ink); }
.featured .art { background: var(--tint, #d8d0ff); display: grid; place-items: center; min-height: 260px; overflow: hidden; }
.featured .art .emoji { font-size: 6rem; }
.featured .art img { width: 100%; height: 100%; object-fit: cover; }
.featured .text { padding: 34px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.tag { display: inline-block; align-self: flex-start; background: var(--mint); border-radius: 6px; padding: 2px 10px; font: 700 .82rem var(--display); }
.featured h2 { font: 800 clamp(1.5rem, 3vw, 2.1rem)/1.15 var(--display); letter-spacing: -0.02em; }
.featured p { color: var(--ink-soft); }
.read-link { font: 700 1rem var(--display); border-bottom: 3px solid var(--highlight); align-self: flex-start; }
.read-link:hover { border-bottom-color: var(--blue); }

/* Category cards */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin: 20px 0 64px; }
.cat-card { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; border-top: 10px solid var(--tint); }
.cat-card.is-extra { display: none; }
.cat-head { display: flex; align-items: center; gap: 14px; }
.cat-emoji { width: 52px; height: 52px; border-radius: 14px; background: var(--tint); display: grid; place-items: center; font-size: 1.7rem; border: 2px solid var(--ink); flex: none; }
.cat-head h3 { font: 800 1.25rem/1.15 var(--display); letter-spacing: -0.01em; }
.meta { font: 500 .82rem var(--display); color: var(--ink-soft); }
.cat-card ul { list-style: none; display: grid; gap: 8px; flex: 1; }
.cat-card li a { display: block; padding: 8px 12px; background: var(--paper); border-radius: 10px; font: 600 .95rem/1.3 var(--display); }
.cat-card li a:hover { background: var(--highlight); }

/* Post cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.post:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.post .thumb { height: 150px; display: grid; place-items: center; background: var(--tint, var(--mint)); border-bottom: 2px solid var(--ink); overflow: hidden; }
.post .thumb .emoji { font-size: 3.4rem; }
.post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post h3 { font: 700 1.2rem/1.25 var(--display); letter-spacing: -0.01em; }
.post h3 a:hover { text-decoration: underline; text-decoration-color: var(--highlight); text-decoration-thickness: 3px; }
.post p { font-size: .95rem; color: var(--ink-soft); }
.empty { display: none; padding: 30px; text-align: center; background: var(--card); border: 2px dashed var(--ink-soft); border-radius: 16px; font: 500 1.05rem var(--display); }
.topic-section { margin-bottom: 56px; scroll-margin-top: 90px; }
.topic-section:target .section-title { background: linear-gradient(transparent 60%, var(--highlight) 60%); display: inline-block; }

/* Article page */
.article { max-width: 760px; padding: 48px 0 24px; }
.back { font: 700 .95rem var(--display); border-bottom: 3px solid var(--highlight); }
.back:hover { border-bottom-color: var(--blue); }
.article h1 { font: 800 clamp(2rem, 6vw, 3.3rem)/1.08 var(--display); letter-spacing: -0.03em; margin: 22px 0 14px; }
.article-meta { font: 500 .92rem var(--display); color: var(--ink-soft); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.cover { width: 100%; height: auto; border: 2px solid var(--ink); border-radius: 18px; margin-bottom: 30px; box-shadow: 6px 6px 0 var(--ink); }
.prose { font-size: 1.1rem; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: clamp(20px, 4vw, 40px); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 800 1.6rem/1.2 var(--display); letter-spacing: -0.02em; margin-top: 1.6em; }
.prose h3 { font: 700 1.25rem/1.25 var(--display); margin-top: 1.4em; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; border: 2px solid var(--ink); display: block; }
.prose blockquote { border-left: 6px solid var(--highlight); padding: 4px 0 4px 18px; color: var(--ink-soft); font-style: italic; }
.prose code { background: var(--paper); padding: 2px 6px; border-radius: 6px; font-size: .92em; }
.prose pre { background: var(--ink); color: #fff; padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.related { margin-top: 56px; }

/* Newsletter */
.news { margin: 70px 0; background: var(--ink); color: #fff; border-radius: 24px; padding: 48px 34px; text-align: center; }
.news h2 { font: 800 clamp(1.7rem, 4vw, 2.4rem) var(--display); letter-spacing: -0.02em; }
.news p { margin: 10px auto 24px; max-width: 46ch; color: #c9d3ec; }
.news form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.news input { padding: 14px 18px; min-width: min(300px, 100%); border-radius: 12px; border: 2px solid #fff; font: 500 1rem var(--display); background: #fff; color: var(--ink); }
.news button { padding: 14px 24px; border-radius: 12px; border: 0; cursor: pointer; background: var(--highlight); color: var(--ink); font: 800 1rem var(--display); }
.news button:hover { background: #ffcb1f; }
.thanks { display: none; color: var(--highlight) !important; font: 700 1.05rem var(--display); }

/* Footer */
footer { border-top: 2px solid var(--ink); background: var(--paper); padding: 32px 0; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; font: 500 .92rem var(--display); color: var(--ink-soft); }
.foot ul { list-style: none; display: flex; gap: 18px; }
.foot a:hover { color: var(--blue); }

@media (max-width: 900px) {
  .grid, .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; }
  nav { display: none; }
}
@media (max-width: 580px) {
  .grid, .cat-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 52px; }
  .brand-domain { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .post { transition: none; }
}
