/* Modern Design System - Project516 */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors - Indigo/Slate Palette */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #ec4899;

  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Layout */
  --sidebar-width: 260px;
  --content-max-width: 900px;

  /* Typography */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-sidebar: #1e293b;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    --border-color: #334155;

    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidenav {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidenav a {
  text-decoration: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.sidenav a:hover,
.sidenav a.active {
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  transform: translateX(5px);
}

/* Main Content Area */
.main {
  margin-left: var(--sidebar-width);
  padding: 3rem 2rem;
  max-width: calc(var(--content-max-width) + var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  /* Adding wrapper semantics if needed via CSS */
  width: 100%;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Section styling using DOM structure classes */
section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
  /* For animation */
  transform: translateY(20px);
  /* For animation */
  animation: none;
  /* Controlled by JS */
}

/* Animation class to be added by JS */
section.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Specific Sections */
.about-intro {
  border-top: 4px solid var(--primary);
}

/* Tech Badges */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge {
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  /* Pill shape */
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.badge:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  transform: scale(1.05);
  cursor: default;
}

/* List Styles */
.skills ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.skills ul li {
  padding: 0.5rem 0;
  border-bottom: none;
  display: flex;
  align-items: center;
}

.skills ul li:before {
  content: "→";
  color: var(--primary);
  margin-right: 0.75rem;
  font-weight: bold;
  font-family: var(--font-mono);
}

/* Blog & Projects specific styling (if they use standard tags) */
article {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

article h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

time {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Dynamic Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  width: 100%;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  text-decoration: none;
  /* because whole card might be a link or contain links */
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}

.project-card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.project-card p {
  font-size: 1rem;
  flex-grow: 1;
  /* Pushes footer down */
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  font-family: var(--font-mono);
}

.loading-message,
.error-message {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.error-message {
  color: var(--secondary);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-left: var(--sidebar-width);
  /* Align with main content */
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidenav {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    flex-direction: row;
    justify-content: space-around;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-right: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
  }

  @media (prefers-color-scheme: dark) {
    .sidenav {
      background: rgba(30, 41, 59, 0.9);
    }
  }

  .sidenav a {
    font-size: 0.9rem;
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.2rem;
  }

  .sidenav a:hover {
    transform: none;
  }

  .main {
    margin-left: 0;
    padding: 1.5rem 1rem;
    width: 100%;
    max-width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  footer {
    margin-left: 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}