/* Base: Sci-Fi Core */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Primary Color Palette */
:root {
  /* Sci-Fi Default (Dark Mode is the primary style) */
  --bg-color: #0d1117; /* Very Dark Space/Code Background */
  --text-color: #c9d1d9; /* Light Grey Text */
  --accent-color: #00ff7f; /* Neon Green/Cyan (Primary Glow) */
  --secondary-color: #4a4f56; /* Subtle Border/Separator Grey */
  --mono-font: 'Inconsolata', 'Courier New', monospace;
  --serif-font: Georgia, serif;
}

/* Light/Classic Mode for accessibility (Optional, but kept the structure) */
body.light {
  --bg-color: #ffffff;
  --text-color: #111111;
  --accent-color: #0077cc;
  --secondary-color: #ddd;
}

/* Default Body Style (Starts Dark) */
body {
  font-family: var(--mono-font); /* Monospace for Digital Look */
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease; /* Smooth toggle */
}

/* Sci-Fi Text Enhancements */
h1, h2, h3, header .logo {
  font-family: var(--serif-font); /* Contrast with the monospace body */
  letter-spacing: 0.1em; /* Digital separation */
  color: var(--accent-color); /* Highlight with the neon color */
  text-shadow: 0 0 5px rgba(0, 255, 127, 0.5); /* Subtle glow effect */
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--text-color); /* Invert color on hover for feedback */
}

/* Header: Sleek Console Bar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  /* Use a subtle box shadow instead of a harsh border for depth */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background: #161b22; /* Slightly different dark shade */
  border-bottom: 2px solid var(--accent-color); /* Strong accent line */
}

header .logo {
  font-size: 2.2rem;
  font-weight: normal; /* Less bold, more refined */
}

header nav {
  display: flex;
  gap: 2rem;
}

header nav a {
  text-decoration: none;
  color: var(--text-color);
  font-family: var(--mono-font);
  font-weight: normal;
  transition: color 0.3s;
}

header nav a:hover {
  color: var(--accent-color); /* Highlight on hover */
  text-shadow: 0 0 3px var(--accent-color);
}

/* Dark Mode Toggle Button */
#dark-mode {
  background: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  padding: 8px 16px;
  border-radius: 2px; /* Sharp edges */
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--mono-font);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}


/* Featured Article: Hero Section with Text on Image */

.featured {
  position: relative; /* Essential for positioning children absolutely */
  width: 100%;
  height: 60vh; /* Make the hero section a good height */
  overflow: hidden; /* Ensures image doesn't spill out */
  display: flex; /* Use flexbox to easily center content */
  align-items: center; /* Vertically center content */
  justify-content: center; /* Horizontally center content */
  text-align: center; /* Center text within its container */
  margin-top: 2rem;
  border-radius: 6px;
  border: 1px solid var(--accent-color);
  box-shadow: 0 0 20px rgba(0, 255, 127, 0.2);
}

.featured img {
  position: absolute; /* Position the image to cover the entire section */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the image covers the area without distortion */
  filter: grayscale(20%) brightness(0.7); /* Slightly grayscale and dim the image */
  z-index: 1; /* Place image behind content */
}

/* Optional: Overlay to further dim the image and help text readability */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* Semi-transparent dark overlay */
  z-index: 2; /* Place overlay between image and content */
}

.hero-content {
  position: relative; /* Keeps content above the image and overlay */
  z-index: 3;
  max-width: 800px; /* Limit content width for readability */
  padding: 2rem;
  /* Add a subtle background or text shadow for readability on busy images */
  background: rgba(13, 17, 23, 0.151); /* Semi-transparent dark background for text */
  border: 0px solid var(--secondary-color);
  border-radius: 4px;
}

.featured h2 {
  font-size: 3.2rem; /* Adjusted for image background */
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-color); /* Light text on dark overlay */
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8); /* Stronger shadow for readability */
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.75rem;
  display: inline-block; /* Makes border-bottom only as wide as text */
}

.featured p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-color);
  margin-bottom: 2rem;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); /* Text shadow for contrast */
}

.featured a {
  display: inline-block;
  padding: 12px 25px; /* Slightly larger button */
  border: 2px solid var(--accent-color); /* Stronger border */
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.0rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.3); /* Slight background to make button pop */
}

.featured a:hover {
  background: var(--accent-color);
  color: var(--bg-color);
  text-decoration: none;
  box-shadow: 0 0 15px rgba(0, 255, 127, 0.8), inset 0 0 10px rgba(0, 255, 127, 0.5); /* Inner glow */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .featured {
    height: 50vh; /* Adjust height for mobile */
  }

  .featured h2 {
    font-size: 2.2rem;
  }

  .featured p {
    font-size: 0.95rem;
  }

  .hero-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .featured h2 {
    font-size: 1.8rem;
  }
  .featured p {
      display: none; /* Hide paragraph on very small screens if needed */
  }
}


#dark-mode:hover {
  background: var(--accent-color);
  color: #111;
  border-color: #111;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1rem;
}

/* Featured Article: Terminal Window Style */
.featured {
  padding: 2rem;
  border: 1px solid var(--secondary-color);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4); /* Semi-transparent panel */
}

.featured img {
  width: 100%;
  border-radius: 2px;
  margin-bottom: 1.5rem;
  /* Image subtle border and desaturation */
  border: 1px solid var(--accent-color);
  filter: grayscale(20%);
}

.featured h2 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.featured p {
  font-family: var(--mono-font);
  color: var(--text-color); /* Use main text color */
  margin-bottom: 0.75rem;
}

/* Articles Grid: Data Blocks */
.articles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.article-card {
  padding: 1rem;
  border: 1px solid var(--secondary-color);
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s, background 0.3s;
}

.article-card:hover {
  border-color: var(--accent-color);
  background: rgba(0, 255, 127, 0.1);
}

.articles img {
  width: 100%;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.articles h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-color); /* H3s are less flashy than H2 */
}

.articles p {
  font-family: var(--mono-font);
  color: var(--text-color);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.articles a {
  color: var(--accent-color);
  font-size: 0.9rem;
}

/* Footer: Console Prompt */
footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 4rem;
  font-family: var(--mono-font);
  color: var(--secondary-color);
  border-top: 1px solid var(--accent-color);
  background: #161b22;
  text-shadow: 0 0 2px rgba(0, 255, 127, 0.5);
}

/* Light Mode Override (Optional Fallback) */
/* This section handles the original "dark mode" button when used to enter "light mode" */
body.light {
  background-color: var(--bg-color);
  color: var(--text-color);
}

body.light a {
  color: var(--accent-color);
}

body.light h1, body.light h2, body.light h3, body.light header .logo {
  color: var(--text-color);
  text-shadow: none;
}

body.light header {
  background-color: #fff;
  border-bottom: 1px solid var(--secondary-color);
}

body.light footer {
  background-color: #f7f7f7;
  border-top: 1px solid var(--secondary-color);
  color: #555;
  text-shadow: none;
}

body.light #dark-mode {
  background-color: #222;
  color: #fff;
  border-color: #222;
}


/* Responsive - No changes needed, structure is fine */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  header nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}