:root {
  color-scheme: light;
  --bg: #fcfcfc;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --border: rgba(24, 21, 18, 0.1);
  --text: #181512;
  --muted: #625c53;
  --accent: #181512;
  --button-bg: rgba(255, 255, 255, 0.96);
  --button-hover: rgba(246, 246, 246, 0.98);
  --shadow: 0 16px 40px rgba(29, 23, 13, 0.05);
  --radius: 24px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --panel: rgba(24, 24, 24, 0.98);
  --panel-strong: rgba(28, 28, 28, 0.99);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f3efe5;
  --muted: #b8b1a5;
  --accent: #f3efe5;
  --button-bg: rgba(30, 30, 30, 0.98);
  --button-hover: rgba(38, 38, 38, 0.98);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

a { color: inherit; }

.page-shell {
  width: min(100%, 68rem);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.page-header__row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  background: var(--button-hover);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle__icon {
  font-size: 1rem;
  line-height: 1;
}

.page-title {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.page-description {
  margin: 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 2;
}

.posts {
  display: grid;
  gap: 1.5rem;
  padding-top: 2.5rem;
}

.post {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.35rem);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 2rem 1.25rem;
}

.post-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-category {
  display: inline-flex;
  margin-top: 1rem;
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  font-weight: 700;
}

.post-title {
  margin: 1.25rem 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.post-summary {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 2;
}

.post-content {
  margin-top: 2rem;
  max-width: 46rem;
  font-size: 1rem;
  line-height: 2;
}

.post-content > :first-child { margin-top: 0; }
.post-content > :last-child { margin-bottom: 0; }
.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content hr {
  margin: 0 0 1.35rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.65rem; }
.post-content h3 { font-size: 1.35rem; }

.post-content ul,
.post-content ol {
  padding-left: 1.4rem;
}

.post-content li + li {
  margin-top: 0.5rem;
}

.post-content blockquote {
  border-left: 3px solid rgba(24, 21, 18, 0.2);
  padding-left: 1rem;
  color: var(--muted);
}

.post-content img,
.post-content video,
.post-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 1rem;
}

.post-content a {
  text-underline-offset: 0.22em;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  max-width: 46rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(58, 47, 24, 0.12);
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state {
  border: 1px dashed var(--border);
  background: var(--panel);
  padding: 2rem 1.5rem;
  color: var(--muted);
  line-height: 1.8;
}

@media (min-width: 640px) {
  .page-shell { padding: 2rem 1.5rem 4rem; }
  .post { padding: 2.5rem 2rem; }
  .post-content,
  .post-summary,
  .page-description {
    font-size: 1.05rem;
  }
}