/* Main Styles */
:root {
  --background-secondary: #1a1a1a;
  --border-color: rgba(255, 255, 255, .1);
  --text-primary: #fff;
  --primary-color: #4a9eff;
  --text-secondary: #aaa;
  --background-primary: #000;
  --background-hover: #e0e0e0;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-primary);
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

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

header nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

header nav a:hover, header nav a.selected {
    color: var(--text-primary);
}

/* Home Container */
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  margin-bottom: 6rem;
  min-height: 60vh;
}

.hero-content {
  flex: 1;
}

h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.1;
  background: linear-gradient(45deg, var(--primary-color, #4a9eff), #a685e2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--background-secondary, #f5f5f5);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s;
}

.theme-dark .social-btn {
  background: #2a2a2a;
}

.social-btn:hover {
  transform: translateY(-2px);
  background: var(--background-hover, #e0e0e0);
}

.theme-dark .social-btn:hover {
  background: #3a3a3a;
}

.hero-image-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
}

/* Blog Cards */
.recent-posts h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.blog-card {
  background-color: var(--background-secondary, #1a1a1a);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border-color, rgba(255, 255, 255, .1));
  position: relative;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px #0003;
}

.card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.card-title a {
  color: var(--text-primary, #fff);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--primary-color, #4a9eff);
}

.card-meta {
  margin-bottom: 1rem;
}

.publish-date {
  background-color: #ffffff1a;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--text-secondary, #aaa);
}

.card-description {
  color: var(--text-secondary, #ccc);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.read-post-btn {
  display: inline-block;
  background-color: var(--text-primary, #fff);
  color: var(--background-primary, #000);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  align-self: flex-start;
  transition: background-color 0.2s ease;
}

.read-post-btn:hover {
  background-color: var(--primary-color, #ddd);
}

.theme-dark .blog-card {
  background-color: #1a1a1a;
  border-color: #333;
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* Theme Toggle */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    background: var(--background-secondary);
}

.theme-toggle label {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.theme-toggle label:hover {
    color: var(--text-primary);
}

.theme-toggle input {
    display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-section {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
    margin-bottom: 4rem;
  }

  .social-links {
    justify-content: center;
  }

  h1 {
    font-size: 2.5rem;
  }
}
