:root {
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-alt: #ecf1e7;
  --ink: #0f1720;
  --muted: #4b5565;
  --border: rgba(15, 23, 32, 0.14);
  --accent: #0e6c60;
  --accent-strong: #0b564d;
  --max: 1120px;
  --radius: 18px;
  --shadow: 0 18px 48px rgba(16, 34, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  color: var(--ink);
  font-family: Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 18% 9%, #eef8ef 0%, #f6f7f3 36%, #f4f4ef 100%);
}

main {
  flex: 1 0 auto;
}

a {
  color: inherit;
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.mesh {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.35;
}

.mesh--top {
  width: 360px;
  height: 360px;
  right: -140px;
  top: -120px;
  background: #89cfbf;
}

.mesh--bottom {
  width: 320px;
  height: 320px;
  left: -130px;
  bottom: -120px;
  background: #d5d7a2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(246, 247, 243, 0.8);
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: Newsreader, Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Sora, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.button-link,
.button,
.action-button {
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 0.6rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}

.button-link:hover,
.button:hover,
.action-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.action-button {
  font-size: 0.86rem;
  padding: 0.45rem 0.85rem;
}

.action-button--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.action-button--ghost:hover {
  background: var(--surface-alt);
}

.hero {
  padding: 4rem 0 2rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: Newsreader, Georgia, serif;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.hero h1 {
  margin: 0.35rem 0 1rem;
  font-size: clamp(2.15rem, 5vw, 4.1rem);
  max-width: 18ch;
}

.lede {
  margin: 0;
  max-width: 66ch;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.link {
  text-decoration: none;
  font-weight: 700;
}

.link:hover {
  text-decoration: underline;
}

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0.5rem 0;
  font-size: clamp(1.25rem, 2.3vw, 2rem);
}

.panel p {
  margin: 0;
  color: var(--muted);
}

.preview {
  margin-bottom: 3rem;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.card-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.entry-card,
.library-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.entry-card h3,
.library-card h2 {
  margin: 0.35rem 0 0.45rem;
  font-size: 1.3rem;
}

.entry-card p,
.library-card p {
  margin: 0;
  color: var(--muted);
}

.entry-type {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-head {
  padding: 2.6rem 0 1.3rem;
}

.page-head h1 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
}

.entry-meta {
  margin: 0.25rem 0 0.65rem;
  color: var(--muted);
  font-weight: 500;
}

.search-controls {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.8rem;
}

.results-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

#library-search {
  width: min(760px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  padding: 0.72rem 0.9rem;
}

.chip-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  padding: 0.3rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover,
.chip.is-active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 3rem;
}

.library-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

.entry-desc {
  margin-top: 0.35rem;
}

.action-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-row--wide {
  margin-top: 1.1rem;
}

.empty-state {
  padding-bottom: 2.5rem;
  color: var(--muted);
}

.is-hidden {
  display: none;
}

.prose {
  max-width: 76ch;
  padding-bottom: 3rem;
}

.reader-prose {
  max-width: min(92ch, 100%);
}

.reader-content {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.2vw, 2.1rem);
}

.reader-content > :first-child {
  margin-top: 0;
}

.reader-content > :last-child {
  margin-bottom: 0;
}

.reader-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.reader-content blockquote {
  margin: 1.2rem 0;
  padding: 0.4rem 0.9rem;
  border-left: 3px solid var(--accent);
  color: #334155;
  background: #f4f7f1;
}

.reader-content pre {
  overflow-x: auto;
  border-radius: 10px;
  padding: 0.9rem;
  background: #f0f4ef;
}

.reader-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.reader-status {
  margin: 0;
  color: var(--muted);
}

.prose p,
.prose li {
  color: #263140;
}

.prose h2,
.prose h3 {
  margin-top: 1.45rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 2rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-wrap p {
  margin: 0;
}

.footer-wrap a {
  text-decoration: none;
}

.footer-wrap a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 950px) {
  .card-grid,
  .library-grid,
  .panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-wrap {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.8rem 0;
    gap: 0.55rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
