/* === Color Palette === */
:root {
  --background-light: #f4f6f9;
  --text-dark: #1a1a1a;
  --primary-dark: #1f2937;
  --primary-gradient-start: #222c3d;
  --primary-gradient-end: #3a4d6b;
  --accent-blue: #2f80ed;
  --accent-green: #27ae60;
  --neutral-gray: #d5d9df;
  --card-bg: #ffffff;
  --section-bg: #e9eef3;
  --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --background-light: #1a1c23;
  --text-dark: #f4f6f9;
  --primary-dark: #0f1117;
  --primary-gradient-start: #0f2027;
  --primary-gradient-end: #203a43;
  --card-bg: #2a2e38;
  --section-bg: #1f232c;
  --neutral-gray: #444b55;
}

/* === Global === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--background-light);
  color: var(--text-dark);
  scroll-behavior: smooth;
  transition: background 0.3s, color 0.3s;
}

/* === Header === */
header {
  background: linear-gradient(to right, var(--primary-gradient-start), var(--primary-gradient-end));
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px var(--shadow);
}

.logo img {
  height: 45px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: color 0.3s;
}

nav ul li a:hover { color: var(--accent-green); }

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}
.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
}
#main-nav.open ul {
  display: flex;
  flex-direction: column;
  background: var(--primary-dark);
  position: absolute;
  top: 60px;
  right: 20px;
  padding: 1rem;
  border-radius: 5px;
}

/* === Sections === */
section {
  padding: 4rem 5%;
  background: var(--section-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.3s;
}

h2 {
  color: var(--accent-blue);
  margin-bottom: 1rem;
  text-align: center;
}

/* === About Section === */
.about-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.about-image img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid var(--accent-blue);
  box-shadow: 0 2px 8px var(--shadow);
  display: block;
  margin: 0 auto;
}

/* === Skills Section === */
.skills-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}
.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.bar span {
  min-width: 100px;
  font-weight: 600;
}
.progress {
  flex: 1;
  height: 18px;
  background: var(--neutral-gray);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.progress::after {
  content: attr(data-percent);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #fff;
  font-weight: bold;
}

/* Animated Progress Bars */
.progress.animate { animation: fillBar 2s ease forwards; }
@keyframes fillBar { from { width: 0; } to { width: var(--target-width); } }
.css { background: var(--accent-blue); width: 90%; }
.js { background: var(--accent-green); width: 80%; }
.php { background: #c49b66; width: 75%; }
.wordpress { background: #7b68ee; width: 60%; }

/* === Projects & Demos === */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.project {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--shadow);
  text-align: center;
}
.project img {
  width: 100%;
  max-width: 500px;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 5px;
}
iframe {
  width: 100%;
  height: 450px;
  border-radius: 8px;
  border: none;
  margin-bottom: 1rem;
}

/* === Gallery Sections (Photography & Design) === */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
  justify-items: center;
}
.gallery img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.3s;
}
.gallery img:hover { transform: scale(1.05); }
/* === Center ONLY Key Elements === */

/* About Section Image */
.about-image img {
  display: block;
  margin: 0 auto;   /* centers only the image */
}

/* Project & Demo Images/Iframes */
.project img,
.project iframe {
  display: block;
  margin: 0 auto 1rem auto;
}

/* Gallery Images */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  justify-content: center;
}
.gallery img {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.3s;
}
.gallery img:hover {
  transform: scale(1.05);
}

/* Keep section text left-aligned */
section {
  text-align: left;
}

/* Headings stay aligned naturally */
h2, h3 {
  text-align: left;
  margin-bottom: 1rem;
}

/* === Buttons === */
.btn {
  display: inline-block;
  background: var(--accent-blue);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s;
}
.btn:hover { background: var(--accent-green); }
.reach-btn { margin: 1rem auto; display: block; width: fit-content; }

/* === Footer === */
footer {
  background: var(--primary-dark);
  color: white;
  text-align: center;
  padding: 2rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin-top: 1rem;
}
.footer-links a { color: var(--accent-blue); text-decoration: none; }

/* === Responsive Layout === */
@media (min-width: 768px) {
  .gallery, .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .gallery, .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
}
@media (max-width: 768px) {
  nav ul { display: none; }
  .hamburger { display: flex; }
  .about-wrapper { flex-direction: column; }
  section { padding: 2rem 1rem; }
  .bar { flex-direction: column; align-items: flex-start; }
}
