/* ===== CSS Variables & Theme ===== */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1e1e1e;
  --text-muted: #5a5a5a;
  --border: #e0dbcf;
  --accent: #6c5ce7;
  --accent-hover: #5a4bd1;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --font-main: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --transition: 0.3s ease;
}

[data-theme="dark"] {
  --bg: #121212;
  --surface: #1e1e1e;
  --text: #f0f0f0;
  --text-muted: #b0b0b0;
  --border: #2e2e2e;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;          /* prevent horizontal scroll on tiny screens */
}

/* ---- MAIN CONTAINER (the fix) ---- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ---- Navbar (unchanged visually, just kept) ---- */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.logo {
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}

.logo .mono {
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

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

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

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.theme-toggle:hover {
  background: var(--border);
}

/* ---- Hero (home page) ---- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 0;
  gap: 2rem;
}

.hero-content {
  flex: 1 1 500px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

.hero-content h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin: 1rem 0;
  font-weight: 700;
}

.hero-content h1 span {
  color: var(--accent);
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 450px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary, .btn-outline {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-outline {
  border: 2px solid var(--accent);
  color: var(--accent);
}

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

.hero-stats {
  display: flex;
  gap: 2rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---- Services Preview ---- */
.services-preview {
  padding: 3rem 0;
}

.services-preview h2,
.skills-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

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

.service-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

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

.service-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.service-card h3 {
  margin-bottom: 0.5rem;
}

/* ---- Page Header (used on about, resume, etc) ---- */
.page-header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
}

.page-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.5rem auto 0;
}

.section-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

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

.skill-item {
  margin-bottom: 1.5rem;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.skill-name {
  font-weight: 600;
}

.skill-percent {
  color: var(--accent);
  font-weight: 600;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 1s ease;
}

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

.tag {
  background: var(--border);
  color: var(--text-muted);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: background var(--transition);
}

.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Timeline (resume) ---- */
.timeline {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.timeline-title {
  font-size: 1.5rem;
  margin: 2rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
}

.timeline-dot::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 14px;
  bottom: -2rem;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}

.timeline-item:last-child .timeline-dot::before {
  display: none;
}

.timeline-content {
  background: var(--surface);
  padding: 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex: 1;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

.timeline-content h3 {
  margin: 0.3rem 0;
}

.timeline-content h4 {
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ---- Portfolio grid ---- */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin: 2rem 0;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
  color: var(--text-muted);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0 0 3rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.project-card h3 {
  margin-bottom: 0.5rem;
}

.project-tag {
  display: inline-block;
  background: var(--border);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

/* ---- Contact page ---- */
.contact-grid {
  display: flex;
  justify-content: center;
  padding-bottom: 3rem;
}

.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}

.contact-links a {
  display: block;
  margin-bottom: 1rem;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.contact-links a i {
  margin-right: 0.5rem;
  color: var(--accent);
}

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

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

/* =========================================
   RESPONSIVE – TABLETS & SMALL DESKTOPS
   ========================================= */
@media (max-width: 768px) {
  .nav-container {
    padding: 0.8rem 1.2rem;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    display: none;
    border-bottom: 1px solid var(--border);
    z-index: 999;
  }

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

  .hero {
    flex-direction: column;
    padding: 2.5rem 0;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-stats {
    width: 100%;
    justify-content: space-around;
  }

  .services-grid,
  .grid-2col {
    grid-template-columns: 1fr;
  }

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

  .timeline-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .timeline-dot {
    display: none;          /* hide dot on small screens for cleaner look */
  }

  .timeline-content {
    width: 100%;
  }

  .contact-grid {
    padding: 0 1rem;
  }

  main {
    padding: 0 1rem;
    border-left: none;      /* no side borders on mobile */
    border-right: none;
  }
}

/* =========================================
   RESPONSIVE – MOBILE PHONES (extra)
   ========================================= */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.7rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .timeline-content {
    padding: 1rem;
  }

  .filter-buttons {
    gap: 0.4rem;
  }

  .filter-btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }
}