:root {
  color-scheme: light;
  background: #ffffff;
  color: #111111;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: 0.01em;
  background: #ffffff;
}

p {
  margin: 0 0 1.35rem;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page-shell {
  margin: 0 auto;
  padding: 36px 80px 80px;
}

.topbar,
.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid #d4d4d4;
  border-radius: 16px;
  object-fit: cover;
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  color: #6b6b6b;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: clamp(2rem, 2.25vw, 3rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.6rem;
  line-height: 1.25;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  align-items: start;
  gap: 32px;
  padding: 48px 0 56px;
}

.hero-copy {
  max-width: 720px;
}

.hero-text,
.note-copy p,
.article-meta,
.related-panel p,
.meta-panel p,
.profile-card p,
.habit-card p,
.profile-meta span {
  color: #424242;
}

.meta-panel {
  border: 1px solid #e5e5e5;
  padding: 24px;
  border-radius: 24px;
  max-width: 340px;
}

.hero-meta.panel-section {
  border: 1px solid #e5e5e5;
  border-radius: 28px;
  padding: 18px;
  background: #ffffff;
  max-width: 340px;
}

.panel-section {
  border: 1px solid #e5e5e5;
  border-radius: 32px;
  padding: 28px;
  background: #ffffff;
  margin-bottom: 40px;
}

.panel-section .section-header {
  margin-bottom: 28px;
}

.meta-label {
  margin: 0 0 14px;
  font-weight: 600;
  color: #333333;
}

.hero-actions {
  margin-top: 32px;
}

.topic-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.topic-card,
.note-card,
.daily-card {
  display: block;
  border: 1px solid #e9e9e9;
  border-radius: 24px;
  padding: 24px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.note-card:hover,
.daily-card:hover {
  border-color: #c7c7c7;
  background-color: #f8f8f8;
}

.topic-card h4,
.note-card h4,
.daily-card h4 {
  margin: 12px 0 10px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.topic-card p,
.note-card p,
.daily-card p {
  margin: 0;
  color: #4a4a4a;
}

.notes-grid,
.daily-grid,
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.link-card {
  display: block;
  border: 1px solid #e9e9e9;
  border-radius: 24px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.link-card:hover {
  border-color: #c7c7c7;
  background: #f8f8f8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #ffffff;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  color: #111111;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  border-color: #8f8f8f;
  background-color: #f7f7f7;
}

.article-hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 28px;
  align-items: start;
  margin-bottom: 32px;
}

.article-intro h2 {
  font-size: clamp(1.7rem, 2vw, 2.3rem);
  line-height: 1.15;
  margin: 18px 0 16px;
}

.article-badge-panel {
  display: flex;
  align-items: flex-end;
}

.article-frame {
  border: 1px solid #e5e5e5;
  border-radius: 32px;
  padding: 32px;
  background: #ffffff;
}

.article-card {
  display: block;
  border: 1px solid #e9e9e9;
  border-radius: 28px;
  padding: 26px;
  background: #ffffff;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  border-color: #c6c6c6;
  transform: translateY(-1px);
}

.article-card-title {
  margin: 18px 0 10px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.article-card-summary {
  margin: 0;
  color: #505050;
}

.article-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  font-size: 0.95rem;
  color: #6b6b6b;
}

.nav-links a {
  color: #4f4f4f;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #111111;
}

.profile-section {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.profile-card,
.habit-card,
.meta-panel,
.article-card {
  background: #ffffff;
}

.profile-card {
  padding: 32px;
  border: 1px solid #e9e9e9;
  border-radius: 28px;
}

.profile-card h3 {
  margin: 16px 0 14px;
  font-size: 1.65rem;
  line-height: 1.1;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.profile-meta span {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  font-size: 0.9rem;
}

.habits-panel {
  padding: 8px 0;
}

.habits-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.habit-card {
  padding: 26px;
  border: 1px solid #e9e9e9;
  border-radius: 24px;
}

.habit-card h4 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.site-footer {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid #e8e8e8;
  color: #6b6b6b;
  font-size: 0.92rem;
}

.article-footer {
  padding-top: 32px;
}

.empty-state {
  color: #6b6b6b;
  padding: 48px 28px;
  border: 1px dashed #d9d9d9;
  border-radius: 24px;
  text-align: center;
}

.wiki-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 40px;
}

.wiki-sidebar {
  position: sticky;
  top: 28px;
}

.wiki-nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.wiki-nav a {
  display: inline-flex;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #e5e5e5;
  color: #4f4f4f;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.wiki-nav a:hover {
  border-color: #c8c8c8;
  background: #f7f7f7;
  color: #111111;
}

.wiki-content .panel-section {
  margin-bottom: 32px;
}

.wiki-content ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #424242;
}

.wiki-content ul li {
  margin-bottom: 0.75rem;
}

.literature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.literature-card {
  border: 1px solid #e9e9e9;
  border-radius: 24px;
  padding: 24px;
  background: #ffffff;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.literature-card:hover {
  border-color: #c7c7c7;
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f8f8f8;
  color: #666666;
}

.literature-card h4 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.literature-card p {
  margin: 0 0 20px;
  color: #4a4a4a;
  line-height: 1.5;
}

.card-actions {
  margin-top: auto;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  color: #111111;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: #ffffff;
}

.primary-button:hover {
  border-color: #8f8f8f;
  background: #f7f7f7;
  transform: translateY(-1px);
}

.primary-button svg {
  width: 16px;
  height: 16px;
}

.daily-posts-section {
  margin-bottom: 40px;
}

.posts-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stats-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111111;
}

.stats-label {
  font-size: 0.85rem;
  color: #6b6b6b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.daily-posts-container {
  margin-top: 32px;
}

.daily-posts-grid {
  display: grid;
  gap: 24px;
}

.daily-post-card {
  border: 1px solid #e9e9e9;
  border-radius: 24px;
  padding: 28px;
  background: #ffffff;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.daily-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.daily-post-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-date {
  font-size: 0.9rem;
  color: #6b6b6b;
}

.daily-reading {
  font-size: 0.85rem;
  color: #9a9a9a;
}

.daily-post-type {
  margin-left: auto;
}

.type-badge {
  display: inline-flex;
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #666666;
  background: #f9f9f9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.daily-post-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #111111;
}

.daily-post-summary {
  margin: 0 0 20px;
  color: #4a4a4a;
  line-height: 1.6;
}

.daily-post-actions {
  margin-top: auto;
}

.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  color: #111111;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.read-more-link:hover {
  border-color: #8f8f8f;
  background: #f7f7f7;
  transform: translateY(-1px);
}

