:root {
  --bg: #0d0d0d;
  --text: #f2f2f2;
  --accent: #4da3ff;
  --card-bg: #111;
  --card-border: #222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease;
  scroll-behavior: smooth;
  overflow-x: hidden;
  position: relative;
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1000;
}

header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

header h1 a {
  color: var(--text);
  text-decoration: none;
}

nav a {
  margin-left: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: 0.3s;
  transform: translateX(-50%);
}

nav a:hover::after {
  width: 60%;
}

/* ===== SECTIONS ===== */
.section {
  padding: 64px 32px 32px 32px;
  max-width: 960px;
  margin: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  position: relative;
  z-index: 1;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  font-size: 32px;
  margin-bottom: 24px;
}

/* ===== HERO ===== */
.hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero h2 {
  font-size: 40px;
  margin: 0;
  animation: slideDown 0.6s ease;
}

.hero p {
  max-width: 600px;
  line-height: 1.6;
}

/* ===== PROJECTS GRID ===== */
.projects {
  display: grid;
  grid-template-columns: 1fr; /* Full width by default */
  gap: 16px;
}

@media (min-width: 600px) {
  .projects {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* ===== PROJECT CARD ===== */
.card, .project-detail {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  min-height: 180px; /* Make them rectangular */
}

.card:hover, .project-detail:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px #0008;
}

.project-detail h3 {
  margin: 0;
}

.project-detail p {
  margin: 0;
  line-height: 1.5;
}

.project-detail a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.project-detail a:hover {
  color: #88baff;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid #222;
  margin-top: 40px;
  font-size: 14px;
  color: #888;
  position: relative;
  z-index: 1; /* Make sure footer is above the star background */
}

/* ===== STAR BACKGROUND ===== */
#stars {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1; /* Send stars behind everything */
  background: var(--bg);
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== LINK COLOR FOR BODY ONLY ===== */
body a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s;
}

body a:hover {
  color: #88baff;
}
