/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e5e5;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
  --section-padding: 100px 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

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

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.hero .tagline {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

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

/* ===== Section Common ===== */
section {
  padding: var(--section-padding);
}

section h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 3rem;
  text-align: center;
}

/* ===== About Section ===== */
.about {
  background: var(--color-surface);
}

.about-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ===== Projects Section ===== */
.projects {
  background: var(--color-bg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.project-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.project-card p {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.btn-small {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn-small:hover {
  background: var(--color-accent-hover);
}

.btn-small.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-small.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ===== Skills Section ===== */
.skills {
  background: var(--color-surface);
}

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

.skill-category {
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.skill-category h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}

.skill-category ul {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-category li {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* ===== Resume Section ===== */
.resume {
  background: var(--color-bg);
}

.timeline {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  transform: translateX(-5px);
}

.timeline-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.timeline-date {
  display: block;
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
}

.timeline-item p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.resume-download {
  text-align: center;
  margin-top: 3rem;
}

/* ===== Contact Section ===== */
.contact {
  background: var(--color-surface);
  text-align: center;
}

.contact > .container > p {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.contact-item:hover {
  color: var(--color-accent);
}

.contact-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== View All Button ===== */
.view-all-wrapper {
  text-align: center;
  margin-top: 3rem;
}

/* ===== All Projects Section ===== */
.all-projects {
  padding: var(--section-padding);
  background: var(--color-surface);
}

.all-projects-intro {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.project-group {
  margin-bottom: 3.5rem;
}

.project-group:last-child {
  margin-bottom: 0;
}

.project-group h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.group-description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.project-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-link:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.project-link-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
}

.project-link-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ===== Footer ===== */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root {
    --section-padding: 70px 0;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
  }

  .nav-links.open {
    right: 0;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .contact-links {
    flex-direction: column;
    gap: 2rem;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline-item::before {
    left: -2rem;
  }

  .project-list {
    grid-template-columns: 1fr;
  }

  .all-projects-intro {
    margin-bottom: 2rem;
  }

  .project-group {
    margin-bottom: 2.5rem;
  }
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
