:root {
  --primary: #3420bc;
  --primary-hover: #27168d;
  --bg: #f4effb;
  --surface: #fffdf7;
  --text: #1c1640;
  --muted: #4f416e;
  --border: #dbd2eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 1rem;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 100;
}
.skip-link:focus { top: 0; }

.shell {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 2px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.site-header nav a:hover { color: var(--primary); }
@media (max-width: 640px) {
  .site-header nav { flex-wrap: nowrap; overflow-x: auto; gap: .85rem; width: 100%; padding-bottom: 2px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 90%, transparent); mask-image: linear-gradient(to right, #000 90%, transparent); }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; font-size: .95rem; }
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}

.prose { max-width: 650px; margin: 0 auto; }
.page-atmosphere { margin: 0 0 1.25rem; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); box-shadow: 4px 4px 0 var(--text); }
.page-atmosphere img { display: block; width: 100%; height: auto; object-fit: cover; max-height: 220px; }
.prose h1 { font-size: 2rem; margin-bottom: 1.5rem; }
article.prose h2 { font-size: 1.5rem; margin: 2rem 0 1rem; padding-top: 1.5rem; border-top: 2px solid var(--border); }
article.prose h2:first-of-type { border-top: 0; padding-top: 0; }
article.prose h3 { font-size: 1.05rem; margin: 1.5rem 0 .35rem; }
article.prose h3 + p { margin-bottom: 0; padding-bottom: .9rem; border-bottom: 1px dashed var(--border); }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.prose p { margin-bottom: 1rem; color: var(--text); }
.prose a { color: var(--primary); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.prose a:hover { color: var(--primary-hover); }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9375rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); }

.habit-pulse {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.habit-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}
.habit-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-weight: 500;
}
.habit-checklist input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.habit-pulse-note {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0;
}

.crumbs { margin-bottom: 1rem; font-size: 0.875rem; color: var(--muted); }
.crumbs a { color: var(--primary); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

footer { text-align: center; padding: 2rem 0; border-top: 2px solid var(--border); color: var(--muted); font-size: 0.875rem; }
.footer-nav { margin-top: 1rem; display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--primary); }
