:root {
  /* Light Theme Palette */
  --bg: #faf5ea;
  --bg-pattern: radial-gradient(#e6d8c3 1px, transparent 1px);
  --card-bg: #fffdfa;
  --text: #241a15;
  --text-muted: #66574f;
  --border: #2c1b14;

  /* Red Armchair & Retro Accents */
  --chair-red: #b92929;
  --chair-red-hover: #982020;
  --chair-red-light: #faeceb;
  --retro-gold: #ebb13a;
  --retro-gold-light: #fef7e6;

  /* Neobrutalist / Retro Shadows & Radii */
  --shadow-sm: 2px 2px 0 var(--border);
  --shadow-md: 3.5px 3.5px 0 var(--border);
  --radius-sm: 5px;
  --radius-md: 10px;

  /* Typography */
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", "Courier Prime", monospace;
  --content-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191513;
    --bg-pattern: radial-gradient(#2b2420 1px, transparent 1px);
    --card-bg: #231d1a;
    --text: #f4ede4;
    --text-muted: #ada197;
    --border: #3b302a;

    --chair-red: #e04848;
    --chair-red-hover: #f06464;
    --chair-red-light: #351c1b;
    --retro-gold: #f2b442;
    --retro-gold-light: #332715;

    --shadow-sm: 2px 2px 0 #0d0b09;
    --shadow-md: 3.5px 3.5px 0 #0d0b09;
  }
}

/* Base Reset & Typography */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15.5px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg);
  background-image: var(--bg-pattern);
  background-size: 18px 18px;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.62;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.site-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  flex: 1;
}

/* Header & Armchair */
.site-header {
  text-align: center;
  padding: 0.5rem 0 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px dashed var(--border);
}

.armchair-hero {
  display: inline-block;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.armchair-svg {
  width: 68px;
  height: 68px;
  display: block;
  margin: 0 auto;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(2.5px 2.5px 0 var(--border));
}

.armchair-hero:hover .armchair-svg {
  transform: scale(1.08) rotate(-2.5deg);
}

.site-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.site-title a {
  color: var(--chair-red);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-title a:hover {
  color: var(--chair-red-hover);
}

/* Post Cards Feed */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

.post-card:hover {
  transform: translate(-1.5px, -1.5px);
  box-shadow: var(--shadow-md);
  border-color: var(--chair-red);
}

.post-card-link {
  display: block;
  padding: 0.95rem 1.2rem;
  text-decoration: none;
  color: inherit;
}

.post-card-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--text);
  margin-bottom: 0.35rem;
  transition: color 0.15s ease;
}

.post-card:hover .post-card-title {
  color: var(--chair-red);
}

.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

/* Individual Post View */
.post-header {
  margin-bottom: 1.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px dashed var(--border);
}

.post-title {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-meta-tag {
  background: var(--chair-red-light);
  color: var(--chair-red);
  border: 1.5px solid var(--border);
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.72rem;
}

/* Post Content & Typography */
.post-content {
  font-size: 1.02rem;
  color: var(--text);
}

.post-content>*+* {
  margin-top: 0.95rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.4rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.post-content h2 {
  font-size: 1.35rem;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 0.2rem;
}

.post-content h3 {
  font-size: 1.15rem;
}

.post-content p {
  line-height: 1.65;
}

.post-content a {
  color: var(--chair-red);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.post-content a:hover {
  color: var(--chair-red-hover);
}

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

.post-content li {
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

.post-content hr {
  border: none;
  border-top: 2px dotted var(--border);
  margin: 1.75rem 0;
}

.post-content blockquote {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-left: 4.5px solid var(--retro-gold);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  box-shadow: var(--shadow-sm);
  font-style: italic;
  margin: 1rem 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 1rem 0;
}

.post-content pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.post-content th,
.post-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--retro-gold-light);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Post Navigation */
.post-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1.5px dashed var(--border);
}

.post-back-link {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--chair-red);
  text-decoration: none;
}

.post-back-link:hover {
  text-decoration: underline;
}

/* Raw HTML Helpers */
.callout-hot-take {
  background: var(--chair-red-light);
  border: 1.5px solid var(--border);
  border-left: 5px solid var(--chair-red);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.05rem;
  box-shadow: var(--shadow-sm);
  margin: 1rem 0;
}

.callout-hot-take::before {
  content: "ARMCHAIR TAKE";
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--chair-red);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.sticky-note {
  background: #fdf3a9;
  color: #2b2210;
  border: 1.5px solid var(--border);
  padding: 0.85rem 1.05rem;
  box-shadow: var(--shadow-sm);
  border-radius: 2px;
  transform: rotate(-1deg);
  margin: 1.25rem auto;
  font-size: 0.94rem;
}

@media (prefers-color-scheme: dark) {
  .sticky-note {
    background: #403615;
    color: #fdf3a9;
  }
}

details {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  box-shadow: var(--shadow-sm);
  margin: 0.9rem 0;
  font-size: 0.94rem;
}

summary {
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
}

details[open] summary {
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.35rem;
}

kbd {
  display: inline-block;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-bottom-width: 2.5px;
  border-radius: 4px;
  padding: 0.08em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 700;
}

/* Site Footer */
.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1.5px dashed var(--border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--chair-red);
}

/* Mobile */
@media (max-width: 600px) {
  .site-title {
    font-size: 1.9rem;
  }

  .armchair-svg {
    width: 60px;
    height: 60px;
  }

  .post-title {
    font-size: 1.6rem;
  }
}