:root {
  --brand-color: #32B444;
  --accent-color: #32B444;
  --darkest-color: #000000;
  --dark-color: #1E1E1E;
  --mid-color: #71796D;
  --light-color: #A8B0A3;
  --lightest-color: #FFFFFF;

  /* Light mode semantic mappings */
  --primary: var(--brand-color);
  --primary-dark: #2a8f37;

  /* Button-specific colors for better accessibility */
  --button-primary: #008a15;
  --button-primary-dark: #006d11;

  --text: var(--darkest-color);
  --text-light: var(--dark-color);
  --border: var(--light-color);
  --bg: var(--lightest-color);
  --bg-light: #f8f9fa;
}

/* Dark mode color overrides */
[data-theme="dark"] {
  --text: var(--lightest-color);
  --text-light: var(--light-color);
  --border: var(--dark-color);
  --bg: var(--darkest-color);
  --bg-light: var(--dark-color);
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  padding: 0;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Bootstrap-like utility classes for footer */
.d-flex {
  display: flex !important;
}

.justify-content-center {
  justify-content: center !important;
}

.mx-2 {
  margin-left: 0.5rem !important;
  margin-right: 0.5rem !important;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

header h1 {
  margin: 0;
}

header h1 a {
  text-decoration: none;
  color: var(--primary);
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  color: var(--primary);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background: var(--bg-light);
  border-color: var(--primary);
}

/* SVG Icons */
.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: inline-block;
  transition: fill 0.2s ease;
}

/* Logo styling */
.logo {
  height: 48px;
  width: 128px;
  display: block;
}

.logo-light {
  display: block;
}

.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: block;
}

main {
  padding: 2rem 0;
  flex: 1;
}

footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text);
}

.footer-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Social Media Icons */
.social-icon {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border);
}

.social-icon:hover {
  color: var(--primary);
  background: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-icon i {
  transition: color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.3;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

code {
  background: var(--bg-light);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: #2d2d2d !important;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

pre code {
  background: none !important;
  padding: 0;
  color: #f8f8f2 !important;
}

/* Basic code block styling before Prism loads */
pre {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: var(--bg-light);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

/* Remove background from code inside pre (Prism will handle this) */
pre code {
  background: none;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

.post-meta {
  color: var(--text);
  font-size: 0.9rem;
  margin: 1rem 0;
}

.post-tags {
  margin: 1rem 0;
}

.tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.85rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  font-weight: 500;
}

.tag:hover {
  background: var(--primary-dark);
  color: white;
}

/* Hamburger menu styles */
.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1001;
}

.hamburger-menu .line {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger-menu.active .line:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-menu.active .line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .line:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  z-index: 1000;
  padding: 80px 2rem 2rem;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu .nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
  width: 100%;
}

.mobile-menu .nav-links a {
  font-size: 1.2rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  width: 100%;
  display: block;
}

.mobile-menu .theme-toggle {
  margin-top: 1rem;
}

/* Post Styles */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.post-header h1 {
  margin: 0 0 1rem 0;
  font-size: 2.5rem;
  line-height: 1.2;
}

.post-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  line-height: 1.4;
  margin: 0 0 1.5rem 0;
  font-weight: 400;
}

.post-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

.post-series {
  background: var(--bg-light);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.post-series p {
  margin: 0;
  font-style: italic;
}

.post-cover {
  width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.7;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content img {
  border-radius: 4px;
  margin: 1.5rem 0;
}

.post-content pre {
  margin: 1.5rem 0;
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  background: var(--bg-light);
  padding: 1rem 1rem 1rem 2rem;
  border-radius: 0 4px 4px 0;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-series-nav {
  margin-top: 1rem;
  text-align: center;
}

.post-series-nav a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--bg-light);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
}

.post-series-nav a:hover {
  background: var(--primary);
  color: white;
}

/* Post list styles - prevent layout shifts */
.post-list {
  contain: layout;
}

.post-preview {
  contain: layout;
  margin-bottom: 2rem;
}

.post-preview-image {
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border-radius: 4px;
}

.post-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .header-content {
    justify-content: space-between;
    align-items: center;
  }

  .header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .header-brand h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.2rem;
  }

  .hamburger-menu {
    display: flex;
  }

  nav {
    display: none;
  }

  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  .post-header h1 {
    font-size: 2rem;
  }
  
  .post-content {
    font-size: 1rem;
  }
  
  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Subscribe button styles */
.subscribe-section {
  text-align: center;
  margin: 2rem 0;
}

.subscribe-button {
  display: inline-block;
  background: var(--button-primary);
  color: var(--lightest-color);
  text-decoration: none;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  border: 2px solid var(--button-primary);
}

.subscribe-button:hover {
  background: var(--button-primary-dark);
  border-color: var(--button-primary-dark);
  color: var(--lightest-color);
}

/* Home page subtitle styling */
.home-subtitle {
  font-size: 0.8em;
  font-weight: normal;
  opacity: 0.8;
}

/* About page styles */
.about-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.about-image {
  flex-shrink: 0;
  width: 200px;
}

.about-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.about-text {
  flex: 1;
}

.nuclear-quote {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Mobile responsiveness for about page */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  
  .about-image {
    width: 100%;
    max-width: 300px;
    align-self: center;
  }
  
  .nuclear-quote {
    font-size: 1.1rem;
  }
}

/* Remove background from Prism token elements */
.token.tag,
.token.attr-name,
.token.attr-value,
.token.punctuation,
.token.operator,
.token.entity,
.token.url,
.token.language-css,
.token.style {
  background: transparent !important;
}