:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --accent: #2563eb;
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
  --accent: #3b82f6;
  --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 0 1.25rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  max-width: 650px;
  margin-bottom: 3rem;
}

section { padding: 5rem 0; }
section.alt { background: var(--bg-alt); }

/* NAV */
nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-container {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.theme-toggle,
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

/* HERO */
header {
  padding: 6rem 0 4rem;
  text-align: center;
}

header h1 {
  font-size: 3.5rem;
  line-height: 1.1;
}

header p {
  color: var(--muted);
  max-width: 650px;
  margin: 1rem auto 0;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  align-items: center;
}

.about-photo img {
  width: 220px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.resume-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
}

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.project-card:hover { transform: translateY(-5px); }

.project-icon { font-size: 1.8rem; }

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

.project-tags span {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.project-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

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

.skill-card {
  background: var(--card);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.skill-card ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.about-text p {
  margin-bottom: 1.2rem;
}

.contact-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--card);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}

/* FOOTER */
.footer {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  text-align: center;
  padding: 2.5rem 0;
}

/* MOBILE */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  header h1 { font-size: 2.2rem; }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.5rem 0;
    display: none;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }

  .hamburger { display: block; }
}

/* ---------- Mobile Fixes ---------- */
@media (max-width: 768px) {

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .about-photo img {
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 auto;
    display: block;
  }

  .about-text {
    text-align: left;
    padding: 0 0.5rem;
  }

  section {
    padding: 3rem 0;
  }

  h2 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .projects-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .project-card,
  .skill-card,
  .contact-card {
    width: 100%;
  }

  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg);
    padding: 1.5rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }
}
