:root {
  --color-primary: #dc2626; /* Vibrant Red */
  --color-secondary: #2563eb; /* True Blue */
  --color-bg: #ffffff;
  --color-bg-subtle: #f8fafc; /* Very light slate for contrast sections */
  --color-text: #0f172a; /* Deep slate, readable black */
  --color-text-muted: #475569;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --transition: all 0.3s ease;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
  padding-top: 80px; /* Offset for fixed navbar */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-text);
}

h1 { font-size: 3.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.75rem; }
p { margin-bottom: 1rem; color: var(--color-text-muted); font-size: 1.125rem; }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }

/* Layout container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Button variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(220, 38, 38, 0.39);
}

.btn-primary:hover {
  background-color: #b91c1c; /* Darker red */
  transform: translateY(-2px);
  color: white; /* Ensure text remains white */
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-secondary);
  border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
  background-color: var(--color-secondary);
  color: white;
  transform: translateY(-2px);
}

/* ====== COMPONENT: Navbar ====== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9); /* Slight transparency for glassmorphism */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 1000;
  height: 80px;
  display: flex;
  align-items: center;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-primary);
  transition: var(--transition);
}

nav a:hover, nav a.active {
  color: var(--color-text);
}

nav a:hover::after, nav a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
}

/* ====== COMPONENT: Footer ====== */
.site-footer {
  background-color: var(--color-bg-subtle);
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  color: var(--color-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.social-link:hover {
  background-color: var(--color-secondary);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li { margin-bottom: 0.5rem; }

.footer-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: var(--transition);
}

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

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Sections */
section {
  padding: 6rem 0;
}

.section-bg { background-color: var(--color-bg-subtle); }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-tag {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ======= HOME PAGE ======= */
.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(220,38,38,0.05) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  z-index: -1;
}

.hero-content { max-width: 800px; }
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}

.skill-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.skill-card:nth-child(even)::after {
  background: var(--color-primary);
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.skill-card:hover::after {
  transform: scaleX(1);
}

.skill-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--color-secondary);
}

.skill-card:nth-child(even) .skill-icon {
  color: var(--color-primary);
}

.skill-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.skill-card p {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
}

.project-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-img {
  width: 100%;
  height: 220px;
  background-color: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 3rem;
  position: relative;
}

.project-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: rgba(37,99,235,0.1);
  color: var(--color-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-links {
  margin-top: auto;
  padding-top: 1.5rem;
}

.project-links a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}

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

.project-links a::after {
  content: '→';
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.project-links a:hover::after {
  transform: translateX(4px);
}

/* Contact Form */
.contact-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  background-color: var(--color-bg-subtle);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-secondary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

/* About Page Specifics */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-image {
  background: linear-gradient(135deg, var(--color-bg-subtle) 0%, rgba(220,38,38,0.1) 100%);
  border-radius: var(--radius);
  height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.about-image::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100%;
  height: 100%;
  border: 4px solid var(--color-secondary);
  border-radius: var(--radius);
  z-index: -1;
}

.timeline {
  margin-top: 3rem;
  position: relative;
  border-left: 2px solid var(--color-bg-subtle);
  padding-left: 2rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -35px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 4px solid white;
}

.timeline-date {
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  
  .menu-toggle { display: block; }
  
  nav {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transform: translateY(-150%);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 999;
  }
  
  nav.active {
    transform: translateY(0);
    opacity: 1;
  }
  
  nav ul {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .hero-actions {
    flex-direction: column;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .about-image {
    height: 400px;
    margin-right: 20px;
  }
}
