:root {
  color-scheme: light;
  --background: #f7f3ea;
  --foreground: #1f2a24;
  --muted: #66756c;
  --primary: #176b5b;
  --surface: #fffaf0;
  --border: #dfd4bd;
  --accent: #f0d47d;
  --logo-surface: #fffaf0;
  font-family:
    Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --background: #111817;
    --foreground: #f1eee5;
    --muted: #aab6ae;
    --primary: #69d2bd;
    --surface: #182320;
    --border: #31433d;
    --accent: #e2be5d;
    --logo-surface: #f8f3e8;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111817;
  --foreground: #f1eee5;
  --muted: #aab6ae;
  --primary: #69d2bd;
  --surface: #182320;
  --border: #31433d;
  --accent: #e2be5d;
  --logo-surface: #f8f3e8;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
}

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

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--logo-surface);
}

.brand-mark img {
  width: 26px;
  height: 26px;
}

.appearance-control {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.appearance-option {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.appearance-option[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary);
}

.appearance-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.appearance-option svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.site-footer a:hover,
.post-card a:hover,
.back-link:hover {
  color: var(--primary);
}

.blog-hero,
.post-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 72px 20px 42px;
  text-align: center;
}

.eyebrow,
.back-link {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  padding: 7px 11px;
  text-transform: uppercase;
}

h1 {
  margin: 18px auto 0;
  max-width: 820px;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  font-weight: 900;
  line-height: 1.05;
}

.blog-hero p,
.post-header p {
  max-width: 760px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.8;
}

.posts-list {
  display: grid;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 20px 72px;
  gap: 16px;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
}

.post-card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
}

.post-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.post-card-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.post-card-meta {
  justify-content: flex-start;
}

.post-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.post-content {
  border-top: 1px solid var(--border);
  padding-top: 34px;
}

.post-content h2 {
  margin: 36px 0 12px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.2;
}

.post-content p,
.post-content li {
  color: var(--foreground);
  font-size: 1.04rem;
  line-height: 1.85;
}

.post-content p {
  margin: 18px 0;
}

.post-content ul,
.post-content ol {
  padding-left: 24px;
}

.post-content a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  align-items: flex-start;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer strong {
  color: var(--foreground);
}

.site-footer p {
  max-width: 420px;
  margin: 8px 0 0;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    align-items: center;
    flex-direction: row;
  }

  .blog-hero,
  .post-header {
    padding-top: 48px;
    text-align: left;
  }

  .post-meta {
    justify-content: flex-start;
  }
}
