:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f2f5;
  --text: #17191c;
  --muted: #6b7280;
  --border: #e1e4e8;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --code: #f4f4f5;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.07);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #15181d;
  --surface-soft: #1b1f25;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --border: #282d35;
  --accent: #a5b4fc;
  --accent-soft: #20233a;
  --code: #111318;
  --shadow: none;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}
button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner,
.footer-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.theme-toggle,
.button-link {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.theme-toggle:hover,
.button-link:hover {
  border-color: var(--accent);
}

.hero {
  padding: 5.5rem 0 3rem;
}
.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1,
.article-header h1,
.not-found h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.3rem, 7vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-copy,
.article-description {
  max-width: 650px;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 2rem;
}

.category-links a,
.post-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
  text-decoration: none;
}

.category-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.content-stack {
  padding-bottom: 4rem;
}
.category-section {
  scroll-margin-top: 90px;
  margin-bottom: 3.25rem;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.section-heading > span {
  color: var(--muted);
  font-size: 0.86rem;
}

.post-list {
  display: grid;
  gap: 0.8rem;
}
.post-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.post-card h3 {
  margin: 0;
  font-size: 1.03rem;
  letter-spacing: -0.02em;
}
.post-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.post-meta time {
  margin-right: 0.25rem;
}

.article-shell {
  max-width: 780px;
  padding: 4rem 0 5rem;
}
.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link:hover {
  color: var(--accent);
}
.article-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.article-header h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}
.article-meta {
  margin-top: 1.25rem;
}

.post-content {
  padding-top: 1.5rem;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 2.2rem 0 0.8rem;
}
.post-content h2 {
  font-size: 1.65rem;
}
.post-content h3 {
  font-size: 1.3rem;
}
.post-content p {
  margin: 0.8rem 0 1.1rem;
}
.post-content a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.post-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.post-content pre,
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.post-content code {
  padding: 0.15rem 0.35rem;
  border-radius: 5px;
  background: var(--code);
  font-size: 0.9em;
}
.post-content pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code);
}
.post-content pre code {
  padding: 0;
  background: transparent;
}
.post-content img {
  display: block;
  max-width: 100%;
  margin: 1.5rem auto;
  border-radius: 14px;
}
.post-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.post-content th,
.post-content td {
  min-width: 120px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.post-content th {
  background: var(--surface-soft);
}

.empty-state,
.not-found {
  padding: 4rem 0;
  color: var(--muted);
}
.not-found h1 {
  color: var(--text);
}
.not-found .button-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer a {
  color: var(--muted);
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .hero {
    padding-top: 4rem;
  }
  .article-shell {
    padding-top: 2.5rem;
  }
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 1rem;
  }
}

/* table of contents */

.table-of-contents {
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.table-of-contents h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents li {
  margin: 0.5rem 0;
}

.table-of-contents a {
  text-decoration: none;
  color: inherit;
}

.table-of-contents a:hover {
  text-decoration: underline;
}

.table-of-contents .toc-subheading {
  padding-left: 1.5rem;
  font-size: 0.95rem;
}


/* back to top button */

.back-to-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;

  width: 44px;
  height: 44px;

  border: none;
  border-radius: 50%;

  font-size: 1.3rem;
  cursor: pointer;

  opacity: 0;
  visibility: hidden;

  transform: translateY(10px);

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;

  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mantra-block {
  text-align: center;
  max-width: 850px;
  margin: 0 auto 2.5rem;
  padding: 1.5rem 2rem;
}

.mantra {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.8;
}

.mantra-meaning {
  margin: 0.5rem auto 0;
  max-width: 700px;
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.7;
}

.mantra-divider {
  width: 50px;
  height: 1px;
  margin: 1.25rem auto;
  background: currentColor;
  opacity: 0.2;
}