.read-more-link svg {
  width: 14px;
  height: 14px;
}

.empty-daily {
  text-align: center;
  padding: 60px 20px;
  color: #6b6b6b;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5f5f5;
  color: #9a9a9a;
}

.empty-icon svg {
  width: 32px;
  height: 32px;
}

.empty-daily h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: #111111;
}

.empty-daily p {
  margin: 0;
  font-size: 0.95rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  color: #4f4f4f;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pill:hover,
.pill.active {
  border-color: #8f8f8f;
  color: #111111;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid #e5e5e5;
  border-radius: 24px;
  min-height: 250px;
}

.article-card:hover {
  border-color: #c7c7c7;
}

.article-card-title {
  margin: 0;
  font-size: 1.35rem;
}

.article-card-summary {
  margin: 0;
  color: #4a4a4a;
  flex: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6c6c6c;
  font-size: 0.95rem;
}

.note-section {
  padding-top: 56px;
}

.note-copy {
  max-width: 680px;
}

.article-actions {
  display: flex;
  gap: 12px;
}

.icon-link,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 1px solid #d7d7d7;
  border-radius: 50%;
  color: #111;
  background: #f6f6f6;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.icon-link:hover,
.icon-button:hover {
  border-color: #9a9a9a;
  background: #ededed;
  transform: translateY(-1px);
}

.icon-link svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.article-shell {
  padding-top: 28px;
}

.article-content {
  padding: 44px 0;
}

.article-body {
  display: grid;
  gap: 24px;
  color: #2e2e2e;
}

.article-body p {
  margin: 0;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: #6a6a6a;
  font-size: 0.95rem;
}

.related-panel {
  border: 1px solid #e5e5e5;
  border-radius: 28px;
  padding: 32px 28px 28px;
  margin-top: 32px;
  background: #fafafa;
  min-width: 260px;
}

.related-panel p {
  margin-bottom: 20px;
}

.related-item {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid #f0f0f0;
  color: inherit;
}

.related-item:last-child {
  border-bottom: none;
}

.related-item-title {
  margin: 0;
  font-size: 1rem;
}

.related-item-meta {
  margin: 8px 0 0;
  color: #6b6b6b;
  font-size: 0.92rem;
}

@media (max-width: 840px) {
  .topic-section,
  .profile-section,
  .notes-grid,
  .daily-grid,
  .links-grid,
  .literature-grid,
  .hero,
  .article-hero {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .wiki-layout {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    position: static;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 16px 16px 48px;
  }

  .topbar,
  .article-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 20px;
  }

  .brand {
    gap: 12px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }

  h1 {
    font-size: 1.45rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  .nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 6px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
  }

  .panel-section {
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
  }

  .section-header {
    gap: 12px;
    margin-bottom: 20px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .pill {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.85rem;
    text-align: center;
    cursor: pointer;
  }

  .article-card {
    border-radius: 16px;
    padding: 18px;
    min-height: auto;
    gap: 14px;
  }

  .article-card-title {
    font-size: 1.05rem;
  }

  .article-card-summary {
    font-size: 0.9rem;
  }

  .article-card-footer {
    font-size: 0.85rem;
  }

  .topic-card,
  .note-card,
  .daily-card {
    border-radius: 16px;
    padding: 18px;
  }

  .topic-card h4,
  .note-card h4,
  .daily-card h4 {
    font-size: 1rem;
    margin: 10px 0 8px;
  }

  .link-card {
    border-radius: 16px;
    padding: 18px;
  }

  .hero {
    padding: 20px 0 28px;
    gap: 20px;
  }

  .hero-copy h2 {
    font-size: 1.25rem;
  }

  .hero-text {
    font-size: 0.9rem;
  }

  .hero-meta,
  .meta-panel {
    max-width: 100%;
  }

  .profile-section {
    gap: 16px;
  }

  .profile-card {
    padding: 20px;
  }

  .profile-card h3 {
    font-size: 1.3rem;
  }

  .profile-meta span {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .habit-card {
    padding: 18px;
  }

  .site-footer {
    font-size: 0.8rem;
    padding-top: 24px;
    margin-top: 24px;
  }
}
